]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: e2e for cephfs creation with existing pools 62410/head
authorNizamudeen A <nia@redhat.com>
Fri, 21 Mar 2025 05:58:45 +0000 (11:28 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 21 Mar 2025 14:35:03 +0000 (20:05 +0530)
Fixes: https://tracker.ceph.com/issues/70600
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/urls.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature

index 6af9dd842d6224ef03efe6421d1f7f3c71d81890..dcc1a15921061478a760ee6e4fd269fb8dba628d 100644 (file)
@@ -9,6 +9,14 @@ And('enter {string} {string}', (field: string, value: string) => {
   cy.get(`input[id=${field}]`).clear().type(value);
 });
 
+/**
+ * Ticks a checkbox in the form
+ * @param field name of the field that needs to be filled out.
+ */
+And('checks {string}', (field: string) => {
+  cy.get('cds-checkbox span').contains(field).click();
+});
+
 /**
  * Fills in the given field using the value provided
  * @param field ID of the field that needs to be filled out.
@@ -95,6 +103,6 @@ Then('I should see an error in {string} field', (field: string) => {
 });
 
 And('select {string} {string}', (selectionName: string, option: string) => {
-  cy.get(`select[name=${selectionName}]`).select(option);
-  cy.get(`select[name=${selectionName}] option:checked`).contains(option);
+  cy.get(`select[id=${selectionName}]`).select(option);
+  cy.get(`select[id=${selectionName}] option:checked`).contains(option);
 });
index 5b664f9674837254b993ad4388578c782dfe2b49..455fdf2cf939f7b19c2b23a32229177f9c4b7e5e 100644 (file)
@@ -43,6 +43,10 @@ export class UrlsCollection extends PageHelper {
 
     // CephFS
     cephfs: { url: '#/cephfs/fs', id: 'cd-cephfs-list' },
-    'create cephfs': { url: '#/cephfs/fs/create', id: 'cd-cephfs-form' }
+    'create cephfs': { url: '#/cephfs/fs/create', id: 'cd-cephfs-form' },
+
+    // Pools
+    pools: { url: '/#pool', id: 'cd-pool-list' },
+    'create pool': { url: '#/pool/create', id: 'cd-pool-form' }
   };
 }
index 13921249f08b06c97990bb2b46fec88a189253b5..7ce0fb2ecea6dc6f1e3a5a96dc4485d04d09f066 100644 (file)
@@ -29,3 +29,47 @@ Feature: CephFS Management
         And I confirm the resource "test_cephfs"
         And I click on "Remove File System" button
         Then I should not see a row with "test_cephfs"
+
+    Scenario Outline: Create two cephfs pools for attaching to a volume
+        Given I am on the "create pool" page
+        And enter "name" "<pool_name>"
+        And select "poolType" "<type>"
+        And select options "<application>"
+        And I click on "Create Pool" button
+        Then I should see a row with "<pool_name>"
+
+        Examples:
+            | pool_name | type | application |
+            | e2e_cephfs_data | replicated | cephfs |
+            | e2e_cephfs_meta | replicated | cephfs |
+
+    Scenario Outline: Create a CephFS Volume with pre-created pools
+        Given I am on the "create cephfs" page
+        And enter "name" "<fs_name>"
+        And checks "Use existing pools"
+        And select "dataPool" "<data_pool>"
+        And select "metadataPool" "<metadata_pool>"
+        And I click on "Create File System" button
+        Then I should see a row with "<fs_name>"
+
+        Examples:
+            | fs_name | data_pool | metadata_pool |
+            | e2e_custom_pool_cephfs | e2e_cephfs_data | e2e_cephfs_meta |
+
+    Scenario Outline: Remove CephFS Volume that has pre-created pools
+        Given I am on the "cephfs" page
+        And I select a row "<fs_name>"
+        And I click on "Remove" button from the table actions
+        Then I should see the carbon modal
+        And I confirm the resource "<fs_name>"
+        And I click on "Remove File System" button
+        Then I should not see a row with "<fs_name>"
+
+        # verify pools associated with the volume is removed
+        Given I am on the "pools" page
+        Then I should not see a row with "<data_pool>"
+        And I should not see a row with "<metadata_pool>"
+
+        Examples:
+            | fs_name | data_pool | metadata_pool |
+            | e2e_custom_pool_cephfs | e2e_cephfs_data | e2e_cephfs_meta |