Skip to content

Commit

Permalink
Merge pull request #16570 from edsantiago/systemtest_cleanup
Browse files Browse the repository at this point in the history
ssh system test: skip until it becomes a test
  • Loading branch information
openshift-merge-robot authored Nov 22, 2022
2 parents d202416 + 50d72bc commit 1aa28b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 40 deletions.
51 changes: 15 additions & 36 deletions test/system/900-ssh.bats
Original file line number Diff line number Diff line change
@@ -1,62 +1,41 @@
#!/usr/bin/env bats
#
# Simplest set of podman tests. If any of these fail, we have serious problems.
# Tests for podman system connection using native ssh
#

load helpers
load helpers.network

# Override standard setup! We don't yet trust podman-images or podman-rm
function setup() {
if ! is_remote; then
skip "only applicable on podman-remote"
fi
is_remote || skip "only applicable on podman-remote"

basic_setup
}

function teardown() {
if ! is_remote; then
return
fi

# In case test function failed to clean up
if [[ -n $_SERVICE_PID ]]; then
run kill $_SERVICE_PID
fi

# see test/system/272-system-connection.bats for why this is needed
mount \
| grep $PODMAN_TMPDIR \
| awk '{print $3}' \
| xargs -l1 --no-run-if-empty umount

run_podman system connection rm --all
run_podman system connection rm testing

basic_teardown
}

function _run_podman_remote() {
PODMAN=${PODMAN%%--url*} run_podman "$@"
}

@test "podman --ssh test" {
skip_if_no_ssh "cannot run these tests without an ssh binary"
# Start server
_SERVICE_PORT=$(random_free_port 63000-64999)
type -P ssh || skip "no ssh binary available on host"

${PODMAN%%-remote*} --root ${PODMAN_TMPDIR}/root \
--runroot ${PODMAN_TMPDIR}/runroot \
system service -t 99 tcp://localhost:$_SERVICE_PORT &
_SERVICE_PID=$!
wait_for_port localhost $_SERVICE_PORT
skip "FIXME: this is not an actual test of anything"

notme=${PODMAN_ROOTLESS_USER}
# FIXME: original code used misleading variable name "notme", even though
# the target user was always the same.
test -n "$PODMAN_ROOTLESS_USER" || skip "\$PODMAN_ROOTLESS_USER is undefined"

uid=$(id -u $notme)
rootless_uid=$(id -u $PODMAN_ROOTLESS_USER)

run_podman 125 --ssh=native system connection add testing ssh://$notme@localhost:22/run/user/$uid/podman/podman.sock
# FIXME FIXME FIXME: someone needs to add a comment here explaining what
# this is supposed to test
run_podman 125 --ssh=native system connection add testing \
ssh://${PODMAN_ROOTLESS_USER}@localhost:22/run/user/${rootless_uid}/podman/podman.sock
# FIXME FIXME FIXME: this is not an acceptable error message
is "$output" "Error: exit status 255"

# FIXME FIXME FIXME: it is not clear what the message below means
# need to figure out how to podman remote test with the new ssh
}
4 changes: 0 additions & 4 deletions test/system/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ function wait_for_file() {
# BEGIN miscellaneous tools

# Shortcuts for common needs:
function no_ssh() {
[ "$(man ssh)" -ne 0 ]
}

function is_ubuntu() {
grep -qiw ubuntu /etc/os-release
}
Expand Down

0 comments on commit 1aa28b1

Please sign in to comment.