From fa29a6e754906c03060e1f6f5f703a1fb1e919a7 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 30 May 2024 16:54:53 +0200 Subject: [PATCH] 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 --- qa/workunits/rbd/cli_generic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/workunits/rbd/cli_generic.sh b/qa/workunits/rbd/cli_generic.sh index 42c15fc28e8..cb062c24ad8 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' -- 2.39.5