Merge pull request #12764 from edsantiago/bats

Emergency system-test fixes
This commit is contained in:
OpenShift Merge Robot
2022-01-07 13:19:51 +01:00
committed by GitHub
2 changed files with 21 additions and 26 deletions

View File

@ -14,8 +14,8 @@ load helpers
# ...but check the configured runtime engine, and switch to crun as needed # ...but check the configured runtime engine, and switch to crun as needed
run_podman info --format '{{ .Host.OCIRuntime.Path }}' run_podman info --format '{{ .Host.OCIRuntime.Path }}'
if expr "$output" : ".*/crun"; then if expr "$output" : ".*/crun"; then
err_no_such_cmd="Error:.*executable file.* not found in \$PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found" err_no_such_cmd="Error: crun: executable file.* not found in \$PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found"
err_no_exec_dir="Error:.*open executable: Operation not permitted: OCI permission denied" err_no_exec_dir="Error: crun: open executable: Operation not permitted: OCI permission denied"
fi fi
tests=" tests="

View File

@ -79,31 +79,26 @@ verify_iid_and_name() {
} }
@test "podman image scp transfer" { @test "podman image scp transfer" {
skip_if_root_ubuntu "cannot create a new user successfully on ubuntu" skip_if_remote "only applicable under local podman"
skip "FIXME FIXME FIXME: this needs a big rewrite"
get_iid_and_name get_iid_and_name
if ! is_remote; then if is_rootless; then
if is_rootless; then whoami=$(id -un)
whoami=$(id -un) # FIXME: first, test that we can sudo. If we can't, skip.
run_podman image scp $whoami@localhost::$iid root@localhost:: # FIXME: test 'scp $IMAGE root@localhost::'
if [ "$status" -ne 0 ]; then # FIXME: then test the rest
die "Command failed: podman image scp transfer" # FIXME: check output
fi run_podman image scp $whoami@localhost::$iid root@localhost::
whoami=$(id -un) is "$output" "Loaded image.*: $iid" "...."
run_podman image scp -q $whoami@localhost::$iid root@localhost::
if [ "$status" -ne 0 ]; then # FIXME: "-q" is a NOP
die "Command failed: podman image scp quiet transfer failed" run_podman image scp -q $whoami@localhost::$iid root@localhost::
fi else
fi # root
if ! is_rootless; then # FIXME: identify a rootless user. DO NOT CREATE ONE.
id -u 1000 &>/dev/null || useradd -u 1000 -g 1000 testingUsr run_podman image scp root@localhost::$iid 1000:1000@localhost::
if [ "$status" -ne 0 ]; then
die "Command failed: useradd 1000"
fi
run_podman image scp root@localhost::$iid 1000:1000@localhost::
if [ "$status" -ne 0 ]; then
die "Command failed: podman image scp transfer"
fi
fi
fi fi
} }