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
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
# 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
# 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)
-- --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>
])
-- --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>
])
-- --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>
])
[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.
[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.
[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.
[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.
[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.
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.
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.
[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
[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.
-- 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>
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])
[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)
])
])
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)
])
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
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
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
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
])
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
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
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
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
])
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
])
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
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.
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])
])
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
])
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
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.
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
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
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
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
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
])
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
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
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
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
])
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
])
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
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.
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])
])
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
])
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
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.
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
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])
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"
[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)
])
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)
])
wc () {
command wc "$@" | tr -s ' ' ' ' | sed 's/^ *//'
}
+
+uuidfilt () {
+ $PYTHON "$top_srcdir"/tests/uuidfilt.py "$@"
+}
]
m4_divert_pop([PREPARE_TESTS])
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>
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>
[--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
[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>
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])
-- --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>
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 : []
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],
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>],
[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])
[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])
[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])
[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])
[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])
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
"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>
[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])
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])
[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])
[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])
[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])
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])
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])
[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])
[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,
[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],
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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:
"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
[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])
]])
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}]}]
]])
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}]}]
"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"}]}]
]],
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}}
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
------------------------------------ ----- ------
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
------------------------------------ ----- ------
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
------------------------------------ ----- ------
[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])
[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])
[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])
[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])
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
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
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
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
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
"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
[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
"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])
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}}
[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
------------------------------------ ----- ------
[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
------------------------------------ ----- ------
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
------------------------------------ ----- ------
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
------------------------------------ ------
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
------------------------------------ ------
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
------------------------------------ ---- ------
[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],
# 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.
#
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])
# 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])
+++ /dev/null
-#! /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 $_;
-}
--- /dev/null
+#!/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)