AT_SETUP([ofproto-dpif - mirroring, select_all])
-OVS_VSWITCHD_START
-AT_CHECK([ovs-vsctl \
- add-port br0 p1 -- set Interface p1 type=dummy --\
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
add-port br0 p2 -- set Interface p2 type=dummy --\
add-port br0 p3 -- set Interface p3 type=dummy --\
set Bridge br0 mirrors=@m --\
--id=@p3 get Port p3 --\
--id=@m create Mirror name=mymirror \
- select_all=true output_port=@p3 ], [0], [stdout])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
-<0>
+ select_all=true output_port=@p3], [<0>
])
AT_CHECK(
AT_SETUP([ofproto-dpif - mirroring, select_src])
-OVS_VSWITCHD_START
-AT_CHECK([ovs-vsctl \
- add-port br0 p1 -- set Interface p1 type=dummy --\
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
add-port br0 p2 -- set Interface p2 type=dummy --\
add-port br0 p3 -- set Interface p3 type=dummy --\
set Bridge br0 mirrors=@m --\
--id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
--id=@m create Mirror name=mymirror \
- select_src_port=@p1 output_port=@p3 ], [0], [stdout])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
-<0>
+ select_src_port=@p1 output_port=@p3], [<0>
])
AT_CHECK(
AT_SETUP([ofproto-dpif - mirroring, select_dst])
-OVS_VSWITCHD_START
-AT_CHECK([ovs-vsctl \
- add-port br0 p1 -- set Interface p1 type=dummy --\
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
add-port br0 p2 -- set Interface p2 type=dummy --\
add-port br0 p3 -- set Interface p3 type=dummy --\
set Bridge br0 mirrors=@m --\
--id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
--id=@m create Mirror name=mymirror \
- select_dst_port=@p2 output_port=@p3 ], [0], [stdout])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
-<0>
+ select_dst_port=@p2 output_port=@p3], [<0>
])
AT_CHECK(
AT_SETUP([ofproto-dpif - mirroring, select_vlan])
-OVS_VSWITCHD_START
-AT_CHECK([ovs-vsctl \
- add-port br0 p1 -- set Interface p1 type=dummy --\
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
add-port br0 p2 -- set Interface p2 type=dummy --\
add-port br0 p3 -- set Interface p3 type=dummy --\
set Bridge br0 mirrors=@m --\
--id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
--id=@m create Mirror name=mymirror \
- select_all=true select_vlan=11 output_port=@p3 ], [0], [stdout])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
-<0>
+ select_all=true select_vlan=11 output_port=@p3], [<0>
])
AT_CHECK(
AT_SETUP([ofproto-dpif - mirroring, output_port])
-OVS_VSWITCHD_START
-AT_CHECK([ovs-vsctl \
- add-port br0 p1 -- set Interface p1 type=dummy --\
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
add-port br0 p2 -- set Interface p2 type=dummy --\
add-port br0 p3 -- set Interface p3 type=dummy --\
set Bridge br0 mirrors=@m --\
--id=@p3 get Port p3 --\
--id=@m create Mirror name=mymirror \
- select_all=true output_port=@p3 ], [0], [stdout])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
-<0>
+ select_all=true output_port=@p3], [<0>
])
AT_CHECK(
OVS_VSWITCHD_STOP
AT_CLEANUP
-
AT_SETUP([ofproto-dpif - mirroring, output_vlan])
-OVS_VSWITCHD_START
-AT_CHECK([ovs-vsctl \
- add-port br0 p1 -- set Interface p1 type=dummy --\
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
add-port br0 p2 -- set Interface p2 type=dummy --\
set Bridge br0 mirrors=@m --\
--id=@m create Mirror name=mymirror \
- select_all=true output_vlan=12 ], [0], [stdout])
-AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [dnl
-<0>
+ select_all=true output_vlan=12], [<0>
])
AT_CHECK(
m4_define([STRIP_DURATION], [[sed 's/\bduration=[0-9.]*s/duration=?s/']])
m4_define([TESTABLE_LOG], [-vPATTERN:ANY:'%c|%p|%m'])
+# OVS_VSWITCHD_START([vsctl-args], [vsctl-output])
+#
+# Creates a database and starts ovsdb-server, starts ovs-vswitchd
+# connected to that database, calls ovs-vsctl to create a bridge named
+# br0 with predictable settings, passing 'vsctl-args' as additional
+# commands to ovs-vsctl. If 'vsctl-args' causes ovs-vsctl to provide
+# output (e.g. because it includes "create" commands) then 'vsctl-output'
+# specifies the expected output after filtering through uuidfilt.pl.
m4_define([OVS_VSWITCHD_START],
[OVS_RUNDIR=$PWD; export OVS_RUNDIR
OVS_LOGDIR=$PWD; export OVS_LOGDIR
/ofproto|INFO|datapath ID changed to fedcba9876543210/d']])
dnl Add bridges, ports, etc.
- AT_CHECK([ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 fail-mode=secure -- $1])
+ AT_CHECK([ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 fail-mode=secure -- $1 m4_if([$2], [], [], [| perl $srcdir/uuidfilt.pl])], [0], [$2])
])
m4_define([OVS_VSWITCHD_STOP],