OVS_VSWITCHD_START
# start another ovs-vswitchd process.
-ovs-vswitchd --log-file=fakelog &
-pid=`echo $!`
+ovs-vswitchd --log-file=fakelog --unixctl="`pwd`"/unixctl &
# sleep for a while
sleep 5
# stop the process.
-kill $pid
+ovs-appctl -t `pwd`/unixctl exit
# check the fakelog, should only see one ERR for reporting
-# the existing ovs-vswitchd process and one WARN for killing
-# the process.
+# the existing ovs-vswitchd process.
AT_CHECK([test `grep ERR fakelog | wc -l` -eq 1])
-AT_CHECK([test `grep WARN fakelog | wc -l` -eq 1])
-
-AT_CHECK([grep ERR fakelog | sed -e 's/^.*ERR|//; s/pid [[0-9]]*//'], [0], [dnl
-another ovs-vswitchd process is running, disabling this process () until it goes away
-])
-# check the fakelog, the ERR log should be the last line.
-AT_CHECK([tail -n 2 fakelog | head -n 1 | sed -e 's/^.*ERR|//; s/pid [[0-9]]*//'], [0], [dnl
+AT_CHECK([tail -n1 fakelog | sed -e 's/^.*ERR|//; s/pid [[0-9]]*//'], [0], [dnl
another ovs-vswitchd process is running, disabling this process () until it goes away
])
OVS_VSWITCHD_START
# start a new ovs-vswitchd process.
-ovs-vswitchd --log-file=fakelog --enable-dummy &
-pid=`echo $!`
+ovs-vswitchd --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl &
# sleep for a while.
sleep 5
])
# stop the process.
-kill $pid
+ovs-appctl -t `pwd`/unixctl exit
# check the fakelog, should not see WARN/ERR/EMER log other than the one
# for reporting the existing ovs-vswitchd process and the one for killing
# the process.
AT_CHECK([sed -n "
/|ERR|another ovs-vswitchd process is running/d
-/|WARN|terminating with signal/d
/|WARN|/p
/|ERR|/p
/|EMER|/p" fakelog