]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: fix bogus grep -v asserts in test_clone()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 30 May 2024 14:54:53 +0000 (16:54 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 13 Jun 2024 12:08:46 +0000 (14:08 +0200)
The intent of "rbd ls | grep -v clone" was probably to check that an
image with the name "clone" shows up in rbd2 pool and not in rbd pool.
However, it's very far from that -- "grep -v clone" would succeed
regardless because of an image with the name "test1" in rbd pool.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
qa/workunits/rbd/cli_generic.sh

index 42c15fc28e8a5d7c134ed491a10fd75cc77a4103..cb062c24ad8d13bead678fc1b5d2d855f172fe5a 100755 (executable)
@@ -385,14 +385,14 @@ test_clone() {
     rbd clone test1@s1 rbd2/clone
     rbd -p rbd2 ls | grep clone
     rbd -p rbd2 ls -l | grep clone | grep test1@s1
-    rbd ls | grep -v clone
+    test "$(rbd ls)" = 'test1'
     rbd flatten rbd2/clone
     rbd snap create rbd2/clone@s1
     rbd snap protect rbd2/clone@s1
     rbd clone rbd2/clone@s1 clone2
     rbd ls | grep clone2
     rbd ls -l | grep clone2 | grep rbd2/clone@s1
-    rbd -p rbd2 ls | grep -v clone2
+    test "$(rbd -p rbd2 ls)" = 'clone'
 
     rbd clone rbd2/clone clone3 |& grep 'snapshot name was not specified'
     rbd clone rbd2/clone@invalid clone3 |& grep 'failed to open parent image'