[ovs-dev] [PATCH] ovs-ofctl:To set importance of a rule for eviction(OF14)

YAMAMOTO Takashi yamamoto at valinux.co.jp
Tue Nov 11 01:55:55 UTC 2014


> +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
> +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
> +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
> +AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort],
> +  [0], [expout])

what would {1..8} and {1..8..2} expand to?

i guess they are bash dialects but my copy of
bash doesn't seem to expand the latter.

    bash-3.2$ echo {1..8}
    1 2 3 4 5 6 7 8
    bash-3.2$ echo {1..8..2}
    {1..8..2}
    bash-3.2$ 

YAMAMOTO Takashi



More information about the dev mailing list