|
@@ -17,21 +17,21 @@ func TestConfigDefaults(t *testing.T) {
|
|
|
t.Errorf("Network mismatch: expected %s, got %s", expectedNet, cfg.Network)
|
|
|
}
|
|
|
|
|
|
- if cfg.FirstIP.String() != "10.3.0.0" {
|
|
|
- t.Errorf("FirstIP mismatch, expected 10.3.0.0, got %s", cfg.FirstIP)
|
|
|
+ if cfg.SubnetMin.String() != "10.3.1.0" {
|
|
|
+ t.Errorf("SubnetMin mismatch, expected 10.3.1.0, got %s", cfg.SubnetMin)
|
|
|
}
|
|
|
|
|
|
- if cfg.LastIP.String() != "10.3.255.0" {
|
|
|
- t.Errorf("LastIP mismatch, expected 10.3.255.0, got %s", cfg.LastIP)
|
|
|
+ if cfg.SubnetMax.String() != "10.3.255.0" {
|
|
|
+ t.Errorf("SubnetMax mismatch, expected 10.3.255.0, got %s", cfg.SubnetMax)
|
|
|
}
|
|
|
|
|
|
- if cfg.HostSubnet != 24 {
|
|
|
- t.Errorf("HostSubnet mismatch: expected 24, got %d", cfg.HostSubnet)
|
|
|
+ if cfg.SubnetLen != 24 {
|
|
|
+ t.Errorf("SubnetLen mismatch: expected 24, got %d", cfg.SubnetLen)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func TestConfigOverrides(t *testing.T) {
|
|
|
- s := `{ "Network": "10.3.0.0/16", "FirstIP": "10.3.5.0", "LastIP": "10.3.8.0", "HostSubnet": 28 }`
|
|
|
+ s := `{ "Network": "10.3.0.0/16", "SubnetMin": "10.3.5.0", "SubnetMax": "10.3.8.0", "SubnetLen": 28 }`
|
|
|
|
|
|
cfg, err := ParseConfig(s)
|
|
|
if err != nil {
|
|
@@ -43,15 +43,15 @@ func TestConfigOverrides(t *testing.T) {
|
|
|
t.Errorf("Network mismatch: expected %s, got %s", expectedNet, cfg.Network)
|
|
|
}
|
|
|
|
|
|
- if cfg.FirstIP.String() != "10.3.5.0" {
|
|
|
- t.Errorf("FirstIP mismatch: expected 10.3.5.0, got %s", cfg.FirstIP)
|
|
|
+ if cfg.SubnetMin.String() != "10.3.5.0" {
|
|
|
+ t.Errorf("SubnetMin mismatch: expected 10.3.5.0, got %s", cfg.SubnetMin)
|
|
|
}
|
|
|
|
|
|
- if cfg.LastIP.String() != "10.3.8.0" {
|
|
|
- t.Errorf("LastIP mismatch: expected 10.3.8.0, got %s", cfg.LastIP)
|
|
|
+ if cfg.SubnetMax.String() != "10.3.8.0" {
|
|
|
+ t.Errorf("SubnetMax mismatch: expected 10.3.8.0, got %s", cfg.SubnetMax)
|
|
|
}
|
|
|
|
|
|
- if cfg.HostSubnet != 28 {
|
|
|
- t.Errorf("HostSubnet mismatch: expected 28, got %d", cfg.HostSubnet)
|
|
|
+ if cfg.SubnetLen != 28 {
|
|
|
+ t.Errorf("SubnetLen mismatch: expected 28, got %d", cfg.SubnetLen)
|
|
|
}
|
|
|
}
|