From: Ilya Dryomov Date: Thu, 30 May 2024 14:54:53 +0000 (+0200) Subject: qa/workunits/rbd: fix bogus grep -v asserts in test_clone() X-Git-Tag: v20.0.0~1745^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa29a6e754906c03060e1f6f5f703a1fb1e919a7;p=ceph.git qa/workunits/rbd: fix bogus grep -v asserts in test_clone() 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 --- diff --git a/qa/workunits/rbd/cli_generic.sh b/qa/workunits/rbd/cli_generic.sh index 42c15fc28e8a..cb062c24ad8d 100755 --- a/qa/workunits/rbd/cli_generic.sh +++ b/qa/workunits/rbd/cli_generic.sh @@ -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'