]>
Commit | Line | Data |
---|---|---|
b7898031 BP |
1 | AT_BANNER([ovs-vswitchd]) |
2 | ||
3 | dnl The OVS initscripts never make an empty database (one without even an | |
4 | dnl Open_vSwitch record) visible to ovs-vswitchd, but hand-rolled scripts | |
5 | dnl sometimes do. At one point, "ovs-vswitchd --detach" would never detach | |
6 | dnl and use 100% CPU if this happened, so this test checks for regression. | |
7 | AT_SETUP([ovs-vswitchd detaches correctly with empty db]) | |
8 | OVS_RUNDIR=`pwd`; export OVS_RUNDIR | |
9 | OVS_LOGDIR=`pwd`; export OVS_LOGDIR | |
10 | OVS_DBDIR=`pwd`; export OVS_DBDIR | |
11 | OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR | |
12 | ON_EXIT([kill `cat ovsdb-server.pid ovs-vswitchd.pid`]) | |
13 | ||
14 | dnl Create database. | |
15 | touch .conf.db.~lock~ | |
16 | AT_CHECK([ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema]) | |
17 | ||
18 | dnl Start ovsdb-server. *Don't* initialize database. | |
19 | AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock], [0], [ignore], [ignore]) | |
20 | AT_CAPTURE_FILE([ovsdb-server.log]) | |
21 | ||
22 | dnl Start ovs-vswitchd. | |
23 | AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file], [0], [], [stderr]) | |
24 | AT_CAPTURE_FILE([ovs-vswitchd.log]) | |
25 | ||
26 | dnl ovs-vswitchd detached OK or we wouldn't have made it this far. Success. | |
27 | AT_CLEANUP |