Use different containerd sock address in tests

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
This commit is contained in:
Kirtana Ashok 2023-11-22 14:39:08 -08:00
parent b0d00f8636
commit 5b6ae0f796
4 changed files with 40 additions and 7 deletions

View File

@ -41,7 +41,7 @@ var (
) )
func init() { 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) { func testContext(t testing.TB) (context.Context, context.CancelFunc) {

View File

@ -18,7 +18,6 @@
package client package client
//nolint:unused // some variables used for fuzz
const ( const (
defaultRoot = "/var/lib/containerd-test" defaultRoot = "/var/lib/containerd-test"
defaultState = "/run/containerd-test" defaultState = "/run/containerd-test"

View File

@ -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`
)

View File

@ -24,11 +24,6 @@ import (
"github.com/Microsoft/hcsshim/osversion" "github.com/Microsoft/hcsshim/osversion"
) )
//nolint:unused // some variables used for fuzz
const (
defaultAddress = `\\.\pipe\containerd-containerd-test`
)
var ( var (
defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test") defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test")
defaultState = filepath.Join(os.Getenv("programfiles"), "containerd", "state-test") defaultState = filepath.Join(os.Getenv("programfiles"), "containerd", "state-test")