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

Ben Pfaff blp at nicira.com
Tue Nov 11 04:29:14 UTC 2014


On Tue, Nov 11, 2014 at 10:55:55AM +0900, YAMAMOTO Takashi wrote:
> > +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$ 

On my bash, I get 1 3 5 7 for the latter.

This is my fault because I did not read the tests in this patch
carefully.  If I had, I would have replaced both of these nonportable
constructs (which I hadn't even heard of before).  Anyway, I sent out a
fix:
        http://openvswitch.org/pipermail/dev/2014-November/048512.html



More information about the dev mailing list