summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/35-networks.at23
-rw-r--r--test/system/001-basic.bats7
-rw-r--r--test/system/005-info.bats9
-rw-r--r--test/system/070-build.bats5
-rw-r--r--test/system/410-selinux.bats28
5 files changed, 71 insertions, 1 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 21840a42d..59947faac 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -106,7 +106,7 @@ t POST libpod/networks/prune?filters='{"label":["tes' 500 \
# prune networks using filter - compat api
t POST networks/prune?filters='{"label":["xyz"]}' 200
-t GET networks/json?filters='{"label":["xyz"]}' 404
+t GET networks?filters='{"label":["xyz"]}' 200 length=0
# prune networks using filter - libpod api
t POST libpod/networks/prune?filters='{"label":["zaq=val"]}' 200
@@ -120,5 +120,26 @@ t DELETE libpod/networks/network2 200 \
.[0].Name~network2 \
.[0].Err=null
+# test until filter - libpod api
+podman network create network5 --label xyz
+
+# with date way back in the past, network should not be deleted
+t POST libpod/networks/prune?filters='{"until":["500000"]}' 200
+t GET libpod/networks/json?filters='{"label":["xyz"]}' 200 length=1
+
+# with date far in the future, network should be deleted
+t POST libpod/networks/prune?filters='{"until":["5000000000"]}' 200
+t GET libpod/networks/json?filters='{"label":["xyz"]}' 200 length=0
+
+# test until filter - compat api
+podman network create network6 --label zaq
+
+# with date way back in the past, network should not be deleted
+t POST networks/prune?filters='{"until":["500000"]}' 200
+t GET networks?filters='{"label":["zaq"]}' 200 length=1
+
+# with date far in the future, network should be deleted
+t POST networks/prune?filters='{"until":["5000000000"]}' 200
+t GET networks?filters='{"label":["zaq"]}' 200 length=0
# vim: filetype=sh
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index d276cfda1..081bb1171 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -10,6 +10,13 @@ function setup() {
:
}
+@test "podman --context emits reasonable output" {
+ run_podman 125 --context=swarm version
+ is "$output" "Error: Podman does not support swarm, the only --context value allowed is \"default\"" "--context=default or fail"
+
+ run_podman --context=default version
+}
+
@test "podman version emits reasonable output" {
run_podman version
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index 7452c1901..c0af2e937 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -53,4 +53,13 @@ store.imageStore.number | 1
}
+@test "podman info --storage-opt='' " {
+ skip_if_remote "--storage-opt flag is not supported for remote"
+ skip_if_rootless "storage opts are required for rootless running"
+ run_podman --storage-opt='' info
+ # Note this will not work in rootless mode, unless you specify
+ # storage-driver=vfs, until we have kernels that support rootless overlay
+ # mounts.
+ is "$output" ".*graphOptions: {}" "output includes graphOptions: {}"
+}
# vim: filetype=sh
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 2e97c93e0..5a887c71e 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -752,6 +752,11 @@ EOF
run_podman rmi -f build_test
}
+@test "podman build --authfile bogus test" {
+ run_podman 125 build --authfile=/tmp/bogus - <<< "from scratch"
+ is "$output" ".*/tmp/bogus: no such file or directory"
+}
+
function teardown() {
# A timeout or other error in 'build' can leave behind stale images
# that podman can't even see and which will cascade into subsequent
diff --git a/test/system/410-selinux.bats b/test/system/410-selinux.bats
index 4a2c7b7a4..8a690fb48 100644
--- a/test/system/410-selinux.bats
+++ b/test/system/410-selinux.bats
@@ -191,5 +191,33 @@ function check_label() {
is "$output" "Error.*: \`/proc/thread-self/attr/exec\`: OCI runtime error: unable to assign security attribute" "useful diagnostic"
}
+@test "podman selinux: check relabel" {
+ skip_if_no_selinux
+
+ LABEL="system_u:object_r:tmp_t:s0"
+ tmpdir=$PODMAN_TMPDIR/vol
+ touch $tmpdir
+ chcon -vR ${LABEL} $tmpdir
+ ls -Z $tmpdir
+
+ run_podman run -v $tmpdir:/test $IMAGE cat /proc/self/attr/current
+ level=$(secon -l $output)
+ run ls -dZ ${tmpdir}
+ is "$output" ${LABEL} "No Relabel Correctly"
+
+ run_podman run -v $tmpdir:/test:Z --security-opt label=disable $IMAGE cat /proc/self/attr/current
+ level=$(secon -l $output)
+ run ls -dZ $tmpdir
+ is "$output" ${LABEL} "No Privileged Relabel Correctly"
+
+ run_podman run -v $tmpdir:/test:Z $IMAGE cat /proc/self/attr/current
+ level=$(secon -l $output)
+ run ls -dZ $tmpdir
+ is "$output" "system_u:object_r:container_file_t:$level" "Confined Relabel Correctly"
+
+ run_podman run -v $tmpdir:/test:z $IMAGE cat /proc/self/attr/current
+ run ls -dZ $tmpdir
+ is "$output" "system_u:object_r:container_file_t:s0" "Shared Relabel Correctly"
+}
# vim: filetype=sh