Skip to content

Commit 94f1f84

Browse files
author
Dongsu Park
committed
validation: squash rootfs propagation tests into a single file
To make the test code simpler, squash tests that are relevant to rootfs propagation into a single file, linux_rootfs_propagation.go. Also print TAP output for rootfs_propagation tests. Signed-off-by: Dongsu Park <[email protected]>
1 parent e222e66 commit 94f1f84

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package main
2+
3+
import (
4+
"github.com/mndrix/tap-go"
5+
"github.com/opencontainers/runtime-tools/validation/util"
6+
)
7+
8+
func testLinuxRootPropagation(propMode string) error {
9+
g, err := util.GetDefaultGenerator()
10+
if err != nil {
11+
util.Fatal(err)
12+
}
13+
g.SetupPrivileged(true)
14+
g.SetLinuxRootPropagation(propMode)
15+
return util.RuntimeInsideValidate(g, nil)
16+
}
17+
18+
func main() {
19+
t := tap.New()
20+
t.Header(0)
21+
defer t.AutoPlan()
22+
23+
cases := []string{
24+
"shared",
25+
"unbindable",
26+
}
27+
28+
for _, c := range cases {
29+
if err := testLinuxRootPropagation(c); err != nil {
30+
t.Fail(err.Error())
31+
}
32+
}
33+
}

validation/linux_rootfs_propagation_shared.go

-18
This file was deleted.

validation/linux_rootfs_propagation_unbindable.go

-18
This file was deleted.

0 commit comments

Comments
 (0)