File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import (
34
34
35
35
var sshOptions = flag .String ("ssh-options" , "" , "Commandline options passed to ssh." )
36
36
var sshEnv = flag .String ("ssh-env" , "" , "Use predefined ssh options for environment. Options: gce" )
37
+ var sshUser = flag .String ("ssh-user" , "" , "Use predefined user for ssh." )
37
38
var testTimeoutSeconds = flag .Int ("test-timeout" , 45 * 60 , "How long (in seconds) to wait for ginkgo tests to complete." )
38
39
var resultsDir = flag .String ("results-dir" , "/tmp/" , "Directory to scp test results to." )
39
40
var ginkgoFlags = flag .String ("ginkgo-flags" , "" , "Passed to ginkgo to specify additional flags such as --skip=." )
@@ -66,10 +67,14 @@ func AddHostnameIp(hostname, ip string) {
66
67
func GetHostnameOrIp (hostname string ) string {
67
68
hostnameIpOverrides .RLock ()
68
69
defer hostnameIpOverrides .RUnlock ()
70
+ host := hostname
69
71
if ip , found := hostnameIpOverrides .m [hostname ]; found {
70
- return ip
72
+ host = ip
71
73
}
72
- return hostname
74
+ if * sshUser != "" {
75
+ host = fmt .Sprintf ("%s@%s" , * sshUser , host )
76
+ }
77
+ return host
73
78
}
74
79
75
80
// CreateTestArchive builds the local source and creates a tar archive e2e_node_test.tar.gz containing
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ WORKSPACE=${WORKSPACE:-"/tmp/"}
34
34
ARTIFACTS=${WORKSPACE} /_artifacts
35
35
36
36
mkdir -p ${ARTIFACTS}
37
- go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=* =2 --ssh-env= " gce " \
38
- --zone= " $GCE_ZONE " --project =" $GCE_PROJECT " --image- project=" $GCE_IMAGE_PROJECT " \
39
- --hosts =" $GCE_HOSTS " --images =" $GCE_IMAGES " --cleanup =" $CLEANUP " \
40
- --results-dir=" $ARTIFACTS " --ginkgo-flags=" $GINKGO_FLAGS " \
37
+ go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=* =2 \
38
+ --ssh-env= " gce " --ssh-user =" $GCE_USER " --zone= " $GCE_ZONE " -- project=" $GCE_PROJECT " \
39
+ --image-project =" $GCE_IMAGE_PROJECT " --hosts =" $GCE_HOSTS " --images =" $GCE_IMAGES " \
40
+ --cleanup= " $CLEANUP " -- results-dir=" $ARTIFACTS " --ginkgo-flags=" $GINKGO_FLAGS " \
41
41
--setup-node=" $SETUP_NODE "
Original file line number Diff line number Diff line change 1
1
# Copy this file to your home directory and modify
2
+ # User used on the gce instances to run the test.
3
+ GCE_USER =
2
4
# Names of gce hosts to test against (must be resolvable) or empty (one or more of GCE_IMAGES, GCE_HOSTS is required)
3
5
GCE_HOSTS =
4
6
# Names of gce images to test or empty (one or more of GCE_IMAGES, GCE_HOSTS is required)
You can’t perform that action at this time.
0 commit comments