]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: Add tests for export create with non-existing fsname and cluster id
authorVarsha Rao <varao@redhat.com>
Tue, 16 Jun 2020 10:04:36 +0000 (15:34 +0530)
committerVarsha Rao <varao@redhat.com>
Tue, 30 Jun 2020 17:47:38 +0000 (23:17 +0530)
Signed-off-by: Varsha Rao <varao@redhat.com>
qa/tasks/cephfs/test_nfs.py

index 0880ba2bfdfb8fe6ae0a55c49aacb2fb9df71766..7ccae6c36cb46672c9c749a251c32aaad0f5ea74 100644 (file)
@@ -185,3 +185,26 @@ class TestNFS(MgrTestCase):
         self._orch_cmd("set", "backend", "cephadm")
         self._test_list_export()
         self._delete_export()
+
+    def test_export_create_with_non_existing_fsname(self):
+        try:
+            fs_name = 'nfs-test'
+            self._test_create_cluster()
+            self._nfs_cmd('export', 'create', 'cephfs', fs_name, self.cluster_id, self.pseudo_path)
+            self.fail(f"Export created with non-existing filesystem {fs_name}")
+        except CommandFailedError as e:
+            # Command should fail for test to pass
+            if e.exitstatus != errno.ENOENT:
+                raise
+        finally:
+            self._test_delete_cluster()
+
+    def test_export_create_with_non_existing_clusterid(self):
+        try:
+            cluster_id = 'invalidtest'
+            self._nfs_cmd('export', 'create', 'cephfs', self.fs_name, cluster_id, self.pseudo_path)
+            self.fail(f"Export created with non-existing cluster id {cluster_id}")
+        except CommandFailedError as e:
+            # Command should fail for test to pass
+            if e.exitstatus != errno.ENOENT:
+                raise