diff options
author | Ed Santiago <santiago@redhat.com> | 2020-07-13 09:42:47 -0600 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-08-11 13:37:35 +0200 |
commit | 589627b0cae2fdfe2cea8426a5dfbe74983962c3 (patch) | |
tree | b06b7ea161fcf693c06ead497ae538a97e545748 /test/system/helpers.bash | |
parent | 85d7cb5fd42642b26b0fe3c98f165c081b41c45e (diff) | |
download | podman-589627b0cae2fdfe2cea8426a5dfbe74983962c3.tar.gz podman-589627b0cae2fdfe2cea8426a5dfbe74983962c3.tar.bz2 podman-589627b0cae2fdfe2cea8426a5dfbe74983962c3.zip |
system tests: new tests for run, exec
- Issue #6735 : problem with multiple namespaces; confirms
combinations of --userns=keep-id, --privileged, --user=XX
- Issue #6829 : --userns=keep-id will add a /etc/passwd entry
- Issue #6593 : podman exec, with --userns=keep-id, errors
(test is currently skipped because issue remains live)
...and, addendum: add new helper function, remove_same_dev_warning.
Some CI systems issue a warning on podman run --privileged:
WARNING: The same type, major and minor should not be used for multiple devices.
We already had special-case code to ignore than in the SELinux
test, but now we're seeing it in the new run tests I added, so
I've refactored the "ignore this warning" code and written
tests for the removal code.
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/helpers.bash')
-rw-r--r-- | test/system/helpers.bash | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 7ec2105d1..5afe14718 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -386,5 +386,37 @@ function find_exec_pid_files() { find $storage_path -type f -iname 'exec_pid_*' fi } + + +############################# +# remove_same_dev_warning # Filter out useless warning from output +############################# +# +# On some CI systems, 'podman run --privileged' emits a useless warning: +# +# WARNING: The same type, major and minor should not be used for multiple devices. +# +# This obviously screws us up when we look at output results. +# +# This function removes the warning from $output and $lines +# +function remove_same_dev_warning() { + # No input arguments. We operate in-place on $output and $lines + + local i=0 + local -a new_lines=() + while [[ $i -lt ${#lines[@]} ]]; do + if expr "${lines[$i]}" : 'WARNING: .* same type, major.* multiple' >/dev/null; then + : + else + new_lines+=("${lines[$i]}") + fi + i=$(( i + 1 )) + done + + lines=("${new_lines[@]}") + output=$(printf '%s\n' "${lines[@]}") +} + # END miscellaneous tools ############################################################################### |