From 66f0966ff2a651850ca91f8ccfd82471e29299af Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Wed, 27 Mar 2024 00:26:43 +0530 Subject: [PATCH] mgr/dashboard: cephfs snapshot and clones e2e tests Fixes: https://tracker.ceph.com/issues/65180 Signed-off-by: Nizamudeen A (cherry picked from commit 3d1a7c56ccb8eb6d988e034e99e199cd226b1704) (cherry picked from commit 9fbcf8658863b5a03d7d8fbf0f3e5d23baf6dc59) --- .../cypress/e2e/common/global.feature.po.ts | 4 ++ .../filesystems/snapshots.e2e-spec.feature | 44 ++++++++++++++++++- ...phfs-subvolume-snapshots-list.component.ts | 4 +- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/global.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/global.feature.po.ts index c6132ae3dd0..cffed0b9b60 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/global.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/global.feature.po.ts @@ -38,3 +38,7 @@ And('I go to the {string} tab', (names: string) => { cy.contains('.nav.nav-tabs a', name).click(); } }); + +And('I wait for {string} seconds', (seconds: number) => { + cy.wait(seconds * 1000); +}); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature index 002282172bb..94d6397b66d 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature @@ -1,6 +1,6 @@ Feature: CephFS Snapshot Management - Goal: To test out the CephFS snapshot management features + Goal: To test out the CephFS snapshot and clone management features Background: Login Given I am logged in @@ -33,6 +33,48 @@ Feature: CephFS Snapshot Management And I go to the "Snapshots" tab Then I should see a table in the expanded row + Scenario: Create a CephFS Subvolume Snapshot + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Snapshots" tab + And I click on "Create" button from the expanded row + And enter "snapshotName" "test_snapshot" in the modal + And I click on "Create Snapshot" button + Then I should see a row with "test_snapshot" in the expanded row + + Scenario: Create a CephFS Subvolume Snapshot Clone + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Snapshots" tab + And I select a row "test_snapshot" in the expanded row + And I click on "Clone" button from the table actions in the expanded row + And enter "cloneName" "test_clone" in the modal + And I click on "Create Clone" button + Then I wait for "5" seconds + And I go to the "Subvolumes" tab + Then I should see a row with "test_clone" in the expanded row + + Scenario: Remove a CephFS Subvolume Snapshot Clone + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Subvolumes" tab + And I select a row "test_clone" in the expanded row + And I click on "Remove" button from the table actions in the expanded row + And I check the tick box in modal + And I click on "Remove Subvolume" button + Then I wait for "5" seconds + And I should not see a row with "test_clone" in the expanded row + + Scenario: Remove a CephFS Subvolume Snapshot + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Snapshots" tab + And I select a row "test_snapshot" in the expanded row + And I click on "Remove" button from the table actions in the expanded row + And I check the tick box in modal + And I click on "Remove Snapshot" button + Then I should not see a row with "test_snapshot" in the expanded row + Scenario: Remove a CephFS Subvolume Given I am on the "cephfs" page When I expand the row "test_cephfs" diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts index 6f004e8e469..05c93faf161 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts @@ -113,7 +113,7 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges click: () => this.cloneModal() }, { - name: this.actionLabels.DELETE, + name: this.actionLabels.REMOVE, permission: 'delete', icon: Icons.destroy, disable: () => !this.selection.hasSingleSelection, @@ -224,7 +224,7 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges const subVolumeGroupName = this.activeGroupName; const fsName = this.fsName; this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, { - actionDescription: 'Delete', + actionDescription: this.actionLabels.REMOVE, itemNames: [snapshotName], itemDescription: 'Snapshot', submitAction: () => -- 2.39.5