-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Chandan Pinjani <chandan.pinjani@suse.com>
- Loading branch information
Showing
4 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
tests/assets/rancher-turtles-fleet-example/gcp_gke/clusters/cluster1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: turtles-qa | ||
spec: | ||
clusterNetwork: | ||
pods: | ||
cidrBlocks: [192.168.0.0/16] | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: GCPManagedCluster | ||
name: turtles-qa | ||
controlPlaneRef: | ||
kind: GCPManagedControlPlane | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
name: turtles-qa-control-plane | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: GCPManagedCluster | ||
metadata: | ||
name: turtles-qa | ||
spec: | ||
project: ei-container-eco | ||
region: asia-south2 | ||
network: | ||
name: hosted-providers-ci | ||
--- | ||
kind: GCPManagedControlPlane | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
metadata: | ||
name: turtles-qa-control-plane | ||
spec: | ||
project: ei-container-eco | ||
location: asia-south2 | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachinePool | ||
metadata: | ||
name: turtles-qa-mp-0 | ||
annotations: | ||
"helm.sh/resource-policy": keep | ||
spec: | ||
clusterName: turtles-qa | ||
replicas: 1 | ||
template: | ||
spec: | ||
bootstrap: | ||
dataSecretName: "" | ||
clusterName: turtles-qa | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: GCPManagedMachinePool | ||
name: turtles-qa-mp-0 | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: GCPManagedMachinePool | ||
metadata: | ||
name: turtles-qa-mp-0 | ||
spec: | ||
nodeLocations: | ||
- asia-south2-c |
1 change: 1 addition & 0 deletions
1
tests/assets/rancher-turtles-fleet-example/gcp_gke/clusters/fleet.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
namespace: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import '~/support/commands'; | ||
import * as cypressLib from '@rancher-ecp-qa/cypress-library'; | ||
import { qase } from 'cypress-qase-reporter/dist/mocha'; | ||
|
||
Cypress.config(); | ||
describe('Import CAPG GKE', { tags: '@full' }, () => { | ||
const timeout = 1200000 | ||
const repoName = 'clusters' | ||
const clusterName = 'turtles-qa' | ||
const branch = 'main' | ||
const path = '/tests/assets/rancher-turtles-fleet-example/gcp_gke' | ||
const repoUrl = 'https://github.com/rancher/rancher-turtles-e2e.git' | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
cypressLib.burgerMenuToggle(); | ||
}); | ||
|
||
it('Setup the namespace for importing', () => { | ||
cy.namespaceAutoImport('Enable'); | ||
}) | ||
|
||
qase(34, | ||
it('Add CAPG cluster fleet repo', () => { | ||
cypressLib.checkNavIcon('cluster-management') | ||
.should('exist'); | ||
|
||
// Add CAPG fleet repository | ||
cy.addFleetGitRepo(repoName, repoUrl, branch, path); | ||
|
||
// Go to Cluster Management > CAPI > Clusters and check if the cluster has started provisioning | ||
cy.checkCAPIMenu(); | ||
cy.contains(new RegExp('Provisioned.*' + clusterName), { timeout: timeout }); | ||
}) | ||
); | ||
|
||
qase(36, | ||
it('Auto import child CAPG cluster', () => { | ||
// Check child cluster is created and auto-imported | ||
cy.goToHome(); | ||
cy.contains(new RegExp('Pending.*' + clusterName)); | ||
|
||
// Check cluster is Active | ||
cy.searchCluster(clusterName); | ||
cy.contains(new RegExp('Active.*' + clusterName), { timeout: 300000 }); | ||
}) | ||
); | ||
|
||
qase(37, | ||
it('Install App on imported cluster', { retries: 1 }, () => { | ||
// Click on imported CAPG cluster | ||
cy.contains(clusterName).click(); | ||
|
||
// Install App | ||
cy.installApp('Monitoring', 'cattle-monitoring'); | ||
}) | ||
); | ||
|
||
qase(38, | ||
it('Remove imported CAPG cluster from Rancher Manager', { retries: 1 }, () => { | ||
|
||
// Check cluster is not deleted after removal | ||
cy.deleteCluster(clusterName); | ||
cy.goToHome(); | ||
// kubectl get clusters.cluster.x-k8s.io | ||
// This is checked by ensuring the cluster is not available in navigation menu | ||
cy.contains(clusterName).should('not.exist'); | ||
cy.checkCAPIClusterProvisioned(clusterName); | ||
}) | ||
); | ||
|
||
qase(39, | ||
it('Delete the CAPG cluster fleet repo', () => { | ||
|
||
// Remove the fleet git repo | ||
cy.removeFleetGitRepo(repoName) | ||
// Wait until the following returns no clusters found | ||
// This is checked by ensuring the cluster is not available in CAPI menu | ||
cy.checkCAPIClusterDeleted(clusterName, timeout); | ||
}) | ||
); | ||
|
||
}); |