test-e2e-node: support pure SSH mode

Right now, `run_remote.go` only supports GCE instances. But actually
running the tests is completely independent of GCE and could work just
as well on any SSH-accessible machine.

This patch adds a new `--mode` switch, which defaults to `gce` for
backwards compatibility, but can be set to `ssh`. In that mode, the GCE
API is not used at all, and we simply connect to the hosts given via
`--hosts`.

This is still better than `run_local.go` because the latter mixes build
environment with test environment, which doesn't fit well with
container-optimized operating systems.

This is part of an effort to setup the e2e node tests on Fedora CoreOS
(see https://github.com/coreos/fedora-coreos-tracker/issues/990).

Patch best viewed with whitespace ignored.
This commit is contained in:
Jonathan Lebon
2021-11-05 12:08:39 -04:00
parent e0723c1e64
commit 3ebd93cd02
3 changed files with 45 additions and 19 deletions

View File

@@ -214,8 +214,10 @@ define TEST_E2E_NODE_HELP_INFO
# Defaults to "".
# RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
# repeatedly until they fail. Defaults to false.
# REMOTE: If true, run the tests on a remote host instance on GCE. Defaults
# to false.
# REMOTE: If true, run the tests on a remote host. Defaults to false.
# REMOTE_MODE: For REMOTE=true only. Mode for remote execution (eg. gce, ssh).
# If set to "gce", an instance can be provisioned or reused from GCE. If set
# to "ssh", provided `HOSTS` must be IPs or resolvable. Defaults to "gce".
# ARTIFACTS: Local directory to scp test artifacts into from the remote hosts
# for REMOTE=true. Local directory to write juntil xml results into for REMOTE=false.
# Defaults to "/tmp/_artifacts/$$(date +%y%m%dT%H%M%S)".