Skip to content

Commit 0791abe

Browse files
author
AnnaZivkovic
committed
CORS-2950: Change tests to work with newly deprecated field OpenShiftSDN
1 parent 611e16a commit 0791abe

File tree

2 files changed

+11
-61
lines changed

2 files changed

+11
-61
lines changed

pkg/asset/agent/installconfig_test.go

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ networking:
5454
clusterNetwork:
5555
- cidr: 10.128.0.0/14
5656
hostPrefix: 23
57-
networkType: OpenShiftSDN
57+
networkType: OVNKubernetes
5858
machineNetwork:
5959
- cidr: 192.168.122.0/23
6060
serviceNetwork:
@@ -269,34 +269,6 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
269269
expectedFound: false,
270270
expectedError: "invalid install-config configuration: Compute.Replicas: Required value: Total number of Compute.Replicas must be 0 when ControlPlane.Replicas is 1 for platform none or external. Found 3",
271271
},
272-
{
273-
name: "invalid networkType for SNO cluster",
274-
data: `
275-
apiVersion: v1
276-
metadata:
277-
name: test-cluster
278-
baseDomain: test-domain
279-
networking:
280-
networkType: OpenShiftSDN
281-
compute:
282-
- architecture: amd64
283-
hyperthreading: Enabled
284-
name: worker
285-
platform: {}
286-
replicas: 0
287-
controlPlane:
288-
architecture: amd64
289-
hyperthreading: Enabled
290-
name: master
291-
platform: {}
292-
replicas: 1
293-
platform:
294-
none : {}
295-
pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
296-
`,
297-
expectedFound: false,
298-
expectedError: "invalid install-config configuration: Networking.NetworkType: Invalid value: \"OpenShiftSDN\": Only OVNKubernetes network type is allowed for Single Node OpenShift (SNO) cluster",
299-
},
300272
{
301273
name: "invalid platform for SNO cluster",
302274
data: `
@@ -305,7 +277,7 @@ metadata:
305277
name: test-cluster
306278
baseDomain: test-domain
307279
networking:
308-
networkType: OpenShiftSDN
280+
networkType: OVNKubernetes
309281
compute:
310282
- architecture: amd64
311283
hyperthreading: Enabled
@@ -637,7 +609,7 @@ networking:
637609
clusterNetwork:
638610
- cidr: 10.128.0.0/14
639611
hostPrefix: 23
640-
networkType: OpenShiftSDN
612+
networkType: OVNKubernetes
641613
machineNetwork:
642614
- cidr: 192.168.122.0/23
643615
serviceNetwork:
@@ -700,7 +672,7 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
700672
MachineNetwork: []types.MachineNetworkEntry{
701673
{CIDR: *ipnet.MustParseCIDR("192.168.122.0/23")},
702674
},
703-
NetworkType: "OpenShiftSDN",
675+
NetworkType: "OVNKubernetes",
704676
ServiceNetwork: []ipnet.IPNet{*ipnet.MustParseCIDR("172.30.0.0/16")},
705677
ClusterNetwork: []types.ClusterNetworkEntry{
706678
{
@@ -798,7 +770,7 @@ networking:
798770
clusterNetwork:
799771
- cidr: 10.128.0.0/14
800772
hostPrefix: 23
801-
networkType: OpenShiftSDN
773+
networkType: OVNKubernetes
802774
machineNetwork:
803775
- cidr: 192.168.122.0/23
804776
serviceNetwork:
@@ -843,7 +815,7 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
843815
MachineNetwork: []types.MachineNetworkEntry{
844816
{CIDR: *ipnet.MustParseCIDR("192.168.122.0/23")},
845817
},
846-
NetworkType: "OpenShiftSDN",
818+
NetworkType: "OVNKubernetes",
847819
ServiceNetwork: []ipnet.IPNet{*ipnet.MustParseCIDR("172.30.0.0/16")},
848820
ClusterNetwork: []types.ClusterNetworkEntry{
849821
{
@@ -916,7 +888,7 @@ networking:
916888
clusterNetwork:
917889
- cidr: 10.128.0.0/14
918890
hostPrefix: 23
919-
networkType: OpenShiftSDN
891+
networkType: OVNKubernetes
920892
machineNetwork:
921893
- cidr: 192.168.122.0/23
922894
serviceNetwork:
@@ -952,7 +924,7 @@ networking:
952924
clusterNetwork:
953925
- cidr: 10.128.0.0/14
954926
hostPrefix: 23
955-
networkType: OpenShiftSDN
927+
networkType: OVNKubernetes
956928
machineNetwork:
957929
- cidr: 192.168.122.0/23
958930
serviceNetwork:

pkg/types/validation/installconfig_test.go

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ func TestValidateInstallConfig(t *testing.T) {
572572
c.Networking.ClusterNetworkMTU = 8000
573573
return c
574574
}(),
575-
expectedError: `networking\.clusterNetworkMTU: Invalid value: 8000: cluster network MTU is not valid with network plugin OpenShiftSDN$`,
575+
expectedError: `networking.networkType: Invalid value: "OpenShiftSDN": networkType OpenShiftSDN is deprecated, please use OVNKubernetes, networking.clusterNetworkMTU: Invalid value: 8000: cluster network MTU is not valid with network plugin OpenShiftSDN`,
576576
},
577577
{
578578
name: "missing control plane",
@@ -1363,28 +1363,6 @@ func TestValidateInstallConfig(t *testing.T) {
13631363
}(),
13641364
expectedError: `Invalid value: "IPv6": single-stack IPv6 is not supported for this platform`,
13651365
},
1366-
{
1367-
name: "invalid dual-stack configuration, bad plugin",
1368-
installConfig: func() *types.InstallConfig {
1369-
c := validInstallConfig()
1370-
c.Platform = types.Platform{None: &none.Platform{}}
1371-
c.Networking = validDualStackNetworkingConfig()
1372-
c.Networking.NetworkType = "OpenShiftSDN"
1373-
return c
1374-
}(),
1375-
expectedError: `IPv6 is not supported for this networking plugin`,
1376-
},
1377-
{
1378-
name: "invalid single-stack IPv6 configuration, bad plugin",
1379-
installConfig: func() *types.InstallConfig {
1380-
c := validInstallConfig()
1381-
c.Platform = types.Platform{None: &none.Platform{}}
1382-
c.Networking = validIPv6NetworkingConfig()
1383-
c.Networking.NetworkType = "OpenShiftSDN"
1384-
return c
1385-
}(),
1386-
expectedError: `IPv6 is not supported for this networking plugin`,
1387-
},
13881366
{
13891367
name: "invalid dual-stack configuration, machine has no IPv6",
13901368
installConfig: func() *types.InstallConfig {
@@ -1727,7 +1705,7 @@ func TestValidateInstallConfig(t *testing.T) {
17271705

17281706
return c
17291707
}(),
1730-
expectedError: "platform.baremetal.apiVIPs: Invalid value: \"ffd0::1\": IPv6 is not supported on OpenShiftSDN",
1708+
expectedError: "[networking.networkType: Invalid value: \"OpenShiftSDN\": networkType OpenShiftSDN is deprecated, please use OVNKubernetes, platform.baremetal.ingressVIPs: Invalid value: \"10.0.0.4\": IP expected to be in one of the machine networks: ffd0::/48]",
17311709
},
17321710
{
17331711
name: "ingressvips_v6_on_openshiftsdn",
@@ -1743,7 +1721,7 @@ func TestValidateInstallConfig(t *testing.T) {
17431721

17441722
return c
17451723
}(),
1746-
expectedError: "platform.baremetal.ingressVIPs: Invalid value: \"ffd0::1\": IPv6 is not supported on OpenShiftSDN",
1724+
expectedError: "[networking.networkType: Invalid value: \"OpenShiftSDN\": networkType OpenShiftSDN is deprecated, please use OVNKubernetes, platform.baremetal.apiVIPs: Invalid value: \"10.0.0.5\": IP expected to be in one of the machine networks: ffd0::/48]",
17471725
},
17481726
{
17491727
name: "too_many_apivips",

0 commit comments

Comments
 (0)