mirror of
https://github.com/containers/podman.git
synced 2025-12-16 03:57:36 +08:00
inspect with network=none show SandboxKey netns path
We do not use any special netns path for the netns=none case, however callers that inspect that may still wish to join the netns path directly without extra work to figure out /proc/$pid/ns/net. Fixes #16716 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -834,10 +834,18 @@ EOF
|
||||
run_podman create --network=$network $IMAGE
|
||||
cid=${output}
|
||||
run_podman inspect --format '{{ .NetworkSettings.Networks }}' $cid
|
||||
is "$output" "map\[$network:.*" "NeworkSettincs should contain one network named $network"
|
||||
is "$output" "map\[$network:.*" "NeworkSettings should contain one network named $network"
|
||||
run_podman inspect --format '{{ .NetworkSettings.SandboxKey }}' $cid
|
||||
assert "$output" == "" "SandboxKey for network=$network should be empty when not running"
|
||||
run_podman rm $cid
|
||||
done
|
||||
|
||||
run_podman run -d --network=none $IMAGE top
|
||||
cid=${output}
|
||||
run_podman inspect --format '{{ .NetworkSettings.SandboxKey }}' $cid
|
||||
assert "$output" =~ "^/proc/[0-9]+/ns/net\$" "SandboxKey for network=none when running"
|
||||
run_podman rm -f -t0 $cid
|
||||
|
||||
# Check with ns:/PATH
|
||||
if ! is_rootless; then
|
||||
netns=netns$(random_string)
|
||||
|
||||
Reference in New Issue
Block a user