From 55c68b58558de6c78242ffb9f88f3a754b5c4bb3 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 19 Jul 2023 15:15:23 +1200 Subject: [PATCH] add an integration test to install core and some fixes Note that it may not be possible to create an fsimage to use as a core installation source (haven't tried, tbh) but I have upcoming changes to use a disk image as installation source. --- examples/answers/core.yaml | 24 ++++++++++++++++++++++++ examples/sources/core.yaml | 10 ++++++++++ scripts/runtests.sh | 8 ++++++-- subiquity/models/oem.py | 1 + subiquity/server/server.py | 5 +++-- 5 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 examples/answers/core.yaml create mode 100644 examples/sources/core.yaml diff --git a/examples/answers/core.yaml b/examples/answers/core.yaml new file mode 100644 index 00000000..df48bd8b --- /dev/null +++ b/examples/answers/core.yaml @@ -0,0 +1,24 @@ +#source-catalog: examples/sources/core.yaml +Source: + source: ubuntu-core +Welcome: + lang: en_US +Refresh: + update: no +Keyboard: + layout: us +Zdev: + accept-default: yes +Network: + accept-default: yes +Proxy: + proxy: "" +Filesystem: + guided: yes + guided-index: 0 +UbuntuPro: + token: "" +InstallProgress: + reboot: yes +Drivers: + install: yes diff --git a/examples/sources/core.yaml b/examples/sources/core.yaml new file mode 100644 index 00000000..8156c7d4 --- /dev/null +++ b/examples/sources/core.yaml @@ -0,0 +1,10 @@ +- description: + en: This test source provides a "Ubuntu Core" base install + id: ubuntu-core + locale_support: none + name: + en: Ubuntu Server + path: ubuntu-core.squashfs + size: 530485248 + type: fsimage + variant: core diff --git a/scripts/runtests.sh b/scripts/runtests.sh index d8edc74e..fd2e3023 100755 --- a/scripts/runtests.sh +++ b/scripts/runtests.sh @@ -49,7 +49,9 @@ validate () { if [ "$opt" = reset-only ]; then return fi - python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data + if [ $answers != examples/answers/core.yaml ]; then + python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data + fi netplan generate --root $tmpdir elif [ "${mode}" = "system_setup" ]; then setup_mode="$2" @@ -194,7 +196,9 @@ for answers in examples/answers/*.yaml; do --snaps-from-examples \ --source-catalog $catalog validate install - grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' $tmpdir/subiquity-server-debug.log + if [ $answers != examples/answers/core.yaml ]; then + grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' $tmpdir/subiquity-server-debug.log + fi else # The OOBE doesn't exist in WSL < 20.04 if [ "${RELEASE%.*}" -ge 20 ]; then diff --git a/subiquity/models/oem.py b/subiquity/models/oem.py index c01e0076..64ca4055 100644 --- a/subiquity/models/oem.py +++ b/subiquity/models/oem.py @@ -39,6 +39,7 @@ class OEMModel: self.install_on = { "server": False, "desktop": True, + "core": False, } def make_autoinstall(self) -> Dict[str, Union[str, bool]]: diff --git a/subiquity/server/server.py b/subiquity/server/server.py index 6d0e687c..7ffb47b0 100644 --- a/subiquity/server/server.py +++ b/subiquity/server/server.py @@ -214,11 +214,12 @@ INSTALL_MODEL_NAMES = ModelNames({ "filesystem", "kernel", "keyboard", - "mirror", "network", "proxy", "source", - }) + }, + desktop={'mirror'}, + server={'mirror'}) POSTINSTALL_MODEL_NAMES = ModelNames({ "drivers",