OVS_VSWITCHD_STOP
AT_CLEANUP
+m4_divert_push([PREPARE_TESTS])
+# Sorts groups of lines that start with a space, without moving them
+# past the nearest line that does not start with a space.
+multiline_sort () {
+ ${PERL} -e '
+ use warnings;
+ use strict;
+ my @buffer = ();
+ while (<STDIN>) {
+ if (/^ /) {
+ push(@buffer, $_);
+ } else {
+ print $_ foreach sort(@buffer);
+ print $_;
+ @buffer = ();
+ }
+ }
+ print $_ foreach sort(@buffer);
+'
+}
+m4_divert_pop([PREPARE_TESTS])
+
AT_SETUP([ofproto - flow monitoring])
AT_KEYWORDS([monitor])
OVS_VSWITCHD_START
ovs-ofctl del-flows br0 dl_vlan=123
ovs-ofctl del-flows br0
ovs-appctl -t ovs-ofctl ofctl/barrier
-sort='
- # Sorts groups of lines that start with a space, without moving them
- # past the nearest line that does not start with a space.
- use warnings;
- use strict;
- my @buffer = ();
- while (<STDIN>) {
- if (/^ /) {
- push(@buffer, $_);
- } else {
- print $_ foreach sort(@buffer);
- print $_;
- @buffer = ();
- }
- }
- print $_ foreach sort(@buffer);
-'
-AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | ${PERL} -e "$sort"], [0],
+AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
[NXST_FLOW_MONITOR reply (xid=0x0):
event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
NXST_FLOW_MONITOR reply (xid=0x0):