diff --git a/actions/provisioning/verify.go b/actions/provisioning/verify.go index e3c5a282b..c3b45521f 100644 --- a/actions/provisioning/verify.go +++ b/actions/provisioning/verify.go @@ -141,7 +141,7 @@ func VerifyClusterReady(t *testing.T, client *rancher.Client, cluster *steveV1.S checkFunc := shepherdclusters.IsProvisioningClusterReady err = wait.WatchWait(watchInterface, checkFunc) if err != nil { - logrus.Warningf("Unable to get cluster status (%s): %v. Retrying", cluster.Name, err) + logrus.Warningf("Unable to get cluster status (%s) Retrying", cluster.Name) return false, nil } diff --git a/actions/workloads/deployment/verify.go b/actions/workloads/deployment/verify.go index d63601b24..ca2590d73 100644 --- a/actions/workloads/deployment/verify.go +++ b/actions/workloads/deployment/verify.go @@ -4,12 +4,17 @@ import ( "context" "errors" "fmt" + "slices" "strconv" "time" "github.com/rancher/shepherd/clients/rancher" + steveV1 "github.com/rancher/shepherd/clients/rancher/v1" + v1 "github.com/rancher/shepherd/clients/rancher/v1" "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/extensions/workloads" namegen "github.com/rancher/shepherd/pkg/namegenerator" "github.com/rancher/shepherd/pkg/wrangler" @@ -22,6 +27,10 @@ import ( ) const ( + Webhook = "rancher-webhook" + SUC = "system-upgrade-controller" + Fleet = "fleet-agent" + ClusterAgent = "cattle-cluster-agent" revisionAnnotation = "deployment.kubernetes.io/revision" ) @@ -490,3 +499,88 @@ func VerifyDeploymentOrchestration(client *rancher.Client, clusterID, namespace, return err } + +// VerifyClusterDeployments verifies that all required deployments are present and available in the cluster +func VerifyClusterDeployments(client *rancher.Client, cluster *v1.SteveAPIObject) error { + clusterID, err := clusters.GetClusterIDByName(client, cluster.Name) + if err != nil { + return err + } + + downstreamClient, err := client.Steve.ProxyDownstream(clusterID) + if err != nil { + return err + } + if downstreamClient == nil { + return errors.New("downstream client is nil") + } + + deploymentClient := downstreamClient.SteveType(stevetypes.Deployment) + requiredDeployments := []string{ClusterAgent, Webhook, Fleet, SUC} + + logrus.Debugf("Verifying all required deployments exist: %v", requiredDeployments) + err = kwait.PollUntilContextTimeout(context.TODO(), 5*time.Second, defaults.TenMinuteTimeout, true, func(ctx context.Context) (done bool, err error) { + clusterDeployments, err := deploymentClient.List(nil) + if err != nil { + return false, nil + } + + for _, deployment := range clusterDeployments.Data { + k8sDeployment := &appv1.Deployment{} + err := steveV1.ConvertToK8sType(deployment.JSONResp, k8sDeployment) + if err != nil { + return false, nil + } + + if slices.Contains(requiredDeployments, k8sDeployment.Name) { + requiredDeployments = slices.Delete(requiredDeployments, slices.Index(requiredDeployments, k8sDeployment.Name), slices.Index(requiredDeployments, k8sDeployment.Name)+1) + } + } + if len(requiredDeployments) != 0 { + return false, nil + } + + return true, nil + }) + + if err != nil { + return fmt.Errorf("Not all required deployments exist: %v", requiredDeployments) + } + + logrus.Debug("Verifying all deployments") + var failedDeployments []appv1.Deployment + err = kwait.PollUntilContextTimeout(context.TODO(), 5*time.Second, defaults.TenMinuteTimeout, true, func(ctx context.Context) (done bool, err error) { + clusterDeployments, err := deploymentClient.List(nil) + if err != nil { + return false, nil + } + + failedDeployments = []appv1.Deployment{} + for _, deploymentObj := range clusterDeployments.Data { + k8sDeployment := &appv1.Deployment{} + err := steveV1.ConvertToK8sType(deploymentObj.JSONResp, k8sDeployment) + if err != nil { + return false, nil + } + + if k8sDeployment.Status.AvailableReplicas != *k8sDeployment.Spec.Replicas { + failedDeployments = append(failedDeployments, *k8sDeployment) + } + } + + return true, nil + }) + + if len(failedDeployments) > 0 { + for _, deploymentObj := range failedDeployments { + + for _, condition := range deploymentObj.Status.Conditions { + logrus.Error("Deployment:", deploymentObj.Name, "Condition: ", condition.Message) + } + } + + return nil + } + + return err +} diff --git a/actions/workloads/pods/verify.go b/actions/workloads/pods/verify.go index 7c6f16589..0ce3b38c0 100644 --- a/actions/workloads/pods/verify.go +++ b/actions/workloads/pods/verify.go @@ -3,7 +3,6 @@ package pods import ( "context" "errors" - "slices" "strings" "testing" "time" @@ -84,23 +83,6 @@ func VerifyClusterPods(client *rancher.Client, cluster *steveV1.SteveAPIObject) } steveClient := downstreamClient.SteveType(stevetypes.Pod) - deploymentClient := downstreamClient.SteveType(stevetypes.Deployment) - clusterDeployments, err := deploymentClient.List(nil) - if err != nil { - return false, nil - } - - requiredDeployments := []string{ClusterAgent, Webhook, Fleet, SUC} - requiredDeploymentCount := 0 - for _, deployment := range clusterDeployments.Data { - if slices.Contains(requiredDeployments, deployment.Name) { - logrus.Tracef("Deployment: %s exists", deployment.Name) - requiredDeploymentCount += 1 - } - } - if requiredDeploymentCount != len(requiredDeployments) { - return false, nil - } podErrors = []error{} diff --git a/actions/workloads/verify.go b/actions/workloads/verify.go index efa3eb831..8f2d3d14e 100644 --- a/actions/workloads/verify.go +++ b/actions/workloads/verify.go @@ -97,7 +97,15 @@ func VerifyWorkloads(client *rancher.Client, clusterName string, workloads Workl } err = pods.VerifyClusterPods(client, cluster) + if err != nil { + return nil, err + } + + err = deployment.VerifyClusterDeployments(client, cluster) + if err != nil { + return nil, err + } - return &workloads, err + return &workloads, nil } diff --git a/validation/auth/kubeconfigs/kubeconfigs_test.go b/validation/auth/kubeconfigs/kubeconfigs_test.go index d1dffa8b6..5b80aef7c 100644 --- a/validation/auth/kubeconfigs/kubeconfigs_test.go +++ b/validation/auth/kubeconfigs/kubeconfigs_test.go @@ -17,6 +17,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/rbac" "github.com/rancher/tests/actions/settings" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" @@ -73,6 +74,10 @@ func (kc *ExtKubeconfigTestSuite) SetupSuite() { require.NoError(kc.T(), err) provisioning.VerifyClusterReady(kc.T(), client, aceClusterObject1) + + err = deployment.VerifyClusterDeployments(client, aceClusterObject1) + require.NoError(kc.T(), err) + err = pods.VerifyClusterPods(client, aceClusterObject1) require.NoError(kc.T(), err) provisioning.VerifyDynamicCluster(kc.T(), client, aceClusterObject1) @@ -81,6 +86,10 @@ func (kc *ExtKubeconfigTestSuite) SetupSuite() { log.Infof("ACE-enabled cluster created: %s (%s)", kc.aceCluster1.Name, aceCluster1ID) provisioning.VerifyClusterReady(kc.T(), client, aceClusterObject2) + + err = deployment.VerifyClusterDeployments(client, aceClusterObject2) + require.NoError(kc.T(), err) + err = pods.VerifyClusterPods(client, aceClusterObject2) require.NoError(kc.T(), err) provisioning.VerifyDynamicCluster(kc.T(), client, aceClusterObject2) @@ -89,6 +98,10 @@ func (kc *ExtKubeconfigTestSuite) SetupSuite() { log.Infof("ACE-enabled cluster created: %s (%s)", kc.aceCluster2.Name, aceCluster2ID) provisioning.VerifyClusterReady(kc.T(), client, clusterObject2) + + err = deployment.VerifyClusterDeployments(client, clusterObject2) + require.NoError(kc.T(), err) + err = pods.VerifyClusterPods(client, clusterObject2) require.NoError(kc.T(), err) provisioning.VerifyDynamicCluster(kc.T(), client, clusterObject2) diff --git a/validation/certificates/dualstack/cert_rotation_test.go b/validation/certificates/dualstack/cert_rotation_test.go index 6e6d411c4..90bdb8fc1 100644 --- a/validation/certificates/dualstack/cert_rotation_test.go +++ b/validation/certificates/dualstack/cert_rotation_test.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/certificates" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -112,6 +113,10 @@ func (c *CertRotationDualstackTestSuite) TestCertRotationDualstack() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(c.T(), c.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(c.client, cluster) + require.NoError(c.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(c.client, cluster) require.NoError(c.T(), err) diff --git a/validation/certificates/ipv6/cert_rotation_test.go b/validation/certificates/ipv6/cert_rotation_test.go index 5a3672856..01ce3ce47 100644 --- a/validation/certificates/ipv6/cert_rotation_test.go +++ b/validation/certificates/ipv6/cert_rotation_test.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/certificates" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -112,6 +113,10 @@ func (c *CertRotationIPv6TestSuite) TestCertRotationIPv6() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(c.T(), c.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(c.client, cluster) + require.NoError(c.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(c.client, cluster) require.NoError(c.T(), err) diff --git a/validation/certificates/rke2k3s/cert_rotation_existing_cluster_test.go b/validation/certificates/rke2k3s/cert_rotation_existing_cluster_test.go index 9cd91350b..cdc705f63 100644 --- a/validation/certificates/rke2k3s/cert_rotation_existing_cluster_test.go +++ b/validation/certificates/rke2k3s/cert_rotation_existing_cluster_test.go @@ -15,6 +15,7 @@ import ( "github.com/rancher/tests/actions/config/defaults" "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/certificates" "github.com/sirupsen/logrus" @@ -78,6 +79,10 @@ func (c *CertRotationExistingClusterTestSuite) TestCertRotationExistingCluster() logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(c.T(), c.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(c.client, cluster) + require.NoError(c.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(c.client, cluster) require.NoError(c.T(), err) diff --git a/validation/certificates/rke2k3s/cert_rotation_test.go b/validation/certificates/rke2k3s/cert_rotation_test.go index cf555bbcc..8513d1dda 100644 --- a/validation/certificates/rke2k3s/cert_rotation_test.go +++ b/validation/certificates/rke2k3s/cert_rotation_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/certificates" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -99,6 +100,10 @@ func (c *CertRotationTestSuite) TestCertRotation() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(c.T(), c.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(c.client, cluster) + require.NoError(c.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(c.client, cluster) require.NoError(c.T(), err) diff --git a/validation/certificates/rke2k3s/cert_rotation_wins_test.go b/validation/certificates/rke2k3s/cert_rotation_wins_test.go index 82cc0d39e..c417dcaad 100644 --- a/validation/certificates/rke2k3s/cert_rotation_wins_test.go +++ b/validation/certificates/rke2k3s/cert_rotation_wins_test.go @@ -21,6 +21,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/certificates" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -116,6 +117,10 @@ func (c *CertRotationWindowsTestSuite) TestCertRotationWindows() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(c.T(), c.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(c.client, cluster) + require.NoError(c.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(c.client, cluster) require.NoError(c.T(), err) diff --git a/validation/charts/backup_restore/backup_restore.go b/validation/charts/backup_restore/backup_restore.go index 6e098d095..b688c1480 100644 --- a/validation/charts/backup_restore/backup_restore.go +++ b/validation/charts/backup_restore/backup_restore.go @@ -14,6 +14,7 @@ import ( actionscharts "github.com/rancher/tests/actions/charts" "github.com/rancher/tests/actions/projects" "github.com/rancher/tests/actions/secrets" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/interoperability/charts" "github.com/stretchr/testify/require" @@ -319,6 +320,10 @@ func createRKE2dsCluster(t *testing.T, client *rancher.Client) (*v1.SteveAPIObje logrus.Infof("Verifying the cluster is ready (%s)", steveObject.Name) provisioning.VerifyClusterReady(t, client, steveObject) + logrus.Infof("Verifying cluster deployments (%s)", steveObject.Name) + err = deployment.VerifyClusterDeployments(client, steveObject) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", steveObject.Name) err = pods.VerifyClusterPods(client, steveObject) require.NoError(t, err) diff --git a/validation/charts/backup_restore/backup_restore_test.go b/validation/charts/backup_restore/backup_restore_test.go index 5894a095a..80a704b80 100644 --- a/validation/charts/backup_restore/backup_restore_test.go +++ b/validation/charts/backup_restore/backup_restore_test.go @@ -15,6 +15,7 @@ import ( "github.com/rancher/shepherd/pkg/session" "github.com/rancher/tests/actions/projects" "github.com/rancher/tests/actions/provisioning" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/interoperability/charts" "github.com/stretchr/testify/assert" @@ -118,6 +119,10 @@ func (b *BackupTestSuite) TestS3InPlaceRestore() { logrus.Infof("Verifying the cluster is ready (%s)", rke2SteveObj.Name) provisioning.VerifyClusterReady(b.T(), b.client, rke2SteveObj) + logrus.Infof("Verifying cluster deployments (%s)", rke2SteveObj.Name) + err = deployment.VerifyClusterDeployments(b.client, rke2SteveObj) + require.NoError(b.T(), err) + logrus.Infof("Verifying cluster pods (%s)", rke2SteveObj.Name) err = pods.VerifyClusterPods(b.client, rke2SteveObj) require.NoError(b.T(), err) diff --git a/validation/deleting/dualstack/delete_init_machine_test.go b/validation/deleting/dualstack/delete_init_machine_test.go index df69d7e49..ed0e1a407 100644 --- a/validation/deleting/dualstack/delete_init_machine_test.go +++ b/validation/deleting/dualstack/delete_init_machine_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/deleting/rke2k3s" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -107,6 +108,10 @@ func (d *DeleteInitMachineDualstackTestSuite) TestDeleteInitMachineDualstack() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(d.T(), d.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(d.client, cluster) + require.NoError(d.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) pods.VerifyClusterPods(d.client, cluster) }) diff --git a/validation/deleting/ipv6/delete_init_machine_test.go b/validation/deleting/ipv6/delete_init_machine_test.go index 6f08d168d..c3b0ffabf 100644 --- a/validation/deleting/ipv6/delete_init_machine_test.go +++ b/validation/deleting/ipv6/delete_init_machine_test.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/deleting/rke2k3s" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -120,6 +121,10 @@ func (d *DeleteInitMachineIPv6TestSuite) TestDeleteInitMachineIPv6() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(d.T(), d.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(d.client, cluster) + require.NoError(d.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(d.client, cluster) require.NoError(d.T(), err) diff --git a/validation/deleting/rke2k3s/delete_init_machine_test.go b/validation/deleting/rke2k3s/delete_init_machine_test.go index 4bac3a11d..a0f8cbeaa 100644 --- a/validation/deleting/rke2k3s/delete_init_machine_test.go +++ b/validation/deleting/rke2k3s/delete_init_machine_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -106,6 +107,10 @@ func (d *DeleteInitMachineTestSuite) TestDeleteInitMachine() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(d.T(), d.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(d.client, cluster) + require.NoError(d.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(d.client, cluster) require.NoError(d.T(), err) diff --git a/validation/fleet/provisioning/airgap/fleet_in_airgap_test.go b/validation/fleet/provisioning/airgap/fleet_in_airgap_test.go index 37a67a08c..3ef7e7364 100644 --- a/validation/fleet/provisioning/airgap/fleet_in_airgap_test.go +++ b/validation/fleet/provisioning/airgap/fleet_in_airgap_test.go @@ -26,6 +26,7 @@ import ( "github.com/rancher/tests/actions/provisioning/permutations" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/reports" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/interoperability/fleet" "github.com/sirupsen/logrus" @@ -180,6 +181,10 @@ func (a *AirGapRKE2CustomClusterTestSuite) TestCustomClusterWithGitRepo() { logrus.Infof("Verifying the cluster is ready (%s)", clusterObject.Name) provisioning.VerifyClusterReady(a.T(), a.standardClient, clusterObject) + logrus.Infof("Verifying cluster deployments (%s)", clusterObject.Name) + err = deployment.VerifyClusterDeployments(a.standardClient, clusterObject) + require.NoError(a.T(), err) + logrus.Infof("Verifying cluster pods (%s)", clusterObject.Name) err = pods.VerifyClusterPods(a.standardClient, clusterObject) require.NoError(a.T(), err) diff --git a/validation/fleet/provisioning/new_cluster_existing_gitrepo_test.go b/validation/fleet/provisioning/new_cluster_existing_gitrepo_test.go index 9e94a48d9..2759bba3b 100644 --- a/validation/fleet/provisioning/new_cluster_existing_gitrepo_test.go +++ b/validation/fleet/provisioning/new_cluster_existing_gitrepo_test.go @@ -24,6 +24,7 @@ import ( "github.com/rancher/tests/actions/provisioning/permutations" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/reports" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/interoperability/fleet" "github.com/sirupsen/logrus" @@ -185,6 +186,10 @@ func (f *FleetWithProvisioningTestSuite) TestHardenedAfterAddedGitRepo() { logrus.Infof("Verifying the cluster is ready (%s)", clusterObject.Name) provisioning.VerifyClusterReady(f.T(), tt.client, clusterObject) + logrus.Infof("Verifying cluster deployments (%s)", clusterObject.Name) + err = deployment.VerifyClusterDeployments(tt.client, clusterObject) + require.NoError(f.T(), err) + logrus.Infof("Verifying cluster pods (%s)", clusterObject.Name) err = pods.VerifyClusterPods(tt.client, clusterObject) require.NoError(f.T(), err) @@ -280,6 +285,10 @@ func (f *FleetWithProvisioningTestSuite) TestWindowsAfterAddedGitRepo() { logrus.Infof("Verifying the cluster is ready (%s)", clusterObject.Name) provisioning.VerifyClusterReady(f.T(), tt.client, clusterObject) + logrus.Infof("Verifying cluster deployments (%s)", clusterObject.Name) + err = deployment.VerifyClusterDeployments(tt.client, clusterObject) + require.NoError(f.T(), err) + logrus.Infof("Verifying cluster pods (%s)", clusterObject.Name) err = pods.VerifyClusterPods(tt.client, clusterObject) require.NoError(f.T(), err) diff --git a/validation/nodescaling/dualstack/scaling_test.go b/validation/nodescaling/dualstack/scaling_test.go index ec19eefad..e6ec3dd65 100644 --- a/validation/nodescaling/dualstack/scaling_test.go +++ b/validation/nodescaling/dualstack/scaling_test.go @@ -21,6 +21,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/scalinginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/nodescaling" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -128,6 +129,10 @@ func (s *NodeScalingDualstackTestSuite) TestScalingDualstackNodePools() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/nodescaling/ipv6/scaling_test.go b/validation/nodescaling/ipv6/scaling_test.go index cb80b753d..dabad3899 100644 --- a/validation/nodescaling/ipv6/scaling_test.go +++ b/validation/nodescaling/ipv6/scaling_test.go @@ -21,6 +21,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/nodescaling" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -132,6 +133,10 @@ func (s *NodeScalingIPv6TestSuite) TestScalingIPv6NodePools() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/nodescaling/rke2k3s/auto_replace_existing_cluster_test.go b/validation/nodescaling/rke2k3s/auto_replace_existing_cluster_test.go index a18eebbcc..eb9ba8b7f 100644 --- a/validation/nodescaling/rke2k3s/auto_replace_existing_cluster_test.go +++ b/validation/nodescaling/rke2k3s/auto_replace_existing_cluster_test.go @@ -17,6 +17,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/scalinginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" @@ -84,6 +85,10 @@ func (s *AutoReplaceExistingClusterSuite) TestAutoReplaceExistingCluster() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/nodescaling/rke2k3s/auto_replace_test.go b/validation/nodescaling/rke2k3s/auto_replace_test.go index bf24c9d94..499fa9512 100644 --- a/validation/nodescaling/rke2k3s/auto_replace_test.go +++ b/validation/nodescaling/rke2k3s/auto_replace_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/scalinginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -102,6 +103,10 @@ func (s *AutoReplaceSuite) TestAutoReplace() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/nodescaling/rke2k3s/scale_replace_test.go b/validation/nodescaling/rke2k3s/scale_replace_test.go index bb1fc8cc2..4daa95d43 100644 --- a/validation/nodescaling/rke2k3s/scale_replace_test.go +++ b/validation/nodescaling/rke2k3s/scale_replace_test.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/scalinginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -120,6 +121,10 @@ func (s *NodeReplacingTestSuite) TestReplacingNodes() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/nodescaling/rke2k3s/scaling_custom_cluster_test.go b/validation/nodescaling/rke2k3s/scaling_custom_cluster_test.go index fac95c609..e5639b636 100644 --- a/validation/nodescaling/rke2k3s/scaling_custom_cluster_test.go +++ b/validation/nodescaling/rke2k3s/scaling_custom_cluster_test.go @@ -21,6 +21,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/scalinginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/nodescaling" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -145,6 +146,10 @@ func (s *CustomClusterNodeScalingTestSuite) TestScalingCustomClusterNodes() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/nodescaling/rke2k3s/scaling_node_driver_test.go b/validation/nodescaling/rke2k3s/scaling_node_driver_test.go index 159d57c30..b87ce1811 100644 --- a/validation/nodescaling/rke2k3s/scaling_node_driver_test.go +++ b/validation/nodescaling/rke2k3s/scaling_node_driver_test.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/scalinginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/validation/nodescaling" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" @@ -135,6 +136,10 @@ func (s *NodeScalingTestSuite) TestScalingNodePools() { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(s.T(), s.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(s.T(), err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(s.client, cluster) require.NoError(s.T(), err) diff --git a/validation/prime/autoscaling/auto_scaling_test.go b/validation/prime/autoscaling/auto_scaling_test.go index 40bac330d..0e944307b 100644 --- a/validation/prime/autoscaling/auto_scaling_test.go +++ b/validation/prime/autoscaling/auto_scaling_test.go @@ -123,6 +123,14 @@ func TestAutoScalingUp(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, s.client, cluster) + + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(t, err) + + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) + err = pods.VerifyClusterPods(s.client, cluster) + require.NoError(t, err) }) params := provisioning.GetProvisioningSchemaParams(tt.client, s.cattleConfig) @@ -185,6 +193,14 @@ func TestAutoScalingDown(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(t, err) + + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) + err = pods.VerifyClusterPods(s.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster autoscaler (%s)", cluster.Name) scaling.VerifyAutoscaler(t, s.client, cluster) @@ -210,8 +226,12 @@ func TestAutoScalingDown(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) - err = pods.VerifyClusterPods(tt.client, cluster) + err = pods.VerifyClusterPods(s.client, cluster) require.NoError(t, err) }) @@ -311,6 +331,14 @@ func TestAutoScalingPause(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, s.client, cluster) + + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(s.client, cluster) + require.NoError(t, err) + + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) + err = pods.VerifyClusterPods(s.client, cluster) + require.NoError(t, err) }) params := provisioning.GetProvisioningSchemaParams(tt.client, s.cattleConfig) diff --git a/validation/provisioning/dualstack/k3s_custom_test.go b/validation/provisioning/dualstack/k3s_custom_test.go index 0db138288..fdb4c5da0 100644 --- a/validation/provisioning/dualstack/k3s_custom_test.go +++ b/validation/provisioning/dualstack/k3s_custom_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -150,6 +151,10 @@ func TestCustomK3SDualstack(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/dualstack/k3s_node_driver_test.go b/validation/provisioning/dualstack/k3s_node_driver_test.go index 9f01445cb..bea3514de 100644 --- a/validation/provisioning/dualstack/k3s_node_driver_test.go +++ b/validation/provisioning/dualstack/k3s_node_driver_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -134,6 +135,10 @@ func TestNodeDriverK3S(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/dualstack/rke2_custom_test.go b/validation/provisioning/dualstack/rke2_custom_test.go index 106572b60..a4142a79e 100644 --- a/validation/provisioning/dualstack/rke2_custom_test.go +++ b/validation/provisioning/dualstack/rke2_custom_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -136,6 +137,10 @@ func TestCustomRKE2Dualstack(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/dualstack/rke2_node_driver_test.go b/validation/provisioning/dualstack/rke2_node_driver_test.go index 4a7df3953..cfdbe182f 100644 --- a/validation/provisioning/dualstack/rke2_node_driver_test.go +++ b/validation/provisioning/dualstack/rke2_node_driver_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -121,6 +122,10 @@ func TestNodeDriverRKE2(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/ipv6/k3s_custom_test.go b/validation/provisioning/ipv6/k3s_custom_test.go index af52b4519..84003c345 100644 --- a/validation/provisioning/ipv6/k3s_custom_test.go +++ b/validation/provisioning/ipv6/k3s_custom_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -149,6 +150,10 @@ func TestCustomK3SIPv6(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/ipv6/k3s_node_driver_test.go b/validation/provisioning/ipv6/k3s_node_driver_test.go index 6d4d5a3cd..3b6831464 100644 --- a/validation/provisioning/ipv6/k3s_node_driver_test.go +++ b/validation/provisioning/ipv6/k3s_node_driver_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -142,6 +143,10 @@ func TestNodeDriverK3SIPv6(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/ipv6/rke2_custom_test.go b/validation/provisioning/ipv6/rke2_custom_test.go index f0ba28f69..331760872 100644 --- a/validation/provisioning/ipv6/rke2_custom_test.go +++ b/validation/provisioning/ipv6/rke2_custom_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -136,6 +137,10 @@ func TestCustomRKE2IPv6(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/ipv6/rke2_node_driver_test.go b/validation/provisioning/ipv6/rke2_node_driver_test.go index a46cd48e0..68719e904 100644 --- a/validation/provisioning/ipv6/rke2_node_driver_test.go +++ b/validation/provisioning/ipv6/rke2_node_driver_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -129,6 +130,10 @@ func TestNodeDriverRKE2IPv6(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/ace_test.go b/validation/provisioning/k3s/ace_test.go index a9eaa10ac..1ae1da0d1 100644 --- a/validation/provisioning/k3s/ace_test.go +++ b/validation/provisioning/k3s/ace_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -112,6 +113,10 @@ func TestACE(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/custom_test.go b/validation/provisioning/k3s/custom_test.go index d6b78f69b..85ee0d434 100644 --- a/validation/provisioning/k3s/custom_test.go +++ b/validation/provisioning/k3s/custom_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -110,6 +111,10 @@ func TestCustom(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/data_directories_test.go b/validation/provisioning/k3s/data_directories_test.go index b3ebea6f2..244b3a2a5 100644 --- a/validation/provisioning/k3s/data_directories_test.go +++ b/validation/provisioning/k3s/data_directories_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -113,6 +114,10 @@ func TestDataDirectories(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/dynamic_custom_test.go b/validation/provisioning/k3s/dynamic_custom_test.go index a1545392e..6d6c6d859 100644 --- a/validation/provisioning/k3s/dynamic_custom_test.go +++ b/validation/provisioning/k3s/dynamic_custom_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/reports" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -107,6 +108,10 @@ func TestDynamicCustom(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/dynamic_node_driver_test.go b/validation/provisioning/k3s/dynamic_node_driver_test.go index 91e3f3d6b..9deb4b168 100644 --- a/validation/provisioning/k3s/dynamic_node_driver_test.go +++ b/validation/provisioning/k3s/dynamic_node_driver_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/config/permutationdata" "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -103,6 +104,10 @@ func TestDynamicNodeDriver(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/hardened_test.go b/validation/provisioning/k3s/hardened_test.go index f8199ecb0..df7ba5844 100644 --- a/validation/provisioning/k3s/hardened_test.go +++ b/validation/provisioning/k3s/hardened_test.go @@ -23,6 +23,7 @@ import ( "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/reports" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" cis "github.com/rancher/tests/validation/provisioning/resources/cisbenchmark" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -106,6 +107,10 @@ func TestHardened(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/hostname_truncation_test.go b/validation/provisioning/k3s/hostname_truncation_test.go index 748b1fd2b..72636a36b 100644 --- a/validation/provisioning/k3s/hostname_truncation_test.go +++ b/validation/provisioning/k3s/hostname_truncation_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/machinepools" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -107,6 +108,10 @@ func TestHostnameTruncation(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/node_driver_test.go b/validation/provisioning/k3s/node_driver_test.go index 68426fd5a..e62697b30 100644 --- a/validation/provisioning/k3s/node_driver_test.go +++ b/validation/provisioning/k3s/node_driver_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -110,6 +111,10 @@ func TestNodeDriver(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/psact_test.go b/validation/provisioning/k3s/psact_test.go index f1eaaf412..326dd041d 100644 --- a/validation/provisioning/k3s/psact_test.go +++ b/validation/provisioning/k3s/psact_test.go @@ -17,6 +17,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -107,6 +108,10 @@ func TestPSACT(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, tt.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(tt.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/k3s/template_test.go b/validation/provisioning/k3s/template_test.go index aa017e443..f0f170db9 100644 --- a/validation/provisioning/k3s/template_test.go +++ b/validation/provisioning/k3s/template_test.go @@ -27,6 +27,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -120,6 +121,12 @@ func TestTemplate(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, k.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(k.client, cluster) + if err != nil { + logrus.Warningf("Deployment verification received an error: %v", err) + } + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(k.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/resources/provisioncluster/provision_cluster.go b/validation/provisioning/resources/provisioncluster/provision_cluster.go index 712aa5aea..bb5ded5b5 100644 --- a/validation/provisioning/resources/provisioncluster/provision_cluster.go +++ b/validation/provisioning/resources/provisioncluster/provision_cluster.go @@ -12,6 +12,7 @@ import ( "github.com/rancher/tests/actions/clusters" "github.com/rancher/tests/actions/machinepools" "github.com/rancher/tests/actions/provisioning" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/stretchr/testify/require" ) @@ -48,6 +49,10 @@ func ProvisionRKE2K3SCluster(t *testing.T, client *rancher.Client, clusterType s require.NoError(t, err) provisioning.VerifyClusterReady(t, client, clusterObject) + + err = deployment.VerifyClusterDeployments(client, clusterObject) + require.NoError(t, err) + err = pods.VerifyClusterPods(client, clusterObject) require.NoError(t, err) } else { @@ -57,6 +62,10 @@ func ProvisionRKE2K3SCluster(t *testing.T, client *rancher.Client, clusterType s require.NoError(t, err) provisioning.VerifyClusterReady(t, client, clusterObject) + + err = deployment.VerifyClusterDeployments(client, clusterObject) + require.NoError(t, err) + err = pods.VerifyClusterPods(client, clusterObject) require.NoError(t, err) } diff --git a/validation/provisioning/rke2/ace_test.go b/validation/provisioning/rke2/ace_test.go index cfdc0622b..c6ac56786 100644 --- a/validation/provisioning/rke2/ace_test.go +++ b/validation/provisioning/rke2/ace_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -112,6 +113,10 @@ func TestACE(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/agent_customization_test.go b/validation/provisioning/rke2/agent_customization_test.go index cb534b447..8eccc03c3 100644 --- a/validation/provisioning/rke2/agent_customization_test.go +++ b/validation/provisioning/rke2/agent_customization_test.go @@ -17,6 +17,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -143,6 +144,10 @@ func TestAgentCustomization(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/cloud_provider_test.go b/validation/provisioning/rke2/cloud_provider_test.go index 87abcf542..8e8b08fd8 100644 --- a/validation/provisioning/rke2/cloud_provider_test.go +++ b/validation/provisioning/rke2/cloud_provider_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -108,6 +109,10 @@ func TestAWSCloudProvider(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) @@ -170,6 +175,10 @@ func TestVSphereCloudProvider(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) @@ -233,6 +242,10 @@ func TestHarvesterCloudProvider(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/cni_test.go b/validation/provisioning/rke2/cni_test.go index a6fccdea4..8cb7fe496 100644 --- a/validation/provisioning/rke2/cni_test.go +++ b/validation/provisioning/rke2/cni_test.go @@ -17,6 +17,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -101,6 +102,10 @@ func TestCNI(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/custom_test.go b/validation/provisioning/rke2/custom_test.go index 96fa6076f..18c355824 100644 --- a/validation/provisioning/rke2/custom_test.go +++ b/validation/provisioning/rke2/custom_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -118,6 +119,10 @@ func TestCustom(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/data_directories_test.go b/validation/provisioning/rke2/data_directories_test.go index b68475d88..f185d4bad 100644 --- a/validation/provisioning/rke2/data_directories_test.go +++ b/validation/provisioning/rke2/data_directories_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -113,6 +114,10 @@ func TestDataDirectories(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/dynamic_custom_test.go b/validation/provisioning/rke2/dynamic_custom_test.go index 178d7747c..11f334677 100644 --- a/validation/provisioning/rke2/dynamic_custom_test.go +++ b/validation/provisioning/rke2/dynamic_custom_test.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/reports" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -111,6 +112,10 @@ func TestDynamicCustom(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/dynamic_node_driver_test.go b/validation/provisioning/rke2/dynamic_node_driver_test.go index 3eb344e93..87a216311 100644 --- a/validation/provisioning/rke2/dynamic_node_driver_test.go +++ b/validation/provisioning/rke2/dynamic_node_driver_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -107,6 +108,10 @@ func TestDynamicNodeDriver(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/hardened_test.go b/validation/provisioning/rke2/hardened_test.go index 6a881dd48..79320ecf1 100644 --- a/validation/provisioning/rke2/hardened_test.go +++ b/validation/provisioning/rke2/hardened_test.go @@ -23,6 +23,7 @@ import ( "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/reports" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" cis "github.com/rancher/tests/validation/provisioning/resources/cisbenchmark" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -107,6 +108,10 @@ func TestHardened(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/hostname_truncation_test.go b/validation/provisioning/rke2/hostname_truncation_test.go index 99fe2f894..a616688ff 100644 --- a/validation/provisioning/rke2/hostname_truncation_test.go +++ b/validation/provisioning/rke2/hostname_truncation_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/machinepools" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -106,6 +107,10 @@ func TestHostnameTruncation(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/node_driver_test.go b/validation/provisioning/rke2/node_driver_test.go index 351ec0803..933407e1c 100644 --- a/validation/provisioning/rke2/node_driver_test.go +++ b/validation/provisioning/rke2/node_driver_test.go @@ -18,6 +18,7 @@ import ( "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -117,6 +118,10 @@ func TestNodeDriver(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/psact_test.go b/validation/provisioning/rke2/psact_test.go index 2181c578e..377a1e470 100644 --- a/validation/provisioning/rke2/psact_test.go +++ b/validation/provisioning/rke2/psact_test.go @@ -19,6 +19,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -123,6 +124,10 @@ func TestPSACT(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + require.NoError(t, err) + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/provisioning/rke2/template_test.go b/validation/provisioning/rke2/template_test.go index 5aa101f3f..aafdf6cce 100644 --- a/validation/provisioning/rke2/template_test.go +++ b/validation/provisioning/rke2/template_test.go @@ -28,6 +28,7 @@ import ( "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/reports" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" "github.com/sirupsen/logrus" @@ -122,6 +123,12 @@ func TestTemplate(t *testing.T) { logrus.Infof("Verifying the cluster is ready (%s)", cluster.Name) provisioning.VerifyClusterReady(t, r.client, cluster) + logrus.Infof("Verifying cluster deployments (%s)", cluster.Name) + err = deployment.VerifyClusterDeployments(tt.client, cluster) + if err != nil { + logrus.Warningf("Deployment verification received an error: %v", err) + } + logrus.Infof("Verifying cluster pods (%s)", cluster.Name) err = pods.VerifyClusterPods(r.client, cluster) require.NoError(t, err) diff --git a/validation/rbac/globalroles/restrictedadmin_replacement_role_test.go b/validation/rbac/globalroles/restrictedadmin_replacement_role_test.go index 419a3b612..bd2d94302 100644 --- a/validation/rbac/globalroles/restrictedadmin_replacement_role_test.go +++ b/validation/rbac/globalroles/restrictedadmin_replacement_role_test.go @@ -23,7 +23,9 @@ import ( rbac "github.com/rancher/tests/actions/rbac" "github.com/rancher/tests/actions/settings" "github.com/rancher/tests/actions/users" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" + "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -99,6 +101,10 @@ func (ra *RestrictedAdminReplacementTestSuite) TestRestrictedAdminReplacementCre log.Infof("Verifying the cluster is ready (%s)", clusterObject.Name) provisioning.VerifyClusterReady(ra.T(), ra.client, clusterObject) + logrus.Infof("Verifying cluster deployments (%s)", clusterObject.Name) + err = deployment.VerifyClusterDeployments(ra.client, clusterObject) + require.NoError(ra.T(), err) + log.Infof("Verifying cluster pods (%s)", clusterObject.Name) err = pods.VerifyClusterPods(ra.client, clusterObject) require.NoError(ra.T(), err) diff --git a/validation/rbac/globalrolesv2/globalroles_v2_test.go b/validation/rbac/globalrolesv2/globalroles_v2_test.go index 4afebaa51..dd2b4e93c 100644 --- a/validation/rbac/globalrolesv2/globalroles_v2_test.go +++ b/validation/rbac/globalrolesv2/globalroles_v2_test.go @@ -5,6 +5,7 @@ package globalrolesv2 import ( "testing" + "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -21,6 +22,7 @@ import ( "github.com/rancher/shepherd/extensions/users" rbacapi "github.com/rancher/tests/actions/kubeapi/rbac" "github.com/rancher/tests/actions/provisioning" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" "github.com/rancher/tests/actions/rbac" @@ -174,6 +176,10 @@ func (gr *GlobalRolesV2TestSuite) TestClusterCreationAfterAddingGlobalRoleWithIn require.NoError(gr.T(), err) provisioning.VerifyClusterReady(gr.T(), userClient, firstClusterSteveObject) + + err = deployment.VerifyClusterDeployments(gr.client, firstClusterSteveObject) + require.NoError(gr.T(), err) + err = pods.VerifyClusterPods(userClient, firstClusterSteveObject) require.NoError(gr.T(), err) @@ -183,6 +189,11 @@ func (gr *GlobalRolesV2TestSuite) TestClusterCreationAfterAddingGlobalRoleWithIn require.NoError(gr.T(), err) provisioning.VerifyClusterReady(gr.T(), userClient, secondClusterSteveObject) + + logrus.Infof("Verifying cluster deployments (%s)", secondClusterSteveObject.Name) + err = deployment.VerifyClusterDeployments(gr.client, secondClusterSteveObject) + require.NoError(gr.T(), err) + err = pods.VerifyClusterPods(userClient, secondClusterSteveObject) require.NoError(gr.T(), err) @@ -439,6 +450,11 @@ func (gr *GlobalRolesV2TestSuite) TestUserWithInheritedClusterRolesImpactFromClu require.NoError(gr.T(), err) provisioning.VerifyClusterReady(gr.T(), gr.client, rke2SteveObject) + + logrus.Infof("Verifying cluster deployments (%s)", rke2SteveObject.Name) + err = deployment.VerifyClusterDeployments(gr.client, rke2SteveObject) + require.NoError(gr.T(), err) + err = pods.VerifyClusterPods(gr.client, rke2SteveObject) require.NoError(gr.T(), err) diff --git a/validation/upgrade/kubernetes.go b/validation/upgrade/kubernetes.go index 2573867e3..55f084d4a 100644 --- a/validation/upgrade/kubernetes.go +++ b/validation/upgrade/kubernetes.go @@ -20,6 +20,7 @@ import ( "github.com/rancher/tests/actions/clusters" "github.com/rancher/tests/actions/provisioning" "github.com/rancher/tests/actions/upgradeinput" + "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" kcluster "github.com/rancher/shepherd/extensions/kubeapi/cluster" @@ -87,6 +88,10 @@ func DownstreamCluster(u *suite.Suite, testName string, client *rancher.Client, logrus.Infof("Verifying the cluster is ready (%s)", upgradedCluster.Name) provisioning.VerifyClusterReady(u.T(), client, upgradedCluster) + logrus.Infof("Verifying cluster deployments (%s)", upgradedCluster.Name) + err = deployment.VerifyClusterDeployments(client, upgradedCluster) + require.NoError(u.T(), err) + logrus.Infof("Verifying cluster pods (%s)", upgradedCluster.Name) err = pods.VerifyClusterPods(client, upgradedCluster) require.NoError(u.T(), err)