From: Ben Pfaff Date: Mon, 16 Sep 2013 22:03:55 +0000 (-0700) Subject: tests: Make ovsdb-server add-db/remove-db test faster and more reliable. X-Git-Tag: sliver-openvswitch-2.0.90-1~13^2~41 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d7ae8d6bba7910baf99409d53ced43d23612bd2d;p=sliver-openvswitch.git tests: Make ovsdb-server add-db/remove-db test faster and more reliable. Until now, the "ovsdb-server/add-db and remove-db with --monitor" test killed ovsdb-server with SIGSEGV twice. Each time, the "--monitor" option caused the supervisor process to restart the child, but the second time it incurred a 10-second delay intended to prevent the daemon from wasting CPU time by restarting itself and dying again very quickly in a loop. This made the test take over 10 seconds to execute. It also made it occasionally fail because the OVS_WAIT_UNTIL check waits at most approximately 10 seconds before it decides that the condition that it is testing for will never occur. This commit fixes the problem by breaking the test into two tests, each of which kills ovsdb-server with SIGSEGV only once. Signed-off-by: Ben Pfaff Acked-by: Ethan Jackson --- diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index 8a01f0a11..c87d9c4f6 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -243,7 +243,7 @@ AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/list-dbs], AT_CHECK([ovsdb-client list-tables unix:socket constraints], [0], [ignore], [ignore]) AT_CLEANUP -AT_SETUP([ovsdb-server/add-db and remove-db with --monitor]) +AT_SETUP([ovsdb-server/add-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) # Start ovsdb-server, initially with one db. OVS_RUNDIR=`pwd`; export OVS_RUNDIR @@ -273,8 +273,21 @@ AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/list-dbs], [0], [constraints ordinals ]) +AT_CLEANUP + +AT_SETUP([ovsdb-server/add-db and remove-db with --monitor]) +AT_KEYWORDS([ovsdb server positive]) +# Start ovsdb-server, initially with one db. +OVS_RUNDIR=`pwd`; export OVS_RUNDIR +OVS_LOGDIR=`pwd`; export OVS_LOGDIR +ordinal_schema > schema +AT_CHECK([ovsdb-tool create db1 schema], [0], [ignore], [ignore]) +constraint_schema > schema2 +AT_CHECK([ovsdb-tool create db2 schema2], [0], [ignore], [ignore]) +ON_EXIT([kill `cat *.pid`]) +AT_CHECK([ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db1 db2]) -# Remove the recently added database. +# Remove the second database. AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/remove-db constraints]) AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/list-dbs], [0], [ordinals