[ovs-dev] [murmurhash 1/4] tests: Fix dependencies on hash function in ofproto-dpif tests.

Ethan Jackson ethan at nicira.com
Tue Jan 15 21:16:13 UTC 2013


Is there any reason we couldn't simply convert these tests to use the
ADD_OF_PORTS macro?

Ethan

On Fri, Dec 14, 2012 at 4:33 PM, Ben Pfaff <blp at nicira.com> wrote:
> These tests relied on luck to ensure that OpenFlow ports received the
> expected OpenFlow port numbers.  With a different hash function, or (I
> expect) on a big-endian architecture, the port numbers were assigned
> differently and the tests failed.
>
> This commit fixes the problem by requesting the specific expected port
> numbers explicitly.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  tests/ofproto-dpif.at |   40 ++++++++++++++++++++--------------------
>  1 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
> index 6a4dc23..1920867 100644
> --- a/tests/ofproto-dpif.at
> +++ b/tests/ofproto-dpif.at
> @@ -602,9 +602,9 @@ AT_CLEANUP
>
>  AT_SETUP([ofproto-dpif - mirroring, select_all])
>  OVS_VSWITCHD_START(
> -       [add-port br0 p1 -- set Interface p1 type=dummy --\
> -        add-port br0 p2 -- set Interface p2 type=dummy --\
> -        add-port br0 p3 -- set Interface p3 type=dummy --\
> +       [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 --\
> +        add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 --\
> +        add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 --\
>          set Bridge br0 mirrors=@m --\
>          --id=@p3 get Port p3 --\
>          --id=@m create Mirror name=mymirror \
> @@ -635,9 +635,9 @@ AT_CLEANUP
>
>  AT_SETUP([ofproto-dpif - mirroring, select_src])
>  OVS_VSWITCHD_START(
> -       [add-port br0 p1 -- set Interface p1 type=dummy --\
> -        add-port br0 p2 -- set Interface p2 type=dummy --\
> -        add-port br0 p3 -- set Interface p3 type=dummy --\
> +       [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 --\
> +        add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 --\
> +        add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 --\
>          set Bridge br0 mirrors=@m --\
>          --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
>          --id=@m create Mirror name=mymirror \
> @@ -666,8 +666,8 @@ AT_CLEANUP
>
>  AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
>  OVS_VSWITCHD_START(
> -       [add-port br0 p1 -- set Interface p1 type=dummy --\
> -        add-port br0 p2 -- set Interface p2 type=dummy --\
> +       [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 --\
> +        add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 --\
>          set Bridge br0 mirrors=@m --\
>          --id=@p2 get Port p2 --\
>          --id=@m create Mirror name=mymirror \
> @@ -722,9 +722,9 @@ AT_CLEANUP
>
>  AT_SETUP([ofproto-dpif - mirroring, select_vlan])
>  OVS_VSWITCHD_START(
> -       [add-port br0 p1 -- set Interface p1 type=dummy --\
> -        add-port br0 p2 -- set Interface p2 type=dummy --\
> -        add-port br0 p3 -- set Interface p3 type=dummy --\
> +       [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 --\
> +        add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 --\
> +        add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 --\
>          set Bridge br0 mirrors=@m --\
>          --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
>          --id=@m create Mirror name=mymirror \
> @@ -760,9 +760,9 @@ AT_CLEANUP
>
>  AT_SETUP([ofproto-dpif - mirroring, output_port])
>  OVS_VSWITCHD_START(
> -       [add-port br0 p1 -- set Interface p1 type=dummy --\
> -        add-port br0 p2 -- set Interface p2 type=dummy --\
> -        add-port br0 p3 -- set Interface p3 type=dummy --\
> +       [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 --\
> +        add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 --\
> +        add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 --\
>          set Bridge br0 mirrors=@m --\
>          --id=@p3 get Port p3 --\
>          --id=@m create Mirror name=mymirror \
> @@ -792,8 +792,8 @@ AT_CLEANUP
>
>  AT_SETUP([ofproto-dpif - mirroring, output_vlan])
>  OVS_VSWITCHD_START(
> -       [add-port br0 p1 -- set Interface p1 type=dummy --\
> -        add-port br0 p2 -- set Interface p2 type=dummy --\
> +       [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 --\
> +        add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 --\
>          set Bridge br0 mirrors=@m --\
>          --id=@m create Mirror name=mymirror \
>          select_all=true output_vlan=12], [<0>
> @@ -1004,8 +1004,8 @@ NETFLOW_PORT=`cat stdout`
>
>  OVS_VSWITCHD_START(
>    [set Bridge br0 fail-mode=standalone -- \
> -   add-port br0 p1 -- set Interface p1 type=dummy -- \
> -   add-port br0 p2 -- set Interface p2 type=dummy -- \
> +   add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
> +   add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
>     set Bridge br0 netflow=@nf -- \
>     --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \
>       engine_id=1 engine_type=2 active_timeout=30 \
> @@ -1049,8 +1049,8 @@ NETFLOW_PORT=`cat stdout`
>
>  OVS_VSWITCHD_START(
>    [set Bridge br0 fail-mode=standalone -- \
> -   add-port br0 p1 -- set Interface p1 type=dummy -- \
> -   add-port br0 p2 -- set Interface p2 type=dummy -- \
> +   add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
> +   add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
>     set Bridge br0 netflow=@nf -- \
>     --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \
>       engine_id=1 engine_type=2 active_timeout=10 \
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list