]> git.proxmox.com Git - ovs.git/blame - tests/ovsdb.at
datapath: Add support for unique flow IDs.
[ovs.git] / tests / ovsdb.at
CommitLineData
21ff1aee
BP
1# OVSDB_CHECK_POSITIVE(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ])
2#
3# Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with
4# status 0 and prints OUTPUT on stdout.
5#
55aa00e0 6# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
f85f8ebb
BP
7m4_define([OVSDB_CHECK_POSITIVE],
8 [AT_SETUP([$1])
f85f8ebb 9 AT_KEYWORDS([ovsdb positive $4])
7c126fbb 10 AT_CHECK([test-ovsdb $2], [0], [$3
f85f8ebb
BP
11], [])
12 AT_CLEANUP])
13
99155935 14# OVSDB_CHECK_POSITIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ],
4807bca9 15# [PY-CHECK])
99155935
BP
16#
17# Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with
18# status 0 and prints OUTPUT on stdout.
19#
4807bca9
BP
20# PY-CHECK is expanded before the check. It can check for features of the
21# Python implementation that are required for the test to pass.
99155935
BP
22#
23# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
24m4_define([OVSDB_CHECK_POSITIVE_PY],
25 [AT_SETUP([$1])
26 AT_SKIP_IF([test $HAVE_PYTHON = no])
4807bca9 27 $6
99155935
BP
28 AT_KEYWORDS([ovsdb positive Python $4])
29 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py $2], [0], [$3
30], [])
31 AT_CLEANUP])
32
33# OVSDB_CHECK_POSITIVE_CPY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS],
4807bca9 34# [PREREQ], [PY-CHECK])
99155935
BP
35#
36# Runs identical C and Python tests, as specified.
37m4_define([OVSDB_CHECK_POSITIVE_CPY],
38 [OVSDB_CHECK_POSITIVE([$1 - C], [$2], [$3], [$4], [$5])
39 OVSDB_CHECK_POSITIVE_PY([$1 - Python], [$2], [$3], [$4], [$5], [$6])])
40
21ff1aee
BP
41# OVSDB_CHECK_NEGATIVE(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ])
42#
43# Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with
44# status 1 and that its output on stdout contains substring OUTPUT.
45# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
f85f8ebb
BP
46m4_define([OVSDB_CHECK_NEGATIVE],
47 [AT_SETUP([$1])
48 AT_KEYWORDS([ovsdb negative $4])
7c126fbb 49 AT_CHECK([test-ovsdb $2], [1], [], [stderr])
f85f8ebb
BP
50 m4_assert(m4_len([$3]))
51 AT_CHECK(
52 [if grep -F -e "AS_ESCAPE([$3])" stderr
53 then
54 :
55 else
56 exit 99
57 fi],
58 [0], [ignore], [ignore])
59 AT_CLEANUP])
60
99155935
BP
61# OVSDB_CHECK_NEGATIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ])
62#
63# Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with
64# status 1 and that its output on stdout contains substring OUTPUT.
65# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
66m4_define([OVSDB_CHECK_NEGATIVE_PY],
67 [AT_SETUP([$1])
68 AT_SKIP_IF([test $HAVE_PYTHON = no])
69 AT_KEYWORDS([ovsdb negative $4])
70 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py $2], [1], [], [stderr])
71 m4_assert(m4_len([$3]))
72 AT_CHECK(
73 [if grep -F -e "AS_ESCAPE([$3])" stderr
74 then
75 :
76 else
77 exit 99
78 fi],
79 [0], [ignore], [ignore])
80 AT_CLEANUP])
81
82# OVSDB_CHECK_NEGATIVE_CPY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS],
83# [PREREQ])
84#
85# Runs identical C and Python tests, as specified.
86m4_define([OVSDB_CHECK_NEGATIVE_CPY],
87 [OVSDB_CHECK_NEGATIVE([$1 - C], [$2], [$3], [$4], [$5])
88 OVSDB_CHECK_NEGATIVE_PY([$1 - Python], [$2], [$3], [$4], [$5])])
89
41709ccc 90m4_include([tests/ovsdb-log.at])
f85f8ebb
BP
91m4_include([tests/ovsdb-types.at])
92m4_include([tests/ovsdb-data.at])
93m4_include([tests/ovsdb-column.at])
94m4_include([tests/ovsdb-table.at])
95m4_include([tests/ovsdb-row.at])
0d0f05b9 96m4_include([tests/ovsdb-schema.at])
f85f8ebb 97m4_include([tests/ovsdb-condition.at])
e9f8f936 98m4_include([tests/ovsdb-mutation.at])
f85f8ebb
BP
99m4_include([tests/ovsdb-query.at])
100m4_include([tests/ovsdb-transaction.at])
101m4_include([tests/ovsdb-execution.at])
102m4_include([tests/ovsdb-trigger.at])
1e19e50e 103m4_include([tests/ovsdb-tool.at])
21ff1aee 104m4_include([tests/ovsdb-server.at])
a8425c53 105m4_include([tests/ovsdb-monitor.at])
c3bb4bd7 106m4_include([tests/ovsdb-idl.at])