2015-04-15 11:16:23 -07:00
|
|
|
AT_BANNER([dpctl])
|
|
|
|
|
|
|
|
AT_SETUP([dpctl - add-dp del-dp])
|
|
|
|
OVS_VSWITCHD_START
|
|
|
|
AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0], [2], [],
|
|
|
|
[ovs-vswitchd: add_dp (File exists)
|
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0])
|
2015-04-20 12:11:23 -07:00
|
|
|
AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0], [2], [], [stderr])
|
|
|
|
AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], [dnl
|
|
|
|
ovs-vswitchd: opening datapath (...)
|
2015-04-15 11:16:23 -07:00
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
OVS_VSWITCHD_STOP
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
AT_SETUP([dpctl - add-if set-if del-if])
|
|
|
|
OVS_VSWITCHD_START([], [], [=override])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl
|
|
|
|
dummy@br0:
|
2018-05-25 16:55:18 -07:00
|
|
|
lookups: hit:0 missed:0 lost:0
|
|
|
|
flows: 0
|
|
|
|
port 0: br0 (dummy-internal)
|
2015-04-15 11:16:23 -07:00
|
|
|
])
|
2015-04-21 19:22:44 -07:00
|
|
|
AT_CHECK([ovs-appctl dpctl/add-if dummy@br0 vif1.0,type=dummy,port_no=5])
|
2015-04-15 11:16:23 -07:00
|
|
|
AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl
|
|
|
|
dummy@br0:
|
2018-05-25 16:55:18 -07:00
|
|
|
lookups: hit:0 missed:0 lost:0
|
|
|
|
flows: 0
|
|
|
|
port 0: br0 (dummy-internal)
|
|
|
|
port 5: vif1.0 (dummy)
|
2015-04-15 11:16:23 -07:00
|
|
|
])
|
2015-04-21 19:22:44 -07:00
|
|
|
AT_CHECK([ovs-appctl dpctl/add-if dummy@br0 vif1.0,type=dummy], [2], [],
|
2015-04-20 12:11:23 -07:00
|
|
|
[stderr])
|
|
|
|
AT_CHECK([sed 's/(.*)/(...)/' stderr], [0],
|
|
|
|
[ovs-vswitchd: adding vif1.0 to dummy@br0 failed (...)
|
2015-04-15 11:16:23 -07:00
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 vif1.0,port_no=5])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 vif1.0,type=system], [2], [],
|
2015-04-21 19:22:44 -07:00
|
|
|
[ovs-vswitchd: vif1.0: can't change type from dummy to system
|
2015-04-15 11:16:23 -07:00
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
2016-02-11 13:11:10 -08:00
|
|
|
AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 br0,type=dummy-internal], [0])
|
2016-07-27 12:06:44 -03:00
|
|
|
AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 br0,type=internal], [2], [],
|
2016-02-11 13:11:10 -08:00
|
|
|
[ovs-vswitchd: br0: can't change type from dummy-internal to internal
|
2015-04-15 11:16:23 -07:00
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 vif1.0])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl
|
|
|
|
dummy@br0:
|
2018-05-25 16:55:18 -07:00
|
|
|
lookups: hit:0 missed:0 lost:0
|
|
|
|
flows: 0
|
|
|
|
port 0: br0 (dummy-internal)
|
2015-04-15 11:16:23 -07:00
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 vif1.0], [2], [],
|
|
|
|
[ovs-vswitchd: no port named vif1.0
|
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl
|
|
|
|
dummy@br0:
|
2018-05-25 16:55:18 -07:00
|
|
|
lookups: hit:0 missed:0 lost:0
|
|
|
|
flows: 0
|
|
|
|
port 0: br0 (dummy-internal)
|
2015-04-15 11:16:23 -07:00
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 nonexistent], [2], [],
|
|
|
|
[ovs-vswitchd: no port named nonexistent
|
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
2015-04-20 12:11:23 -07:00
|
|
|
AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], [stderr])
|
|
|
|
AT_CHECK([sed 's/(.*)/(...)/' stderr], [0],
|
|
|
|
[ovs-vswitchd: deleting port br0 from dummy@br0 failed (...)
|
2015-04-15 11:16:23 -07:00
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0])
|
2015-04-20 12:11:23 -07:00
|
|
|
AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], [stderr])
|
|
|
|
AT_CHECK([sed 's/(.*)/(...)/' stderr], [0],
|
|
|
|
[ovs-vswitchd: opening datapath (...)
|
2015-04-15 11:16:23 -07:00
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
2015-04-20 12:11:23 -07:00
|
|
|
OVS_VSWITCHD_STOP(["/dummy@br0: port_del failed/d
|
2016-06-28 20:16:09 +00:00
|
|
|
/dummy@br0: failed to add vif1.0 as port/d
|
|
|
|
/Dropped 1 log messages in last/d"])
|
2015-04-15 11:16:23 -07:00
|
|
|
AT_CLEANUP
|
dpctl: Add add/mod/del-flows command.
When you would like to add, modify, or delete a lot of flows in the
datapath, for example when you want to measure performance, adding
one flow at the time won't scale. This as it takes a decent amount
of time to set up the datapath connection.
This new command is in-line with the same command available in
ovs-ofctl which allows the same thing, with the only difference that
we do not verify all lines before we start execution. This allows for
a continuous add/delete stream. For example with a command like this:
python3 -c 'while True:
for i in range(0, 1000):
print("add in_port(0),eth(),eth_type(0x800),ipv4(src=100.1.{}.{}) 1".format(int(i / 256), i % 256))
for i in range(0, 1000):
print("delete in_port(0),eth(),eth_type(0x800),ipv4(src=100.1.{}.{})".format(int(i / 256), i % 256))' \
| sudo utilities/ovs-dpctl add-flows -
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2020-10-13 10:36:48 +02:00
|
|
|
|
|
|
|
AT_SETUP([dpctl - add/mod/del-flows])
|
|
|
|
OVS_VSWITCHD_START
|
|
|
|
AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0])
|
|
|
|
AT_DATA([flows.txt], [dnl
|
|
|
|
in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234) 2
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/add-flows dummy@br0 flows.txt], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
|
|
|
|
flow-dump from the main thread:
|
|
|
|
recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2
|
|
|
|
])
|
|
|
|
AT_DATA([flows.txt], [dnl
|
|
|
|
in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234) 3
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/mod-flows dummy@br0 flows.txt], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
|
|
|
|
flow-dump from the main thread:
|
|
|
|
recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:3
|
|
|
|
])
|
|
|
|
AT_DATA([flows.txt], [dnl
|
|
|
|
in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234)
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-flows dummy@br0 flows.txt], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_DATA([flows.txt], [dnl
|
|
|
|
add in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234) 2
|
|
|
|
add in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:03),eth_type(0x1234) 2
|
|
|
|
add in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:04),eth_type(0x1234) 2
|
|
|
|
modify in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234) 1
|
|
|
|
delete in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:03),eth_type(0x1234)
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/add-flows dummy@br0 flows.txt], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
|
|
|
|
flow-dump from the main thread:
|
|
|
|
recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:1
|
|
|
|
recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:04),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-flows dummy@br0], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0])
|
|
|
|
OVS_VSWITCHD_STOP
|
|
|
|
AT_CLEANUP
|
2023-05-10 16:35:37 +08:00
|
|
|
|
2023-12-04 06:49:13 +01:00
|
|
|
AT_SETUP([dpctl - ct-set-limits ct-get-limits ct-del-limits])
|
2023-05-10 16:35:37 +08:00
|
|
|
OVS_VSWITCHD_START
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-get-limits], [0], [default limit=0
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=], [0], [default limit=0
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=,], [0], [default limit=0
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=x], [2], [],
|
|
|
|
[ovs-vswitchd: invalid zone (Invalid argument)
|
|
|
|
ovs-appctl: ovs-vswitchd: server returned an error
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-del-limits zone=])
|
2023-12-04 06:49:13 +01:00
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-set-limits zone=0,limit=0])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=0], [0], [default limit=0
|
|
|
|
zone=0,limit=0,count=0
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-appctl dpctl/ct-del-limits zone=0])
|
|
|
|
|
2023-05-10 16:35:37 +08:00
|
|
|
OVS_VSWITCHD_STOP
|
|
|
|
AT_CLEANUP
|