]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/test_nfs: fix test failure when cluster does not exist 46209/head
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Jan 2023 18:47:49 +0000 (13:47 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Jan 2023 20:43:54 +0000 (15:43 -0500)
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 <jmulligan@redhat.com>
qa/tasks/cephfs/test_nfs.py

index 58490dea86a95c24b57f4d13c72ae45a854e0425..dc380610aa7c8a512d25802f9b529a863d401f2b 100644 (file)
@@ -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