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>
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'