Skip to content

Commit

Permalink
skip inappropriate checks in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhudson committed Aug 2, 2023
1 parent 0395b6e commit 24a4d76
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions scripts/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,27 @@ validate () {
echo "password leaked into log file"
exit 1
fi
opt=
[ $# -gt 1 ] && opt="$2"
if [ $opt = reset-only ]; then
python3 scripts/validate-yaml.py --no-root-mount "${cfgs[@]}"
else
python3 scripts/validate-yaml.py "${cfgs[@]}"
fi
case $testname in
autoinstall-reset-only)
python3 scripts/validate-yaml.py --no-root-mount "${cfgs[@]}"
;;
answers-core)
;;
*)
python3 scripts/validate-yaml.py "${cfgs[@]}"
;;
esac
if [ ! -e $tmpdir/subiquity-client-debug.log ] || [ ! -e $tmpdir/subiquity-server-debug.log ]; then
echo "log file not created"
exit 1
fi
if [ "$opt" = reset-only ]; then
return
fi
if [ $answers != examples/answers/core.yaml ]; then
python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data
fi
case $testname in
answers-core)
;;
*)
python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data
;;
esac
netplan generate --root $tmpdir
elif [ "${mode}" = "system_setup" ]; then
setup_mode="$2"
Expand Down Expand Up @@ -174,6 +178,7 @@ export SUBIQUITY_REPLAY_TIMESCALE=100

for answers in examples/answers/*.yaml; do
if echo $answers|grep -vq system-setup; then
testname=answers-$(basename $answers .yaml)
config=$(sed -n 's/^#machine-config: \(.*\)/\1/p' $answers || true)
catalog=$(sed -n 's/^#source-catalog: \(.*\)/\1/p' $answers || true)
dr_config=$(sed -n 's/^#dr-config: \(.*\)/\1/p' "$answers" || true)
Expand Down Expand Up @@ -227,6 +232,7 @@ for answers in examples/answers/*.yaml; do
clean
done

testname=autoinstall-most-options
LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \
--dry-run \
Expand Down Expand Up @@ -261,6 +267,7 @@ grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades:
$tmpdir/subiquity-server-debug.log

clean
testname=autoinstall-simple
LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \
--dry-run \
Expand All @@ -275,6 +282,7 @@ python3 scripts/check-yaml-fields.py "$tmpdir"/var/log/installer/autoinstall-use
grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' $tmpdir/subiquity-server-debug.log

clean
testname=autoinstall-hybrid
LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \
--dry-run \
Expand All @@ -288,6 +296,7 @@ LANG=C.UTF-8 timeout --foreground 60 \
validate

clean
testname=autoinstall-reset-only
LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \
--dry-run \
Expand All @@ -296,7 +305,7 @@ LANG=C.UTF-8 timeout --foreground 60 \
--autoinstall examples/autoinstall/reset-only.yaml \
--kernel-cmdline autoinstall \
--source-catalog examples/sources/install.yaml
validate install reset-only
validate install

# The OOBE doesn't exist in WSL < 20.04
if [ "${RELEASE%.*}" -ge 20 ]; then
Expand Down

0 comments on commit 24a4d76

Please sign in to comment.