-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Vendor c/common pasta branch for testing #21563
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
load helpers | ||
load helpers.systemd | ||
load helpers.network | ||
|
||
SERVICE_NAME="podman_test_$(random_string)" | ||
|
||
|
@@ -294,7 +295,7 @@ LISTEN_FDNAMES=listen_fdnames" | sort) | |
} | ||
|
||
# https://github.com/containers/podman/issues/13153 | ||
@test "podman rootless-netns slirp4netns process should be in different cgroup" { | ||
@test "podman rootless-netns pasta processes should be in different cgroup" { | ||
edsantiago marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked and looked for some way to do this:
You know, for futureproofing. I could not find any marker. Is there one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually the test should happen for slirp and pasta. We do not have a marker it is just some containers.conf setting but looks we never actually explicitly test that here. I don't want to block this PR on this though. I can submit a PR tomorrow to address this and the other comments once this is merged. |
||
is_rootless || skip "only meaningful for rootless" | ||
|
||
cname=$(random_string) | ||
|
@@ -314,9 +315,11 @@ LISTEN_FDNAMES=listen_fdnames" | sort) | |
# stop systemd container | ||
service_cleanup | ||
|
||
pasta_iface=$(default_ifname) | ||
|
||
# now check that the rootless netns slirp4netns process is still alive and working | ||
run_podman unshare --rootless-netns ip addr | ||
is "$output" ".*tap0.*" "slirp4netns interface exists in the netns" | ||
is "$output" ".*$pasta_iface.*" "pasta interface exists in the netns" | ||
run_podman exec $cname2 nslookup google.com | ||
|
||
run_podman rm -f -t0 $cname2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,13 +144,16 @@ function remove_secret() { | |
} | ||
|
||
@test "quadlet - basic" { | ||
# Network=none is to work around a Pasta bug, can be removed once a patched Pasta is available. | ||
# Ref https://github.com/containers/podman/pull/21563#issuecomment-1965145324 | ||
Comment on lines
+147
to
+148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the sort of comment where I like to see "FIXME" or "TODO", because I have a script that looks for those. I also like to see explicit comments with version strings, or "> 2024-03", or some sort of date or version string offering a hint about when it would be good to check. Someone reading this in the year 2050 might wonder what "patched Pasta" means. |
||
local quadlet_file=$PODMAN_TMPDIR/basic_$(random_string).container | ||
cat > $quadlet_file <<EOF | ||
[Container] | ||
Image=$IMAGE | ||
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; sleep inf" | ||
Notify=yes | ||
LogDriver=passthrough | ||
Network=none | ||
EOF | ||
|
||
# FIXME: Temporary until podman fully removes cgroupsv1 support; see #21431 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,6 @@ function setup() { | |
XFER_FILE="${PODMAN_TMPDIR}/pasta.bin" | ||
} | ||
|
||
function default_ifname() { | ||
local ip_ver="${1}" | ||
|
||
local expr='[.[] | select(.dst == "default").dev] | .[0]' | ||
ip -j -"${ip_ver}" route show | jq -rM "${expr}" | ||
} | ||
|
||
function default_addr() { | ||
local ip_ver="${1}" | ||
local ifname="${2:-$(default_ifname "${ip_ver}")}" | ||
|
||
local expr='.[0] | .addr_info[0].local' | ||
ip -j -"${ip_ver}" addr show "${ifname}" | jq -rM "${expr}" | ||
} | ||
|
||
# _set_opt() - meta-helper for pasta_test_do. | ||
# | ||
# Sets an option, but panics if option is already set (e.g. UDP+TCP, IPv4/v6) | ||
|
@@ -789,3 +774,14 @@ EOF | |
CONTAINERS_CONF_OVERRIDE=$containersconf run_podman run --net=pasta:--ns-mac-addr,"$mac2" $IMAGE ip link show myname | ||
assert "$output" =~ "$mac2" "mac address from cli is set on custom interface" | ||
} | ||
|
||
### Rootless unshare testins | ||
|
||
@test "Podman unshare --rootless-netns with Pasta" { | ||
skip_if_remote "unshare is local-only" | ||
|
||
pasta_iface=$(default_ifname) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I really dislike the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Never. It's pasta e basta. |
||
|
||
run_podman unshare --rootless-netns ip addr | ||
is "$output" ".*${pasta_iface}.*" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
This cannot work with the file logger as you cannot unmarshal into an error interface so it must be changed to a string. And in general I am really not a fan of merging such changes (in an unrelated PR) without any tests nor chance for actual review.
I know we just wanted pasta to get in but that could have just gone it normal way without causing all the extra troubles by simply not merging unverified/untested changes in c/common without thinking how they effect podman.
Also the whole thing is not plumbed in at all, you never set this option from the libimage type so the error is lost and also not plugged into podman the cli nor API which means it will not show any error messages, users only see
pull-error $IMAGE
right now.I am aware that your goal was to just get test passing but I write this because this "feature" if far from done and needs tests.