*_test.go: fix test conditions
- add `testutil.RequiresRoot()` to TestMain - moved `if testing.Short{ t.Skip() }` from each of the tests into a common `newClient()` Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -6,13 +6,10 @@ import (
|
||||
)
|
||||
|
||||
func TestCheckpointRestore(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
}
|
||||
if !supportsCriu {
|
||||
t.Skip("system does not have criu installed")
|
||||
}
|
||||
client, err := New(address)
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -101,13 +98,10 @@ func TestCheckpointRestore(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCheckpointRestoreNewContainer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
}
|
||||
if !supportsCriu {
|
||||
t.Skip("system does not have criu installed")
|
||||
}
|
||||
client, err := New(address)
|
||||
client, err := newClient(t, address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user