update integration tests

This commit is contained in:
Michael Hudson-Doyle 2020-10-12 14:23:50 +13:00
parent 303c0d75d6
commit 449ad839aa
1 changed files with 10 additions and 12 deletions

View File

@ -4,11 +4,11 @@ python3 -m unittest discover
validate () { validate () {
python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf
if [ ! -e .subiquity/subiquity-debug.log ]; then if [ ! -e .subiquity/subiquity-client-debug.log ] || [ ! -e .subiquity/subiquity-server-debug.log ]; then
echo "log file not created" echo "log file not created"
exit 1 exit 1
fi fi
if grep passw0rd .subiquity/subiquity-debug.log | grep -v "Loaded answers" | grep -v "answers_action"; then if grep passw0rd .subiquity/subiquity-client-debug.log .subiquity/subiquity-server-debug.log | grep -v "Loaded answers" | grep -v "answers_action"; then
echo "password leaked into log file" echo "password leaked into log file"
exit 1 exit 1
fi fi
@ -17,7 +17,7 @@ validate () {
clean () { clean () {
rm -f .subiquity/subiquity-curtin-install.conf rm -f .subiquity/subiquity-curtin-install.conf
rm -f .subiquity/subiquity-debug.log rm -f .subiquity/subiquity-*.log
rm -rf .subiquity/run/ rm -rf .subiquity/run/
} }
@ -33,24 +33,22 @@ for answers in examples/answers*.yaml; do
validate validate
done done
TTY=$(tty || true)
clean clean
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall.yaml \ timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall.yaml \
--dry-run --machine-config examples/existing-partitions.json --bootloader bios \ --dry-run --machine-config examples/existing-partitions.json --bootloader bios \
--kernel-cmdline 'autoinstall console=\"${TTY#/dev/}\"'" --kernel-cmdline 'autoinstall'"
validate validate
python3 scripts/check-yaml-fields.py .subiquity/subiquity-curtin-install.conf \ python3 scripts/check-yaml-fields.py .subiquity/subiquity-curtin-install.conf \
debconf_selections.subiquity='"eek"' debconf_selections.subiquity='"eek"'
python3 scripts/check-yaml-fields.py <(python3 scripts/check-yaml-fields.py .subiquity/etc/cloud/cloud.cfg.d/99-installer.cfg datasource.None.userdata_raw) \ python3 scripts/check-yaml-fields.py <(python3 scripts/check-yaml-fields.py .subiquity/etc/cloud/cloud.cfg.d/99-installer.cfg datasource.None.userdata_raw) \
locale='"en_GB.UTF-8"' locale='"en_GB.UTF-8"'
grep -q 'finish: subiquity/InstallProgress/install/postinstall/install_package1: SUCCESS: installing package1' \ grep -q 'finish: subiquity/Install/install/postinstall/install_package1: SUCCESS: installing package1' \
.subiquity/subiquity-debug.log .subiquity/subiquity-server-debug.log
grep -q 'finish: subiquity/InstallProgress/install/postinstall/install_package2: SUCCESS: installing package2' \ grep -q 'finish: subiquity/Install/install/postinstall/install_package2: SUCCESS: installing package2' \
.subiquity/subiquity-debug.log .subiquity/subiquity-server-debug.log
grep -q 'switching subiquity to edge' .subiquity/subiquity-debug.log grep -q 'switching subiquity to edge' .subiquity/subiquity-server-debug.log
clean clean
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall-user-data.yaml \ timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall-user-data.yaml \
--dry-run --machine-config examples/simple.json \ --dry-run --machine-config examples/simple.json --kernel-cmdline 'autoinstall'"
--kernel-cmdline 'autoinstall console=\"${TTY#/dev/}\"'"
validate validate