Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[-] dix get_dev in namespaced environments #98

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions test/behaviour_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@ function get_dev {
# select a suitable device for testing purposes
# * a device that is an "ether"
# * and isn't a nil hardware address

# https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net
ARPHRD_ETHER=1

for dev in /sys/class/net/* ; do
test ! -e "$dev/address" && continue
test "`cat $dev/address`" = "00:00:00:00:00:00" && continue
test "`cat $dev/type`" != "$ARPHRD_ETHER" && continue
basename "$dev"
break
done
# strip suffix from name (veth3@if8 -> veth3)
ip -oneline link show | grep link/ether | grep -v 00:00:00:00:00:00 | cut -d ":" -f2 | cut -d "@" -f 1
}

dev="`get_dev`"
Expand Down