Skip to content

Commit

Permalink
tests: Change ADD_OF_PORTS from macro to shell function.
Browse files Browse the repository at this point in the history
This reduces the size of the generated testsuite and makes it possible
to pass arguments that vary at runtime instead of at the time of
translation from .at to shell script.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
blp committed Jan 28, 2016
1 parent c5e8254 commit ca5792f
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 132 deletions.
2 changes: 1 addition & 1 deletion tests/bridge.at
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AT_SETUP([bridge - ports that disappear get added back])
OVS_VSWITCHD_START

# Add some ports and make sure that they show up in the datapath.
ADD_OF_PORTS([br0], 1, 2)
add_of_ports br0 1 2
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dummy@ovs-dummy: hit:0 missed:0
br0:
Expand Down
10 changes: 5 additions & 5 deletions tests/classifier.at
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ m4_foreach(
AT_BANNER([flow classifier lookup segmentation])
AT_SETUP([flow classifier - lookup segmentation])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], [1], [2], [3])
add_of_ports br0 1 2 3
AT_DATA([flows.txt], [dnl
table=0 in_port=1 priority=16,tcp,nw_dst=10.1.0.0/255.255.0.0,action=output(3)
table=0 in_port=1 priority=32,tcp,nw_dst=10.1.2.15,action=output(2)
Expand Down Expand Up @@ -68,7 +68,7 @@ AT_CLEANUP
AT_BANNER([flow classifier prefix lookup])
AT_SETUP([flow classifier - prefix lookup])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], [1], [2], [3])
add_of_ports br0 1 2 3
AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0], [0], [ignore], [])
AT_DATA([flows.txt], [dnl
table=0 in_port=1 priority=16,tcp,nw_dst=10.1.0.0/255.255.0.0,action=output(3)
Expand Down Expand Up @@ -133,7 +133,7 @@ AT_BANNER([conjunctive match])

AT_SETUP([single conjunctive match])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], 1, 2, 3, 4, 5)
add_of_ports br0 1 2 3 4 5
AT_DATA([flows.txt], [dnl
conj_id=1,actions=3
priority=100,ip,ip_src=10.0.0.1,actions=conjunction(1,1/2)
Expand Down Expand Up @@ -170,7 +170,7 @@ AT_CLEANUP

AT_SETUP([multiple conjunctive match])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], 1, 2, 3, 4, 5)
add_of_ports br0 1 2 3 4 5
AT_DATA([flows.txt], [dnl
conj_id=1,actions=1
conj_id=2,actions=2
Expand Down Expand Up @@ -246,7 +246,7 @@ AT_CLEANUP
# priority flow. This test checks this special case.
AT_SETUP([conjunctive match priority fallback])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], 1, 2, 3, 4, 5, 6, 7)
add_of_ports br0 1 2 3 4 5 6 7
AT_DATA([flows.txt], [dnl
conj_id=1,actions=1
conj_id=3,actions=3
Expand Down
6 changes: 3 additions & 3 deletions tests/learn.at
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ AT_CLEANUP
# flow.
AT_SETUP([learning action - self-modifying flow])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], 1, 2, 3)
add_of_ports br0 1 2 3

ovs-appctl time/stop
# Set up flow table for TCPv4 port learning.
Expand Down Expand Up @@ -344,7 +344,7 @@ AT_CLEANUP
# attributed correctly.
AT_SETUP([learning action - self-modifying flow with idle_timeout])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], 1, 2, 3)
add_of_ports br0 1 2 3

ovs-appctl time/stop
# Set up flow table for TCPv4 port learning.
Expand Down Expand Up @@ -402,7 +402,7 @@ AT_CLEANUP
# attributed correctly.
AT_SETUP([learning action - self-modifying flow with hard_timeout])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], 1, 2, 3)
add_of_ports br0 1 2 3

ovs-appctl time/stop
# Set up flow table for TCPv4 port learning.
Expand Down
Loading

0 comments on commit ca5792f

Please sign in to comment.