summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-07 01:40:47 -0400
committerGitHub <noreply@github.com>2021-04-07 01:40:47 -0400
commit9b0627617ab35daf34f051352f3a6f05898ca935 (patch)
tree1f92ed024c5f7905b3c205ddd7a7b216eb0699d8 /test
parentd83f49ef6b8a53535257bb56f5573ef3f65e3ba9 (diff)
parentf230214db120793d68d95c5b1892ca5d7d128e79 (diff)
downloadpodman-9b0627617ab35daf34f051352f3a6f05898ca935.tar.gz
podman-9b0627617ab35daf34f051352f3a6f05898ca935.tar.bz2
podman-9b0627617ab35daf34f051352f3a6f05898ca935.zip
Merge pull request #9959 from Luap99/rootless-cni-path
rootless cni add /usr/sbin to PATH if not present
Diffstat (limited to 'test')
-rw-r--r--test/system/500-networking.bats15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 804dd46b1..cda054b15 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -209,4 +209,19 @@ load helpers
run_podman rm -f $cid
}
+@test "podman rootless cni adds /usr/sbin to PATH" {
+ is_rootless || skip "only meaningful for rootless"
+
+ local mynetname=testnet-$(random_string 10)
+ run_podman network create $mynetname
+
+ # Test that rootless cni adds /usr/sbin to $PATH
+ # iptables is located under /usr/sbin and is needed for the CNI plugins.
+ # Debian doesn't add /usr/sbin to $PATH for rootless users so we have to add it.
+ PATH=/usr/local/bin:/usr/bin run_podman run --rm --network $mynetname $IMAGE ip addr
+ is "$output" ".*eth0.*" "Interface eth0 not found in ip addr output"
+
+ run_podman network rm -f $mynetname
+}
+
# vim: filetype=sh