Skip to content

Commit

Permalink
tests: Avoid nonportable use of bash-specific {a..b..c} construct.
Browse files Browse the repository at this point in the history
Reported-by: Alex Wang <[email protected]>
Reported-by: YAMAMOTO Takashi <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: YAMAMOTO Takashi <[email protected]>
  • Loading branch information
blp committed Nov 11, 2014
1 parent 2cc5abd commit c453c5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/ovs-ofctl.at
Original file line number Diff line number Diff line change
Expand Up @@ -2791,15 +2791,15 @@ AT_SETUP([ovs-ofctl replace-flows with importance])
OVS_VSWITCHD_START

dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case.
for i in {1..8}; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt
for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt
AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt])

dnl Replace some flows in the bridge.
for i in {1..8..2}; do echo "dl_vlan=$i,importance=`expr $i + 10`,actions=drop"; done > replace-flows.txt
for i in 1 3 5 7; do echo "dl_vlan=$i,importance=`expr $i + 10`,actions=drop"; done > replace-flows.txt
AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt])

dnl Dump them and compare the dump flows output against the expected output.
for i in `seq 1 8`; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > expout
for i in 1 2 3 4 5 6 7 8; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > expout
AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort],
[0], [expout])

Expand Down

0 comments on commit c453c5a

Please sign in to comment.