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