From 5b6ae0f796f3d6e3e499d37785e93e167aef0fe1 Mon Sep 17 00:00:00 2001 From: Kirtana Ashok Date: Wed, 22 Nov 2023 14:39:08 -0800 Subject: [PATCH] Use different containerd sock address in tests Signed-off-by: Kirtana Ashok --- integration/client/client.go | 2 +- integration/client/client_unix.go | 1 - integration/client/client_windows.go | 39 +++++++++++++++++++++++ integration/client/client_windows_test.go | 5 --- 4 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 integration/client/client_windows.go diff --git a/integration/client/client.go b/integration/client/client.go index 787edb710..e24cf1f8d 100644 --- a/integration/client/client.go +++ b/integration/client/client.go @@ -41,7 +41,7 @@ var ( ) func init() { - flag.StringVar(&address, "address", defaults.DefaultAddress, "The address to the containerd socket for use in the tests") + flag.StringVar(&address, "address", defaultAddress, "The address to the containerd socket for use in the tests") } func testContext(t testing.TB) (context.Context, context.CancelFunc) { diff --git a/integration/client/client_unix.go b/integration/client/client_unix.go index f7198bbc8..6e8ae3e98 100644 --- a/integration/client/client_unix.go +++ b/integration/client/client_unix.go @@ -18,7 +18,6 @@ package client -//nolint:unused // some variables used for fuzz const ( defaultRoot = "/var/lib/containerd-test" defaultState = "/run/containerd-test" diff --git a/integration/client/client_windows.go b/integration/client/client_windows.go new file mode 100644 index 000000000..24566b95b --- /dev/null +++ b/integration/client/client_windows.go @@ -0,0 +1,39 @@ +//go:build windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + Copyright 2024 The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package client + +const ( + defaultAddress = `\\.\pipe\containerd-containerd-test` +) diff --git a/integration/client/client_windows_test.go b/integration/client/client_windows_test.go index 3a5c60ca0..146820e06 100644 --- a/integration/client/client_windows_test.go +++ b/integration/client/client_windows_test.go @@ -24,11 +24,6 @@ import ( "github.com/Microsoft/hcsshim/osversion" ) -//nolint:unused // some variables used for fuzz -const ( - defaultAddress = `\\.\pipe\containerd-containerd-test` -) - var ( defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test") defaultState = filepath.Join(os.Getenv("programfiles"), "containerd", "state-test")