From: Varsha Rao Date: Tue, 16 Jun 2020 10:04:36 +0000 (+0530) Subject: qa/tasks/cephfs: Add tests for export create with non-existing fsname and cluster id X-Git-Tag: v15.2.5~166^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c650889ddae2b8e34235f12b856929a9ef09873;p=ceph.git qa/tasks/cephfs: Add tests for export create with non-existing fsname and cluster id Signed-off-by: Varsha Rao (cherry picked from commit eab60b5fad6d2e0166d40f255b9507eada831b87) --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 0880ba2bfdf..7ccae6c36cb 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -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