Perl is unfashionable and Python is more widely available and understood, so this commit converts one of the OVS uses of Perl into Python.
Signed-off-by: Ben Pfaff <[email protected]> --- tests/automake.mk | 5 +- tests/ofproto-macros.at | 4 +- tests/ofproto.at | 24 ++++----- tests/ovn-controller.at | 2 +- tests/ovn-nbctl.at | 102 +++++++++++++++++++-------------------- tests/ovs-macros.at | 4 ++ tests/ovs-vsctl.at | 16 +++--- tests/ovsdb-execution.at | 4 +- tests/ovsdb-idl.at | 30 ++++++------ tests/ovsdb-monitor.at | 4 +- tests/ovsdb-rbac.at | 28 +++++------ tests/ovsdb-server.at | 36 +++++++------- tests/ovsdb-tool.at | 18 +++---- tests/ovsdb-trigger.at | 2 +- tests/system-kmod-macros.at | 4 +- tests/system-userspace-macros.at | 4 +- tests/uuidfilt.pl | 33 ------------- tests/uuidfilt.py | 50 +++++++++++++++++++ 18 files changed, 196 insertions(+), 174 deletions(-) delete mode 100755 tests/uuidfilt.pl create mode 100755 tests/uuidfilt.py diff --git a/tests/automake.mk b/tests/automake.mk index 156b40f58d7c..3ca60e2ea450 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -290,7 +290,7 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac noinst_PROGRAMS += tests/test-ovsdb tests_test_ovsdb_SOURCES = tests/test-ovsdb.c nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h -EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl +EXTRA_DIST += tests/ovsdb-monitor-sort.pl tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la noinst_PROGRAMS += tests/test-lib @@ -389,7 +389,8 @@ CHECK_PYFILES = \ tests/MockXenAPI.py \ tests/test-unix-socket.py \ tests/test-unixctl.py \ - tests/test-vlog.py + tests/test-vlog.py \ + tests/uuidfilt.py EXTRA_DIST += $(CHECK_PYFILES) PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at index 38449db32ee0..4fbb10070342 100644 --- a/tests/ofproto-macros.at +++ b/tests/ofproto-macros.at @@ -353,7 +353,7 @@ m4_define([_OVS_VSWITCHD_START], # 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. +# specifies the expected output after filtering through uuidfilt. # # If a test needs to use "system" devices (as dummies), then specify # =override (literally) as the third argument. Otherwise, system devices @@ -364,7 +364,7 @@ m4_define([_OVS_VSWITCHD_START], # to ovs-vswitchd m4_define([OVS_VSWITCHD_START], [_OVS_VSWITCHD_START([--enable-dummy$3 --disable-system $4]) - AT_CHECK([add_of_br 0 $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2]) + AT_CHECK([add_of_br 0 $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) ]) # check_logs scans through all *.log files (except '*.log' and testsuite.log) diff --git a/tests/ofproto.at b/tests/ofproto.at index 31cb5208fc1c..9853a21db989 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -2196,7 +2196,7 @@ AT_CHECK( -- --id=@t0 create Flow_Table name=main \ -- --id=@t1 create Flow_Table flow-limit=1024 \ -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> <1> ]) @@ -2348,7 +2348,7 @@ AT_CHECK( -- --id=@t0 create Flow_Table name=main \ -- --id=@t1 create Flow_Table flow-limit=1024 \ -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> <1> ]) @@ -2603,7 +2603,7 @@ AT_CHECK( -- --id=@t0 create Flow_Table name=main \ -- --id=@t1 create Flow_Table flow-limit=1024 \ -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> <1> ]) @@ -2655,7 +2655,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table flow-limit=4 \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. @@ -2699,7 +2699,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table flow-limit=4 \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. @@ -2738,7 +2738,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. @@ -2796,7 +2796,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. @@ -2855,7 +2855,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table name=evict flow-limit=4 \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Use mod-table to turn on eviction just to demonstrate that it works. @@ -2921,7 +2921,7 @@ AT_CHECK( overflow-policy=evict \ groups='"NXM_OF_IN_PORT[[]]"' \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. @@ -3003,7 +3003,7 @@ AT_CHECK( overflow-policy=evict \ groups='"NXM_OF_IN_PORT[[]]"' \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. @@ -3083,7 +3083,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) ovs-appctl time/stop @@ -3127,7 +3127,7 @@ AT_CHECK( [ovs-vsctl \ -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl], + | uuidfilt], [0], [<0> ]) # Add 4 flows. diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 2b28279c18da..3244707f6032 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -96,7 +96,7 @@ AT_CHECK([ovn-sbctl \ -- create Port_Binding datapath=@dp1 logical_port=foo tunnel_key=1 type=patch options:peer=bar \ -- create Port_Binding datapath=@dp2 logical_port=bar tunnel_key=2 type=patch options:peer=foo \ -- create Port_Binding datapath=@dp1 logical_port=dp1vif tunnel_key=3 \ -| ${PERL} $srcdir/uuidfilt.pl], [0], [<0> +| uuidfilt], [0], [<0> <1> <2> <3> diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 26b3ee9d8dda..bcc627e98de4 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -38,31 +38,31 @@ AT_SETUP([ovn-nbctl - basic switch commands]) OVN_NBCTL_TEST_START AT_CHECK([ovn-nbctl ls-add ls0]) -AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-list | uuidfilt], [0], [dnl <0> (ls0) ]) AT_CHECK([ovn-nbctl ls-add ls1]) -AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-list | uuidfilt], [0], [dnl <0> (ls0) <1> (ls1) ]) AT_CHECK([ovn-nbctl ls-del ls0]) -AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-list | uuidfilt], [0], [dnl <0> (ls1) ]) AT_CHECK([ovn-nbctl show ls0]) AT_CHECK([ovn-nbctl ls-add ls0]) -AT_CHECK([ovn-nbctl show ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], +AT_CHECK([ovn-nbctl show ls0 | uuidfilt], [0], [switch <0> (ls0) ]) AT_CHECK([ovn-nbctl ls-add ls0], [1], [], [ovn-nbctl: ls0: a switch with this name already exists ]) AT_CHECK([ovn-nbctl --may-exist ls-add ls0]) -AT_CHECK([ovn-nbctl show ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], +AT_CHECK([ovn-nbctl show ls0 | uuidfilt], [0], [switch <0> (ls0) ]) AT_CHECK([ovn-nbctl --add-duplicate ls-add ls0]) @@ -101,12 +101,12 @@ AT_CHECK([ovn-nbctl lsp-add ls0 lp0], [1], [], [ovn-nbctl: lp0: a port with this name already exists ]) AT_CHECK([ovn-nbctl --may-exist lsp-add ls0 lp0]) -AT_CHECK([ovn-nbctl lsp-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lsp-list ls0 | uuidfilt], [0], [dnl <0> (lp0) ]) AT_CHECK([ovn-nbctl lsp-add ls0 lp1]) -AT_CHECK([ovn-nbctl lsp-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lsp-list ls0 | uuidfilt], [0], [dnl <0> (lp0) <1> (lp1) ]) @@ -123,7 +123,7 @@ AT_CHECK([ovn-nbctl --may-exist lsp-add ls0 lp1 lp0 5], [1], [], ]) AT_CHECK([ovn-nbctl lsp-del lp1]) -AT_CHECK([ovn-nbctl lsp-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lsp-list ls0 | uuidfilt], [0], [dnl <0> (lp0) ]) @@ -449,7 +449,7 @@ AT_CHECK([ovn-nbctl lb-add lb0 30.0.0.10 192.168.10.10:900 tcp], [1], [], dnl Add ips to lb AT_CHECK([ovn-nbctl lb-add lb0 30.0.0.10:80 ,,,192.168.10.10:80,,,,,]) AT_CHECK([ovn-nbctl lb-add lb1 30.0.0.10:80 ,,,192.168.10.10:80,,,,192.168.10.20:80,,,,]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80 <1> lb1 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 @@ -459,7 +459,7 @@ AT_CHECK([ovn-nbctl lb-del lb1]) AT_CHECK([ovn-nbctl lb-add lb0 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80]) AT_CHECK([ovn-nbctl lb-add lb1 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 tcp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 @@ -467,14 +467,14 @@ UUID LB PROTO VIP dnl Update the VIP of the lb1. AT_CHECK([ovn-nbctl --may-exist lb-add lb1 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 ]) AT_CHECK([ovn-nbctl --may-exist lb-add lb1 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 udp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 @@ -482,7 +482,7 @@ UUID LB PROTO VIP dnl Config lb1 with another VIP. AT_CHECK([ovn-nbctl lb-add lb1 30.0.0.20:80 192.168.10.10:80 udp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 @@ -490,7 +490,7 @@ UUID LB PROTO VIP ]) AT_CHECK([ovn-nbctl lb-del lb1 30.0.0.20:80]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 @@ -499,7 +499,7 @@ UUID LB PROTO VIP dnl Add LBs whose vip is just an IP address. AT_CHECK([ovn-nbctl lb-add lb2 30.0.0.30 192.168.10.10]) AT_CHECK([ovn-nbctl lb-add lb3 30.0.0.30 192.168.10.10]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 @@ -511,7 +511,7 @@ AT_CHECK([ovn-nbctl lb-del lb3 30.0.0.30]) AT_CHECK([ovn-nbctl lb-add lb2 30.0.0.10:8080 192.168.10.10:80,192.168.10.20:80 tcp]) AT_CHECK([ovn-nbctl --add-duplicate lb-add lb2 30.0.0.10:8080 192.168.10.10:80,192.168.10.20:80 tcp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080 @@ -533,7 +533,7 @@ AT_CHECK([ovn-nbctl --may-exist lb-add lb1 30.0.0.10:8080 192.168.10.10:8080,192 AT_CHECK([ovn-nbctl --may-exist lb-add lb1 30.0.0.10:9090 192.168.10.10:8080,192.168.10.20:8080 udp]) AT_CHECK([ovn-nbctl lb-del lb0 30.0.0.10:80]) AT_CHECK([ovn-nbctl lb-del lb1]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb2 tcp 30.0.0.10:8080 192.168.10.10:80,192.168.10.20:80 <1> lb2 tcp 30.0.0.10:8080 192.168.10.10:80,192.168.10.20:80 @@ -552,7 +552,7 @@ AT_CHECK([ovn-nbctl ls-lb-add ls0 lb2], [1], [], ]) AT_CHECK([ovn-nbctl ls-lb-add ls0 lb3]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 @@ -560,7 +560,7 @@ UUID LB PROTO VIP ]) AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb3 tcp/udp 30.0.0.10 192.168.10.10,192.168.10.20 @@ -568,7 +568,7 @@ UUID LB PROTO VIP AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1]) AT_CHECK([ovn-nbctl ls-lb-del ls0 lb3]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], []) AT_CHECK([ovn-nbctl --if-exists ls-lb-del ls0 lb1]) dnl Remove all load balancers from logical switch. @@ -576,7 +576,7 @@ AT_CHECK([ovn-nbctl ls-lb-add ls0 lb0]) AT_CHECK([ovn-nbctl ls-lb-add ls0 lb1]) AT_CHECK([ovn-nbctl ls-lb-add ls0 lb3]) AT_CHECK([ovn-nbctl ls-lb-del ls0]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], []) dnl Add load balancer to logical router. AT_CHECK([ovn-nbctl lr-add lr0]) @@ -588,7 +588,7 @@ AT_CHECK([ovn-nbctl lr-lb-add lr0 lb2], [1], [], ]) AT_CHECK([ovn-nbctl lr-lb-add lr0 lb3]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 @@ -596,7 +596,7 @@ UUID LB PROTO VIP ]) AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80 <1> lb3 tcp/udp 30.0.0.10 192.168.10.10,192.168.10.20 @@ -604,7 +604,7 @@ UUID LB PROTO VIP AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1]) AT_CHECK([ovn-nbctl lr-lb-del lr0 lb3]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], []) AT_CHECK([ovn-nbctl --if-exists lr-lb-del lr0 lb1]) dnl Remove all load balancers from logical router. @@ -612,7 +612,7 @@ AT_CHECK([ovn-nbctl lr-lb-add lr0 lb0]) AT_CHECK([ovn-nbctl lr-lb-add lr0 lb1]) AT_CHECK([ovn-nbctl lr-lb-add lr0 lb3]) AT_CHECK([ovn-nbctl lr-lb-del lr0]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], []) OVN_NBCTL_TEST_STOP AT_CLEANUP @@ -712,7 +712,7 @@ AT_CHECK([ovn-nbctl lb-del lb0]) dnl Add ips to lb AT_CHECK([ovn-nbctl lb-add lb0 [[ae0f::10]]:80 ,,,[[fd0f::10]]:80,,,,,]) AT_CHECK([ovn-nbctl lb-add lb1 [[ae0f::10]]:80 ,,,[[fd0f::10]]:80,,,,[[fd0f::20]]:80,,,,]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80 <1> lb1 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 @@ -723,7 +723,7 @@ AT_CHECK([ovn-nbctl lb-del lb1]) AT_CHECK([ovn-nbctl lb-add lb0 [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80]) AT_CHECK([ovn-nbctl lb-add lb1 [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 tcp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 @@ -731,14 +731,14 @@ UUID LB PROTO VIP dnl Update the VIP of the lb1. AT_CHECK([ovn-nbctl --may-exist lb-add lb1 [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 ]) AT_CHECK([ovn-nbctl --may-exist lb-add lb1 [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 udp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 @@ -746,7 +746,7 @@ UUID LB PROTO VIP dnl Config lb1 with another VIP. AT_CHECK([ovn-nbctl lb-add lb1 [[ae0f::20]]:80 [[fd0f::10]]:80 udp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 @@ -754,7 +754,7 @@ UUID LB PROTO VIP ]) AT_CHECK([ovn-nbctl lb-del lb1 [[ae0f::20]]:80]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 @@ -763,7 +763,7 @@ UUID LB PROTO VIP dnl Add LBs whose vip is just an IP address. AT_CHECK([ovn-nbctl lb-add lb2 ae0f::30 fd0f::10]) AT_CHECK([ovn-nbctl lb-add lb3 ae0f::30 fd0f::10]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 @@ -775,7 +775,7 @@ AT_CHECK([ovn-nbctl lb-del lb3 ae0f::30]) AT_CHECK([ovn-nbctl lb-add lb2 [[ae0f::10]]:8080 [[fd0f::10]]:80,[[fd0f::20]]:80 tcp]) AT_CHECK([ovn-nbctl --add-duplicate lb-add lb2 [[ae0f::10]]:8080 [[fd0f::10]]:80,[[fd0f::20]]:80 tcp]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080 @@ -797,7 +797,7 @@ AT_CHECK([ovn-nbctl --may-exist lb-add lb1 [[ae0f::10]]:8080 [[fd0f::10]]:8080,[ AT_CHECK([ovn-nbctl --may-exist lb-add lb1 [[ae0f::10]]:9090 [[fd0f::10]]:8080,[[fd0f::20]]:8080 udp]) AT_CHECK([ovn-nbctl lb-del lb0 [[ae0f::10]]:80]) AT_CHECK([ovn-nbctl lb-del lb1]) -AT_CHECK([ovn-nbctl lb-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb2 tcp [[ae0f::10]]:8080 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb2 tcp [[ae0f::10]]:8080 [[fd0f::10]]:80,[[fd0f::20]]:80 @@ -816,7 +816,7 @@ AT_CHECK([ovn-nbctl ls-lb-add ls0 lb2], [1], [], ]) AT_CHECK([ovn-nbctl ls-lb-add ls0 lb3]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 @@ -824,7 +824,7 @@ UUID LB PROTO VIP ]) AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb3 tcp/udp ae0f::10 fd0f::10,fd0f::20 @@ -832,7 +832,7 @@ UUID LB PROTO VIP AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1]) AT_CHECK([ovn-nbctl ls-lb-del ls0 lb3]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], []) AT_CHECK([ovn-nbctl --if-exists ls-lb-del ls0 lb1]) dnl Remove all load balancers from logical switch. @@ -840,7 +840,7 @@ AT_CHECK([ovn-nbctl ls-lb-add ls0 lb0]) AT_CHECK([ovn-nbctl ls-lb-add ls0 lb1]) AT_CHECK([ovn-nbctl ls-lb-add ls0 lb3]) AT_CHECK([ovn-nbctl ls-lb-del ls0]) -AT_CHECK([ovn-nbctl ls-lb-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], []) dnl Add load balancer to logical router. AT_CHECK([ovn-nbctl lr-add lr0]) @@ -852,7 +852,7 @@ AT_CHECK([ovn-nbctl lr-lb-add lr0 lb2], [1], [], ]) AT_CHECK([ovn-nbctl lr-lb-add lr0 lb3]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 @@ -860,7 +860,7 @@ UUID LB PROTO VIP ]) AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl UUID LB PROTO VIP IPs <0> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80 <1> lb3 tcp/udp ae0f::10 fd0f::10,fd0f::20 @@ -868,7 +868,7 @@ UUID LB PROTO VIP AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1]) AT_CHECK([ovn-nbctl lr-lb-del lr0 lb3]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], []) AT_CHECK([ovn-nbctl --if-exists lr-lb-del lr0 lb1]) dnl Remove all load balancers from logical router. @@ -876,7 +876,7 @@ AT_CHECK([ovn-nbctl lr-lb-add lr0 lb0]) AT_CHECK([ovn-nbctl lr-lb-add lr0 lb1]) AT_CHECK([ovn-nbctl lr-lb-add lr0 lb3]) AT_CHECK([ovn-nbctl lr-lb-del lr0]) -AT_CHECK([ovn-nbctl lr-lb-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], []) +AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], []) OVN_NBCTL_TEST_STOP AT_CLEANUP @@ -886,31 +886,31 @@ AT_SETUP([ovn-nbctl - basic logical router commands]) OVN_NBCTL_TEST_START AT_CHECK([ovn-nbctl lr-add lr0]) -AT_CHECK([ovn-nbctl lr-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-list | uuidfilt], [0], [dnl <0> (lr0) ]) AT_CHECK([ovn-nbctl lr-add lr1]) -AT_CHECK([ovn-nbctl lr-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-list | uuidfilt], [0], [dnl <0> (lr0) <1> (lr1) ]) AT_CHECK([ovn-nbctl lr-del lr0]) -AT_CHECK([ovn-nbctl lr-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lr-list | uuidfilt], [0], [dnl <0> (lr1) ]) AT_CHECK([ovn-nbctl show lr0]) AT_CHECK([ovn-nbctl lr-add lr0]) -AT_CHECK([ovn-nbctl show lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], +AT_CHECK([ovn-nbctl show lr0 | uuidfilt], [0], [router <0> (lr0) ]) AT_CHECK([ovn-nbctl lr-add lr0], [1], [], [ovn-nbctl: lr0: a router with this name already exists ]) AT_CHECK([ovn-nbctl --may-exist lr-add lr0]) -AT_CHECK([ovn-nbctl show lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], +AT_CHECK([ovn-nbctl show lr0 | uuidfilt], [0], [router <0> (lr0) ]) AT_CHECK([ovn-nbctl --add-duplicate lr-add lr0]) @@ -953,7 +953,7 @@ AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03:04 192.168.1.1/24], [1], AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24]) -AT_CHECK([ovn-nbctl show lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl show lr0 | uuidfilt], [0], [dnl router <0> (lr0) port lrp0 mac: "00:00:00:01:02:03" @@ -964,12 +964,12 @@ AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24], [1], [], [ovn-nbctl: lrp0: a port with this name already exists ]) AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24]) -AT_CHECK([ovn-nbctl lrp-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lrp-list lr0 | uuidfilt], [0], [dnl <0> (lrp0) ]) AT_CHECK([ovn-nbctl lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 peer=lrp1-peer]) -AT_CHECK([ovn-nbctl lrp-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lrp-list lr0 | uuidfilt], [0], [dnl <0> (lrp0) <1> (lrp1) ]) @@ -998,7 +998,7 @@ AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 10.0.0.1/24 p AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 peer=lrp1-peer]) AT_CHECK([ovn-nbctl lrp-del lrp1]) -AT_CHECK([ovn-nbctl lrp-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl +AT_CHECK([ovn-nbctl lrp-list lr0 | uuidfilt], [0], [dnl <0> (lrp0) ]) diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 7c57ca1bcad2..08d3d5a020f5 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -197,6 +197,10 @@ kill_ovs_vswitchd () { wc () { command wc "$@" | tr -s ' ' ' ' | sed 's/^ *//' } + +uuidfilt () { + $PYTHON "$top_srcdir"/tests/uuidfilt.py "$@" +} ] m4_divert_pop([PREPARE_TESTS]) diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index 8861a4aad3b1..d54188976ad9 100644 --- a/tests/ovs-vsctl.at +++ b/tests/ovs-vsctl.at @@ -654,7 +654,7 @@ cp stdout out1 AT_CHECK([RUN_OVS_VSCTL([list bridge], [get bridge br0 _uuid])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) cp stdout out2 -AT_CHECK([${PERL} $srcdir/uuidfilt.pl out1 out2], [0], +AT_CHECK([uuidfilt out1 out2], [0], [[<0> @@ -785,7 +785,7 @@ AT_CHECK([ cp stdout netflow-uuid AT_CHECK([RUN_OVS_VSCTL([list netflow `cat netflow-uuid`])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl netflow-uuid stdout], [0], +AT_CHECK([uuidfilt netflow-uuid stdout], [0], [[<0> _uuid : <0> @@ -1084,7 +1084,7 @@ AT_CHECK( [--id=@m create mirror name=mymirror select-dst-port=@eth0 select-src-port=@eth0 output-port=@eth1])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) AT_CHECK( - [${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl + [uuidfilt stdout], [0], [dnl @@ -1098,7 +1098,7 @@ AT_CHECK( [list bridge br0])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) AT_CHECK( - [sed -n -e '/uuid/p' -e '/name/p' -e '/mirrors/p' -e '/select/p' -e '/output/p' < stdout | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl + [sed -n -e '/uuid/p' -e '/name/p' -e '/mirrors/p' -e '/select/p' -e '/output/p' < stdout | uuidfilt], [0], [dnl [_uuid : <0> name : "eth0" _uuid : <1> @@ -1124,13 +1124,13 @@ AT_KEYWORDS([ovs-vsctl]) OVS_VSCTL_SETUP AT_CHECK( [ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \ - -- create Bridge name=br0 | ${PERL} $srcdir/uuidfilt.pl], + -- create Bridge name=br0 | uuidfilt], [0], [<0> ], [db_ctl_base|WARN|applying "create" command to table Bridge without --id option will have no effect ], [OVS_VSCTL_CLEANUP]) AT_CHECK( [ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \ - -- --id=@br0 create Bridge name=br0 | ${PERL} $srcdir/uuidfilt.pl], + -- --id=@br0 create Bridge name=br0 | uuidfilt], [0], [<0> ], [vsctl|WARN|row id "@br0" was created but no reference to it was inserted, so it will not actually appear in the database ], [OVS_VSCTL_CLEANUP]) @@ -1140,7 +1140,7 @@ AT_CHECK( -- --id=@eth0 create Port name=eth0 interfaces=@eth0_iface \ -- --id=@m0 create Mirror name=m0 output_port=@eth0 \ -- --id=@br0 create Bridge name=br0 mirrors=@m0 \ - -- set Open_vSwitch . bridges=@br0 | ${PERL} $srcdir/uuidfilt.pl], + -- set Open_vSwitch . bridges=@br0 | uuidfilt], [0], [<0> <1> <2> @@ -1158,7 +1158,7 @@ AT_KEYWORDS([ovs-vsctl]) OVS_VSCTL_SETUP AT_CHECK([RUN_OVS_VSCTL([--id=@br0 create Bridge name=br0 -- add Open_vSwitch . bridges @br0 -- list bridge])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], +AT_CHECK([uuidfilt stdout], [0], [[<0> _uuid : <1> auto_attach : [] diff --git a/tests/ovsdb-execution.at b/tests/ovsdb-execution.at index 311f44abc527..3129e73f4a09 100644 --- a/tests/ovsdb-execution.at +++ b/tests/ovsdb-execution.at @@ -141,7 +141,7 @@ m4_define([OVSDB_CHECK_EXECUTION_RO], AT_KEYWORDS([ovsdb execute execution positive $5]) AT_CHECK([test-ovsdb execute-readonly "`$2`" m4_foreach([txn], [$3], [ 'txn'])], [0], [stdout], []) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [$4]) + AT_CHECK([uuidfilt stdout], [0], [$4]) AT_CLEANUP]) OVSDB_CHECK_EXECUTION_RO([block insert on read only DB], @@ -179,7 +179,7 @@ m4_define([OVSDB_CHECK_EXECUTION], AT_KEYWORDS([ovsdb execute execution positive $5]) AT_CHECK([test-ovsdb execute "`$2`" m4_foreach([txn], [$3], [ 'txn'])], [0], [stdout], []) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [$4]) + AT_CHECK([uuidfilt stdout], [0], [$4]) AT_CLEANUP]) OVSDB_CHECK_EXECUTION([uuid-name must be <id>], diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at index 21745eacbb5c..59b2c1991bde 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -37,7 +37,7 @@ m4_define([OVSDB_CHECK_IDL_C], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -52,7 +52,7 @@ m4_define([OVSDB_CHECK_IDL_PYN], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -72,7 +72,7 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?link1:i,k,ka,l2?link2:i,l1 $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -95,7 +95,7 @@ m4_define([OVSDB_CHECK_IDL_TCP_PYN], [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])]) AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -121,7 +121,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PYN], [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])]) AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -154,7 +154,7 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY], AT_CHECK([ovsdb_start_idltest "tcp:127.0.0.1:$TCP_PORT"]) AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP @@ -764,7 +764,7 @@ AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl uni "where": [], "row": {"k": ["uuid", "#0#"]}}]']], [0], [stdout], [stderr]) -AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0], +AT_CHECK([sort stdout | uuidfilt], [0], [[000: empty 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} 002: i=0 k=0 ka=[] l2= uuid=<0> @@ -812,7 +812,7 @@ m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$7],,, [[| $7]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]), [0], [$5]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -856,7 +856,7 @@ m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY], AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond]) AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2], [0], [stdout], [ignore], [kill `cat pid`]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$5],,, [[| $5]]), [0], [$3], [], [kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -951,7 +951,7 @@ m4_define([OVSDB_CHECK_IDL_TRACK_C], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1080,7 +1080,7 @@ m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1129,7 +1129,7 @@ m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1188,7 +1188,7 @@ m4_define([OVSDB_CHECK_IDL_NOTIFY_PY], AT_CHECK([ovsdb_start_idltest]) AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2], [0], [stdout], [ignore], [kill `cat pid`]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$5],,, [[| $5]]), [0], [$3], [], [kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1217,7 +1217,7 @@ m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PY], ssl:127.0.0.1:$TCP_PORT $PKIDIR/testpki-privkey.pem \ $PKIDIR/testpki-cert.pem $PKIDIR/testpki-cacert.pem $2], [0], [stdout], [ignore], [kill `cat pid`]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$5],,, [[| $5]]), [0], [$3], [], [kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1605,7 +1605,7 @@ m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index-with-ref unix:socket $3], [0], [stdout], [ignore]) - AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at index 256868b0248f..65c595645b14 100644 --- a/tests/ovsdb-monitor.at +++ b/tests/ovsdb-monitor.at @@ -44,7 +44,7 @@ m4_define([OVSDB_CHECK_MONITOR], [ignore], [ignore]) OVS_APP_EXIT_AND_WAIT_BY_TARGET([ovsdb-server], [ovsdb-server.pid]) OVS_WAIT_UNTIL([test ! -e ovsdb-client.pid]) - AT_CHECK([${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl], [0], [$7], [ignore]) + AT_CHECK([${PERL} $srcdir/ovsdb-monitor-sort.pl < output | uuidfilt], [0], [$7], [ignore]) AT_CLEANUP]) # OVSDB_CHECK_MONITOR_COND(TITLE, SCHEMA, [PRE-MONITOR-TXN], DB, TABLE, @@ -86,7 +86,7 @@ m4_define([OVSDB_CHECK_MONITOR_COND], [ignore], [ignore]) AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore]) OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid]) - AT_CHECK([${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl], [0], [$7], [ignore]) + AT_CHECK([${PERL} $srcdir/ovsdb-monitor-sort.pl < output | uuidfilt], [0], [$7], [ignore]) AT_CLEANUP]) OVSDB_CHECK_MONITOR([monitor insert into empty table], diff --git a/tests/ovsdb-rbac.at b/tests/ovsdb-rbac.at index 351eab9637c7..adefee4dfa27 100644 --- a/tests/ovsdb-rbac.at +++ b/tests/ovsdb-rbac.at @@ -135,7 +135,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"name": "chartreuse", "value": '8388352'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-1\" role \"testrole\" prohibit row insertion into table \"fixed_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-1\" role \"testrole\" prohibit row insertion into table \"fixed_colors\".","error":"permission error"}]] ], [ignore]) # Test 2: @@ -152,7 +152,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"creator": "client-2", "name": "chartreuse", "value": '8388352'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-1\" role \"testrole\" prohibit row insertion into table \"user_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-1\" role \"testrole\" prohibit row insertion into table \"user_colors\".","error":"permission error"}]] ], [ignore]) # Test 3: @@ -169,7 +169,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"creator": "client-1", "name": "chartreuse", "value": '8388352'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"uuid":["uuid","<0>"]}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"uuid":["uuid","<0>"]}]] ], [ignore]) # Test 4: @@ -188,7 +188,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"value": '8388353'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"count":1}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"count":1}]] ], [ignore]) # Test 5: @@ -207,7 +207,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"value": '8388354'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit modification of table \"user_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit modification of table \"user_colors\".","error":"permission error"}]] ], [ignore]) # Test 6: @@ -226,7 +226,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "mutations": [["value", "+=", '10']]} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"count":1}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"count":1}]] ], [ignore]) # Test 7: @@ -245,7 +245,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "mutations": [["value", "+=", '10']]} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit mutate operation on table \"user_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit mutate operation on table \"user_colors\".","error":"permission error"}]] ], [ignore]) # Test 8: @@ -262,7 +262,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "where": [["name", "==", "chartreuse"]]} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit row deletion from table \"user_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit row deletion from table \"user_colors\".","error":"permission error"}]] ], [ignore]) # Test 9: @@ -279,7 +279,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "where": [["name", "==", "chartreuse"]]} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"count":1}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"count":1}]] ], [ignore]) # Test 10: @@ -296,7 +296,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"creator": ["map",[["chassis", "client-1"]]], "name": "seafoam", "value": '7466680'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"uuid":["uuid","<0>"]}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"uuid":["uuid","<0>"]}]] ], [ignore]) # Test 11: @@ -315,7 +315,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"value": '8388353'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"count":1}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"count":1}]] ], [ignore]) # Test 12: @@ -334,7 +334,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "row": {"value": '8388354'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit modification of table \"other_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit modification of table \"other_colors\".","error":"permission error"}]] ], [ignore]) # Test 13: @@ -351,7 +351,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "where": [["name", "==", "seafoam"]]} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit row deletion from table \"other_colors\".","error":"permission error"}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"details":"RBAC rules for client \"client-2\" role \"testrole\" prohibit row deletion from table \"other_colors\".","error":"permission error"}]] ], [ignore]) # Test 14: @@ -368,7 +368,7 @@ AT_CHECK([ovsdb-client transact ssl:127.0.0.1:$SSL_PORT \ "where": [["name", "==", "seafoam"]]} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[[{"count":1}]] +AT_CHECK([uuidfilt stdout], [0], [[[{"count":1}]] ], [ignore]) OVSDB_SERVER_SHUTDOWN diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index 0f8c791128b1..bcc1bc8f7d39 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -33,7 +33,7 @@ m4_define([OVSDB_CHECK_EXECUTION], [test ! -e pid || kill `cat pid`]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore], + AT_CHECK([uuidfilt output], [0], [$4], [ignore], [test ! -e pid || kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -81,7 +81,7 @@ AT_DATA([txnfile], [[ovsdb-client transact unix:socket \ ]]) AT_CHECK([ovsdb-server --remote=punix:socket db --run="sh txnfile"], [0], [stdout], []) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], +AT_CHECK([uuidfilt output], [0], [[[{"uuid":["uuid","<0>"]}] [{"uuid":["uuid","<1>"]}] [{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<2>"],"name":"zero","number":0},{"_uuid":["uuid","<1>"],"_version":["uuid","<3>"],"name":"one","number":1}]}] @@ -129,7 +129,7 @@ AT_DATA([txnfile], [[ovsdb-client transact unix:socket \ ]]) AT_CHECK([ovsdb-server --remote=punix:socket db --run="sh txnfile"], [0], [stdout], []) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], +AT_CHECK([uuidfilt output], [0], [[[{"uuid":["uuid","<0>"]}] [{"uuid":["uuid","<1>"]}] [{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<2>"],"name":"zero","number":0},{"_uuid":["uuid","<1>"],"_version":["uuid","<3>"],"name":"one","number":1}]}] @@ -370,7 +370,7 @@ AT_CHECK( "columns": ["target", "is_connected"]}]']], [0], [stdout], [ignore]) AT_CHECK( - [${PERL} $srcdir/uuidfilt.pl stdout], + [uuidfilt stdout], [0], [[[{"rows":[{"managers":"punix:socket1"}]},{"rows":[{"is_connected":false,"target":"punix:socket2"}]}] ]], @@ -661,7 +661,7 @@ AT_CHECK( done]], [0], [stdout], [ignore], [test ! -e pid || kill `cat pid`]) dnl Check that all the crap is in fact in the database log. -AT_CHECK([[${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple -]], [0], +AT_CHECK([[uuidfilt db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple -]], [0], [[{"cksum":"12345678 9","name":"ordinals","tables":{"ordinals":{"columns":{"name":{"type":"string"},"number":{"type":"integer"}},"indexes":[["number"]]}},"version":"5.1.3"} {"_comment":"add row for zero 0","_date":0,"ordinals":{"<0>":{"name":"zero"}}} {"_comment":"delete row for 0","_date":0,"ordinals":{"<0>":null}} @@ -685,7 +685,7 @@ AT_CHECK([[${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9 dnl Dump out and check the actual database contents. AT_CHECK([[ovsdb-client dump unix:socket ordinals]], [0], [stdout], [ignore]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ----- ------ @@ -716,7 +716,7 @@ AT_CHECK([test `wc -l < db` -eq 4], [0], [], [], dnl And check that the dumped data is the same too: AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore], [test ! -e pid || kill `cat pid`]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ----- ------ @@ -746,7 +746,7 @@ OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server.log db], [0], [ignore], [ignore]) AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore], [test ! -e pid || kill `cat pid`]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ----- ------ @@ -885,7 +885,7 @@ m4_define([OVSDB_CHECK_EXECUTION], [test ! -e pid || kill `cat pid`]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore], + AT_CHECK([uuidfilt output], [0], [$4], [ignore], [test ! -e pid || kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -923,7 +923,7 @@ m4_define([OVSDB_CHECK_EXECUTION], [test ! -e pid || kill `cat pid`]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore], + AT_CHECK([uuidfilt output], [0], [$4], [ignore], [test ! -e pid || kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -970,7 +970,7 @@ m4_define([OVSDB_CHECK_EXECUTION], [test ! -e pid || kill `cat pid`]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore], + AT_CHECK([uuidfilt output], [0], [$4], [ignore], [test ! -e pid || kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1007,7 +1007,7 @@ m4_define([OVSDB_CHECK_EXECUTION], [test ! -e pid || kill `cat pid`]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore], + AT_CHECK([uuidfilt output], [0], [$4], [ignore], [test ! -e pid || kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -1045,7 +1045,7 @@ m4_define([OVSDB_CHECK_EXECUTION], AT_CHECK([ovsdb-server --remote=punix:socket db --run="sh txnfile"], [0], [stdout], [ignore]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore]) + AT_CHECK([uuidfilt output], [0], [$4], [ignore]) AT_CLEANUP]) EXECUTION_EXAMPLES @@ -1135,7 +1135,7 @@ m4_define([OVSDB_CHECK_REPLICATION], AT_CHECK([diff dump1 dump2], [1], [stdout], [ignore]) cat stdout > output - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4], [ignore]) + AT_CHECK([uuidfilt output], [0], [$4], [ignore]) OVSDB_SERVER_SHUTDOWN OVSDB_SERVER_SHUTDOWN2 @@ -1220,7 +1220,7 @@ cat stdout > dump2 AT_CHECK([diff dump1 dump2], [1], [stdout], [ignore]) cat stdout > output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [7,9c7,8 +AT_CHECK([uuidfilt output], [0], [7,9c7,8 < _uuid name number < ------------------------------------ ---- ------ < <0> one 1 @@ -1322,7 +1322,7 @@ cat stdout > dump2 AT_CHECK([diff dump1 dump2], [1], [stdout], [ignore]) cat stdout > output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [7,9c7,8 +AT_CHECK([uuidfilt output], [0], [7,9c7,8 < _uuid name number < ------------------------------------ ---- ------ < <0> one 1 @@ -1341,7 +1341,7 @@ AT_CHECK([ovsdb-client transact unix:db2.sock \ AT_CHECK([ovsdb-client dump unix:db2.sock], [0], [stdout]) cat stdout > output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [a table +AT_CHECK([uuidfilt output], [0], [a table _uuid name number ------------------------------------ ---- ------ <0> zero 0 @@ -1534,7 +1534,7 @@ AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT \ "row": {"name": "two", "number": '2'}} ]']], [0], [stdout], [ignore]) cat stdout >> output -AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [[[{"details":"insert operation not allowed when database server is in read only mode","error":"not allowed"}]] +AT_CHECK([uuidfilt output], [0], [[[{"details":"insert operation not allowed when database server is in read only mode","error":"not allowed"}]] ], [ignore]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP diff --git a/tests/ovsdb-tool.at b/tests/ovsdb-tool.at index f782952a3d7f..2ce0f3571165 100644 --- a/tests/ovsdb-tool.at +++ b/tests/ovsdb-tool.at @@ -23,7 +23,7 @@ m4_define([OVSDB_CHECK_EXECUTION], [AT_CHECK([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore]) cat stdout >> output ]) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl output], [0], [$4]) + AT_CHECK([uuidfilt output], [0], [$4]) AT_CLEANUP]) EXECUTION_EXAMPLES @@ -40,7 +40,7 @@ AT_CHECK([[ovsdb-tool transact db ' "row": {"name": "five", "number": 5}}, {"op": "comment", "comment": "add row for 5"}]']], [0], [stdout], [ignore]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], +AT_CHECK([uuidfilt stdout], [0], [[[{"uuid":["uuid","<0>"]},{}] ]]) AT_CHECK([grep "add row for 5" db], [0], [ignore]) @@ -93,7 +93,7 @@ AT_CHECK( done]], [0], [stdout], [ignore]) dnl Check that all the crap is in fact in the database log. -AT_CHECK([[${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple -]], [0], +AT_CHECK([[uuidfilt db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple -]], [0], [[{"cksum":"12345678 9","name":"ordinals","tables":{"ordinals":{"columns":{"name":{"type":"string"},"number":{"type":"integer"}},"indexes":[["number"]]}},"version":"5.1.3"} {"_comment":"add row for zero 0","_date":0,"ordinals":{"<0>":{"name":"zero"}}} {"_comment":"delete row for 0","_date":0,"ordinals":{"<0>":null}} @@ -123,7 +123,7 @@ AT_CHECK([[ovsdb-client dump unix:socket ordinals]], [0], [stdout], [ignore]) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ----- ------ @@ -156,7 +156,7 @@ AT_CHECK([[ovsdb-client dump unix:socket ordinals]], [0], [stdout], [ignore]) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ----- ------ @@ -198,7 +198,7 @@ dnl Dump out and check the actual database contents. AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], [0]) AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ----- ------ @@ -222,7 +222,7 @@ dnl And check that the dumped data is the same except for the removed column: AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], [0]) AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid number ------------------------------------ ------ @@ -264,7 +264,7 @@ dnl Dump out and check the actual database contents. AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], [0]) AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid number ------------------------------------ ------ @@ -288,7 +288,7 @@ dnl And check that the dumped data is the same except for the added column: AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], [0]) AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) -AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl +AT_CHECK([uuidfilt stdout], [0], [dnl ordinals table _uuid name number ------------------------------------ ---- ------ diff --git a/tests/ovsdb-trigger.at b/tests/ovsdb-trigger.at index 1da63364858f..7ba6cb326c31 100644 --- a/tests/ovsdb-trigger.at +++ b/tests/ovsdb-trigger.at @@ -9,7 +9,7 @@ m4_define([OVSDB_CHECK_TRIGGER], [AT_SETUP([$1]) AT_KEYWORDS([ovsdb execute execution trigger positive $4]) AT_CHECK([test-ovsdb trigger $2], [0], [stdout], []) - AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [$3]) + AT_CHECK([uuidfilt stdout], [0], [$3]) AT_CLEANUP]) OVSDB_CHECK_TRIGGER([trigger fires immediately], diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at index 27498341a9f8..a7c6808ad1b4 100644 --- a/tests/system-kmod-macros.at +++ b/tests/system-kmod-macros.at @@ -11,7 +11,7 @@ m4_define([_ADD_BR], [[add-br $1 -- set Bridge $1 protocols=OpenFlow10,OpenFlow1 # 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. +# specifies the expected output after filtering through uuidfilt. # # Best-effort loading of all available vport modules is performed. # @@ -25,7 +25,7 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], on_exit 'ovs-dpctl del-dp ovs-system' _OVS_VSWITCHD_START([]) dnl Add bridges, ports, etc. - AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2]) + AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) ]) # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at index f3337f04499a..d3d27bb2b8f2 100644 --- a/tests/system-userspace-macros.at +++ b/tests/system-userspace-macros.at @@ -11,14 +11,14 @@ m4_define([_ADD_BR], [[add-br $1 -- set Bridge $1 datapath_type="netdev" protoco # 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. +# specifies the expected output after filtering through uuidfilt. m4_define([OVS_TRAFFIC_VSWITCHD_START], [ OVS_WAIT_WHILE([ip link show ovs-netdev]) _OVS_VSWITCHD_START([--disable-system]) dnl Add bridges, ports, etc. OVS_WAIT_WHILE([ip link show br0]) - AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2]) + AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) ]) # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) diff --git a/tests/uuidfilt.pl b/tests/uuidfilt.pl deleted file mode 100755 index 835f13b5344e..000000000000 --- a/tests/uuidfilt.pl +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/perl - -use strict; -use warnings; - -our %uuids; -our $n_uuids = 0; -sub lookup_uuid { - my ($uuid) = @_; - if (!exists($uuids{$uuid})) { - $uuids{$uuid} = $n_uuids++; - } - return "<$uuids{$uuid}>"; -} - -sub sort_set { - my ($s) = @_; - my (@uuids) = sort { $a <=> $b } (grep(/\d+/, split(/(\d+)/, $s))); - return '["set",[' . join(',', map('["uuid","<' . $_ . '>"]', @uuids)) . ']]'; -} - -my $u = '[0-9a-fA-F]'; -my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}"; -while (<>) { - s/($uuid_re)/lookup_uuid($1)/eg; - - # Sort sets like this: - # [["uuid","<1>"],["uuid","<0>"]] - # to look like this: - # [["uuid","<0>"],["uuid","<1>"]] - s/(\["set",\[(,?\["uuid","<\d+>"\])+\]\])/sort_set($1)/ge; - print $_; -} diff --git a/tests/uuidfilt.py b/tests/uuidfilt.py new file mode 100755 index 000000000000..ea7281296e22 --- /dev/null +++ b/tests/uuidfilt.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +import re +import sys + + +def lookup_uuid(uuids, match): + return "<%s>" % uuids.setdefault(match.group(0), len(uuids)) + + +int_re = re.compile(r'\d+') + + +def sort_set(match): + s = match.group(0) + uuids = sorted([int(x) for x in int_re.findall(s)]) + return '["set",[' + ','.join('["uuid","<%s>"]' % x for x in uuids) + ']]' + + +u = '[0-9a-fA-F]' +uuid_re = re.compile(r'%s{8}-%s{4}-%s{4}-%s{4}-%s{12}' % ((u,) * 5)) +set_re = re.compile(r'(\["set",\[(,?\["uuid","<\d+>"\])+\]\])') + + +def filter_uuids(src, dst): + uuids = {} + + def lf(match): + return lookup_uuid(uuids, match) + + while True: + line = src.readline() + if not line: + break + line = uuid_re.sub(lf, line) + + # Sort sets like this: + # [["uuid","<1>"],["uuid","<0>"]] + # to look like this: + # [["uuid","<0>"],["uuid","<1>"]] + line = set_re.sub(sort_set, line) + dst.write(line) + + +if __name__ == '__main__': + if len(sys.argv) > 1: + for src in sys.argv[1:]: + filter_uuids(open(src), sys.stdout) + else: + filter_uuids(sys.stdin, sys.stdout) -- 2.10.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
