File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,19 @@ func TestDevicesSetAllow(t *testing.T) {
5656 if value != allowedList {
5757 t .Fatal ("Got the wrong value, set devices.allow failed." )
5858 }
59+
60+ // When AllowAllDevices is nil, devices.allow file should not be modified.
61+ helper .CgroupData .config .Resources .AllowAllDevices = nil
62+ if err := devices .Set (helper .CgroupPath , helper .CgroupData .config ); err != nil {
63+ t .Fatal (err )
64+ }
65+ value , err = getCgroupParamString (helper .CgroupPath , "devices.allow" )
66+ if err != nil {
67+ t .Fatalf ("Failed to parse devices.allow - %s" , err )
68+ }
69+ if value != allowedList {
70+ t .Fatal ("devices policy shouldn't have changed on AllowedAllDevices=nil." )
71+ }
5972}
6073
6174func TestDevicesSetDeny (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments