Added integration test for WSL
This tests covers the configuration of WSL on first boot.
This commit is contained in:
parent
f41f44e9d6
commit
b0299f255f
|
@ -0,0 +1,18 @@
|
||||||
|
Welcome:
|
||||||
|
lang: en_US
|
||||||
|
WSLIdentity:
|
||||||
|
realname: Ubuntu
|
||||||
|
username: ubuntu
|
||||||
|
# ubuntu
|
||||||
|
password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1'
|
||||||
|
Integration:
|
||||||
|
custom_path: '/custom_mnt_path'
|
||||||
|
custom_mount_opt: 'opt1 opt2 opt3'
|
||||||
|
gen_host: false
|
||||||
|
gen_resolvconf: false
|
||||||
|
Overview:
|
||||||
|
noproperty: "there is no property for this view, just a done button but subiquity requires something to proceed"
|
||||||
|
InstallProgress:
|
||||||
|
reboot: yes
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@ testschema=.subiquity/test-autoinstall-schema.json
|
||||||
export PYTHONPATH=$PWD:$PWD/probert:$PWD/curtin
|
export PYTHONPATH=$PWD:$PWD/probert:$PWD/curtin
|
||||||
|
|
||||||
validate () {
|
validate () {
|
||||||
|
mode="install"
|
||||||
|
[ $# -gt 0 ] && mode="$1"
|
||||||
|
|
||||||
|
if [ "${mode}" = "install" ]; then
|
||||||
python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf
|
python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf
|
||||||
if [ ! -e .subiquity/subiquity-client-debug.log ] || [ ! -e .subiquity/subiquity-server-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"
|
||||||
|
@ -15,6 +19,12 @@ validate () {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
netplan generate --root .subiquity
|
netplan generate --root .subiquity
|
||||||
|
elif [ "${mode}" = "system_setup" ]; then
|
||||||
|
# TODO WSL: Compare generated wsl.conf to oracle
|
||||||
|
echo "system setup validation"
|
||||||
|
else
|
||||||
|
echo "W: Unknown validation mode: ${mode}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
clean () {
|
clean () {
|
||||||
|
@ -45,6 +55,7 @@ tty=$(tty) || tty=/dev/console
|
||||||
export SUBIQUITY_REPLAY_TIMESCALE=100
|
export SUBIQUITY_REPLAY_TIMESCALE=100
|
||||||
for answers in examples/answers*.yaml; do
|
for answers in examples/answers*.yaml; do
|
||||||
clean
|
clean
|
||||||
|
if echo $answers|grep -vq system-setup; then
|
||||||
config=$(sed -n 's/^#machine-config: \(.*\)/\1/p' $answers || true)
|
config=$(sed -n 's/^#machine-config: \(.*\)/\1/p' $answers || true)
|
||||||
if [ -z "$config" ]; then
|
if [ -z "$config" ]; then
|
||||||
config=examples/simple.json
|
config=examples/simple.json
|
||||||
|
@ -58,6 +69,10 @@ for answers in examples/answers*.yaml; do
|
||||||
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --bootloader uefi --answers $answers --dry-run --snaps-from-examples --machine-config $config $opts" < $tty
|
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --bootloader uefi --answers $answers --dry-run --snaps-from-examples --machine-config $config $opts" < $tty
|
||||||
validate
|
validate
|
||||||
grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' .subiquity/subiquity-server-debug.log
|
grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' .subiquity/subiquity-server-debug.log
|
||||||
|
else
|
||||||
|
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m system_setup.cmd.tui --answers $answers --dry-run " < $tty
|
||||||
|
validate "system_setup"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
clean
|
clean
|
||||||
|
|
Loading…
Reference in New Issue