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() {
|
if testing.Short() {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
if !supportsCriu {
|
||||||
|
t.Skip("system does not have criu installed")
|
||||||
|
}
|
||||||
client, err := New(address)
|
client, err := New(address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -100,6 +103,9 @@ func TestCheckpointRestoreNewContainer(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
if !supportsCriu {
|
||||||
|
t.Skip("system does not have criu installed")
|
||||||
|
}
|
||||||
client, err := New(address)
|
client, err := New(address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
@ -19,8 +19,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
address string
|
address string
|
||||||
noDaemon bool
|
noDaemon bool
|
||||||
|
supportsCriu bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -33,6 +34,11 @@ func TestMain(m *testing.M) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
os.Exit(m.Run())
|
os.Exit(m.Run())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if criu is installed on the system
|
||||||
|
_, err := exec.LookPath("criu")
|
||||||
|
supportsCriu = err == nil
|
||||||
|
|
||||||
var (
|
var (
|
||||||
cmd *exec.Cmd
|
cmd *exec.Cmd
|
||||||
buf = bytes.NewBuffer(nil)
|
buf = bytes.NewBuffer(nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user