mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
* tests: add tests details part 12 This is a set of changes to add details to spread test * Update tests/main/debug-confinement/task.yaml Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl> * Update tests/main/install-many-transactional/task.yaml Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl> * Update tests/main/snap-env/task.yaml Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl> * Update tests/main/snap-get/task.yaml Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl> * Update tests/main/snapd-state/task.yaml Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl> * Updated the details to address review comments --------- Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl>
27 lines
836 B
YAML
27 lines
836 B
YAML
summary: Check commands help
|
|
|
|
details: |
|
|
This test checks the output for the `snap <CMD> help` command
|
|
follows the expected format and content.
|
|
|
|
execute: |
|
|
bad=""
|
|
for CMD in $( GO_FLAGS_COMPLETION=1 snap | grep -evFx 'help|blame' ); do
|
|
printf "Checking help for command %-16s" "'$CMD':"
|
|
expected="Usage:\\n\\s+snap $CMD\\b.*\\n\\nThe $CMD command (?s).*\\.\\n"
|
|
actual="$( snap "$CMD" --help )"
|
|
if ! grep -Pzq "$expected" <<<"$actual"; then
|
|
bad=1
|
|
echo
|
|
echo "The output of 'snap $CMD --help' does not match the regular expression"
|
|
echo "'$expected':"
|
|
echo
|
|
echo "----------------"
|
|
echo "$actual"
|
|
echo "----------------"
|
|
else
|
|
echo " Ok."
|
|
fi
|
|
done
|
|
test ! "$bad"
|