tool: Fix TAP output of test-secret-tool.sh

This commit is contained in:
Daiki Ueno 2020-01-13 13:52:11 +01:00
parent 53748c29eb
commit f1451c348a

View File

@ -25,28 +25,28 @@ export SECRET_FILE_TEST_PASSWORD
: ${DIFF=diff} : ${DIFF=diff}
echo 1..4 echo 1..6
echo test1 | ${SECRET_TOOL} store --label label1 foo bar echo test1 | ${SECRET_TOOL} store --label label1 foo bar
if test $? -eq 0; then if test $? -eq 0; then
echo "ok 1 /secret-tool/store" echo "ok 1 /secret-tool/store1"
else else
echo "not ok 1 /secret-tool/store" echo "not ok 1 /secret-tool/store1"
fi fi
echo test2 | ${SECRET_TOOL} store --label label2 foo bar apple orange echo test2 | ${SECRET_TOOL} store --label label2 foo bar apple orange
if test $? -eq 0; then if test $? -eq 0; then
echo "ok 1 /secret-tool/store" echo "ok 2 /secret-tool/store2"
else else
echo "not ok 1 /secret-tool/store" echo "not ok 2 /secret-tool/store2"
fi fi
echo test1 > lookup.exp echo test1 > lookup.exp
${SECRET_TOOL} lookup foo bar > lookup.out ${SECRET_TOOL} lookup foo bar > lookup.out
if ${DIFF} lookup.exp lookup.out > lookup.diff; then if ${DIFF} lookup.exp lookup.out > lookup.diff; then
echo "ok 2 /secret-tool/lookup" echo "ok 3 /secret-tool/lookup"
else else
echo "not ok 2 /secret-tool/lookup" echo "not ok 3 /secret-tool/lookup"
sed 's/^/# /' lookup.diff sed 's/^/# /' lookup.diff
exit 1 exit 1
fi fi
@ -64,22 +64,22 @@ EOF
${SECRET_TOOL} search foo bar | sed '/^created\|^modified/d' > search.out ${SECRET_TOOL} search foo bar | sed '/^created\|^modified/d' > search.out
if test $? -ne 0; then if test $? -ne 0; then
echo "not ok 3 /secret-tool/search" echo "not ok 4 /secret-tool/search"
exit 1 exit 1
fi fi
if ${DIFF} search.exp search.out > search.diff; then if ${DIFF} search.exp search.out > search.diff; then
echo "ok 3 /secret-tool/search" echo "ok 4 /secret-tool/search"
else else
echo "not ok 3 /secret-tool/search" echo "not ok 4 /secret-tool/search"
sed 's/^/# /' search.diff sed 's/^/# /' search.diff
exit 1 exit 1
fi fi
${SECRET_TOOL} clear apple orange ${SECRET_TOOL} clear apple orange
if test $? -eq 0; then if test $? -eq 0; then
echo "ok 4 /secret-tool/clear" echo "ok 5 /secret-tool/clear"
else else
echo "not ok 4 /secret-tool/clear" echo "not ok 5 /secret-tool/clear"
exit 1 exit 1
fi fi
@ -92,13 +92,13 @@ EOF
${SECRET_TOOL} search foo bar | sed '/^created\|^modified/d' > search-after-clear.out ${SECRET_TOOL} search foo bar | sed '/^created\|^modified/d' > search-after-clear.out
if test $? -ne 0; then if test $? -ne 0; then
echo "not ok 5 /secret-tool/search-after-clear" echo "not ok 6 /secret-tool/search-after-clear"
exit 1 exit 1
fi fi
if ${DIFF} search-after-clear.exp search-after-clear.out > search-after-clear.diff; then if ${DIFF} search-after-clear.exp search-after-clear.out > search-after-clear.diff; then
echo "ok 5 /secret-tool/search-after-clear" echo "ok 6 /secret-tool/search-after-clear"
else else
echo "not ok 5 /secret-tool/search-after-clear" echo "not ok 6 /secret-tool/search-after-clear"
sed 's/^/# /' search-after-clear.diff sed 's/^/# /' search-after-clear.diff
exit 1 exit 1
fi fi