• Guillaume Nault's avatar
    selftests: tc: Add generic mpls matching support for tc-flower · c09bfd9a
    Guillaume Nault authored
    Add tests in tc_flower.sh for generic matching on MPLS Label Stack
    Entries. The label, tc, bos and ttl fields are tested for the first
    and second labels. For each field, the minimal and maximal values are
    tested (the former at depth 1 and the later at depth 2).
    There are also tests for matching the presence of a label stack entry
    at a given depth.
    
    In order to reduce the amount of code, all "lse" subcommands are tested
    in match_mpls_lse_test(). Action "continue" is used, so that test
    packets are evaluated by all filters. Then, we can verify if each
    filter matched the expected number of packets.
    
    Some versions of tc-flower produced invalid json output when dumping
    MPLS filters with depth > 1. Skip the test if tc isn't recent enough.
    Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c09bfd9a
lib.sh 27.1 KB