@@ -111,14 +111,13 @@ func getTestEnv() {
111
111
sshKey = os .Getenv ("SSH_KEY" )
112
112
Expect (sshKey ).NotTo (BeEmpty (), "SSH_KEY environment variable must be set" )
113
113
114
- sshUser = os .Getenv ("SSH_USER " )
114
+ sshUser = os .Getenv ("E2E_SSH_USER " )
115
115
Expect (sshUser ).NotTo (BeEmpty (), "SSH_USER environment variable must be set" )
116
116
117
- host = os .Getenv ("REMOTE_HOST " )
117
+ host = os .Getenv ("E2E_SSH_HOST " )
118
118
Expect (host ).NotTo (BeEmpty (), "REMOTE_HOST environment variable must be set" )
119
119
120
- sshPort = os .Getenv ("REMOTE_PORT" )
121
- Expect (sshPort ).NotTo (BeEmpty (), "REMOTE_PORT environment variable must be set" )
120
+ sshPort = getIntEnvVar ("E2E_SSH_PORT" , 22 )
122
121
123
122
// Get current working directory
124
123
cwd , err = os .Getwd ()
@@ -137,3 +136,16 @@ func getBoolEnvVar(key string, defaultValue bool) bool {
137
136
}
138
137
return boolValue
139
138
}
139
+
140
+ // getIntEnvVar returns the integer value of the environment variable or the default value if not set.
141
+ func getIntEnvVar (key string , defaultValue int ) string {
142
+ value := os .Getenv (key )
143
+ if value == "" {
144
+ return strconv .Itoa (defaultValue )
145
+ }
146
+ intValue , err := strconv .Atoi (value )
147
+ if err != nil {
148
+ return strconv .Itoa (defaultValue )
149
+ }
150
+ return strconv .Itoa (intValue )
151
+ }
0 commit comments