summaryrefslogtreecommitdiff
path: root/runconfig/config_test.go
diff options
context:
space:
mode:
authorMichael Crosby <michael@crosbymichael.com>2014-04-07 19:12:22 -0700
committerMichael Crosby <michael@crosbymichael.com>2014-04-07 19:12:22 -0700
commit919dbbe44df0722ca35538223a9c89e71856ec88 (patch)
tree8855b47a9fd66be7212d65adc7719423505deb9c /runconfig/config_test.go
parent02c5a87b402cb1b575d84a86c118a1efcb6abd7f (diff)
downloaddocker-919dbbe44df0722ca35538223a9c89e71856ec88.tar.gz
Move DNS options to hostconfig
The local resolver warning needed to be moved at daemon start because it was only show for the first container started anyways before having a default value set. 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, 0 insertions, 41 deletions
diff --git a/runconfig/config_test.go b/runconfig/config_test.go
index 784341b08c..d5ab75b3b9 100644
--- a/runconfig/config_test.go
+++ b/runconfig/config_test.go
@@ -163,32 +163,18 @@ func TestCompare(t *testing.T) {
volumes1 := make(map[string]struct{})
volumes1["/test1"] = struct{}{}
config1 := Config{
- Dns: []string{"1.1.1.1", "2.2.2.2"},
- DnsSearch: []string{"foo", "bar"},
- PortSpecs: []string{"1111:1111", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "11111111",
- Volumes: volumes1,
- }
- config2 := Config{
- Dns: []string{"0.0.0.0", "2.2.2.2"},
- DnsSearch: []string{"foo", "bar"},
PortSpecs: []string{"1111:1111", "2222:2222"},
Env: []string{"VAR1=1", "VAR2=2"},
VolumesFrom: "11111111",
Volumes: volumes1,
}
config3 := Config{
- Dns: []string{"1.1.1.1", "2.2.2.2"},
- DnsSearch: []string{"foo", "bar"},
PortSpecs: []string{"0000:0000", "2222:2222"},
Env: []string{"VAR1=1", "VAR2=2"},
VolumesFrom: "11111111",
Volumes: volumes1,
}
config4 := Config{
- Dns: []string{"1.1.1.1", "2.2.2.2"},
- DnsSearch: []string{"foo", "bar"},
PortSpecs: []string{"0000:0000", "2222:2222"},
Env: []string{"VAR1=1", "VAR2=2"},
VolumesFrom: "22222222",
@@ -197,24 +183,11 @@ func TestCompare(t *testing.T) {
volumes2 := make(map[string]struct{})
volumes2["/test2"] = struct{}{}
config5 := Config{
- Dns: []string{"1.1.1.1", "2.2.2.2"},
- DnsSearch: []string{"foo", "bar"},
PortSpecs: []string{"0000:0000", "2222:2222"},
Env: []string{"VAR1=1", "VAR2=2"},
VolumesFrom: "11111111",
Volumes: volumes2,
}
- config6 := Config{
- Dns: []string{"1.1.1.1", "2.2.2.2"},
- DnsSearch: []string{"foos", "bars"},
- PortSpecs: []string{"1111:1111", "2222:2222"},
- Env: []string{"VAR1=1", "VAR2=2"},
- VolumesFrom: "11111111",
- Volumes: volumes1,
- }
- if Compare(&config1, &config2) {
- t.Fatalf("Compare should return false, Dns are different")
- }
if Compare(&config1, &config3) {
t.Fatalf("Compare should return false, PortSpecs are different")
}
@@ -224,9 +197,6 @@ func TestCompare(t *testing.T) {
if Compare(&config1, &config5) {
t.Fatalf("Compare should return false, Volumes are different")
}
- if Compare(&config1, &config6) {
- t.Fatalf("Compare should return false, DnsSearch are different")
- }
if !Compare(&config1, &config1) {
t.Fatalf("Compare should return true")
}
@@ -237,7 +207,6 @@ func TestMerge(t *testing.T) {
volumesImage["/test1"] = struct{}{}
volumesImage["/test2"] = struct{}{}
configImage := &Config{
- Dns: []string{"1.1.1.1", "2.2.2.2"},
PortSpecs: []string{"1111:1111", "2222:2222"},
Env: []string{"VAR1=1", "VAR2=2"},
VolumesFrom: "1111",
@@ -247,7 +216,6 @@ func TestMerge(t *testing.T) {
volumesUser := make(map[string]struct{})
volumesUser["/test3"] = struct{}{}
configUser := &Config{
- Dns: []string{"2.2.2.2", "3.3.3.3"},
PortSpecs: []string{"3333:2222", "3333:3333"},
Env: []string{"VAR2=3", "VAR3=3"},
Volumes: volumesUser,
@@ -257,15 +225,6 @@ func TestMerge(t *testing.T) {
t.Error(err)
}
- if len(configUser.Dns) != 3 {
- t.Fatalf("Expected 3 dns, 1.1.1.1, 2.2.2.2 and 3.3.3.3, found %d", len(configUser.Dns))
- }
- for _, dns := range configUser.Dns {
- if dns != "1.1.1.1" && dns != "2.2.2.2" && dns != "3.3.3.3" {
- t.Fatalf("Expected 1.1.1.1 or 2.2.2.2 or 3.3.3.3, found %s", dns)
- }
- }
-
if len(configUser.ExposedPorts) != 3 {
t.Fatalf("Expected 3 ExposedPorts, 1111, 2222 and 3333, found %d", len(configUser.ExposedPorts))
}