Skip to content

Commit 990f9c0

Browse files
committed
unit test updates
1 parent 3422ec6 commit 990f9c0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pkg/asset/manifests/infrastructure_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ func TestGenerateInfrastructure(t *testing.T) {
136136
infraBuild.withVSphereMachineNetworkEntry(configv1.CIDR(ipv4IngressVIP+"/32")),
137137
infraBuild.withVSphereAPIVIP(ipv4APIVIP),
138138
infraBuild.withVSphereIngressVIP(ipv4IngressVIP),
139+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(defaultMachineNetwork)),
140+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4APIVIP+"/32")),
141+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4IngressVIP+"/32")),
139142
),
140143
expectedFilesGenerated: 1,
141144
}, {
@@ -161,6 +164,13 @@ func TestGenerateInfrastructure(t *testing.T) {
161164
infraBuild.withVSphereIngressVIP(ipv4IngressVIP),
162165
infraBuild.withVSphereAPIVIP(ipv6APIVIP),
163166
infraBuild.withVSphereIngressVIP(ipv6IngressVIP),
167+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(defaultMachineNetwork)),
168+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv6MachineNetwork)),
169+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4APIVIP+"/32")),
170+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv6APIVIP+"/128")),
171+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4IngressVIP+"/32")),
172+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv6IngressVIP+"/128")),
173+
164174
),
165175
expectedFilesGenerated: 1,
166176
},
@@ -180,6 +190,9 @@ func TestGenerateInfrastructure(t *testing.T) {
180190
infraBuild.withVSphereMachineNetworkEntry(configv1.CIDR(ipv4IngressVIP+"/32")),
181191
infraBuild.withVSphereAPIVIP(ipv4APIVIP),
182192
infraBuild.withVSphereIngressVIP(ipv4IngressVIP),
193+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(defaultMachineNetwork)),
194+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4APIVIP+"/32")),
195+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4IngressVIP+"/32")),
183196
),
184197
expectedFilesGenerated: 1,
185198
},
@@ -197,6 +210,8 @@ func TestGenerateInfrastructure(t *testing.T) {
197210
infraBuild.withVSphereMachineNetworkEntry(configv1.CIDR(ipv4APIVIP+"/32")),
198211
infraBuild.withVSphereAPIVIP(ipv4APIVIP),
199212
infraBuild.withVSphereIngressVIP(ipv4APIVIP),
213+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(defaultMachineNetwork)),
214+
infraBuild.withVSphereNodeNetworkingEntry(configv1.CIDR(ipv4APIVIP+"/32")),
200215
),
201216
expectedFilesGenerated: 1,
202217
},
@@ -551,6 +566,15 @@ func (b infraBuildNamespace) withVSphereMachineNetworkEntry(cidr configv1.CIDR)
551566
}
552567
}
553568

569+
func (b infraBuildNamespace) withVSphereNodeNetworkingEntry(cidr configv1.CIDR) infraOption {
570+
return func(infra *configv1.Infrastructure) {
571+
b.withVSpherePlatformSpec()(infra)
572+
b.withVSpherePlatformStatus()(infra)
573+
infra.Spec.PlatformSpec.VSphere.NodeNetworking.External.NetworkSubnetCIDR = append(infra.Spec.PlatformSpec.VSphere.NodeNetworking.External.NetworkSubnetCIDR, string(cidr))
574+
infra.Spec.PlatformSpec.VSphere.NodeNetworking.Internal.NetworkSubnetCIDR = append(infra.Spec.PlatformSpec.VSphere.NodeNetworking.Internal.NetworkSubnetCIDR, string(cidr))
575+
}
576+
}
577+
554578
func (b infraBuildNamespace) withVSphereAPIVIP(vip string) infraOption {
555579
return func(infra *configv1.Infrastructure) {
556580
b.withVSpherePlatformSpec()(infra)

0 commit comments

Comments
 (0)