Skip to content

Commit 62cfad9

Browse files
committed
specconv: add a test case to check null spec.Process
Signed-off-by: l00397676 <[email protected]>
1 parent bbaba4c commit 62cfad9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

libcontainer/specconv/spec_linux_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,3 +585,16 @@ func TestInitSystemdProps(t *testing.T) {
585585
}
586586
}
587587
}
588+
589+
func TestNullProcess(t *testing.T) {
590+
spec := Example()
591+
spec.Process = nil
592+
593+
_, err := CreateLibcontainerConfig(&CreateOpts{
594+
Spec: spec,
595+
})
596+
597+
if err != nil {
598+
t.Errorf("Null process should be forbidden")
599+
}
600+
}

0 commit comments

Comments
 (0)