aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-04-29 10:44:58 -0700
committerBen Pfaff <blp@nicira.com>2011-05-13 14:43:12 -0700
commit7fcfe998c5e3356fe04fb183f9f33d3c9fbbb387 (patch)
tree3c10927e10f60ea031eb7595af04a1a3ea99e054
parentf89ffb0e2f6fa8adc100192ea4b5f948170d8d57 (diff)
tests: Check test output more carefully.
It's better to check output than to ignore it, because ignoring output can fail to detect real bugs later if the output changes. Reviewed-by: Simon Horman <horms@verge.net.au>
-rw-r--r--tests/daemon-py.at10
-rw-r--r--tests/jsonrpc-py.at6
-rw-r--r--tests/jsonrpc.at6
-rw-r--r--tests/library.at21
-rw-r--r--tests/test-strtok_r.c2
5 files changed, 25 insertions, 20 deletions
diff --git a/tests/daemon-py.at b/tests/daemon-py.at
index 9a2549c1..bc5a0511 100644
--- a/tests/daemon-py.at
+++ b/tests/daemon-py.at
@@ -6,7 +6,7 @@ AT_CAPTURE_FILE([pid])
AT_CAPTURE_FILE([expected])
# Start the daemon and wait for the pidfile to get created
# and that its contents are the correct pid.
-AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid& echo $! > expected], [0], [ignore], [ignore])
+AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid& echo $! > expected], [0])
OVS_WAIT_UNTIL([test -s pid], [kill `cat expected`])
AT_CHECK(
[pid=`cat pid` && expected=`cat expected` && test "$pid" = "$expected"],
@@ -25,7 +25,7 @@ AT_CAPTURE_FILE([parent])
AT_CAPTURE_FILE([parentpid])
AT_CAPTURE_FILE([newpid])
# Start the daemon and wait for the pidfile to get created.
-AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid --monitor& echo $! > parent], [0], [ignore], [ignore])
+AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid --monitor& echo $! > parent], [0])
OVS_WAIT_UNTIL([test -s pid], [kill `cat parent`])
# Check that the pidfile names a running process,
# and that the parent process of that process is our child process.
@@ -68,7 +68,7 @@ AT_CAPTURE_FILE([parent])
AT_CAPTURE_FILE([parentpid])
AT_CAPTURE_FILE([newpid])
# Start the daemon and wait for the pidfile to get created.
-AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid --monitor& echo $! > parent], [0], [ignore], [ignore])
+AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid --monitor& echo $! > parent], [0])
OVS_WAIT_UNTIL([test -s pid], [kill `cat parent`])
# Check that the pidfile names a running process,
# and that the parent process of that process is our child process.
@@ -110,7 +110,7 @@ AT_CAPTURE_FILE([pid])
# Start the daemon and make sure that the pidfile exists immediately.
# We don't wait for the pidfile to get created because the daemon is
# supposed to do so before the parent exits.
-AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid --detach], [0], [ignore], [ignore])
+AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/pid --detach], [0])
AT_CHECK([test -s pid])
AT_CHECK([kill -0 `cat pid`])
# Kill the daemon and make sure that the pidfile gets deleted.
@@ -133,7 +133,7 @@ AT_CAPTURE_FILE([init])
# Start the daemon and make sure that the pidfile exists immediately.
# We don't wait for the pidfile to get created because the daemon is
# supposed to do so before the parent exits.
-AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/daemon --detach --monitor], [0], [ignore], [ignore])
+AT_CHECK([$PYTHON $srcdir/test-daemon.py --pidfile-name=$PWD/daemon --detach --monitor], [0])
AT_CHECK([test -s daemon])
# Check that the pidfile names a running process,
# and that the parent process of that process is a running process,
diff --git a/tests/jsonrpc-py.at b/tests/jsonrpc-py.at
index e8a98bbc..cda34ab5 100644
--- a/tests/jsonrpc-py.at
+++ b/tests/jsonrpc-py.at
@@ -8,7 +8,7 @@ AT_CHECK([kill -0 `cat pid`])
AT_CHECK(
[[$PYTHON $srcdir/test-jsonrpc.py request unix:socket echo '[{"a": "b", "x": null}]']], [0],
[[{"error":null,"id":0,"result":[{"a":"b","x":null}]}
-]], [ignore], [test ! -e pid || kill `cat pid`])
+]], [], [test ! -e pid || kill `cat pid`])
AT_CHECK([kill `cat pid`])
AT_CLEANUP
@@ -20,7 +20,7 @@ AT_CHECK([kill -0 `cat pid`])
AT_CHECK(
[[$PYTHON $srcdir/test-jsonrpc.py request unix:socket bad-request '[]']], [0],
[[{"error":{"error":"unknown method"},"id":0,"result":null}
-]], [ignore], [test ! -e pid || kill `cat pid`])
+]], [], [test ! -e pid || kill `cat pid`])
AT_CHECK([kill `cat pid`])
AT_CLEANUP
@@ -32,7 +32,7 @@ AT_CHECK([test -s pid])
AT_CHECK([cp pid pid2])
AT_CHECK([kill -0 `cat pid2`])
AT_CHECK([[$PYTHON $srcdir/test-jsonrpc.py notify unix:socket shutdown '[]']], [0], [],
- [ignore], [kill `cat pid2`])
+ [], [kill `cat pid2`])
AT_CHECK(
[pid=`cat pid2`
# First try a quick sleep, so that the test completes very quickly
diff --git a/tests/jsonrpc.at b/tests/jsonrpc.at
index 856fa46e..b669a392 100644
--- a/tests/jsonrpc.at
+++ b/tests/jsonrpc.at
@@ -7,7 +7,7 @@ AT_CHECK([kill -0 `cat pid`])
AT_CHECK(
[[test-jsonrpc request unix:socket echo '[{"a": "b", "x": null}]']], [0],
[[{"error":null,"id":0,"result":[{"a":"b","x":null}]}
-]], [ignore], [test ! -e pid || kill `cat pid`])
+]], [], [test ! -e pid || kill `cat pid`])
AT_CHECK([kill `cat pid`])
AT_CLEANUP
@@ -18,7 +18,7 @@ AT_CHECK([kill -0 `cat pid`])
AT_CHECK(
[[test-jsonrpc request unix:socket bad-request '[]']], [0],
[[{"error":{"error":"unknown method"},"id":0,"result":null}
-]], [ignore], [test ! -e pid || kill `cat pid`])
+]], [], [test ! -e pid || kill `cat pid`])
AT_CHECK([kill `cat pid`])
AT_CLEANUP
@@ -29,7 +29,7 @@ AT_CHECK([test -s pid])
AT_CHECK([cp pid pid2])
AT_CHECK([kill -0 `cat pid2`])
AT_CHECK([[test-jsonrpc notify unix:socket shutdown '[]']], [0], [],
- [ignore], [kill `cat pid2`])
+ [], [kill `cat pid2`])
AT_CHECK(
[pid=`cat pid2`
# First try a quick sleep, so that the test completes very quickly
diff --git a/tests/library.at b/tests/library.at
index d199373c..ec50e23a 100644
--- a/tests/library.at
+++ b/tests/library.at
@@ -7,19 +7,22 @@ AT_CHECK([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
AT_CLEANUP
AT_SETUP([test TCP/IP checksumming])
-AT_CHECK([test-csum], [0], [ignore])
+AT_CHECK([test-csum], [0], [....#....#....##................................#................................#
+])
AT_CLEANUP
AT_SETUP([test hash functions])
-AT_CHECK([test-hash], [0], [ignore])
+AT_CHECK([test-hash])
AT_CLEANUP
AT_SETUP([test hash map])
-AT_CHECK([test-hmap], [0], [ignore])
+AT_CHECK([test-hmap], [0], [.........
+])
AT_CLEANUP
AT_SETUP([test linked lists])
-AT_CHECK([test-list], [0], [ignore])
+AT_CHECK([test-list], [0], [..
+])
AT_CLEANUP
AT_SETUP([test packet library])
@@ -27,20 +30,22 @@ AT_CHECK([test-packets])
AT_CLEANUP
AT_SETUP([test SHA-1])
-AT_CHECK([test-sha1], [0], [ignore])
+AT_CHECK([test-sha1], [0], [.........
+])
AT_CLEANUP
AT_SETUP([test type properties])
-AT_CHECK([test-type-props], [0], [ignore])
+AT_CHECK([test-type-props])
AT_CLEANUP
AT_SETUP([test strtok_r bug fix])
-AT_CHECK([test-strtok_r], [0], [ignore])
+AT_CHECK([test-strtok_r], [0], [NULL NULL
+])
AT_CLEANUP
AT_SETUP([test byte order conversion])
AT_KEYWORDS([byte order])
-AT_CHECK([test-byte-order], [0], [ignore])
+AT_CHECK([test-byte-order])
AT_CLEANUP
AT_SETUP([test random number generator])
diff --git a/tests/test-strtok_r.c b/tests/test-strtok_r.c
index 9f8d8986..b3026303 100644
--- a/tests/test-strtok_r.c
+++ b/tests/test-strtok_r.c
@@ -33,6 +33,6 @@ main(void)
char *token1, *token2;
token1 = strtok_r(string, ":", &save_ptr);
token2 = strtok_r(NULL, ":", &save_ptr);
- printf ("%s %s\n", token1, token2);
+ printf ("%s %s\n", token1 ? token1 : "NULL", token2 ? token2 : "NULL");
return 0;
}