Skip to content

Commit

Permalink
test/main: Fix indentation
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Jan 29, 2025
1 parent 04a2ebe commit ec292bc
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,43 @@ cleanup() {
set +x
fi

for name in $(lxc list -c n -f csv micro); do
echo -n "${name} CLI stdout:"
if ! lxc exec "${name}" -- test -e out; then
echo " was not found"
elif ! lxc exec "${name}" -- test -s out; then
echo " was empty"
else
echo
lxc exec "${name}" -- cat out
fi

for name in $(lxc list -c n -f csv micro); do
echo -n "${name} CLI stdout:"
if ! lxc exec "${name}" -- test -e out; then
echo " was not found"
elif ! lxc exec "${name}" -- test -s out; then
echo " was empty"
else
echo
lxc exec "${name}" -- cat out
fi
echo

echo -n "${name} Debug output:"
if ! lxc exec "${name}" -- test -e debug; then
echo " was not found"
elif ! lxc exec "${name}" -- test -s debug; then
echo " was empty"
else
echo
# The github console can't interpret the escape sequences baked into the output, so omit them manually.
lxc exec "${name}" -- cat -v debug | sed -e 's/\^M$//g' -e 's/.*\^M//g' -e 's/\^\[\[D//' -e 's/^\^\[.*//g' -e '/^$/d'
fi
if ! lxc exec "${name}" -- test -e debug; then
echo " was not found"
elif ! lxc exec "${name}" -- test -s debug; then
echo " was empty"
else
echo
# The github console can't interpret the escape sequences baked into the output, so omit them manually.
lxc exec "${name}" -- cat -v debug | sed -e 's/\^M$//g' -e 's/.*\^M//g' -e 's/\^\[\[D//' -e 's/^\^\[.*//g' -e '/^$/d'
fi
echo
<<<<<<< HEAD

Check failure

Code scanning / shellcheck

SC1072 Error test

Fix any mentioned problems and try again.
<<<<<<< Updated upstream
=======

echo -n "${name} MicroCloud daemon log:"
lxc exec "${name}" -- snap logs microcloud -n 200
>>>>>>> 4f4a5f4 (test/main: Add MicroCloud daemon's log when running cleanup)
done
=======
echo -n "${name} MicroCloud daemon log:"
lxc exec "${name}" -- snap logs microcloud -n 200
done
>>>>>>> Stashed changes
if [ ${enable_xtrace} = 1 ]; then
set -x
Expand Down

0 comments on commit ec292bc

Please sign in to comment.