]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/07-nfs-exports.e2e-spec.ts
import ceph 16.2.7
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / orchestrator / workflow / 07-nfs-exports.e2e-spec.ts
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/07-nfs-exports.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/07-nfs-exports.e2e-spec.ts
new file mode 100644 (file)
index 0000000..2d92075
--- /dev/null
@@ -0,0 +1,81 @@
+import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
+import { NFSPageHelper } from 'cypress/integration/orchestrator/workflow/nfs/nfs-export.po';
+import { BucketsPageHelper } from 'cypress/integration/rgw/buckets.po';
+
+describe('nfsExport page', () => {
+  const nfsExport = new NFSPageHelper();
+  const services = new ServicesPageHelper();
+  const buckets = new BucketsPageHelper();
+  const bucketName = 'e2e.nfs.bucket';
+  // @TODO: uncomment this when a CephFS volume can be created through Dashboard.
+  // const fsPseudo = '/fsPseudo';
+  const rgwPseudo = '/rgwPseudo';
+  const editPseudo = '/editPseudo';
+  const backends = ['CephFS', 'Object Gateway'];
+  const squash = 'no_root_squash';
+  const client: object = { addresses: '192.168.0.10' };
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    nfsExport.navigateTo();
+  });
+
+  describe('breadcrumb test', () => {
+    it('should open and show breadcrumb', () => {
+      nfsExport.expectBreadcrumbText('NFS');
+    });
+  });
+
+  describe('Create, edit and delete', () => {
+    it('should create an NFS cluster', () => {
+      services.navigateTo('create');
+
+      services.addService('nfs');
+
+      services.checkExist('nfs.testnfs', true);
+      services.getExpandCollapseElement().click();
+      services.checkServiceStatus('nfs');
+    });
+
+    it('should create a nfs-export with RGW backend', () => {
+      buckets.navigateTo('create');
+      buckets.create(bucketName, 'dashboard', 'default-placement');
+
+      nfsExport.navigateTo();
+      nfsExport.existTableCell(rgwPseudo, false);
+      nfsExport.navigateTo('create');
+      nfsExport.create(backends[1], squash, client, rgwPseudo, bucketName);
+      nfsExport.existTableCell(rgwPseudo);
+    });
+
+    // @TODO: uncomment this when a CephFS volume can be created through Dashboard.
+    // it('should create a nfs-export with CephFS backend', () => {
+    //   nfsExport.navigateTo();
+    //   nfsExport.existTableCell(fsPseudo, false);
+    //   nfsExport.navigateTo('create');
+    //   nfsExport.create(backends[0], squash, client, fsPseudo);
+    //   nfsExport.existTableCell(fsPseudo);
+    // });
+
+    it('should show Clients', () => {
+      nfsExport.clickTab('cd-nfs-details', rgwPseudo, 'Clients (1)');
+      cy.get('cd-nfs-details').within(() => {
+        nfsExport.getTableCount('total').should('be.gte', 0);
+      });
+    });
+
+    it('should edit an export', () => {
+      nfsExport.editExport(rgwPseudo, editPseudo);
+
+      nfsExport.existTableCell(editPseudo);
+    });
+
+    it('should delete exports and bucket', () => {
+      nfsExport.delete(editPseudo);
+
+      buckets.navigateTo();
+      buckets.delete(bucketName);
+    });
+  });
+});