1 AT_BANNER([OVSDB -- ovsdb-server transactions (Unix sockets)])
3 # OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
5 # Creates a database with the given SCHEMA, starts an ovsdb-server on
6 # that database, and runs each of the TRANSACTIONS (which should be a
7 # quoted list of quoted strings) against it with ovsdb-client one at a
10 # Checks that the overall output is OUTPUT, but UUIDs in the output
11 # are replaced by markers of the form <N> where N is a number. The
12 # first unique UUID is replaced by <0>, the next by <1>, and so on.
13 # If a given UUID appears more than once it is always replaced by the
16 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
17 m4_define([OVSDB_CHECK_EXECUTION],
19 AT_KEYWORDS([ovsdb server positive $5])
22 OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
23 AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --remote=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
24 m4_foreach([txn], [$3],
25 [OVS_CHECK_LCOV([ovsdb-client transact unix:socket 'txn'], [0], [stdout], [ignore],
26 [test ! -e pid || kill `cat pid`])
29 AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [ignore],
30 [test ! -e pid || kill `cat pid`])
31 test ! -e pid || kill `cat pid`
36 AT_SETUP([--remote=db: implementation])
37 AT_KEYWORDS([ovsdb server positive])
43 "manager": {"type": "string"}}}}}
45 OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [ignore], [ignore])
47 [[ovsdb-tool transact db \
50 "row": {"manager": "punix:socket"}}]']], [0], [ignore], [ignore])
51 AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --remote=db:Manager,manager --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
53 [[ovsdb-client transact unix:socket \
57 "columns": ["manager"]}]']],
58 [0], [stdout], [ignore], [test ! -e pid || kill `cat pid`])
60 [perl $srcdir/uuidfilt.pl stdout],
62 [[[{"rows":[{"manager":"punix:socket"}]}]
65 [test ! -e pid || kill `cat pid`])
66 test ! -e pid || kill `cat pid`
69 AT_BANNER([OVSDB -- ovsdb-server transactions (SSL sockets)])
71 # OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
73 # Creates a database with the given SCHEMA, starts an ovsdb-server on
74 # that database, and runs each of the TRANSACTIONS (which should be a
75 # quoted list of quoted strings) against it with ovsdb-client one at a
78 # Checks that the overall output is OUTPUT, but UUIDs in the output
79 # are replaced by markers of the form <N> where N is a number. The
80 # first unique UUID is replaced by <0>, the next by <1>, and so on.
81 # If a given UUID appears more than once it is always replaced by the
84 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
85 m4_define([OVSDB_CHECK_EXECUTION],
87 AT_KEYWORDS([ovsdb server positive ssl $5])
88 AT_SKIP_IF([test "$HAVE_OPENSSL" = no])
89 AT_SKIP_IF([test "x$RANDOM" = x])
92 SSL_PORT=`expr 32767 + \( $RANDOM % 32767 \)`
93 PKIDIR=$abs_top_srcdir/tests
94 OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
95 AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:$SSL_PORT:127.0.0.1 --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
96 m4_foreach([txn], [$3],
97 [OVS_CHECK_LCOV([ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT 'txn'], [0], [stdout], [ignore],
98 [test ! -e pid || kill `cat pid`])
101 AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [ignore],
102 [test ! -e pid || kill `cat pid`])
103 test ! -e pid || kill `cat pid`