@@ -67,8 +67,6 @@ func TestContainerInspectContainsMounts(t *testing.T) {
67
67
testutil .NginxAlpineImage ).AssertOK ()
68
68
69
69
inspect := base .InspectContainer (testContainer )
70
- t .Logf ("inspect in TestContainerInspectContainsMounts: %+v" , inspect )
71
- t .Logf ("inspect.Mounts in TestContainerInspectContainsMounts: %+v" , inspect .Mounts )
72
70
// convert array to map to get by key of Destination
73
71
actual := make (map [string ]dockercompat.MountPoint )
74
72
for i := range inspect .Mounts {
@@ -119,19 +117,6 @@ func TestContainerInspectContainsMounts(t *testing.T) {
119
117
RW : true ,
120
118
},
121
119
},
122
-
123
- // Tmpfs
124
- {
125
- dest : "/app1" ,
126
- mountPoint : dockercompat.MountPoint {
127
- Type : "tmpfs" ,
128
- Name : "" ,
129
- Source : "tmpfs" ,
130
- Destination : "/app1" ,
131
- Mode : "noexec,nosuid,nodev,size=64m" ,
132
- RW : true ,
133
- },
134
- },
135
120
}
136
121
137
122
for i := range expected {
@@ -431,3 +416,52 @@ func TestContainerInspectHostConfigPIDDefaults(t *testing.T) {
431
416
// assert.DeepEqual(t, expectedSysctls, inspect.HostConfig.Sysctls)
432
417
// expectedDevices := []string{"/dev/null:/dev/null"}
433
418
// assert.DeepEqual(t, expectedDevices, inspect.HostConfig.Devices)
419
+
420
+ // func TestContainerInspectHostConfigAdvanced(t *testing.T) {
421
+ // testContainer := testutil.Identifier(t)
422
+
423
+ // base := testutil.NewBase(t)
424
+ // defer base.Cmd("rm", "-f", testContainer).Run()
425
+
426
+ // // Run a container with various advanced HostConfig options
427
+ // base.Cmd("run", "-d", "--name", testContainer,
428
+ // "--read-only",
429
+ // "--uts", "host",
430
+ // "--shm-size", "256m",
431
+ // "--runtime", "io.containerd.runtime.v1.linux",
432
+ // "--sysctl", "net.core.somaxconn=1024",
433
+ // "--device", "/dev/null:/dev/null",
434
+ // testutil.AlpineImage, "sleep", "infinity").AssertOK()
435
+
436
+ // inspect := base.InspectContainer(testContainer)
437
+
438
+ // // Check ReadonlyRootfs
439
+ // assert.Equal(t, true, inspect.HostConfig.ReadonlyRootfs)
440
+
441
+ // // Check UTSMode
442
+ // assert.Equal(t, "host", inspect.HostConfig.UTSMode)
443
+
444
+ // // Check ShmSize
445
+ // assert.Equal(t, int64(268435456), inspect.HostConfig.ShmSize)
446
+
447
+ // // Check Runtime
448
+ // assert.Equal(t, "io.containerd.runtime.v1.linux", inspect.HostConfig.Runtime)
449
+
450
+ // // Check Sysctls
451
+ // expectedSysctls := map[string]string{
452
+ // "net.core.somaxconn": "1024",
453
+ // }
454
+ // assert.DeepEqual(t, expectedSysctls, inspect.HostConfig.Sysctls)
455
+
456
+ // // Check Devices
457
+ // expectedDevices := []string{"/dev/null:/dev/null"}
458
+ // assert.DeepEqual(t, expectedDevices, inspect.HostConfig.Devices)
459
+
460
+ // // Log the entire HostConfig for debugging
461
+ // hostConfigJSON, err := json.MarshalIndent(inspect.HostConfig, "", " ")
462
+ // if err != nil {
463
+ // t.Errorf("Failed to marshal HostConfig: %v", err)
464
+ // } else {
465
+ // t.Logf("HostConfig in TestContainerInspectHostConfigAdvanced:\n%s", string(hostConfigJSON))
466
+ // }
467
+ // }
0 commit comments