-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
Commit cd9ab29 fixed device selection in environments that have multiple devices, but unfortunately broke it on apt.postgresql.org, where the tests are running in network namespaces via veth/ceth devices. This fixes the detection to support both.
The problem here was that /sys/class/net/* lists all the devices from the host system, but inside the network namespace, only one is present (and moreover, it has the wrong end of the ceth/veth pair). "ip link" has the correct list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my laptop:
$ cat pre
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
$ cat post
ip -oneline link show | grep link/ether | grep -v 00:00:00:00:00:00 | cut -d ":" -f2 | cut -d "@" -f 1
$ source pre
docker0
$ source post
wlo1
docker0
So the new version of the code does not strictly behave like the old code: it does not check the network type.
Is that relevant?
Hmm, true. On my laptop, the first one returns
We should probably just append |
Hi @df7cb
Is it guaranteed, that But as I said, no idea if my criticism is relevant. I'm just observing that the code before and after do not behave in the same way. |
I don't know about any ordering constraints, but I'd say the old |
WLAN interfaces are ether as well, so that wouldn't make a difference. From what I can tell, all that's relevant here is that we find an interface that has an IP that can be used for testing. |
hey there. Sorry for such a delay. Tough time, eh. So is this PR still valid and should be applied? Best regards |
Hi Pavlo, |
Thanks Christoph! Merged! 👍 |
get_dev
in namespaced environments
Thanks! |
Speaking of apt.postgresql.org... @df7cb are you using scripts/files from package folder or do you have your own? The reason is I want to establish GHA workflow for automatic packaging/building and want to know if I'm allowed make some changes to those files. We are preparing the v2-beta with some breaking changes and I'm trying to figure out what exactly I can drop/change but to leave everybody happy |
The packaging files are there: https://salsa.debian.org/postgresql/vip-manager/-/tree/master/debian We are not using anything from the package except for what gets invoked by the normal build system, i.e. what gets invoked by |
Commit cd9ab29 fixed device selection in environments that have
multiple devices, but unfortunately broke it on apt.postgresql.org,
where the tests are running in network namespaces via veth/ceth devices.
This fixes the detection to support both.