mirror of
https://github.com/opencontainers/runc.git
synced 2026-04-22 23:17:17 +08:00
specconv: add a test case to check null spec.Process
Signed-off-by: l00397676 <lujingxiao@huawei.com>
This commit is contained in:
@@ -585,3 +585,16 @@ func TestInitSystemdProps(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNullProcess(t *testing.T) {
|
||||
spec := Example()
|
||||
spec.Process = nil
|
||||
|
||||
_, err := CreateLibcontainerConfig(&CreateOpts{
|
||||
Spec: spec,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Null process should be forbidden")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user