Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtests: test for autoinstall w/ lvm password #1587

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions documentation/autoinstall-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ When using the "lvm" layout, LUKS encryption can be enabled by supplying a passw

The default is to use the lvm layout.

WARNING: Conveying the LUKS passphrase in autoinstall carries risk that this passphrase will be leaked. This includes the possibility that software defects may mean that the passphrase is logged, or that the passphrase is captured from the autoinstall in transit. It is strongly recommended to treat this passphrase as a temporary measure until it can be changed, such as with the `cryptsetup luksChangeKey` command.

#### action-based config

For full flexibility, the installer allows storage configuration to be done using a syntax which is a superset of that supported by curtin, described at https://curtin.readthedocs.io/en/latest/topics/storage.html.
Expand Down
6 changes: 6 additions & 0 deletions examples/autoinstall-lvm-password.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 1
user-data: {}
storage:
layout:
name: lvm
password: passw0rd
17 changes: 16 additions & 1 deletion scripts/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ validate () {
exit 1
fi
python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data
if grep passw0rd $tmpdir/subiquity-client-debug.log $tmpdir/subiquity-server-debug.log | grep -v "Loaded answers" | grep -v "answers_action"; then
if grep passw0rd \
$tmpdir/subiquity-client-debug.log \
$tmpdir/subiquity-server-debug.log \
$tmpdir/var/log/installer/autoinstall-user-data \
| grep -v "Loaded answers" | grep -v "answers_action"; then
echo "password leaked into log file"
exit 1
fi
Expand Down Expand Up @@ -240,6 +244,17 @@ grep -q 'switching subiquity to edge' $tmpdir/subiquity-server-debug.log
grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing all updates' \
$tmpdir/subiquity-server-debug.log

clean
LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \
--dry-run \
--output-base "$tmpdir" \
--machine-config examples/simple.json \
--autoinstall examples/autoinstall-lvm-password.yaml \
--kernel-cmdline autoinstall \
--source-catalog examples/install-sources.yaml
validate

clean
LANG=C.UTF-8 timeout --foreground 60 \
python3 -m subiquity.cmd.tui \
Expand Down