New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KVS Jansson Updates #1108
KVS Jansson Updates #1108
Commits on Jul 20, 2017
-
-
-
modules/kvs: Refactor build of unit tests
Only build tests with the object files they require, instead of using all object files in the directory. This will make it easier for testing as unit tests are updated one at a time. Eliminate unnecessary header inclusion in unit tests.
-
-
-
modules/kvs: Add comments & unit tests
Add comments and unit tests to indicate json_compare() logic when a NULL pointer may be passed into it.
-
-
-
-
-
modules/kvs: Convert lookup API to use jansson
Conversion also requires elimination of use of proto.h. Convert KVS_PROTO_READDIR, KVS_PROTO_READLINK, and KVS_PROTO_TREEOBJ to FLUX_KVS_READDIR, FLUX_KVS_READLINK, and FLUX_KVS_TREEOBJ respectively.
-
modules/kvs: Update lookup tests for jansson
Conversion also requires elimination of use of proto.h. Convert KVS_PROTO_READDIR, KVS_PROTO_READLINK, and KVS_PROTO_TREEOBJ to FLUX_KVS_READDIR, FLUX_KVS_READLINK, and FLUX_KVS_TREEOBJ respectively.
-
-
-
modules/kvs: Add more unit tests to commit tests
Add tests checking for deletes of invalid keys. Add tests for multiple fences and merged/unmerged multiple fences. Add test for giant directory.
-
modules/kvs: Add json_strdump util function
Add util function so different parts of KVS that need to call json_dumps() call it consistently.
-
modules/kvs: Convert kvs to use jansson
Convert kvs to use jansson. Use pack/unpack functions appropriately as needed to remove dependency on json-c functions. Conversion also requires elimination of use of proto.h. Convert KVS_PROTO_FIRST and KVS_PROTO_ONCE to KVS_WATCH_FIRST and KVS_WATCH_ONE appropriately.
-
t/t1002-kvs-cmd.t: Fix testing corner case
In some watch tests, the output can be in unsorted order, leading to a mismatch with "expected" output. Add a small tweak to sort fields from the output before comparison.
-
common/libkvs: Remove proto.[ch]
With modules/kvs conversion to jansson, proto.[ch] files and functions are no longer used anywhere in flux-core. Also remove lingering build dependency on proto.o in t/Makefile.am.
-
common/libkvs: Remove json_dirent.[ch]
With modules/kvs conversion to jansson, json_dirent.[ch] files and functions are no longer used anywhere in flux-core.
-
modules/kvs: workaround cppcheck false positive
cppcheck detects "Memory pointed to by 's1' is freed twice". This is believed to be false positive. Set s1 to NULL after free to workaround it.
-
modules/kvs: Remove json_compare
With jansson conversion, json_compare() is now simply a call to json_equal(). Remove json_compare() everywhere and replace with direct call to json_equal().
-
modules/kvs: Re-work commit unit tests
Create own convenience function for unit tests instead of using j_dirent_append().
-
libkvs/jansson_dirent: drop j_dirent_append()
The flux_kvs_txn_t object now abstracts the "op array" passed in a commit/fence request. Drop j_dirent_append() which operates on these arrays. Remove it from the jansson_dirent unit test as well.
-
libkvs/jansson_dirent: Remove j_dirent_match
With jansson conversions in modules/kvs and common/libkvs, j_dirent_match() was no longer used except in jansson_dirent unit tests. Remove function globally and use json_equal() in unit tests instead.
-
modules/kvs: Rename json_util functions
With use of jansson, some of the json_util function names may appear to be part of the jansson library. To differentiate the functions, adjust names and have all of them prefixed with "kvs_util". Rename files appropriately, use appropriate new header file, and use new functions where appropriate.