diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index ab39ff49..e7a2a173 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -16,7 +16,7 @@ jobs: name: Build and test the project if: github.repository == 'apple/container' timeout-minutes: 60 - runs-on: [self-hosted, macos, sequoia, ARM64] + runs-on: [self-hosted, macos, tahoe, ARM64] permissions: contents: read packages: read @@ -73,6 +73,10 @@ jobs: APP_ROOT=$(mktemp -d -p "${RUNNER_TEMP}") trap 'rm -rf "${APP_ROOT}"; echo Removing data directory ${APP_ROOT}' EXIT echo "Created data directory ${APP_ROOT}" + export NO_PROXY="${NO_PROXY},192.168.0.0/16,fe80::/10" + echo NO_PROXY=${NO_PROXY} + export no_proxy="${no_proxy},192.168.0.0/16,fe80::/10" + echo no_proxy=${no_proxy} make APP_ROOT="${APP_ROOT}" test install-kernel integration env: DEVELOPER_DIR: "/Applications/Xcode-latest.app/Contents/Developer" diff --git a/Tests/CLITests/Subcommands/Networks/TestCLINetwork.swift b/Tests/CLITests/Subcommands/Networks/TestCLINetwork.swift index 894ec931..5fe4eb9e 100644 --- a/Tests/CLITests/Subcommands/Networks/TestCLINetwork.swift +++ b/Tests/CLITests/Subcommands/Networks/TestCLINetwork.swift @@ -65,7 +65,7 @@ class TestCLINetwork: CLITest { let url = "http://\(cidrAddress.address):\(port)" var request = HTTPClientRequest(url: url) request.method = .GET - let client = getClient() + let client = getClient(useHttpProxy: false) defer { _ = client.shutdown() } var retriesRemaining = Self.retries var success = false diff --git a/Tests/CLITests/TestCLINoParallelCases.swift b/Tests/CLITests/TestCLINoParallelCases.swift index 5638ae61..9011e412 100644 --- a/Tests/CLITests/TestCLINoParallelCases.swift +++ b/Tests/CLITests/TestCLINoParallelCases.swift @@ -196,8 +196,7 @@ class TestCLINoParallelCases: CLITest { } @available(macOS 26, *) - @Test(.disabled("https://github.com/apple/container/issues/953")) - func testNetworkPruneSkipsNetworksInUse() throws { + @Test func testNetworkPruneSkipsNetworksInUse() throws { let name = getTestName() let containerName = "\(name)_c1" let networkInUse = "\(name)_inuse" @@ -251,8 +250,7 @@ class TestCLINoParallelCases: CLITest { } @available(macOS 26, *) - @Test(.disabled("https://github.com/apple/container/issues/953")) - func testNetworkPruneSkipsNetworkAttachedToStoppedContainer() async throws { + @Test func testNetworkPruneSkipsNetworkAttachedToStoppedContainer() async throws { let name = getTestName() let containerName = "\(name)_c1" let networkName = "\(name)" diff --git a/Tests/CLITests/Utilities/CLITest.swift b/Tests/CLITests/Utilities/CLITest.swift index 4ccd71a5..7f94cf37 100644 --- a/Tests/CLITests/Utilities/CLITest.swift +++ b/Tests/CLITests/Utilities/CLITest.swift @@ -215,6 +215,8 @@ class CLITest { runArgs.append(contentsOf: args) } + runArgs.append(contentsOf: getProxyEnvironment()) + if let image { runArgs.append(image) } else { @@ -237,6 +239,7 @@ class CLITest { var execArgs = [ "exec" ] + execArgs.append(contentsOf: getProxyEnvironment()) if detach { execArgs.append("-d") } @@ -273,6 +276,8 @@ class CLITest { var arguments = ["create", "--rm", "--name", name] + arguments.append(contentsOf: getProxyEnvironment()) + // Add volume mounts for volume in volumes { arguments += ["-v", volume] @@ -457,9 +462,12 @@ class CLITest { } } - func getClient() -> HTTPClient { + func getClient(useHttpProxy: Bool) -> HTTPClient { var httpConfiguration = HTTPClient.Configuration() let proxyConfig: HTTPClient.Configuration.Proxy? = { + guard useHttpProxy else { + return nil + } let proxyEnv = ProcessInfo.processInfo.environment["HTTP_PROXY"] guard let proxyEnv else { return nil @@ -555,4 +563,15 @@ class CLITest { func doNetworkDeleteIfExists(name: String) { let (_, _, _, _) = (try? run(arguments: ["network", "rm", name])) ?? (nil, "", "", 1) } + + private func getProxyEnvironment() -> [String] { + let proxyVars = Set([ + "HTTP_PROXY", "http_proxy", + "HTTPS_PROXY", "https_proxy", + "NO_PROXY", "no_proxy", + ]) + return ProcessInfo.processInfo.environment + .filter { (key, val) in proxyVars.contains(key) } + .flatMap { (key, val) in ["-e", "\(key)=\(val)"] } + } }