summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-09-04 13:57:29 -0600
committerEd Santiago <santiago@redhat.com>2019-09-04 14:03:55 -0600
commitacf55e1f870f8562bb00304338c731fc94b6a54b (patch)
tree1e73139ed825fd7fe297eaa744a3f39b63d7c601 /test/system
parentf1a3e02aea68a37f85cb924c934be1bcc4131d7d (diff)
downloadpodman-acf55e1f870f8562bb00304338c731fc94b6a54b.tar.gz
podman-acf55e1f870f8562bb00304338c731fc94b6a54b.tar.bz2
podman-acf55e1f870f8562bb00304338c731fc94b6a54b.zip
System tests: support for crun on f31/rawhide
crun emits wildly different error messages than runc in two cases: podman run ... /no/such/path (enoent) podman run ... /etc (trying to exec a directory) Deal with it by getting the runtime from 'podman info' and, if crun, changing what we expect. There may be more tweaks needed to get system tests working with crun, but right now podman rawhide is too broken to have any hope of finding them all. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/030-run.bats18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 9e609b434..f279a0c75 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -4,13 +4,27 @@ load helpers
@test "podman run - basic tests" {
rand=$(random_string 30)
+
+ # 2019-09 Fedora 31 and rawhide (32) are switching from runc to crun
+ # because of cgroups v2; crun emits different error messages.
+ # Default to runc:
+ err_no_such_cmd="Error: .*: starting container process caused .*exec:.*stat /no/such/command: no such file or directory"
+ err_no_exec_dir="Error: .*: starting container process caused .*exec:.* permission denied"
+
+ # ...but check the configured runtime engine, and switch to crun as needed
+ run_podman info --format '{{ .host.OCIRuntime.path }}'
+ if expr "$output" : ".*/crun"; then
+ err_no_such_cmd="Error: executable file not found in \$PATH: No such file or directory: OCI runtime command not found error"
+ err_no_exec_dir="Error: open executable: Operation not permitted: OCI runtime permission denied error"
+ fi
+
tests="
true | 0 |
false | 1 |
sh -c 'exit 32' | 32 |
echo $rand | 0 | $rand
-/no/such/command | 127 | Error: .*: starting container process caused .*exec:.*stat /no/such/command: no such file or directory
-/etc | 126 | Error: .*: starting container process caused .*exec:.* permission denied
+/no/such/command | 127 | $err_no_such_cmd
+/etc | 126 | $err_no_exec_dir
"
while read cmd expected_rc expected_output; do