Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: test creating netdevsim inside network namespace

Add a test that creates netdevsim instance inside network namespace
and verifies that the related devlink instance and port netdevices
reside in the namespace.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jiri Pirko and committed by
David S. Miller
c04d71b5 7b60027b

+78 -1
+6 -1
tools/testing/selftests/net/forwarding/lib.sh
··· 254 254 { 255 255 local cmd=$1 256 256 local jq_exp=$2 257 + local jq_opts=$3 257 258 local ret 258 259 local output 259 260 ··· 264 263 if [[ $ret -ne 0 ]]; then 265 264 return $ret 266 265 fi 267 - output=$(echo $output | jq -r "$jq_exp") 266 + output=$(echo $output | jq -r $jq_opts "$jq_exp") 267 + ret=$? 268 + if [[ $ret -ne 0 ]]; then 269 + return $ret 270 + fi 268 271 echo $output 269 272 # return success only in case of non-empty output 270 273 [ ! -z "$output" ]