Skip to content

Commit 73c0807

Browse files
author
Zhou Hao
committed
runtimetest: add logrus.Debugf
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
1 parent eead136 commit 73c0807

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

cmd/runtimetest/main.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ func validateGeneralProcess(spec *rspec.Spec) error {
107107
}
108108

109109
func validateLinuxProcess(spec *rspec.Spec) error {
110+
logrus.Debugf("validating linux process")
111+
110112
if spec.Process == nil {
111113
return nil
112114
}
@@ -168,6 +170,8 @@ func validateLinuxProcess(spec *rspec.Spec) error {
168170
}
169171

170172
func validateCapabilities(spec *rspec.Spec) error {
173+
logrus.Debugf("validating capabilities")
174+
171175
if spec.Process == nil || spec.Process.Capabilities == nil {
172176
return nil
173177
}
@@ -256,6 +260,8 @@ func validateCapabilities(spec *rspec.Spec) error {
256260
}
257261

258262
func validateHostname(spec *rspec.Spec) error {
263+
logrus.Debugf("validating hostname")
264+
259265
hostname, err := os.Hostname()
260266
if err != nil {
261267
return err
@@ -267,6 +273,8 @@ func validateHostname(spec *rspec.Spec) error {
267273
}
268274

269275
func validateRlimits(spec *rspec.Spec) error {
276+
logrus.Debugf("validating rlimits")
277+
270278
if runtime.GOOS == "windows" {
271279
return nil
272280
}
@@ -297,6 +305,8 @@ func validateRlimits(spec *rspec.Spec) error {
297305
}
298306

299307
func validateSysctls(spec *rspec.Spec) error {
308+
logrus.Debugf("validating sysctls")
309+
300310
if spec.Linux == nil {
301311
return nil
302312
}
@@ -327,6 +337,8 @@ func testWriteAccess(path string) error {
327337
}
328338

329339
func validateRootFS(spec *rspec.Spec) error {
340+
logrus.Debugf("validating root filesystem")
341+
330342
if spec.Root == nil {
331343
return nil
332344
}
@@ -364,6 +376,8 @@ func validateDefaultFS(spec *rspec.Spec) error {
364376
}
365377

366378
func validateLinuxDevices(spec *rspec.Spec) error {
379+
logrus.Debugf("validating linux devices")
380+
367381
if spec.Linux == nil {
368382
return nil
369383
}
@@ -421,6 +435,8 @@ func validateLinuxDevices(spec *rspec.Spec) error {
421435
}
422436

423437
func validateDefaultSymlinks(spec *rspec.Spec) error {
438+
logrus.Debugf("validating linux default symlinks")
439+
424440
for symlink, dest := range defaultSymlinks {
425441
fi, err := os.Lstat(symlink)
426442
if err != nil {
@@ -447,6 +463,8 @@ func validateDefaultSymlinks(spec *rspec.Spec) error {
447463
}
448464

449465
func validateDefaultDevices(spec *rspec.Spec) error {
466+
logrus.Debugf("validating linux default devices")
467+
450468
if spec.Process == nil {
451469
return nil
452470
}
@@ -475,6 +493,8 @@ func validateDefaultDevices(spec *rspec.Spec) error {
475493
}
476494

477495
func validateMaskedPaths(spec *rspec.Spec) error {
496+
logrus.Debugf("validating masked paths")
497+
478498
if spec.Linux == nil {
479499
return nil
480500
}
@@ -494,6 +514,8 @@ func validateMaskedPaths(spec *rspec.Spec) error {
494514
}
495515

496516
func validateROPaths(spec *rspec.Spec) error {
517+
logrus.Debugf("validating readonly paths")
518+
497519
if spec.Linux == nil {
498520
return nil
499521
}
@@ -508,6 +530,8 @@ func validateROPaths(spec *rspec.Spec) error {
508530
}
509531

510532
func validateOOMScoreAdj(spec *rspec.Spec) error {
533+
logrus.Debugf("validating oomScoreAdj")
534+
511535
if spec.Process != nil && spec.Process.OOMScoreAdj != nil {
512536
expected := *spec.Process.OOMScoreAdj
513537
f, err := os.Open("/proc/self/oom_score_adj")
@@ -597,13 +621,17 @@ func validateIDMappings(mappings []rspec.LinuxIDMapping, path string, property s
597621
}
598622

599623
func validateUIDMappings(spec *rspec.Spec) error {
624+
logrus.Debugf("validating UIDMappings")
625+
600626
if spec.Linux == nil {
601627
return nil
602628
}
603629
return validateIDMappings(spec.Linux.UIDMappings, "/proc/self/uid_map", "linux.uidMappings")
604630
}
605631

606632
func validateGIDMappings(spec *rspec.Spec) error {
633+
logrus.Debugf("validating GIDMappings")
634+
607635
if spec.Linux == nil {
608636
return nil
609637
}
@@ -633,6 +661,8 @@ func mountMatch(configMount rspec.Mount, sysMount *mount.Info) error {
633661
}
634662

635663
func validateMounts(spec *rspec.Spec) error {
664+
logrus.Debugf("validating mounts")
665+
636666
if runtime.GOOS == "windows" {
637667
logrus.Warnf("mounts validation not yet implemented for OS %q", runtime.GOOS)
638668
return nil

0 commit comments

Comments
 (0)