path: root/tests/json_echo
Commit message (Collapse)AuthorAgeFilesLines
* tests/json_echo: Drop needless workaroundPhil Sutter2019-06-071-4/+2
| | | | | | | | With cache issues now resolved, there is no need for the multi add test workaround anymore. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* tests: json_echo: convert to py3Shekhar Sharma2019-05-291-22/+23
| | | | | | | | This patch converts the file to run on both python3 and python2. Signed-off-by: Shekhar Sharma <> Acked-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* parser_json: Rewrite echo supportPhil Sutter2019-04-031-61/+145
| | | | | | | | | | | | | | | | | Instead of guessing which object to update with retrieved handle, introduce a list containing struct cmd <-> json_t associations. Upon batch commit, allocated cmd objects are assigned a unique netlink sequence number. Monitor events contain that number as well, so they may be associated to the cmd object which triggered them. Using json_cmd_assoc list the event may in turn be associated to the input's JSON object which should receive the handle value. This also fixes incorrect behaviour if JSON input contained "insert" commands. Fixes: bb32d8db9a125 ("JSON: Add support for echo option") Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* doc: Spelling and grammar fixesVille Skyttä2018-11-131-1/+1
| | | | | Signed-off-by: Ville Skyttä <> Signed-off-by: Pablo Neira Ayuso <>
* JSON: Add support for echo optionPhil Sutter2018-10-291-0/+211
The basic principle is to not return a JSON object freshly created from netlink responses, but just update the existing user-provided one to make sure callers get back exactly what they expect. To achieve that, keep the parsed JSON object around in a global variable ('cur_root') and provide a custom callback to insert handles into it from received netlink messages. The tricky bit here is updating rules since unique identification is problematic. Therefore drop possibly present handles from input and later assume updates are received in order so the first rule not having a handle set is the right one. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>