Add test flag for setting containerd address
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -2,17 +2,22 @@ package containerd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const defaultAddress = "/run/containerd/containerd.sock"
|
||||
func init() {
|
||||
flag.StringVar(&address, "address", "/run/containerd/containerd.sock", "The address to the containerd socket for use in the tests")
|
||||
flag.Parse()
|
||||
}
|
||||
|
||||
var address string
|
||||
|
||||
func TestNewClient(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
client, err := New(defaultAddress)
|
||||
client, err := New(address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -27,9 +32,8 @@ func TestNewClient(t *testing.T) {
|
||||
func TestImagePull(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
client, err := New(defaultAddress)
|
||||
client, err := New(address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user