Merge pull request #964 from crosbymichael/criu-test
Only run checkpoint test if criu is installed
This commit is contained in:
commit
ecc08d7524
@ -10,6 +10,9 @@ func TestCheckpointRestore(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
}
|
||||
if !supportsCriu {
|
||||
t.Skip("system does not have criu installed")
|
||||
}
|
||||
client, err := New(address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -100,6 +103,9 @@ func TestCheckpointRestoreNewContainer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
}
|
||||
if !supportsCriu {
|
||||
t.Skip("system does not have criu installed")
|
||||
}
|
||||
client, err := New(address)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -21,6 +21,7 @@ const (
|
||||
var (
|
||||
address string
|
||||
noDaemon bool
|
||||
supportsCriu bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -33,6 +34,11 @@ func TestMain(m *testing.M) {
|
||||
if testing.Short() {
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
// check if criu is installed on the system
|
||||
_, err := exec.LookPath("criu")
|
||||
supportsCriu = err == nil
|
||||
|
||||
var (
|
||||
cmd *exec.Cmd
|
||||
buf = bytes.NewBuffer(nil)
|
||||
|
Loading…
Reference in New Issue
Block a user