|
1 | 1 | package featuresupport |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "bytes" |
4 | 5 | "fmt" |
5 | 6 | "testing" |
6 | 7 |
|
| 8 | + "github.com/go-openapi/strfmt" |
7 | 9 | "github.com/go-openapi/swag" |
8 | 10 | . "github.com/onsi/ginkgo" |
9 | 11 | . "github.com/onsi/ginkgo/extensions/table" |
@@ -457,6 +459,29 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() { |
457 | 459 | params := models.V2ClusterUpdateParams{UserManagedNetworking: swag.Bool(false)} |
458 | 460 | Expect(ValidateIncompatibleFeatures(log, models.ClusterCPUArchitectureS390x, &cluster, nil, ¶ms)).To(Not(BeNil())) |
459 | 461 | }) |
| 462 | + It("Ignore validation on AddHostCluster", func() { |
| 463 | + logBuffer := bytes.Buffer{} |
| 464 | + testLogger := logrus.New() |
| 465 | + testLogger.SetOutput(&logBuffer) |
| 466 | + |
| 467 | + clusterID := strfmt.UUID("e679ea3f-3b85-40e0-8dc9-82fd6945d9b2") |
| 468 | + cluster := common.Cluster{Cluster: models.Cluster{ |
| 469 | + ID: &clusterID, |
| 470 | + OpenshiftVersion: "4.19", |
| 471 | + Kind: swag.String(models.ClusterKindAddHostsCluster), |
| 472 | + CPUArchitecture: models.ClusterCPUArchitectureS390x, |
| 473 | + ControlPlaneCount: common.MinMasterHostsNeededForInstallationInHaMode, |
| 474 | + Platform: &models.Platform{Type: common.PlatformTypePtr(models.PlatformTypeNone)}, |
| 475 | + }} |
| 476 | + |
| 477 | + infraEnv := models.InfraEnv{ |
| 478 | + ClusterID: *cluster.ID, |
| 479 | + CPUArchitecture: models.ClusterCPUArchitectureS390x, |
| 480 | + } |
| 481 | + |
| 482 | + Expect(ValidateActiveFeatures(logrus.NewEntry(testLogger), &cluster, &infraEnv, nil)).To(BeNil()) |
| 483 | + Expect(logBuffer.String()).To(ContainSubstring("skipping feature support validation:")) |
| 484 | + }) |
460 | 485 | It("Update s390x cluster", func() { |
461 | 486 | cluster := common.Cluster{Cluster: models.Cluster{ |
462 | 487 | OpenshiftVersion: "4.13", |
@@ -866,6 +891,30 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() { |
866 | 891 | }) |
867 | 892 |
|
868 | 893 | Context("Test validate active features", func() { |
| 894 | + It("Ignore validation on AddHostCluster", func() { |
| 895 | + logBuffer := bytes.Buffer{} |
| 896 | + testLogger := logrus.New() |
| 897 | + testLogger.SetOutput(&logBuffer) |
| 898 | + |
| 899 | + clusterID := strfmt.UUID("e679ea3f-3b85-40e0-8dc9-82fd6945d9b2") |
| 900 | + cluster := common.Cluster{Cluster: models.Cluster{ |
| 901 | + ID: &clusterID, |
| 902 | + OpenshiftVersion: "4.19", |
| 903 | + Kind: swag.String(models.ClusterKindAddHostsCluster), |
| 904 | + CPUArchitecture: models.ClusterCPUArchitectureS390x, |
| 905 | + ControlPlaneCount: common.MinMasterHostsNeededForInstallationInHaMode, |
| 906 | + Platform: &models.Platform{Type: common.PlatformTypePtr(models.PlatformTypeNone)}, |
| 907 | + }} |
| 908 | + |
| 909 | + infraEnv := models.InfraEnv{ |
| 910 | + ClusterID: *cluster.ID, |
| 911 | + CPUArchitecture: models.ClusterCPUArchitectureS390x, |
| 912 | + } |
| 913 | + |
| 914 | + Expect(ValidateIncompatibleFeatures(logrus.NewEntry(testLogger), models.ClusterCPUArchitectureS390x, &cluster, &infraEnv, nil)).To(BeNil()) |
| 915 | + Expect(logBuffer.String()).To(ContainSubstring("skipping feature support validation:")) |
| 916 | + }) |
| 917 | + |
869 | 918 | DescribeTable( |
870 | 919 | "Valid VipDhcpAllocation and OpenShift version", |
871 | 920 | func(openshiftVersion string) { |
|
0 commit comments