From aa261df9b1f4304d50d6490b921762590e7c1023 Mon Sep 17 00:00:00 2001 From: ak1ra24 Date: Sun, 19 Jan 2020 22:10:07 +0900 Subject: [PATCH] add docker mount option test code --- internal/pkg/shell/shell_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/internal/pkg/shell/shell_test.go b/internal/pkg/shell/shell_test.go index 3b0c768..4f8de01 100644 --- a/internal/pkg/shell/shell_test.go +++ b/internal/pkg/shell/shell_test.go @@ -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) {