From 1b1d45bf517237b5221581c3dfb1a7e5fccf712f Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 4 Apr 2018 16:04:41 -0700 Subject: [PATCH] test: Add getjson variable to save output Signed-off-by: David Zafman --- qa/standalone/scrub/osd-scrub-snaps.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qa/standalone/scrub/osd-scrub-snaps.sh b/qa/standalone/scrub/osd-scrub-snaps.sh index c42e0302322..fa8a8e8412d 100755 --- a/qa/standalone/scrub/osd-scrub-snaps.sh +++ b/qa/standalone/scrub/osd-scrub-snaps.sh @@ -16,6 +16,10 @@ # source $CEPH_ROOT/qa/standalone/ceph-helpers.sh +# Test development and debugging +# Set to "yes" in order to ignore diff errors and save results to update test +getjson="no" + function run() { local dir=$1 shift @@ -396,7 +400,11 @@ function TEST_scrub_snaps() { EOF jq "$jqfilter" $dir/json | python -c "$sortkeys" > $dir/csjson - diff ${DIFFCOLOPTS} $dir/checkcsjson $dir/csjson || return 1 + diff ${DIFFCOLOPTS} $dir/checkcsjson $dir/csjson || test $getjson = "yes" || return 1 + if test $getjson = "yes" + then + jq '.' $dir/json > save1.json + fi if which jsonschema > /dev/null; then -- 2.39.5