[ovs-dev] [PATCH ovn v3 5/5] expr: Support string fields in expr_to_matches().

Russell Bryant rbryant at redhat.com
Thu Apr 9 19:02:17 UTC 2015


On 04/01/2015 12:52 AM, Ben Pfaff wrote:
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  ovn/expr.c       | 115 ++++++++++++++++++++++++++++++++++++++++++-------------
>  ovn/expr.h       |   6 ++-
>  tests/test-ovn.c |   6 +--
>  3 files changed, 95 insertions(+), 32 deletions(-)

> diff --git a/tests/test-ovn.c b/tests/test-ovn.c
> index aef4e45..8048e08 100644
> --- a/tests/test-ovn.c
> +++ b/tests/test-ovn.c
> @@ -130,8 +130,8 @@ create_symtab(struct shash *symtab)
>  {
>      shash_init(symtab);
>  
> -    expr_symtab_add_string(symtab, "inport", NULL);
> -    expr_symtab_add_string(symtab, "outport", NULL);
> +    expr_symtab_add_string(symtab, "inport", MFF_IN_PORT, NULL);
> +    expr_symtab_add_string(symtab, "outport", MFF_ACTSET_OUTPUT, NULL);
>  
>      expr_symtab_add_field(symtab, "xreg0", MFF_XREG0, NULL, false);
>      expr_symtab_add_field(symtab, "xreg1", MFF_XREG1, NULL, false);
> @@ -858,7 +858,7 @@ test_tree_shape_exhaustively(struct expr *expr, struct shash *symtab,
>              struct test_rule *test_rule;
>              uint32_t n_conjs;
>  
> -            n_conjs = expr_to_matches(modified, &matches);
> +            n_conjs = expr_to_matches(modified, NULL, &matches);
>  
>              classifier_init(&cls, NULL);
>              HMAP_FOR_EACH (m, hmap_node, &matches) {
> 

How about a test case that includes a map of port names to
expr_to_matches() ?

-- 
Russell Bryant



More information about the dev mailing list