From 5a8c8c01cac7f8ef8b898a88cac96af973350a3d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 30 Jul 2014 13:40:33 -0700 Subject: [PATCH] test/cli-integration/rbd: fix trailing space Newer versions of json.tool remove the trailing ' ' after the comma. Add it back in with sed so that the .t works on both old and new versions, and so that we don't have to remove the trailing spaces from all of the test cases. Backport: firefly Fixes: #8920 Signed-off-by: Sage Weil (cherry picked from commit 605064dc685aa25cc7d58ec18b6449a3ce476d01) Conflicts: src/test/cli-integration/rbd/defaults.t --- .../cli-integration/rbd/formatted-output.t | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/test/cli-integration/rbd/formatted-output.t b/src/test/cli-integration/rbd/formatted-output.t index fe4318aa5c4d4..7c657554d8437 100644 --- a/src/test/cli-integration/rbd/formatted-output.t +++ b/src/test/cli-integration/rbd/formatted-output.t @@ -53,7 +53,7 @@ For now, use a more inclusive regex. \torder 22 (4096 kB objects) (esc) [^^]+ (re) \tformat: 1 (esc) - $ rbd info foo --format json | python -mjson.tool + $ rbd info foo --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rb.0.*", (glob) "format": 1, @@ -82,7 +82,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. [^^]+ (re) \tformat: 1 (esc) \tprotected: False (esc) - $ rbd info foo@snap --format json | python -mjson.tool + $ rbd info foo@snap --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rb.0.*", (glob) "format": 1, @@ -111,7 +111,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. [^^]+ (re) \tformat: 2 (esc) \tfeatures: layering (esc) - $ rbd info bar --format json | python -mjson.tool + $ rbd info bar --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rbd_data.*", (glob) "features": [ @@ -147,7 +147,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. \tformat: 2 (esc) \tfeatures: layering (esc) \tprotected: True (esc) - $ rbd info bar@snap --format json | python -mjson.tool + $ rbd info bar@snap --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rbd_data.*", (glob) "features": [ @@ -185,7 +185,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. \tformat: 2 (esc) \tfeatures: layering (esc) \tprotected: False (esc) - $ rbd info bar@snap2 --format json | python -mjson.tool + $ rbd info bar@snap2 --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rbd_data.*", (glob) "features": [ @@ -222,7 +222,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. [^^]+ (re) \tformat: 2 (esc) \tfeatures: layering (esc) - $ rbd info baz --format json | python -mjson.tool + $ rbd info baz --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rbd_data.*", (glob) "features": [ @@ -256,7 +256,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. \torder 22 (4096 kB objects) (esc) [^^]+ (re) \tformat: 1 (esc) - $ rbd info quux --format json | python -mjson.tool + $ rbd info quux --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rb.0.*", (glob) "format": 1, @@ -283,7 +283,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. [^^]+ (re) \tformat: 2 (esc) \tfeatures: layering (esc) - $ rbd info rbd_other/child --format json | python -mjson.tool + $ rbd info rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rbd_data.*", (glob) "features": [ @@ -321,7 +321,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. \tprotected: False (esc) \tparent: rbd/bar@snap (esc) \toverlap: 512 MB (esc) - $ rbd info rbd_other/child@snap --format json | python -mjson.tool + $ rbd info rbd_other/child@snap --format json | python -mjson.tool | sed 's/,$/, /' { "block_name_prefix": "rbd_data.*", (glob) "features": [ @@ -368,7 +368,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. quux bar baz - $ rbd list --format json | python -mjson.tool + $ rbd list --format json | python -mjson.tool | sed 's/,$/, /' [ "foo", "quux", @@ -391,7 +391,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. bar@snap 512M 2 yes bar@snap2 1024M 2 baz 2048M 2 shr - $ rbd list -l --format json | python -mjson.tool + $ rbd list -l --format json | python -mjson.tool | sed 's/,$/, /' [ { "format": 1, @@ -485,7 +485,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. $ rbd list rbd_other child - $ rbd list rbd_other --format json | python -mjson.tool + $ rbd list rbd_other --format json | python -mjson.tool | sed 's/,$/, /' [ "child" ] @@ -497,7 +497,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. NAME SIZE PARENT FMT PROT LOCK child 512M 2 child@snap 512M rbd/bar@snap 2 - $ rbd list rbd_other -l --format json | python -mjson.tool + $ rbd list rbd_other -l --format json | python -mjson.tool | sed 's/,$/, /' [ { "format": 2, @@ -538,7 +538,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. $ rbd lock list foo - $ rbd lock list foo --format json | python -mjson.tool + $ rbd lock list foo --format json | python -mjson.tool | sed 's/,$/, /' {} $ rbd lock list foo --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' @@ -546,7 +546,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. There is 1 exclusive lock on this image. Locker*ID*Address* (glob) client.* id * (glob) - $ rbd lock list quux --format json | python -mjson.tool + $ rbd lock list quux --format json | python -mjson.tool | sed 's/,$/, /' { "id": { "address": "*", (glob) @@ -567,7 +567,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. client.*id[123].* (re) client.*id[123].* (re) client.*id[123].* (re) - $ rbd lock list baz --format json | python -mjson.tool + $ rbd lock list baz --format json | python -mjson.tool | sed 's/,$/, /' { "id1": { "address": "*", (glob) @@ -600,7 +600,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. $ rbd snap list foo SNAPID NAME SIZE *snap*1024*MB* (glob) - $ rbd snap list foo --format json | python -mjson.tool + $ rbd snap list foo --format json | python -mjson.tool | sed 's/,$/, /' [ { "id": *, (glob) @@ -620,7 +620,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros. SNAPID NAME SIZE *snap*512*MB* (glob) *snap2*1024*MB* (glob) - $ rbd snap list bar --format json | python -mjson.tool + $ rbd snap list bar --format json | python -mjson.tool | sed 's/,$/, /' [ { "id": *, (glob) @@ -647,14 +647,14 @@ whenever it is run. grep -v to ignore it, but still work on other distros. $ rbd snap list baz - $ rbd snap list baz --format json | python -mjson.tool + $ rbd snap list baz --format json | python -mjson.tool | sed 's/,$/, /' [] $ rbd snap list baz --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' $ rbd snap list rbd_other/child SNAPID NAME SIZE *snap*512*MB* (glob) - $ rbd snap list rbd_other/child --format json | python -mjson.tool + $ rbd snap list rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /' [ { "id": *, (glob) -- 2.39.5