Skip to content

Commit

Permalink
selftests: mlxsw: qos_lib: Add a wrapper for running mlnx_qos
Browse files Browse the repository at this point in the history
mlnx_qos is a script for configuration of DCB. Despite the name it is not
actually Mellanox-specific in any way. It is currently the only ad-hoc tool
available (in contrast to a daemon that manages an interface on an ongoing
basis). However, it is very verbose and parsing out error messages is not
really possible. Add a wrapper that makes it easier to use the tool.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
pmachata authored and davem330 committed Sep 30, 2020
1 parent 5b3a53c commit 4b94a2f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ bail_on_lldpad()
fi
fi
}

__mlnx_qos()
{
local err

mlnx_qos "$@" 2>/dev/null
err=$?

if ((err)); then
echo "Error ($err) in mlnx_qos $@" >/dev/stderr
fi

return $err
}

0 comments on commit 4b94a2f

Please sign in to comment.