skip inappropriate checks in integration tests

This commit is contained in:
Michael Hudson-Doyle 2023-08-03 10:02:36 +12:00
parent 0395b6e9b0
commit 24a4d76e42
1 changed files with 23 additions and 14 deletions

View File

@ -35,23 +35,27 @@ validate () {
echo "password leaked into log file" echo "password leaked into log file"
exit 1 exit 1
fi fi
opt= case $testname in
[ $# -gt 1 ] && opt="$2" autoinstall-reset-only)
if [ $opt = reset-only ]; then python3 scripts/validate-yaml.py --no-root-mount "${cfgs[@]}"
python3 scripts/validate-yaml.py --no-root-mount "${cfgs[@]}" ;;
else answers-core)
python3 scripts/validate-yaml.py "${cfgs[@]}" ;;
fi *)
python3 scripts/validate-yaml.py "${cfgs[@]}"
;;
esac
if [ ! -e $tmpdir/subiquity-client-debug.log ] || [ ! -e $tmpdir/subiquity-server-debug.log ]; then if [ ! -e $tmpdir/subiquity-client-debug.log ] || [ ! -e $tmpdir/subiquity-server-debug.log ]; then
echo "log file not created" echo "log file not created"
exit 1 exit 1
fi fi
if [ "$opt" = reset-only ]; then case $testname in
return answers-core)
fi ;;
if [ $answers != examples/answers/core.yaml ]; then *)
python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data
fi ;;
esac
netplan generate --root $tmpdir netplan generate --root $tmpdir
elif [ "${mode}" = "system_setup" ]; then elif [ "${mode}" = "system_setup" ]; then
setup_mode="$2" setup_mode="$2"
@ -174,6 +178,7 @@ export SUBIQUITY_REPLAY_TIMESCALE=100
for answers in examples/answers/*.yaml; do for answers in examples/answers/*.yaml; do
if echo $answers|grep -vq system-setup; then if echo $answers|grep -vq system-setup; then
testname=answers-$(basename $answers .yaml)
config=$(sed -n 's/^#machine-config: \(.*\)/\1/p' $answers || true) config=$(sed -n 's/^#machine-config: \(.*\)/\1/p' $answers || true)
catalog=$(sed -n 's/^#source-catalog: \(.*\)/\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) dr_config=$(sed -n 's/^#dr-config: \(.*\)/\1/p' "$answers" || true)
@ -227,6 +232,7 @@ for answers in examples/answers/*.yaml; do
clean clean
done done
testname=autoinstall-most-options
LANG=C.UTF-8 timeout --foreground 60 \ LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \ python3 -m subiquity.cmd.tui \
--dry-run \ --dry-run \
@ -261,6 +267,7 @@ grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades:
$tmpdir/subiquity-server-debug.log $tmpdir/subiquity-server-debug.log
clean clean
testname=autoinstall-simple
LANG=C.UTF-8 timeout --foreground 60 \ LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \ python3 -m subiquity.cmd.tui \
--dry-run \ --dry-run \
@ -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 grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' $tmpdir/subiquity-server-debug.log
clean clean
testname=autoinstall-hybrid
LANG=C.UTF-8 timeout --foreground 60 \ LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \ python3 -m subiquity.cmd.tui \
--dry-run \ --dry-run \
@ -288,6 +296,7 @@ LANG=C.UTF-8 timeout --foreground 60 \
validate validate
clean clean
testname=autoinstall-reset-only
LANG=C.UTF-8 timeout --foreground 60 \ LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \ python3 -m subiquity.cmd.tui \
--dry-run \ --dry-run \
@ -296,7 +305,7 @@ LANG=C.UTF-8 timeout --foreground 60 \
--autoinstall examples/autoinstall/reset-only.yaml \ --autoinstall examples/autoinstall/reset-only.yaml \
--kernel-cmdline autoinstall \ --kernel-cmdline autoinstall \
--source-catalog examples/sources/install.yaml --source-catalog examples/sources/install.yaml
validate install reset-only validate install
# The OOBE doesn't exist in WSL < 20.04 # The OOBE doesn't exist in WSL < 20.04
if [ "${RELEASE%.*}" -ge 20 ]; then if [ "${RELEASE%.*}" -ge 20 ]; then