summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-11 19:19:23 -0700
committerGitHub <noreply@github.com>2019-04-11 19:19:23 -0700
commite197cb2ff4db0685cd77abf81d4913db51c6d08f (patch)
treee5245850d7f625d38ca245a1e76c8095de8e38d7
parente6fd4737ec80b0bbe5e299076e36f29cee112a0a (diff)
parent7220c166d42273c6e70c4a9df8cc0964987cd57b (diff)
downloadpodman-e197cb2ff4db0685cd77abf81d4913db51c6d08f.tar.gz
podman-e197cb2ff4db0685cd77abf81d4913db51c6d08f.tar.bz2
podman-e197cb2ff4db0685cd77abf81d4913db51c6d08f.zip
Merge pull request #2889 from edsantiago/bats
BATS tests: start supporting podman-remote
-rw-r--r--test/system/005-info.bats4
-rw-r--r--test/system/010-images.bats3
-rw-r--r--test/system/015-help.bats2
-rw-r--r--test/system/030-run.bats2
-rw-r--r--test/system/035-logs.bats2
-rw-r--r--test/system/060-mount.bats1
-rw-r--r--test/system/070-build.bats2
-rw-r--r--test/system/075-exec.bats2
-rw-r--r--test/system/110-history.bats2
-rw-r--r--test/system/400-unprivileged-access.bats1
-rw-r--r--test/system/helpers.bash10
11 files changed, 29 insertions, 2 deletions
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index 7dcc78838..c64b011bd 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -3,6 +3,8 @@
load helpers
@test "podman info - basic test" {
+ skip_if_remote
+
run_podman info
expected_keys="
@@ -26,6 +28,8 @@ RunRoot:
}
@test "podman info - json" {
+ skip_if_remote
+
run_podman info --format=json
expr_nvr="[a-z0-9-]\\\+-[a-z0-9.]\\\+-[a-z0-9]\\\+\."
diff --git a/test/system/010-images.bats b/test/system/010-images.bats
index 1c9577e34..380623078 100644
--- a/test/system/010-images.bats
+++ b/test/system/010-images.bats
@@ -25,11 +25,12 @@ load helpers
@test "podman images - json" {
+ # 'created': podman includes fractional seconds, podman-remote does not
tests="
names[0] | $PODMAN_TEST_IMAGE_FQN
id | [0-9a-f]\\\{64\\\}
digest | sha256:[0-9a-f]\\\{64\\\}
-created | [0-9-]\\\+T[0-9:]\\\+\\\.[0-9]\\\+Z
+created | [0-9-]\\\+T[0-9:.]\\\+Z
size | [0-9]\\\+
"
diff --git a/test/system/015-help.bats b/test/system/015-help.bats
index 8e07b8822..a987f04bc 100644
--- a/test/system/015-help.bats
+++ b/test/system/015-help.bats
@@ -87,6 +87,8 @@ function check_help() {
@test "podman help - basic tests" {
+ skip_if_remote
+
# Called with no args -- start with 'podman --help'. check_help() will
# recurse for any subcommands.
check_help
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 188070550..eef05747f 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -3,6 +3,8 @@
load helpers
@test "podman run - basic tests" {
+ skip_if_remote
+
rand=$(random_string 30)
tests="
true | 0 |
diff --git a/test/system/035-logs.bats b/test/system/035-logs.bats
index 055865c8d..5736e0939 100644
--- a/test/system/035-logs.bats
+++ b/test/system/035-logs.bats
@@ -6,6 +6,8 @@
load helpers
@test "podman logs - basic test" {
+ skip_if_remote
+
rand_string=$(random_string 40)
run_podman create $IMAGE echo $rand_string
diff --git a/test/system/060-mount.bats b/test/system/060-mount.bats
index e249b2883..7570f3ac4 100644
--- a/test/system/060-mount.bats
+++ b/test/system/060-mount.bats
@@ -6,6 +6,7 @@ load helpers
@test "podman mount - basic test" {
# Only works with root (FIXME: does it work with rootless + vfs?)
skip_if_rootless "mount does not work rootless"
+ skip_if_remote
f_path=/tmp/tmpfile_$(random_string 8)
f_content=$(random_string 30)
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 25eb36c58..c6a25093f 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -6,6 +6,8 @@
load helpers
@test "podman build - basic test" {
+ skip_if_remote
+
rand_filename=$(random_string 20)
rand_content=$(random_string 50)
diff --git a/test/system/075-exec.bats b/test/system/075-exec.bats
index a12d28b32..11cb98269 100644
--- a/test/system/075-exec.bats
+++ b/test/system/075-exec.bats
@@ -6,6 +6,8 @@
load helpers
@test "podman exec - basic test" {
+ skip_if_remote
+
rand_filename=$(random_string 20)
rand_content=$(random_string 50)
diff --git a/test/system/110-history.bats b/test/system/110-history.bats
index 84a1e42b4..5dc221d61 100644
--- a/test/system/110-history.bats
+++ b/test/system/110-history.bats
@@ -24,7 +24,7 @@ load helpers
@test "podman history - json" {
tests="
id | [0-9a-f]\\\{64\\\}
-created | [0-9-]\\\+T[0-9:]\\\+\\\.[0-9]\\\+Z
+created | [0-9-]\\\+T[0-9:.]\\\+Z
size | -\\\?[0-9]\\\+
"
diff --git a/test/system/400-unprivileged-access.bats b/test/system/400-unprivileged-access.bats
index c195d71eb..0358b3beb 100644
--- a/test/system/400-unprivileged-access.bats
+++ b/test/system/400-unprivileged-access.bats
@@ -7,6 +7,7 @@ load helpers
@test "podman container storage is not accessible by unprivileged users" {
skip_if_rootless "test meaningless without suid"
+ skip_if_remote
run_podman run --name c_uidmap --uidmap 0:10000:10000 $IMAGE true
run_podman run --name c_uidmap_v --uidmap 0:10000:10000 -v foo:/foo $IMAGE true
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 431228498..29ef19ecc 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -225,6 +225,16 @@ function skip_if_rootless() {
skip "${1:-not applicable under rootless podman}"
}
+####################
+# skip_if_remote # ...with an optional message
+####################
+function skip_if_remote() {
+ if [[ ! "$PODMAN" =~ -remote ]]; then
+ return
+ fi
+
+ skip "${1:-test does not work with podman-remote}"
+}
#########
# die # Abort with helpful message