]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsns: (tests) skip test if rtnetlin is nonfunctional
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 6 May 2023 21:19:03 +0000 (23:19 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 6 May 2023 21:28:42 +0000 (23:28 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tests/ts/lsns/netnsid

index 719b064d983a5f6377f19806ce9557a8991d0d97..80ccd9b5437c28de81e006261d08d63a5357054a 100755 (executable)
@@ -53,7 +53,8 @@ mkfifo $FIFO
 echo "==Netns ADD" >> $LOG
 if ip netns add $NS &&
        ip link add name $vetha type veth peer name $vethb &&
-       ip link set $vethb netns $NS; then
+       ip link set $vethb netns $NS &&
+       ! (ip -o link show dev $vetha 2>&1 >$NULL | grep 'Cannot talk to rtnetlink' > $NULL); then
     echo "===Netns EXEC" >> $LOG
     ip netns exec $NS dd if=$FIFO bs=1 count=2 of=$NULL 2> $NULL &
     PID=$!