forked from rootless-containers/runrootless
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathruncreate_test.go
More file actions
37 lines (33 loc) · 945 Bytes
/
runcreate_test.go
File metadata and controls
37 lines (33 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestTransformRunCreate(t *testing.T) {
newBundle := "/some/bundle/runrootless"
cases := []struct {
osArgs []string
expected []string
}{
{
osArgs: []string{"runc", "--root", "/foo", "run", "-b", "/bar", "baz"},
expected: []string{"--root", "/foo", "run", "baz", "--bundle", newBundle},
},
{
osArgs: []string{"runc", "--root", "/foo", "run", "-b=/bar", "baz"},
expected: []string{"--root", "/foo", "run", "baz", "--bundle", newBundle},
},
{
osArgs: []string{"runc", "--root", "/foo", "run", "baz"},
expected: []string{"--root", "/foo", "run", "baz", "--bundle", newBundle},
},
{
osArgs: []string{"runc", "--root", "/foo", "list"},
expected: []string{"--root", "/foo", "list"},
},
}
for _, c := range cases {
actual := _transformRunCreate(c.osArgs, newBundle)
require.Equal(t, c.expected, actual)
}
}