summaryrefslogtreecommitdiff
path: root/pkg/spec/spec_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/spec/spec_test.go')
-rw-r--r--pkg/spec/spec_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/spec/spec_test.go b/pkg/spec/spec_test.go
index c037bf69e..b7c9c9c0d 100644
--- a/pkg/spec/spec_test.go
+++ b/pkg/spec/spec_test.go
@@ -8,22 +8,22 @@ import (
"github.com/stretchr/testify/assert"
)
-func TestCreateConfig_GetVolumeMounts(t *testing.T) {
+func TestGetVolumeMountsOneVolume(t *testing.T) {
data := spec.Mount{
Destination: "/foobar",
Type: "bind",
- Source: "foobar",
+ Source: "/foobar",
Options: []string{"ro", "rbind", "rprivate"},
}
config := CreateConfig{
- Volumes: []string{"foobar:/foobar:ro"},
+ Volumes: []string{"/foobar:/foobar:ro"},
}
- specMount, err := config.GetVolumeMounts([]spec.Mount{})
+ specMount, _, err := config.getVolumeMounts()
assert.NoError(t, err)
- assert.True(t, reflect.DeepEqual(data, specMount[0]))
+ assert.True(t, reflect.DeepEqual(data, specMount[data.Destination]))
}
-func TestCreateConfig_GetTmpfsMounts(t *testing.T) {
+func TestGetTmpfsMounts(t *testing.T) {
data := spec.Mount{
Destination: "/homer",
Type: "tmpfs",
@@ -33,7 +33,7 @@ func TestCreateConfig_GetTmpfsMounts(t *testing.T) {
config := CreateConfig{
Tmpfs: []string{"/homer:rw,size=787448k,mode=1777"},
}
- tmpfsMount := config.GetTmpfsMounts()
- assert.True(t, reflect.DeepEqual(data, tmpfsMount[0]))
-
+ tmpfsMount, err := config.getTmpfsMounts()
+ assert.NoError(t, err)
+ assert.True(t, reflect.DeepEqual(data, tmpfsMount[data.Destination]))
}