On 3/15/24 11:27, Eelco Chaudron wrote: > On 18 Jan 2024, at 16:26, [email protected] wrote: > >> From: Jakob Meng <[email protected]> >> diff --git a/lib/unixctl.h b/lib/unixctl.h >> index 35ef6a548..fe9160894 100644 >> --- a/lib/unixctl.h >> +++ b/lib/unixctl.h >> @@ -39,6 +39,7 @@ int unixctl_client_create(const char *path, struct jsonrpc >> **client); >> int unixctl_client_transact(struct jsonrpc *client, >> const char *command, >> int argc, char *argv[], >> + int fmt_flags, >> char **result, char **error); >> >> /* Command registration. */ >> diff --git a/tests/pmd.at b/tests/pmd.at >> index 57660c407..cff80da15 100644 >> --- a/tests/pmd.at >> +++ b/tests/pmd.at >> @@ -112,8 +112,33 @@ dummy@ovs-dummy: hit:0 missed:0 >> p0 1/1: (dummy-pmd: n_rxq=1, n_txq=1, numa_id=0) >> ]) >> >> -AT_CHECK([ovs-appctl --format json dpif/show], [0], [dnl >> -[[{"ofprotos":[{"name":"br0","ports":[{"netdev_type":"dummy-internal","ofp_port":"65534","odp_port":"100","netdev_config":{},"netdev_name":"br0"},{"netdev_type":"dummy-pmd","ofp_port":"1","odp_port":"1","netdev_config":{"numa_id":"0","n_txq":"1","n_rxq":"1"},"netdev_name":"p0"}]}],"name":"dummy@ovs-dummy","stats":{"n_hit":"0","n_missed":"0"}}]]]) > > It might be worth considering retaining this test to ensure it functions > properly even without the pretty options. Additionally, we could think about > adding a separate test (not in pmd.at) to be executed with make check, > specifically testing the JSON format with both pretty and non-pretty options > in the final patch.
Keeping the test is a good thing, but I'd suggest to wrap the lines. You could define the output once with m4_define and then compare the non-pretty output with the result of m4_normalize and the pretty one with the original. Should be done in the previous patch and expanded in this one. BTW, is this output stable? It doesn't seem to be sorted. May cause random test failures and different architectures or with different compiler flags. Best regards, Ilya Maximets. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
