1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

integration tests: allow running in a network sandbox

The testscript framework needs environment variables explicitly passed
through to the test environment. This adds passthrough for proxy variables
(HTTP_PROXY, HTTPS_PROXY, NO_PROXY and lowercase variants) that may be set
by the sandbox or CI environment.

Without these, integration tests running behind a proxy would fail with
network DNS resolution failures when attempting to download resources.

Assisted-by: Claude Code
This commit is contained in:
Zane Bitter
2025-10-29 23:53:42 +13:00
parent 6326ea7f96
commit 680f3904a9
2 changed files with 19 additions and 2 deletions

View File

@@ -112,8 +112,12 @@ func runIntegrationTest(t *testing.T, testFolder string) {
}
}
e.Vars = append(e.Vars, fmt.Sprintf("RELEASE_IMAGE=%s", pullspec))
if xdgCacheHome, ok := os.LookupEnv("XDG_CACHE_HOME"); ok && xdgCacheHome != "" {
e.Vars = append(e.Vars, fmt.Sprintf("XDG_CACHE_HOME=%s", xdgCacheHome))
// Pass through environment variables that may be set by the sandbox or CI
passthroughVars := []string{"XDG_CACHE_HOME", "HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"}
for _, varName := range passthroughVars {
if value, ok := os.LookupEnv(varName); ok && value != "" {
e.Vars = append(e.Vars, fmt.Sprintf("%s=%s", varName, value))
}
}
// When AUTH_FILE is set in the CI integration-tests job
if authFilePath, ok := os.LookupEnv("AUTH_FILE"); ok && authFilePath != "" {