]>
Commit | Line | Data |
---|---|---|
99155935 | 1 | AT_BANNER([JSON-RPC - C]) |
f2129093 BP |
2 | |
3 | AT_SETUP([JSON-RPC request and successful reply]) | |
56120500 BP |
4 | AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket]) |
5 | on_exit 'kill `cat test-jsonrpc.pid`' | |
f2129093 | 6 | AT_CHECK( |
eadd1644 | 7 | [[ovstest test-jsonrpc request unix:socket echo '[{"a": "b", "x": null}]']], [0], |
f2129093 | 8 | [[{"error":null,"id":0,"result":[{"a":"b","x":null}]} |
56120500 | 9 | ]]) |
f2129093 BP |
10 | AT_CLEANUP |
11 | ||
12 | AT_SETUP([JSON-RPC request and error reply]) | |
56120500 BP |
13 | AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket]) |
14 | on_exit 'kill `cat test-jsonrpc.pid`' | |
f2129093 | 15 | AT_CHECK( |
eadd1644 | 16 | [[ovstest test-jsonrpc request unix:socket bad-request '[]']], [0], |
f2129093 | 17 | [[{"error":{"error":"unknown method"},"id":0,"result":null} |
56120500 | 18 | ]]) |
f2129093 BP |
19 | AT_CLEANUP |
20 | ||
21 | AT_SETUP([JSON-RPC notification]) | |
56120500 BP |
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]) | |
f2129093 | 29 | AT_CLEANUP |