Skip to content

Commit

Permalink
add docker mount option test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ak1ra24 committed Jan 19, 2020
1 parent d751ffe commit aa261df
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions internal/pkg/shell/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,27 @@ func TestCreateNode(t *testing.T) {
},
want: []string{"unknown nodetype hoge"},
},
{
name: "create node with mounts",
args: args{
node: Node{
Name: "T1",
Image: "slankdev/frr",
Interfaces: []Interface{
Interface{
Name: "net0",
Type: "direct",
Args: "T2#net0",
},
},
Mounts: []string{
"`pwd`:/mnt/test",
"/usr/share/vim:/mnt/vim",
},
},
},
want: []string{"docker run -td --hostname T1 --net none --name T1 --rm --privileged -v `pwd`:/mnt/test -v /usr/share/vim:/mnt/vim slankdev/frr"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit aa261df

Please sign in to comment.