From: John Mulligan Date: Thu, 12 Jan 2023 18:47:49 +0000 (-0500) Subject: qa/test_nfs: fix test failure when cluster does not exist X-Git-Tag: v18.1.0~491^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F46209%2Fhead;p=ceph.git qa/test_nfs: fix test failure when cluster does not exist The patches that add object formatting / decorators to the nfs module also made error handling more generic when accessing an nfs cluster and now returns a nonzero exit code. A test was after the PR adding the object format support that only checked an error message. Update the test to match the new nfs module behavior as well as fixing a typo. Signed-off-by: John Mulligan --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 58490dea86a9..dc380610aa7c 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -736,7 +736,11 @@ class TestNFS(MgrTestCase): """ Test that cluster info doesn't throw junk data for non-existent cluster """ - cluseter_ls = self._nfs_cmd('cluster', 'ls') - self.assertNotIn('foo', cluseter_ls, 'cluster foo exists') - cluster_info = self._nfs_cmd('cluster', 'info', 'foo') - self.assertIn('cluster does not exist', cluster_info) + cluster_ls = self._nfs_cmd('cluster', 'ls') + self.assertNotIn('foo', cluster_ls, 'cluster foo exists') + try: + self._nfs_cmd('cluster', 'info', 'foo') + self.fail("nfs cluster info foo returned successfully for non-existent cluster") + except CommandFailedError as e: + if e.exitstatus != errno.ENOENT: + raise