]> git.proxmox.com Git - ovs.git/blame - tests/testsuite.at
tests: Create dpif-netdev.at.
[ovs.git] / tests / testsuite.at
CommitLineData
1b233b95
BP
1AT_INIT
2
b7898031 3AT_COPYRIGHT([Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
1b233b95
BP
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at:
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.])
16
17AT_TESTED([ovs-vswitchd])
3b135da3 18AT_TESTED([ovs-vsctl])
f85f8ebb 19AT_TESTED([perl])
1b233b95 20
f17e0c25
BP
21m4_divert_push([PREPARE_TESTS])
22[
23ovs_wait () {
24 # First try a quick sleep, so that the test completes very quickly
25 # in the normal case. POSIX doesn't require fractional times to
26 # work, so this might not work.
27 sleep 0.1
28 ovs_wait_cond && exit 0
29 # Then wait up to 10 seconds.
30 for d in 0 1 2 3 4 5 6 7 8 9; do
31 sleep 1
32 ovs_wait_cond && exit 0
33 done
34 exit 1
35}
535e8b04
BP
36
37# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout.
38seq () {
39 while test $1 -le $2; do
40 echo $1
41 set `expr $1 + ${3-1}` $2 $3
42 done
43}
038b21a1
GS
44
45if test "$IS_WIN32" = "yes"; then
46 pwd () {
47 command pwd -W "$@"
48 }
b3c3eec7 49
0d21340a
GS
50 diff () {
51 command diff --strip-trailing-cr "$@"
52 }
53
b3c3eec7
GS
54 kill () {
55 case "$1" in
56 -0)
57 shift
58 for i in $*; do
59 # tasklist will always have return code 0.
60 # If pid does exist, there will be a line with the pid.
61 if tasklist //fi "PID eq $i" | grep $i; then
62 :
63 else
64 return 1
65 fi
66 done
67 return 0
68 ;;
69 -[1-9]*)
70 shift
71 for i in $*; do
72 taskkill //F //PID $i
73 done
74 ;;
75 [1-9][1-9]*)
76 for i in $*; do
77 taskkill //F //PID $i
78 done
79 ;;
80 esac
81 }
038b21a1 82fi
f17e0c25
BP
83]
84m4_divert_pop([PREPARE_TESTS])
85
f5961335 86m4_define([OVS_WAIT],
b12e3c41 87 [AT_CHECK(
f17e0c25
BP
88 [ovs_wait_cond () { $1
89}
90ovs_wait], [0], [ignore], [ignore], [$2])])
91m4_define([OVS_WAIT_UNTIL], [OVS_WAIT([$1], [$2])])
92m4_define([OVS_WAIT_WHILE],
93 [OVS_WAIT([if $1; then return 1; else return 0; fi], [$2])])
b12e3c41 94
0c473314
YT
95dnl OVS_APP_EXIT_AND_WAIT(DAEMON)
96dnl
97dnl Ask the daemon named DAEMON to exit, via ovs-appctl, and then waits for it
98dnl to exit.
99m4_define([OVS_APP_EXIT_AND_WAIT],
100 [ovs-appctl -t $1 exit
101 OVS_WAIT_WHILE([test -e $1.pid])])
102
0b7140bb
BP
103dnl ON_EXIT([COMMANDS])
104dnl
105dnl Adds the shell COMMANDS to a collection executed when the current test
106dnl completes, as a cleanup action. (The most common use is to kill a
107dnl daemon started by the test. This is important to prevent tests that
108dnl start daemons from hanging at exit.)
109m4_define([ON_EXIT], [trap '. ./cleanup' 0; cat >>cleanup <<'EOF'
110$1
111EOF
112])
113
24c8ae53 114m4_include([tests/ovsdb-macros.at])
0fbc9f11 115m4_include([tests/ofproto-macros.at])
24c8ae53 116
015cf297 117m4_include([tests/bfd.at])
03f209ba 118m4_include([tests/cfm.at])
742468d9 119m4_include([tests/lacp.at])
1b233b95 120m4_include([tests/library.at])
95974447 121m4_include([tests/heap.at])
daff3353 122m4_include([tests/bundle.at])
3223e977 123m4_include([tests/classifier.at])
05b3c97b 124m4_include([tests/check-structs.at])
ff8decf1 125m4_include([tests/daemon.at])
99155935 126m4_include([tests/daemon-py.at])
f25d0cf3 127m4_include([tests/ofp-actions.at])
fec00620 128m4_include([tests/ofp-print.at])
681ea7a0 129m4_include([tests/ofp-util.at])
2e0525bc 130m4_include([tests/ofp-errors.at])
0e581146 131m4_include([tests/ovs-ofctl.at])
3bffc610 132m4_include([tests/odp.at])
53ddd40a 133m4_include([tests/multipath.at])
75a75043 134m4_include([tests/learn.at])
d27ce529 135m4_include([tests/vconn.at])
e1aff6f9 136m4_include([tests/file_name.at])
d918d9d1 137m4_include([tests/aes128.at])
0a68ffd2 138m4_include([tests/unixctl-py.at])
d918d9d1 139m4_include([tests/uuid.at])
f38b84ea 140m4_include([tests/json.at])
f2129093 141m4_include([tests/jsonrpc.at])
99155935 142m4_include([tests/jsonrpc-py.at])
0f538378 143m4_include([tests/tunnel.at])
ac718c9d 144m4_include([tests/lockfile.at])
3ed497fc 145m4_include([tests/reconnect.at])
b7898031 146m4_include([tests/ovs-vswitchd.at])
a2cb9dfd 147m4_include([tests/ofproto.at])
9c4044a5 148m4_include([tests/dpif-netdev.at])
29901626 149m4_include([tests/ofproto-dpif.at])
1c3e353d 150m4_include([tests/vlan-splinters.at])
f85f8ebb 151m4_include([tests/ovsdb.at])
3b135da3 152m4_include([tests/ovs-vsctl.at])
b54bdbe9 153m4_include([tests/ovs-monitor-ipsec.at])
1b0fdca5 154m4_include([tests/ovs-xapi-sync.at])
48d014bf 155m4_include([tests/interface-reconfigure.at])
829a7d02 156m4_include([tests/stp.at])
8ed182d8 157m4_include([tests/vlog.at])
ffc759c6 158m4_include([tests/vtep-ctl.at])