summaryrefslogtreecommitdiff
path: root/runconfig/config_test.go
diff options
context:
space:
mode:
authorMichael Crosby <michael@crosbymichael.com>2014-04-08 09:26:09 +0000
committerMichael Crosby <michael@crosbymichael.com>2014-04-08 21:45:06 +0000
commitaf9746412b6070063f105ae97eba1f8fbd56bd22 (patch)
tree3779b34c71455528928a2aafaab025a3339d6318 /runconfig/config_test.go
parenta10c17ad11dbe7da389d9bb2185e26ed56cd2204 (diff)
downloaddocker-af9746412b6070063f105ae97eba1f8fbd56bd22.tar.gz
Move volumesfrom to hostconfig
This also migrates the volumes from integration tests into the new cli integration test framework. Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Diffstat (limited to 'runconfig/config_test.go')
-rw-r--r--runconfig/config_test.go41
1 files changed, 12 insertions, 29 deletions
diff --git a/runconfig/config_test.go b/runconfig/config_test.go
index d5ab75b3b9..f71528ff8e 100644
--- a/runconfig/config_test.go
+++ b/runconfig/config_test.go
@@ -163,37 +163,25 @@ func TestCompare(t *testing.T) {
volumes1 := make(map[string]struct{})
volumes1["/test1"] = struct{}{}
config1 := Config{
- PortSpecs: []string{"1111:1111", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "11111111",
- Volumes: volumes1,
+ PortSpecs: []string{"1111:1111", "2222:2222"},
+ Env: []string{"VAR1=1", "VAR2=2"},
+ Volumes: volumes1,
}
config3 := Config{
- PortSpecs: []string{"0000:0000", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "11111111",
- Volumes: volumes1,
- }
- config4 := Config{
- PortSpecs: []string{"0000:0000", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "22222222",
- Volumes: volumes1,
+ PortSpecs: []string{"0000:0000", "2222:2222"},
+ Env: []string{"VAR1=1", "VAR2=2"},
+ Volumes: volumes1,
}
volumes2 := make(map[string]struct{})
volumes2["/test2"] = struct{}{}
config5 := Config{
- PortSpecs: []string{"0000:0000", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "11111111",
- Volumes: volumes2,
+ PortSpecs: []string{"0000:0000", "2222:2222"},
+ Env: []string{"VAR1=1", "VAR2=2"},
+ Volumes: volumes2,
}
if Compare(&config1, &config3) {
t.Fatalf("Compare should return false, PortSpecs are different")
}
- if Compare(&config1, &config4) {
- t.Fatalf("Compare should return false, VolumesFrom are different")
- }
if Compare(&config1, &config5) {
t.Fatalf("Compare should return false, Volumes are different")
}
@@ -207,10 +195,9 @@ func TestMerge(t *testing.T) {
volumesImage["/test1"] = struct{}{}
volumesImage["/test2"] = struct{}{}
configImage := &Config{
- PortSpecs: []string{"1111:1111", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "1111",
- Volumes: volumesImage,
+ PortSpecs: []string{"1111:1111", "2222:2222"},
+ Env: []string{"VAR1=1", "VAR2=2"},
+ Volumes: volumesImage,
}
volumesUser := make(map[string]struct{})
@@ -251,10 +238,6 @@ func TestMerge(t *testing.T) {
}
}
- if configUser.VolumesFrom != "1111" {
- t.Fatalf("Expected VolumesFrom to be 1111, found %s", configUser.VolumesFrom)
- }
-
ports, _, err := nat.ParsePortSpecs([]string{"0000"})
if err != nil {
t.Error(err)