• Petr Machata's avatar
    selftests: mlxsw: resource_scale: Allow skipping a test · 8cad339d
    Petr Machata authored
    The scale tests are currently testing two things: that some number of
    instances of a given resource can actually be created; and that when an
    attempt is made to create more than the supported amount, the failures are
    noted and handled gracefully.
    
    Sometimes the scale test depends on more than one resource. In particular,
    a following patch will add a RIF counter scale test, which depends on the
    number of RIF counters that can be bound, and also on the number of RIFs
    that can be created.
    
    When the test is limited by the auxiliary resource and not by the primary
    one, there's no point trying to run the overflow test, because it would be
    testing exhaustion of the wrong resource.
    
    To support this use case, when the $test_get_target yields 0, skip the test
    instead.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8cad339d
resource_scale.sh 1.74 KB