diff --git a/tests/tailor-images/README.md b/tests/tailor-images/README.md index b9ddd4b1c2..f3f8f0b382 100644 --- a/tests/tailor-images/README.md +++ b/tests/tailor-images/README.md @@ -9,7 +9,7 @@ for now and is removed in a follow-up cleanup PR. Use the in-tree tailor binary via Cargo: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml matrix trident-testimage --format json +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml matrix trident-installer --format json ``` Build examples: @@ -20,6 +20,9 @@ cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-i # trident-testimage-arm64 cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-testimage -s arch=arm64 --output-dir ./artifacts + +# trident-direct-streaming-installer-arm64 +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-installer -s arch=arm64 -s variant=direct-streaming --output-dir ./artifacts ``` ## Base images @@ -45,5 +48,7 @@ remote source. The current families are: +- `azl-installer` - `trident-functest` +- `trident-installer` - `trident-testimage` diff --git a/tests/tailor-images/azl-installer/image.yaml b/tests/tailor-images/azl-installer/image.yaml new file mode 100644 index 0000000000..c7ca49d701 --- /dev/null +++ b/tests/tailor-images/azl-installer/image.yaml @@ -0,0 +1,20 @@ +name: azl-installer + +base: + ref: baremetal + +outputs: + - format: iso + +rpmSources: + - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides + +extraDependencies: + - ./installer-iso.yaml + - ./mos + - ./iso + - ../common + +config: + $include: ./installer-iso.yaml diff --git a/tests/tailor-images/azl-installer/installer-iso.yaml b/tests/tailor-images/azl-installer/installer-iso.yaml new file mode 100644 index 0000000000..79fcf0c032 --- /dev/null +++ b/tests/tailor-images/azl-installer/installer-iso.yaml @@ -0,0 +1,95 @@ +storage: + bootType: efi + + disks: + - partitionTableType: gpt + maxSize: 4G + partitions: + - id: esp + type: esp + size: 8M + + - id: rootfs + size: grow + + filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + + - deviceId: rootfs + type: ext4 + mountPoint: + path: / + +os: + hostname: azl-installer + bootloader: + resetType: hard-reset + + selinux: + mode: disabled + + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M + + packages: + install: + - curl + - device-mapper + - dnf + - dosfstools + - efibootmgr + - iproute + - iptables + - jq + - lsof + - mdadm + - nano + - netplan + - openssh-server + - squashfs-tools + - tar + - tpm2-tools + - trident-provisioning + - vim + - veritysetup + # Accessibility packages + - pcaudiolib + + additionalFiles: + # Getty service files for root autologin + - source: ../common/files/getty@.service + destination: /usr/lib/systemd/system/getty@.service + - source: ../common/files/serial-getty@.service + destination: /usr/lib/systemd/system/serial-getty@.service + - source: mos/scripts/installation.sh + destination: /root/installer/installation.sh + +iso: + initramfsType: full-os + + additionalFiles: + - source: iso/images/trident-testimage.cosi + destination: /images/azure-linux-core.cosi + - source: iso/bin/liveinstaller + destination: /installer/liveinstaller + - source: iso/files/config-placeholder.yaml + destination: /installer/trident-config.yaml.tmpl + + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=tty1 + - console=ttyS0 + - loglevel=6 + +scripts: + postCustomization: + - path: mos/scripts/startup-command.sh diff --git a/tests/tailor-images/azl-installer/iso/.gitignore b/tests/tailor-images/azl-installer/iso/.gitignore new file mode 100644 index 0000000000..6fda09c27e --- /dev/null +++ b/tests/tailor-images/azl-installer/iso/.gitignore @@ -0,0 +1,2 @@ +/images/ +/bin/ \ No newline at end of file diff --git a/tests/tailor-images/azl-installer/iso/files/config-placeholder.yaml b/tests/tailor-images/azl-installer/iso/files/config-placeholder.yaml new file mode 100644 index 0000000000..135e8d6d57 --- /dev/null +++ b/tests/tailor-images/azl-installer/iso/files/config-placeholder.yaml @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/installer/trident-config.yaml.tmpl:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################## diff --git a/tests/tailor-images/azl-installer/mos/scripts/installation.sh b/tests/tailor-images/azl-installer/mos/scripts/installation.sh new file mode 100644 index 0000000000..79289b519b --- /dev/null +++ b/tests/tailor-images/azl-installer/mos/scripts/installation.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -ex +trap '/bin/bash' ERR + +CDROM_MOUNT="/mnt/cdrom" +WORKING_DIR="/root/installer" +MAGIC_PLACEHOLDER="8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d" + +# Mount CD-ROM using symlink +mkdir -p "$CDROM_MOUNT" +mount /dev/cdrom "$CDROM_MOUNT" + +# CD-ROM paths +LIVEINSTALLER_PATH="$CDROM_MOUNT/installer/liveinstaller" +POSSIBLE_HC_TEMPLATE="$CDROM_MOUNT/installer/trident-config.yaml.tmpl" +IMAGES_DIR="$CDROM_MOUNT/images/" + +# WORKING_DIR paths +LIVEINSTALLER_BIN="$WORKING_DIR/liveinstaller" +TRIDENT_CONFIG_DESTINATION="/etc/trident/config.yaml" +LOG_FILE="$WORKING_DIR/liveinstaller.log" +OUTPUT_LOG="$WORKING_DIR/output_liveinstaller.log" + +# Copy to WORKING_DIR to execute liveinstaller +cp "$LIVEINSTALLER_PATH" "$LIVEINSTALLER_BIN" + +# Check if placeholder magic string is present (ISO not patched) +if grep -q "^#${MAGIC_PLACEHOLDER}:" "$POSSIBLE_HC_TEMPLATE"; then + # Placeholder found - execute attended installation (interactive UI) + cd "$WORKING_DIR" + "$LIVEINSTALLER_BIN" \ + --images-dir="$IMAGES_DIR" \ + --host-config-output="$TRIDENT_CONFIG_DESTINATION" \ + --log-level=trace \ + --log-file="$LOG_FILE" 2>&1 | tee "$OUTPUT_LOG" +else + # Placeholder was replaced by a Host Configuration - execute unattended installation + echo "Pre-configured Host Configuration found. Starting unattended installation..." + # Save template in WORKING_DIR in case of failure + TEMPLATE_FILE="$WORKING_DIR/template.yaml" + cp "$POSSIBLE_HC_TEMPLATE" "$TEMPLATE_FILE" + # Execute liveinstaller (unattended) + cd "$WORKING_DIR" + "$LIVEINSTALLER_BIN" \ + --unattended \ + --template-file="$TEMPLATE_FILE" \ + --log-level=trace \ + --log-file="$LOG_FILE" 2>&1 | tee "$OUTPUT_LOG" +fi + +/bin/bash \ No newline at end of file diff --git a/tests/tailor-images/azl-installer/mos/scripts/startup-command.sh b/tests/tailor-images/azl-installer/mos/scripts/startup-command.sh new file mode 100755 index 0000000000..7502521001 --- /dev/null +++ b/tests/tailor-images/azl-installer/mos/scripts/startup-command.sh @@ -0,0 +1,5 @@ +#!/bin/bash +INSTALLATION="/root/installer/installation.sh" +chmod +x "$INSTALLATION" + +chsh -s "$INSTALLATION" root diff --git a/tests/tailor-images/tailor.yaml b/tests/tailor-images/tailor.yaml index 247f9cdbf7..20bb35f413 100644 --- a/tests/tailor-images/tailor.yaml +++ b/tests/tailor-images/tailor.yaml @@ -64,5 +64,7 @@ baseImages: images: members: + - azl-installer - trident-functest + - trident-installer - trident-testimage diff --git a/tests/tailor-images/trident-installer/README.md b/tests/tailor-images/trident-installer/README.md new file mode 100644 index 0000000000..cf24a33a60 --- /dev/null +++ b/tests/tailor-images/trident-installer/README.md @@ -0,0 +1,19 @@ +# Trident Installer ISO Test Image + +This image is used by the Trident test pipelines. It contains a copy of Trident that launches at +startup and reads a configuration that can be patched into the ISO. + +## Building + +From the repo root, run: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-installer -s arch=amd64 -s variant=default --output-dir ./artifacts +``` + +Other legacy variants map to selectors on the same family: + +- `trident-split-installer` → `-s arch=amd64 -s variant=split` +- `trident-direct-streaming-installer-amd64` → `-s arch=amd64 -s variant=direct-streaming` +- `trident-installer-arm64` → `-s arch=arm64 -s variant=default` +- `trident-direct-streaming-installer-arm64` → `-s arch=arm64 -s variant=direct-streaming` diff --git a/tests/tailor-images/trident-installer/base/files/direct-streaming-placeholder.conf b/tests/tailor-images/trident-installer/base/files/direct-streaming-placeholder.conf new file mode 100644 index 0000000000..a215248819 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/direct-streaming-placeholder.conf @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/direct-streaming.conf:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-installer/base/files/pre-trident-script.sh b/tests/tailor-images/trident-installer/base/files/pre-trident-script.sh new file mode 100644 index 0000000000..2f58380523 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/pre-trident-script.sh @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/pre-trident-script.sh:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-installer/base/files/rcp-agent.yaml b/tests/tailor-images/trident-installer/base/files/rcp-agent.yaml new file mode 100644 index 0000000000..f67f224a79 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/rcp-agent.yaml @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/rcp-agent.yaml:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-installer/base/files/root.profile b/tests/tailor-images/trident-installer/base/files/root.profile new file mode 100644 index 0000000000..0042af12a5 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/root.profile @@ -0,0 +1,5 @@ +# Add short alias to see trident's logs +alias tridentlog="journalctl -u trident -u trident-network" + +# Open journalctl immediately after autologin +journalctl -f --no-tail -u trident -u trident-network \ No newline at end of file diff --git a/tests/tailor-images/trident-installer/base/files/trident-install.service b/tests/tailor-images/trident-installer/base/files/trident-install.service new file mode 100644 index 0000000000..2057d49dd2 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/trident-install.service @@ -0,0 +1,10 @@ +[Unit] +Description=Trident Install Service +After=network.target network-online.target systemd-udev-settle.service + +[Service] +ExecStart=trident install --verbosity DEBUG +Type=oneshot + +[Install] +WantedBy=multi-user.target diff --git a/tests/tailor-images/trident-installer/base/files/trident-split-install.service b/tests/tailor-images/trident-installer/base/files/trident-split-install.service new file mode 100644 index 0000000000..bfb868b857 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/trident-split-install.service @@ -0,0 +1,13 @@ +[Unit] +Description=Trident Install Service +After=network.target network-online.target systemd-udev-settle.service + +[Service] +ExecStart=echo stage +ExecStart=trident install --verbosity DEBUG --allowed-operations stage +ExecStart=echo finalize +ExecStart=trident install --verbosity DEBUG --allowed-operations finalize +Type=oneshot + +[Install] +WantedBy=multi-user.target diff --git a/tests/tailor-images/trident-installer/base/post-install.sh b/tests/tailor-images/trident-installer/base/post-install.sh new file mode 100755 index 0000000000..1bfa85174a --- /dev/null +++ b/tests/tailor-images/trident-installer/base/post-install.sh @@ -0,0 +1,31 @@ +# Add the necessary directories for the audit logs so that auditd can start +mkdir -p /var/log/audit + +# Use more intuitive path for the ISO mount +ln -s -T /run/initramfs/live /trident_cdrom + +# Load the config from the CDROM so that the user can patch it +if [ ! -d /etc/trident ]; then + mkdir -p /etc/trident +fi + +if [ "$1" != "stream-image-test" ]; then + ln -s -T /trident_cdrom/trident-config.yaml /etc/trident/config.yaml + + if [ ! -d /etc/systemd/system/trident-install.service.d ]; then + mkdir -p /etc/systemd/system/trident-install.service.d + fi + ln -s -T /trident_cdrom/trident-override.conf /etc/systemd/system/trident-install.service.d/override.conf +else + # The stream image test purposefully does not have /etc/trident/config.yaml, so remove + # this condition from the systemd service to avoid it failing to start + sed -i 's|ConditionPathExists=/etc/trident/config.yaml||' /usr/lib/systemd/system/trident-install.service +fi + +# Ensure /etc/rcp-agent/ exists +if [ ! -d /etc/rcp-agent ]; then + mkdir -p /etc/rcp-agent +fi + +# Link rcp-agent config from the ISO +ln -s -T /trident_cdrom/rcp-agent.yaml /etc/rcp-agent/config.yaml \ No newline at end of file diff --git a/tests/tailor-images/trident-installer/by-arch/arm64.yaml b/tests/tailor-images/trident-installer/by-arch/arm64.yaml new file mode 100644 index 0000000000..02f51548c7 --- /dev/null +++ b/tests/tailor-images/trident-installer/by-arch/arm64.yaml @@ -0,0 +1,6 @@ +base: + $include: ../common/matrix/base-core-arm64.yaml + +outputs: + $replace: + - format: iso diff --git a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml new file mode 100644 index 0000000000..aa8dd57e6e --- /dev/null +++ b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml @@ -0,0 +1,58 @@ +outputs: + $replace: + - format: iso + +config: + os: + hostname: + $set: trident-direct-streaming-mos-testimage + packages: + update: + - systemd + install: + $remove: + - trident-static-pcrlock-files + - selinux-policy + - audit + $append: + - setools-console + - trident-selinux + - trident-install-service + services: + enable: + $remove: + - trident-install + $append: + - rcp-agent + disable: + - trident-install + additionalFiles: + $remove: + - source: base/files/trident-install.service + destination: /usr/lib/systemd/system/trident-install.service + $append: + - source: ../../../artifacts/rcp-agent + destination: /usr/bin/rcp-agent + - source: ../../../artifacts/rcp-agent.service + destination: /usr/lib/systemd/system/rcp-agent.service + scripts: + postCustomization: + $replace: + - path: base/post-install.sh + arguments: + - stream-image-test + iso: + additionalFiles: + $replace: + - source: base/files/pre-trident-script.sh + destination: /pre-trident-script.sh + - source: base/files/rcp-agent.yaml + destination: /rcp-agent.yaml + kernelCommandLine: + extraCommandLine: + $append: + - selinux=1 + +extraDependencies: + - ../../../artifacts/rcp-agent + - ../../../artifacts/rcp-agent.service diff --git a/tests/tailor-images/trident-installer/by-variant/split.yaml b/tests/tailor-images/trident-installer/by-variant/split.yaml new file mode 100644 index 0000000000..65614b47f1 --- /dev/null +++ b/tests/tailor-images/trident-installer/by-variant/split.yaml @@ -0,0 +1,26 @@ +outputs: + $replace: + - format: iso + +config: + os: + packages: + install: + $remove: + - binutils + - trident-static-pcrlock-files + - selinux-policy + - selinux-policy-devel + - audit + additionalFiles: + $remove: + - source: base/files/trident-install.service + destination: /usr/lib/systemd/system/trident-install.service + $append: + - source: base/files/trident-split-install.service + destination: /usr/lib/systemd/system/trident-install.service + iso: + additionalFiles: + $remove: + - source: ../common/files/override-placeholder.conf + destination: /trident-override.conf diff --git a/tests/tailor-images/trident-installer/image.yaml b/tests/tailor-images/trident-installer/image.yaml new file mode 100644 index 0000000000..dc7bc48d07 --- /dev/null +++ b/tests/tailor-images/trident-installer/image.yaml @@ -0,0 +1,62 @@ +name: trident-installer + +matrix: + arch: [amd64, arm64] + variant: [default, split, direct-streaming] + +selectors: + exclude: + - { arch: arm64, variant: split } + +base: + ref: baremetal + +outputs: + - format: iso + +rpmSources: + - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides + +extraDependencies: + - ./base + - ../common + +config: + storage: + $include: ./include/storage.yaml + os: + bootloader: + resetType: hard-reset + hostname: trident-mos-testimage + packages: + install: + - $include: ./include/common-packages.yaml + - binutils + - trident-static-pcrlock-files + - selinux-policy + - selinux-policy-devel + - audit + services: + enable: + - sshd + - trident-install + - tridentd.socket + additionalFiles: + - $include: ./include/common-files.yaml + - source: base/files/trident-install.service + destination: /usr/lib/systemd/system/trident-install.service + selinux: + mode: enforcing + scripts: + postCustomization: + - path: base/post-install.sh + iso: + additionalFiles: + - source: ../common/files/config-placeholder.yaml + destination: /trident-config.yaml + - source: ../common/files/override-placeholder.conf + destination: /trident-override.conf + kernelCommandLine: + extraCommandLine: + - $include: ./include/kernel-args.yaml diff --git a/tests/tailor-images/trident-installer/include/common-files.yaml b/tests/tailor-images/trident-installer/include/common-files.yaml new file mode 100644 index 0000000000..8c72875d36 --- /dev/null +++ b/tests/tailor-images/trident-installer/include/common-files.yaml @@ -0,0 +1,6 @@ +- source: ../common/files/getty@.service + destination: /usr/lib/systemd/system/getty@.service +- source: ../common/files/serial-getty@.service + destination: /usr/lib/systemd/system/serial-getty@.service +- source: base/files/root.profile + destination: /root/.profile diff --git a/tests/tailor-images/trident-installer/include/common-packages.yaml b/tests/tailor-images/trident-installer/include/common-packages.yaml new file mode 100644 index 0000000000..82b2d430e0 --- /dev/null +++ b/tests/tailor-images/trident-installer/include/common-packages.yaml @@ -0,0 +1,19 @@ +- curl +- device-mapper +- dnf +- dosfstools +- efibootmgr +- iproute +- iptables +- lsof +- mdadm +- netplan +- ntfs-3g +- ntfsprogs +- openssh-server +- squashfs-tools +- tar +- tpm2-tools +- trident +- vim +- veritysetup diff --git a/tests/tailor-images/trident-installer/include/kernel-args.yaml b/tests/tailor-images/trident-installer/include/kernel-args.yaml new file mode 100644 index 0000000000..9b4f24cc61 --- /dev/null +++ b/tests/tailor-images/trident-installer/include/kernel-args.yaml @@ -0,0 +1,3 @@ +- console=tty0 +- console=ttyS0 +- rd.luks=0 diff --git a/tests/tailor-images/trident-installer/include/storage.yaml b/tests/tailor-images/trident-installer/include/storage.yaml new file mode 100644 index 0000000000..28c45f83e1 --- /dev/null +++ b/tests/tailor-images/trident-installer/include/storage.yaml @@ -0,0 +1,20 @@ +bootType: efi +disks: + - partitionTableType: gpt + maxSize: 4G + partitions: + - id: esp + type: esp + size: 8M + - id: rootfs + size: grow +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: rootfs + type: ext4 + mountPoint: + path: /