File: jsonrpc.at

package info (click to toggle)
openvswitch 3.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 97,848 kB
  • sloc: sh: 1,643,930; ansic: 313,386; python: 27,939; xml: 21,526; makefile: 546; javascript: 191
file content (29 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
AT_BANNER([JSON-RPC - C])

AT_SETUP([JSON-RPC request and successful reply])
AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket])
on_exit 'kill `cat test-jsonrpc.pid`'
AT_CHECK(
  [[ovstest test-jsonrpc request unix:socket echo '[{"a": "b", "x": null}]']], [0],
  [[{"error":null,"id":0,"result":[{"a":"b","x":null}]}
]])
AT_CLEANUP

AT_SETUP([JSON-RPC request and error reply])
AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket])
on_exit 'kill `cat test-jsonrpc.pid`'
AT_CHECK(
  [[ovstest test-jsonrpc request unix:socket bad-request '[]']], [0],
  [[{"error":{"error":"unknown method"},"id":0,"result":null}
]])
AT_CLEANUP

AT_SETUP([JSON-RPC notification])
AT_CHECK([ovstest test-jsonrpc --detach --no-chdir --pidfile listen punix:socket])
on_exit 'kill `cat test-jsonrpc.pid`'
# Check that the pidfile got created.
AT_CHECK([test -e test-jsonrpc.pid])
AT_CHECK([[ovstest test-jsonrpc notify unix:socket shutdown '[]']])
# Wait for test-jsonrpc to die, based on its pidfile disappearing
OVS_WAIT_WHILE([test -e test-jsonrpc.pid])
AT_CLEANUP