Skip to content

Commit 49a0b5e

Browse files
committed
OCM-13483 | test: fix ids: 61138,70370,67419 and remove 55883
1 parent 24ddae0 commit 49a0b5e

File tree

4 files changed

+31
-199
lines changed

4 files changed

+31
-199
lines changed

tests/e2e/hcp_machine_pool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ var _ = Describe("HCP Machine Pool", labels.Feature.Machinepool, func() {
836836
"")
837837
Expect(err).ToNot(HaveOccurred())
838838
textData := rosaClient.Parser.TextData.Input(output).Parse().Tip()
839-
Expect(textData).To(ContainSubstring("WARN: There is already a pending upgrade"))
839+
Expect(textData).To(ContainSubstring("WARN: There is already a"))
840840
})
841841

842842
It("will validate root volume size - [id:66874]",

tests/e2e/test_rosacli_network_verifier.go

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ var _ = Describe("Network verifier",
207207
})
208208

209209
It("verify that network will be failed if it can't reach to cluster subnet via the rosa cli - [id:70370]",
210-
labels.Medium, labels.Runtime.Day2, labels.Runtime.Destructive,
210+
labels.Medium, labels.Runtime.Destructive,
211211
func() {
212212
By("Prepare a ready byo vpc ROSA cluster")
213213
isBYOVPC, err := clusterService.IsBYOVPCCluster(clusterID)
@@ -269,14 +269,38 @@ var _ = Describe("Network verifier",
269269
helper.AssertWaitPollNoErr(err, "Network verification result are not ready after 200")
270270

271271
By("The network verification result will be sync to cluster inflight check")
272-
clusterDetail, err = clusterService.DescribeClusterAndReflect(clusterID)
272+
err = wait.PollUntilContextTimeout(
273+
context.Background(),
274+
20*time.Second,
275+
300*time.Second,
276+
false,
277+
func(context.Context) (bool, error) {
278+
clusterDetail, err = clusterService.DescribeClusterAndReflect(clusterID)
279+
if !strings.Contains(clusterDetail.FailedInflightChecks,
280+
fmt.Sprintf("rosa verify network -c %s", clusterID)) {
281+
return false, err
282+
}
283+
return true, err
284+
})
273285
Expect(err).To(BeNil())
274-
Expect(clusterDetail.FailedInflightChecks).To(ContainSubstring(fmt.Sprintf("rosa verify network -c %s", clusterID)))
286+
275287
for _, s := range strings.Split(subnets, ",") {
276288
for _, p := range vpcClient.AllPrivateSubnetIDs() {
277289
if s == p {
278-
Expect(clusterDetail.FailedInflightChecks).To(ContainSubstring(fmt.Sprintf(
279-
"Invalid configurations on subnet '%s' have been identified", s)))
290+
err = wait.PollUntilContextTimeout(
291+
context.Background(),
292+
20*time.Second,
293+
300*time.Second,
294+
false,
295+
func(context.Context) (bool, error) {
296+
clusterDetail, err = clusterService.DescribeClusterAndReflect(clusterID)
297+
if !strings.Contains(clusterDetail.FailedInflightChecks,
298+
fmt.Sprintf("Invalid configurations on subnet '%s' have been identified", s)) {
299+
return false, err
300+
}
301+
return true, err
302+
})
303+
Expect(err).To(BeNil())
280304
}
281305
}
282306
}

tests/e2e/test_rosacli_node_pool.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ package e2e
22

33
import (
44
"bytes"
5-
"context"
65
"encoding/json"
76
"fmt"
87
"strconv"
98
"strings"
109
"time"
1110

12-
"k8s.io/apimachinery/pkg/util/wait"
1311
"k8s.io/utils/strings/slices"
1412

1513
"github.com/Masterminds/semver"
@@ -498,21 +496,7 @@ var _ = Describe("Edit nodepool",
498496
Expect(err).ToNot(HaveOccurred())
499497
Expect(np.Version).To(Equal(previousVersion))
500498

501-
By("Wait for NodePool replicas to be available")
502-
err = wait.PollUntilContextTimeout(
503-
context.Background(),
504-
30*time.Second,
505-
20*time.Minute,
506-
false,
507-
func(context.Context) (bool, error) {
508-
npDesc, err := machinePoolService.DescribeAndReflectNodePool(clusterID, nodePoolName)
509-
if err != nil {
510-
return false, err
511-
}
512-
return npDesc.CurrentReplicas == defaultNodePoolReplicas, nil
513-
})
514-
helper.AssertWaitPollNoErr(err, "Replicas are not ready after 600")
515-
499+
By("Create nodepool with different verions")
516500
nodePoolVersion, err := versionList.FindNearestBackwardMinorVersion(clusterVersion, 1, true)
517501
Expect(err).ToNot(HaveOccurred())
518502
if nodePoolVersion != nil {

tests/e2e/test_rosacli_upgrade.go

Lines changed: 0 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,179 +1346,3 @@ var _ = Describe("Create cluster upgrade policy validation", labels.Feature.Clus
13461346

13471347
})
13481348
})
1349-
var _ = Describe("Successful Upgrade Testing",
1350-
labels.Feature.Policy,
1351-
func() {
1352-
defer GinkgoRecover()
1353-
1354-
var (
1355-
clusterID string
1356-
clusterName string
1357-
rosaClient *rosacli.Client
1358-
clusterService rosacli.ClusterService
1359-
upgradeService rosacli.UpgradeService
1360-
versionService rosacli.VersionService
1361-
profile *handler.Profile
1362-
clusterHandler handler.ClusterHandler
1363-
)
1364-
1365-
BeforeEach(func() {
1366-
By("Init the client")
1367-
rosaClient = rosacli.NewClient()
1368-
clusterService = rosaClient.Cluster
1369-
upgradeService = rosaClient.Upgrade
1370-
versionService = rosaClient.Version
1371-
})
1372-
1373-
AfterEach(func() {
1374-
By("Clean resources")
1375-
clusterHandler.Destroy()
1376-
})
1377-
1378-
Context("for Y-stream cluster - [id:55883]", labels.Critical, labels.Runtime.Day1Supplemental, func() {
1379-
It("on STS rosa classic cluster", func() {
1380-
By("Create a Y-stream sts rosa classic cluster")
1381-
profile = handler.GetProfile("rosa-upgrade-y-stream", handler.GetYAMLProfilesDir())
1382-
Expect(profile).ToNot(BeNil())
1383-
profile.NamePrefix = constants.DefaultNamePrefix
1384-
1385-
clusterHandler, err := handler.NewClusterHandlerFromFilesystem(rosaClient, profile)
1386-
Expect(err).To(BeNil())
1387-
1388-
flags, err := clusterHandler.GenerateClusterCreateFlags()
1389-
Expect(err).ToNot(HaveOccurred())
1390-
1391-
clusterName = helper.GenerateRandomName("cluster-55883", 2)
1392-
command := "rosa create cluster --cluster-name " + clusterName + " " + strings.Join(flags, " ") + " --mode auto"
1393-
rosalCommand := config.GenerateCommand(command)
1394-
log.Logger.Info(rosalCommand)
1395-
output, err := rosaClient.Runner.RunCMD(strings.Split(rosalCommand.GetFullCommand(), " "))
1396-
Expect(err).ToNot(HaveOccurred())
1397-
Expect(output.String()).To(ContainSubstring(fmt.Sprintf("Cluster '%s' has been created", clusterName)))
1398-
1399-
By("Retrieve cluster ID")
1400-
rosaClient.Runner.UnsetArgs()
1401-
clusterListout, err := clusterService.List()
1402-
Expect(err).To(BeNil())
1403-
clusterList, err := clusterService.ReflectClusterList(clusterListout)
1404-
Expect(err).To(BeNil())
1405-
clusterID = clusterList.ClusterByName(clusterName).ID
1406-
1407-
By("Wait for Cluster to be ready")
1408-
err = clusterService.WaitClusterStatus(clusterID, constants.Ready, 3, 120)
1409-
Expect(err).To(BeNil(), "It met error or timeout when waiting cluster to ready status")
1410-
1411-
By("Check the cluster upgrade version to decide if skip this case")
1412-
jsonData, err := clusterService.GetJSONClusterDescription(clusterID)
1413-
Expect(err).To(BeNil())
1414-
clusterVersion := jsonData.DigString("version", "raw_id")
1415-
1416-
clusterVersionList, err := versionService.ListAndReflectVersions(profile.ChannelGroup, false)
1417-
Expect(err).To(BeNil())
1418-
upgradingVersion, _, err := clusterVersionList.FindUpperYStreamVersion(profile.ChannelGroup, clusterVersion)
1419-
Expect(err).To(BeNil())
1420-
if upgradingVersion == "" {
1421-
Skip("Skip this case as the cluster is being upgraded.")
1422-
}
1423-
1424-
scheduledDate := time.Now().Format("2006-01-02")
1425-
scheduledTime := time.Now().Add(10 * time.Minute).UTC().Format("15:04")
1426-
By("Upgrade STS classic cluster")
1427-
output, err = upgradeService.Upgrade(
1428-
"-c", clusterID,
1429-
"--version", upgradingVersion,
1430-
"--schedule-date", scheduledDate,
1431-
"--schedule-time", scheduledTime,
1432-
"-m", "auto",
1433-
"-y",
1434-
)
1435-
Expect(err).To(BeNil())
1436-
Expect(output.String()).To(ContainSubstring("Upgrade successfully scheduled for cluster"))
1437-
1438-
By("Check upgrade state")
1439-
err = upgradeService.WaitForUpgradeToState(clusterID, constants.Scheduled, 4)
1440-
Expect(err).To(BeNil())
1441-
err = upgradeService.WaitForUpgradeToState(clusterID, constants.Started, 70)
1442-
Expect(err).To(BeNil())
1443-
1444-
By("Check the scheduled upgrade is completed successfully")
1445-
Eventually(func() (string, error) {
1446-
output, err := upgradeService.DescribeUpgrade(clusterID)
1447-
return rosaClient.Parser.TextData.Input(output).Parse().Tip(), err
1448-
}, time.Minute*70, time.Minute*1).Should(
1449-
ContainSubstring("INFO: No scheduled upgrades for cluster '%s'", clusterID))
1450-
})
1451-
1452-
It("on rosa hcp cluster", func() {
1453-
By("Create a Y-stream rosa hcp cluster")
1454-
profile = handler.GetProfile("rosa-hcp-upgrade-y-stream", handler.GetYAMLProfilesDir())
1455-
Expect(profile).ToNot(BeNil())
1456-
profile.NamePrefix = constants.DefaultNamePrefix
1457-
1458-
clusterHandler, err := handler.NewClusterHandlerFromFilesystem(rosaClient, profile)
1459-
Expect(err).To(BeNil())
1460-
1461-
flags, err := clusterHandler.GenerateClusterCreateFlags()
1462-
Expect(err).ToNot(HaveOccurred())
1463-
1464-
clusterName = helper.GenerateRandomName("cluster-55883", 2)
1465-
command := "rosa create cluster --cluster-name " + clusterName + " " + strings.Join(flags, " ")
1466-
rosalCommand := config.GenerateCommand(command)
1467-
output, err := rosaClient.Runner.RunCMD(strings.Split(rosalCommand.GetFullCommand(), " "))
1468-
Expect(err).ToNot(HaveOccurred())
1469-
Expect(output.String()).To(ContainSubstring(fmt.Sprintf("Cluster '%s' has been created", clusterName)))
1470-
1471-
By("Retrieve cluster ID")
1472-
rosaClient.Runner.UnsetArgs()
1473-
clusterListout, err := clusterService.List()
1474-
Expect(err).To(BeNil())
1475-
clusterList, err := clusterService.ReflectClusterList(clusterListout)
1476-
Expect(err).To(BeNil())
1477-
clusterID = clusterList.ClusterByName(clusterName).ID
1478-
1479-
By("Wait for Cluster to be ready")
1480-
err = clusterService.WaitClusterStatus(clusterID, constants.Ready, 3, 60)
1481-
Expect(err).To(BeNil(), "It met error or timeout when waiting cluster to ready status")
1482-
1483-
By("Check the cluster upgrade version to decide if skip this case")
1484-
jsonData, err := clusterService.GetJSONClusterDescription(clusterID)
1485-
Expect(err).To(BeNil())
1486-
clusterVersion := jsonData.DigString("version", "raw_id")
1487-
1488-
clusterVersionList, err := versionService.ListAndReflectVersions(profile.ChannelGroup, false)
1489-
Expect(err).To(BeNil())
1490-
upgradingVersion, _, err := clusterVersionList.FindUpperYStreamVersion(profile.ChannelGroup, clusterVersion)
1491-
Expect(err).To(BeNil())
1492-
if upgradingVersion == "" {
1493-
Skip("Skip this case as the cluster is being upgraded.")
1494-
}
1495-
1496-
scheduledDate := time.Now().Format("2006-01-02")
1497-
scheduledTime := time.Now().Add(10 * time.Minute).UTC().Format("15:04")
1498-
By("Upgrade HCP cluster")
1499-
output, err = upgradeService.Upgrade(
1500-
"-c", clusterID,
1501-
"--version", upgradingVersion,
1502-
"--schedule-date", scheduledDate,
1503-
"--schedule-time", scheduledTime,
1504-
"--control-plane",
1505-
"-m", "auto",
1506-
"-y",
1507-
)
1508-
Expect(err).To(BeNil())
1509-
Expect(output.String()).To(ContainSubstring("Upgrade successfully scheduled for cluster"))
1510-
By("Check upgrade state")
1511-
err = upgradeService.WaitForUpgradeToState(clusterID, constants.Scheduled, 4)
1512-
Expect(err).To(BeNil())
1513-
err = upgradeService.WaitForUpgradeToState(clusterID, constants.Started, 70)
1514-
Expect(err).To(BeNil())
1515-
1516-
By("Check the scheduled upgrade is completed successfully")
1517-
Eventually(func() (string, error) {
1518-
output, err := upgradeService.DescribeUpgrade(clusterID)
1519-
return rosaClient.Parser.TextData.Input(output).Parse().Tip(), err
1520-
}, time.Minute*30, time.Minute*1).Should(
1521-
ContainSubstring("INFO: No scheduled upgrades for cluster '%s'", clusterID))
1522-
})
1523-
})
1524-
})

0 commit comments

Comments
 (0)