Skip to content

Commit f898376

Browse files
committed
mgr/dashboard: e2e for cephfs creation with existing pools
Fixes: https://tracker.ceph.com/issues/70600 Signed-off-by: Nizamudeen A <[email protected]>
1 parent 8628b46 commit f898376

File tree

3 files changed

+59
-3
lines changed

3 files changed

+59
-3
lines changed

src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ And('enter {string} {string}', (field: string, value: string) => {
99
cy.get(`input[id=${field}]`).clear().type(value);
1010
});
1111

12+
/**
13+
* Ticks a checkbox in the form
14+
* @param field name of the field that needs to be filled out.
15+
*/
16+
And('checks {string}', (field: string) => {
17+
cy.get('cds-checkbox span').contains(field).click();
18+
});
19+
1220
/**
1321
* Fills in the given field using the value provided
1422
* @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) => {
95103
});
96104

97105
And('select {string} {string}', (selectionName: string, option: string) => {
98-
cy.get(`select[name=${selectionName}]`).select(option);
99-
cy.get(`select[name=${selectionName}] option:checked`).contains(option);
106+
cy.get(`select[id=${selectionName}]`).select(option);
107+
cy.get(`select[id=${selectionName}] option:checked`).contains(option);
100108
});

src/pybind/mgr/dashboard/frontend/cypress/e2e/common/urls.po.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export class UrlsCollection extends PageHelper {
4343

4444
// CephFS
4545
cephfs: { url: '#/cephfs/fs', id: 'cd-cephfs-list' },
46-
'create cephfs': { url: '#/cephfs/fs/create', id: 'cd-cephfs-form' }
46+
'create cephfs': { url: '#/cephfs/fs/create', id: 'cd-cephfs-form' },
47+
48+
// Pools
49+
pools: { url: '/#pool', id: 'cd-pool-list' },
50+
'create pool': { url: '#/pool/create', id: 'cd-pool-form' }
4751
};
4852
}

src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,47 @@ Feature: CephFS Management
2929
And I confirm the resource "test_cephfs"
3030
And I click on "Remove File System" button
3131
Then I should not see a row with "test_cephfs"
32+
33+
Scenario Outline: Create two cephfs pools for attaching to a volume
34+
Given I am on the "create pool" page
35+
And enter "name" "<pool_name>"
36+
And select "poolType" "<type>"
37+
And select options "<application>"
38+
And I click on "Create Pool" button
39+
Then I should see a row with "<pool_name>"
40+
41+
Examples:
42+
| pool_name | type | application |
43+
| e2e_cephfs_data | replicated | cephfs |
44+
| e2e_cephfs_meta | replicated | cephfs |
45+
46+
Scenario Outline: Create a CephFS Volume with pre-created pools
47+
Given I am on the "create cephfs" page
48+
And enter "name" "<fs_name>"
49+
And checks "Use existing pools"
50+
And select "dataPool" "<data_pool>"
51+
And select "metadataPool" "<metadata_pool>"
52+
And I click on "Create File System" button
53+
Then I should see a row with "<fs_name>"
54+
55+
Examples:
56+
| fs_name | data_pool | metadata_pool |
57+
| e2e_custom_pool_cephfs | e2e_cephfs_data | e2e_cephfs_meta |
58+
59+
Scenario Outline: Remove CephFS Volume that has pre-created pools
60+
Given I am on the "cephfs" page
61+
And I select a row "<fs_name>"
62+
And I click on "Remove" button from the table actions
63+
Then I should see the carbon modal
64+
And I confirm the resource "<fs_name>"
65+
And I click on "Remove File System" button
66+
Then I should not see a row with "<fs_name>"
67+
68+
# verify pools associated with the volume is removed
69+
Given I am on the "pools" page
70+
Then I should not see a row with "<data_pool>"
71+
And I should not see a row with "<metadata_pool>"
72+
73+
Examples:
74+
| fs_name | data_pool | metadata_pool |
75+
| e2e_custom_pool_cephfs | e2e_cephfs_data | e2e_cephfs_meta |

0 commit comments

Comments
 (0)