]> git.proxmox.com Git - ovs.git/blob - tests/jsonrpc.at
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
[ovs.git] / tests / jsonrpc.at
1 AT_BANNER([JSON-RPC - C])
2
3 AT_SETUP([JSON-RPC request and successful reply])
4 AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket])
5 on_exit 'kill `cat test-jsonrpc.pid`'
6 AT_CHECK(
7 [[ovstest test-jsonrpc request unix:socket echo '[{"a": "b", "x": null}]']], [0],
8 [[{"error":null,"id":0,"result":[{"a":"b","x":null}]}
9 ]])
10 AT_CLEANUP
11
12 AT_SETUP([JSON-RPC request and error reply])
13 AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket])
14 on_exit 'kill `cat test-jsonrpc.pid`'
15 AT_CHECK(
16 [[ovstest test-jsonrpc request unix:socket bad-request '[]']], [0],
17 [[{"error":{"error":"unknown method"},"id":0,"result":null}
18 ]])
19 AT_CLEANUP
20
21 AT_SETUP([JSON-RPC notification])
22 AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket])
23 on_exit 'kill `cat test-jsonrpc.pid`'
24 # Check that the pidfile got created.
25 AT_CHECK([test -e test-jsonrpc.pid])
26 AT_CHECK([[ovstest test-jsonrpc notify unix:socket shutdown '[]']])
27 # Wait for test-jsonrpc to die, based on its pidfile disappearing
28 OVS_WAIT_WHILE([test -e test-jsonrpc.pid])
29 AT_CLEANUP