From 0ac52227d1ba7440c1bd3ea8b455332c79a56499 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sat, 10 Oct 2026 16:57:13 +0000 Subject: [PATCH 01/26] tests: add standalone tailor image workspace Copy the new tailor-based image definitions into tests/tailor-images as a self-contained workspace that can be validated and dry-run independently of the existing tests/images tree. The old tests/images tree remains untouched in this change. Only the new tailor manifest, per-family image definitions, and the support files and helper YAML fragments they reference are copied over. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/README.md | 66 ++++++++++++ tests/tailor-images/azl-installer/image.yaml | 18 ++++ .../azl-installer/installer-iso.yaml | 95 ++++++++++++++++ .../azl-installer/iso/.gitignore | 2 + .../iso/files/config-placeholder.yaml | 1 + .../azl-installer/mos/files/getty@.service | 58 ++++++++++ .../mos/files/serial-getty@.service | 46 ++++++++ .../azl-installer/mos/scripts/installation.sh | 51 +++++++++ .../mos/scripts/startup-command.sh | 5 + .../base/post-install.sh | 2 + .../by-arch/arm64.yaml | 3 + .../image.yaml | 19 ++++ .../tailor/baseimg.yaml | 68 ++++++++++++ .../by-arch+source/arm64+ubuntu-2204.yaml | 3 + .../by-arch+source/arm64+ubuntu-2404.yaml | 3 + .../by-source/gb200-2404.yaml | 3 + .../by-source/ubuntu-2404.yaml | 3 + .../image.yaml | 16 +++ tests/tailor-images/tailor.yaml | 76 +++++++++++++ .../trident-container-installer/README.md | 20 ++++ .../base/files/config-placeholder.yaml | 1 + .../base/files/containerd-mmap-fix.cil | 7 ++ .../base/files/getty@.service | 58 ++++++++++ .../base/files/override-placeholder.conf | 1 + .../base/files/root.profile | 2 + .../base/files/serial-getty@.service | 46 ++++++++ .../base/files/trident-container.service | 16 +++ .../scripts/load-containerd-selinux-fix.sh | 5 + .../base/scripts/post-install.sh | 15 +++ .../trident-container-installer/image.yaml | 13 +++ .../tailor/baseimg.yaml | 71 ++++++++++++ .../trident-container-testimage/README.md | 19 ++++ .../base/files/containerd-mmap-fix.cil | 7 ++ .../base/files/trident-container.service | 16 +++ .../scripts/load-containerd-selinux-fix.sh | 5 + .../base/scripts/post-install.sh | 2 + .../trident-container-testimage/image.yaml | 13 +++ .../tailor/baseimg.yaml | 71 ++++++++++++ .../tailor-images/trident-functest/image.yaml | 13 +++ .../trident-functest/tailor/baseimg.yaml | 75 +++++++++++++ .../tailor-images/trident-installer/README.md | 19 ++++ .../base/files/config-placeholder.yaml | 1 + .../files/direct-streaming-placeholder.conf | 1 + .../base/files/getty@.service | 58 ++++++++++ .../base/files/override-placeholder.conf | 1 + .../base/files/pre-trident-script.sh | 1 + .../base/files/rcp-agent.yaml | 1 + .../trident-installer/base/files/root.profile | 5 + .../base/files/serial-getty@.service | 46 ++++++++ .../base/files/trident-install.service | 10 ++ .../base/files/trident-split-install.service | 13 +++ .../trident-installer/base/post-install.sh | 31 ++++++ .../trident-installer/by-arch/arm64.yaml | 3 + .../by-variant/direct-streaming.yaml | 52 +++++++++ .../trident-installer/by-variant/split.yaml | 22 ++++ .../trident-installer/image.yaml | 60 +++++++++++ .../include/common-files.yaml | 6 ++ .../include/common-packages.yaml | 19 ++++ .../include/kernel-args.yaml | 3 + .../trident-installer/include/storage.yaml | 20 ++++ .../tailor-images/trident-testimage/README.md | 26 +++++ .../base/files/use-grpc-client-commit.conf | 5 + .../trident-testimage/base/post-install.sh | 2 + .../trident-testimage/by-arch/arm64.yaml | 3 + .../trident-testimage/image.yaml | 19 ++++ .../trident-testimage/tailor/baseimg.yaml | 66 ++++++++++++ .../trident-verity-testimage/README.md | 31 ++++++ .../base/create-web-dir.sh | 2 + .../base/etc-mount.service | 17 +++ .../base/etc-mount.sh | 7 ++ .../trident-verity-testimage/base/etc.mount | 10 ++ .../base/files/trident-container.service | 14 +++ .../base/files/use-grpc-client-commit.conf | 5 + .../base/sudoers-wheel | 1 + .../base/trident-debug-log.sh | 3 + .../by-deployment+mode/container+root.yaml | 19 ++++ .../by-deployment+mode/container+usr.yaml | 15 +++ .../by-deployment+mode/host+root.yaml | 17 +++ .../by-deployment+mode/host+usr.yaml | 17 +++ .../by-deployment/container.yaml | 1 + .../by-deployment/host.yaml | 2 + .../by-mode/root.yaml | 5 + .../trident-verity-testimage/by-mode/usr.yaml | 14 +++ .../trident-verity-testimage/image.yaml | 17 +++ .../include/root-os-common.yaml | 42 ++++++++ .../include/root-storage.yaml | 56 ++++++++++ .../include/usr-os-common.yaml | 41 +++++++ .../include/usr-storage.yaml | 45 ++++++++ .../usr/files/dracut-nohostonly.conf | 1 + .../usr/files/sudoers-wheel | 1 + .../usr/files/trident-container.service | 14 +++ .../usr/files/use-grpc-client-commit.conf | 5 + .../trident-vm-testimage/README.md | 51 +++++++++ .../trident-vm-testimage/base/.gitignore | 1 + .../trident-vm-testimage/base/etc.mount | 10 ++ .../base/files/.gitignore | 3 + .../base/files/99-dhcp-eth0.network | 6 ++ .../base/files/etc-mount-mic.service | 15 +++ .../base/files/etc-mount.service | 17 +++ .../base/files/etc-mount.sh | 24 +++++ .../base/files/sshd-keygen.service | 14 +++ .../base/files/sudoers-wheel | 1 + .../trident-acl-agent-cert-install.service | 28 +++++ .../files/trident-acl-agent-override.conf | 10 ++ .../base/files/use-grpc-client-commit.conf | 5 + .../base/scripts/create-rw-overlay-dirs.sh | 2 + .../base/scripts/create-ssh-dirs.sh | 3 + .../base/scripts/duid-type-to-link-layer.sh | 1 + .../base/scripts/lsblk.sh | 1 + .../base/scripts/post-install.sh | 2 + .../prepare-update-config-usrverity.sh | 9 ++ .../scripts/prepare-update-config-verity.sh | 36 +++++++ .../base/scripts/prepare-update-config.sh | 9 ++ .../base/scripts/ssh-move-host-keys.sh | 9 ++ .../base/scripts/update-host-status.sh | 1 + .../base/scripts/update-os-release.sh | 2 + .../trident-vm-testimage/by-arch/arm64.yaml | 3 + .../by-scenario/acl-agent.yaml | 24 +++++ .../grub-verity+grub-verity-azure.yaml | 6 ++ .../by-scenario/grub-verity-azure.yaml | 23 ++++ .../by-scenario/grub-verity.yaml | 5 + .../by-scenario/grub.yaml | 55 ++++++++++ .../root-verity+usr-verity+acl-agent.yaml | 8 ++ .../by-scenario/root-verity.yaml | 24 +++++ .../by-scenario/usr-verity.yaml | 15 +++ .../trident-vm-testimage/image.yaml | 23 ++++ .../include/grub-scripts.yaml | 4 + .../include/grub-verity-os-common.yaml | 59 ++++++++++ .../include/grub-verity-scripts.yaml | 4 + .../include/storage-acl-agent.yaml | 101 ++++++++++++++++++ .../include/storage-grub-verity.yaml | 54 ++++++++++ .../include/storage-grub.yaml | 31 ++++++ .../include/storage-root-verity.yaml | 78 ++++++++++++++ .../include/storage-usr-verity.yaml | 77 +++++++++++++ .../include/uki-verity-os-common.yaml | 41 +++++++ .../include/uki-verity-scripts.yaml | 6 ++ 136 files changed, 2810 insertions(+) create mode 100644 tests/tailor-images/README.md create mode 100644 tests/tailor-images/azl-installer/image.yaml create mode 100644 tests/tailor-images/azl-installer/installer-iso.yaml create mode 100644 tests/tailor-images/azl-installer/iso/.gitignore create mode 100644 tests/tailor-images/azl-installer/iso/files/config-placeholder.yaml create mode 100644 tests/tailor-images/azl-installer/mos/files/getty@.service create mode 100644 tests/tailor-images/azl-installer/mos/files/serial-getty@.service create mode 100644 tests/tailor-images/azl-installer/mos/scripts/installation.sh create mode 100644 tests/tailor-images/azl-installer/mos/scripts/startup-command.sh create mode 100644 tests/tailor-images/azurelinux-direct-streaming-testimage/base/post-install.sh create mode 100644 tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml create mode 100644 tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml create mode 100644 tests/tailor-images/azurelinux-direct-streaming-testimage/tailor/baseimg.yaml create mode 100644 tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml create mode 100644 tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml create mode 100644 tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml create mode 100644 tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml create mode 100644 tests/tailor-images/foreign-direct-streaming-testimage/image.yaml create mode 100644 tests/tailor-images/tailor.yaml create mode 100644 tests/tailor-images/trident-container-installer/README.md create mode 100644 tests/tailor-images/trident-container-installer/base/files/config-placeholder.yaml create mode 100644 tests/tailor-images/trident-container-installer/base/files/containerd-mmap-fix.cil create mode 100644 tests/tailor-images/trident-container-installer/base/files/getty@.service create mode 100644 tests/tailor-images/trident-container-installer/base/files/override-placeholder.conf create mode 100644 tests/tailor-images/trident-container-installer/base/files/root.profile create mode 100644 tests/tailor-images/trident-container-installer/base/files/serial-getty@.service create mode 100644 tests/tailor-images/trident-container-installer/base/files/trident-container.service create mode 100644 tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh create mode 100644 tests/tailor-images/trident-container-installer/base/scripts/post-install.sh create mode 100644 tests/tailor-images/trident-container-installer/image.yaml create mode 100644 tests/tailor-images/trident-container-installer/tailor/baseimg.yaml create mode 100644 tests/tailor-images/trident-container-testimage/README.md create mode 100644 tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil create mode 100644 tests/tailor-images/trident-container-testimage/base/files/trident-container.service create mode 100644 tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh create mode 100644 tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh create mode 100644 tests/tailor-images/trident-container-testimage/image.yaml create mode 100644 tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml create mode 100644 tests/tailor-images/trident-functest/image.yaml create mode 100644 tests/tailor-images/trident-functest/tailor/baseimg.yaml create mode 100644 tests/tailor-images/trident-installer/README.md create mode 100644 tests/tailor-images/trident-installer/base/files/config-placeholder.yaml create mode 100644 tests/tailor-images/trident-installer/base/files/direct-streaming-placeholder.conf create mode 100644 tests/tailor-images/trident-installer/base/files/getty@.service create mode 100644 tests/tailor-images/trident-installer/base/files/override-placeholder.conf create mode 100644 tests/tailor-images/trident-installer/base/files/pre-trident-script.sh create mode 100644 tests/tailor-images/trident-installer/base/files/rcp-agent.yaml create mode 100644 tests/tailor-images/trident-installer/base/files/root.profile create mode 100644 tests/tailor-images/trident-installer/base/files/serial-getty@.service create mode 100644 tests/tailor-images/trident-installer/base/files/trident-install.service create mode 100644 tests/tailor-images/trident-installer/base/files/trident-split-install.service create mode 100644 tests/tailor-images/trident-installer/base/post-install.sh create mode 100644 tests/tailor-images/trident-installer/by-arch/arm64.yaml create mode 100644 tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml create mode 100644 tests/tailor-images/trident-installer/by-variant/split.yaml create mode 100644 tests/tailor-images/trident-installer/image.yaml create mode 100644 tests/tailor-images/trident-installer/include/common-files.yaml create mode 100644 tests/tailor-images/trident-installer/include/common-packages.yaml create mode 100644 tests/tailor-images/trident-installer/include/kernel-args.yaml create mode 100644 tests/tailor-images/trident-installer/include/storage.yaml create mode 100644 tests/tailor-images/trident-testimage/README.md create mode 100644 tests/tailor-images/trident-testimage/base/files/use-grpc-client-commit.conf create mode 100644 tests/tailor-images/trident-testimage/base/post-install.sh create mode 100644 tests/tailor-images/trident-testimage/by-arch/arm64.yaml create mode 100644 tests/tailor-images/trident-testimage/image.yaml create mode 100644 tests/tailor-images/trident-testimage/tailor/baseimg.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/README.md create mode 100644 tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh create mode 100644 tests/tailor-images/trident-verity-testimage/base/etc-mount.service create mode 100644 tests/tailor-images/trident-verity-testimage/base/etc-mount.sh create mode 100644 tests/tailor-images/trident-verity-testimage/base/etc.mount create mode 100644 tests/tailor-images/trident-verity-testimage/base/files/trident-container.service create mode 100644 tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf create mode 100644 tests/tailor-images/trident-verity-testimage/base/sudoers-wheel create mode 100644 tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh create mode 100644 tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-deployment/container.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-mode/root.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/by-mode/usr.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/image.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/include/root-storage.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/include/usr-storage.yaml create mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/dracut-nohostonly.conf create mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel create mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service create mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf create mode 100644 tests/tailor-images/trident-vm-testimage/README.md create mode 100644 tests/tailor-images/trident-vm-testimage/base/.gitignore create mode 100644 tests/tailor-images/trident-vm-testimage/base/etc.mount create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/.gitignore create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/99-dhcp-eth0.network create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/etc-mount-mic.service create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/etc-mount.service create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/sshd-keygen.service create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-override.conf create mode 100644 tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/lsblk.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh create mode 100644 tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh create mode 100644 tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity+grub-verity-azure.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/image.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/grub-scripts.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/grub-verity-scripts.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-acl-agent.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-grub-verity.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-grub.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-root-verity.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-usr-verity.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/uki-verity-os-common.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/uki-verity-scripts.yaml diff --git a/tests/tailor-images/README.md b/tests/tailor-images/README.md new file mode 100644 index 0000000000..fbd8ac44df --- /dev/null +++ b/tests/tailor-images/README.md @@ -0,0 +1,66 @@ +# Test images with tailor + +`tests/images/` is now a [tailor](../../tools/tailor/README.md) workspace. +The legacy `testimages.py` / `builder/` flow is removed. + +## Build from the repo root + +Use the in-tree tailor binary via Cargo: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml matrix trident-installer --format json +``` + +Build examples: + +```bash +# trident-testimage +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts + +# trident-testimage-arm64 +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/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/images/tailor.yaml build trident-installer -s arch=arm64 -s variant=direct-streaming --output-dir ./artifacts + +# trident-container-usrverity-testimage (signed) +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-verity-testimage -s deployment=container -s mode=usr --output-dir ./artifacts +``` + +## Base images + +The workspace uses a `baseImages:` catalogue in `tests/images/tailor.yaml`. +For the Azure Linux base slots you can materialize the defaults locally with: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases download baremetal core_arm64 core_selinux qemu_guest +``` + +Verify that every referenced base file exists: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases verify +``` + +Ubuntu / GB200 direct-streaming inputs still come from the pipeline-managed blob +staging flow; those slots are intentionally catalogued without an in-workspace +remote source. + +## Legacy name mapping + +Pipelines still accept the historical image names. `tests/images/legacy-map.json` +maps each legacy name to the tailor image family, selectors, expected base slot, +and published artifact extension. + +The current families are: + +- `azl-installer` +- `azurelinux-direct-streaming-testimage` +- `foreign-direct-streaming-testimage` +- `trident-container-installer` +- `trident-container-testimage` +- `trident-functest` +- `trident-installer` +- `trident-testimage` +- `trident-verity-testimage` +- `trident-vm-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..0622ba3131 --- /dev/null +++ b/tests/tailor-images/azl-installer/image.yaml @@ -0,0 +1,18 @@ +name: azl-installer + +base: + ref: baremetal + +outputs: + - format: iso + +rpmSources: + - ../../../bin/RPMS + +extraDependencies: + - ./installer-iso.yaml + - ./mos + - ./iso + +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..a5f63a0a17 --- /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: mos/files/getty@.service + destination: /usr/lib/systemd/system/getty@.service + - source: mos/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/files/getty@.service b/tests/tailor-images/azl-installer/mos/files/getty@.service new file mode 100644 index 0000000000..10d3131812 --- /dev/null +++ b/tests/tailor-images/azl-installer/mos/files/getty@.service @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty --autologin root --noclear %I linux +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION + +[Install] +WantedBy=getty.target +DefaultInstance=tty1 diff --git a/tests/tailor-images/azl-installer/mos/files/serial-getty@.service b/tests/tailor-images/azl-installer/mos/files/serial-getty@.service new file mode 100644 index 0000000000..2f65391a8e --- /dev/null +++ b/tests/tailor-images/azl-installer/mos/files/serial-getty@.service @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Serial Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +BindsTo=dev-%i.device +After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +[Service] +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I screen +Type=idle +Restart=always +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +[Install] +WantedBy=getty.target 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 100644 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/azurelinux-direct-streaming-testimage/base/post-install.sh b/tests/tailor-images/azurelinux-direct-streaming-testimage/base/post-install.sh new file mode 100644 index 0000000000..79da025b3b --- /dev/null +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/base/post-install.sh @@ -0,0 +1,2 @@ +# Add the necessary directories for the audit logs so that auditd can start +mkdir -p /var/log/audit diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml new file mode 100644 index 0000000000..6fe6f6f38d --- /dev/null +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: core_arm64 diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml new file mode 100644 index 0000000000..c6cca2f107 --- /dev/null +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml @@ -0,0 +1,19 @@ +name: azurelinux-direct-streaming-testimage + +matrix: + arch: [amd64, arm64] + +base: + ref: baremetal + +outputs: + - format: baremetal-image + +rpmSources: + - ../../../bin/RPMS + +extraDependencies: + - ./base + +config: + $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/tailor/baseimg.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/tailor/baseimg.yaml new file mode 100644 index 0000000000..a6af1726ae --- /dev/null +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/tailor/baseimg.yaml @@ -0,0 +1,68 @@ +storage: + bootType: efi + disks: + - partitionTableType: gpt + maxSize: 15G + partitions: + - id: esp + type: esp + size: 50M + label: esp + - id: root-a + size: 4G + type: root + label: root-a + - id: root-b + size: 4G + type: root + label: root-b + - id: swap + size: 2G + type: swap + label: swap + filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: root-a + type: ext4 + mountPoint: + path: / +os: + bootloader: + resetType: hard-reset + hostname: trident-rawcosi-testimage + selinux: + mode: permissive + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M + packages: + install: + - curl + - dnf + - efibootmgr + - iproute + - iptables + - lsof + - mdadm + - netplan + - openssh-server + - tpm2-tools + - vim + - audit + - device-mapper + - dosfstools + - lvm2 + - veritysetup + - ntfs-3g + - ntfsprogs + - selinux-policy + services: + enable: + - sshd diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml new file mode 100644 index 0000000000..3f1dcbc0e4 --- /dev/null +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: ubuntu_2204_arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml new file mode 100644 index 0000000000..94f6b20459 --- /dev/null +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: ubuntu_2404_arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml new file mode 100644 index 0000000000..6799181856 --- /dev/null +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: gb200_2404_arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml new file mode 100644 index 0000000000..1fc2ef81f2 --- /dev/null +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: ubuntu_2404_amd64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml new file mode 100644 index 0000000000..3d006bffb6 --- /dev/null +++ b/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml @@ -0,0 +1,16 @@ +name: foreign-direct-streaming-testimage +operation: convert + +matrix: + arch: [amd64, arm64] + source: [ubuntu-2204, ubuntu-2404, gb200-2404] + +selectors: + exclude: + - { arch: amd64, source: gb200-2404 } + +base: + ref: ubuntu_2204_amd64 + +outputs: + - format: baremetal-image diff --git a/tests/tailor-images/tailor.yaml b/tests/tailor-images/tailor.yaml new file mode 100644 index 0000000000..2d7b1d5a75 --- /dev/null +++ b/tests/tailor-images/tailor.yaml @@ -0,0 +1,76 @@ +schemaVersion: 1 + +previewFeatures: + - signing + +toolchains: + default: ic + entries: + - name: ic + container: mcr.microsoft.com/azurelinux/imagecustomizer + tag: latest + +signing: + default: test-ca + profiles: + test-ca: + backend: local-test-ca + publishCaCert: ./artifacts/ca_cert.pem + +baseImages: + - name: baremetal + path: ../../artifacts/baremetal.vhdx + arch: amd64 + source: + oci: + uri: mcr.microsoft.com/azurelinux/3.0/image/baremetal:latest + platform: linux/amd64 + - name: core_arm64 + path: ../../artifacts/core_arm64.vhdx + arch: arm64 + source: + oci: + uri: mcr.microsoft.com/azurelinux/3.0/image/core_arm64:latest + platform: linux/arm64 + - name: core_selinux + path: ../../artifacts/core_selinux.vhdx + arch: amd64 + source: + oci: + uri: mcr.microsoft.com/azurelinux/3.0/image/core_selinux:latest + platform: linux/amd64 + - name: qemu_guest + path: ../../artifacts/qemu_guest.vhdx + arch: amd64 + source: + oci: + uri: mcr.microsoft.com/azurelinux/3.0/image/qemu_guest:latest + platform: linux/amd64 + - name: ubuntu_2204_amd64 + path: ../../artifacts/ubuntu_2204_amd64.vhdx + arch: amd64 + - name: ubuntu_2204_arm64 + path: ../../artifacts/ubuntu_2204_arm64.vhdx + arch: arm64 + - name: ubuntu_2404_amd64 + path: ../../artifacts/ubuntu_2404_amd64.vhdx + arch: amd64 + - name: ubuntu_2404_arm64 + path: ../../artifacts/ubuntu_2404_arm64.vhdx + arch: arm64 + - name: gb200_2404_arm64 + path: ../../artifacts/gb200_2404_arm64.vhdx + arch: arm64 + +images: + members: + - azl-installer + - azurelinux-direct-streaming-testimage + - foreign-direct-streaming-testimage + - trident-container-installer + - trident-container-testimage + - trident-functest + - trident-installer + - trident-testimage + - trident-verity-testimage + - trident-vm-testimage diff --git a/tests/tailor-images/trident-container-installer/README.md b/tests/tailor-images/trident-container-installer/README.md new file mode 100644 index 0000000000..5fadc6fee4 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/README.md @@ -0,0 +1,20 @@ +# Trident Container Installer ISO Test Image + +This image is used in the Trident test pipelines. At startup, it loads a +specified version of a container, which must be provided. Trident runs from +this container. The configuration for Trident can be patched into the ISO by +replacing it with the placeholder file (config-placeholder). + +This image does **not** include Trident RPMs — Trident is loaded from a +container at boot. + +## Building + +From the repo root, run: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-container-installer --output-dir ./artifacts +``` + +Output is written to `artifacts/trident-container-installer.iso` by default. +Use `--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-container-installer/base/files/config-placeholder.yaml b/tests/tailor-images/trident-container-installer/base/files/config-placeholder.yaml new file mode 100644 index 0000000000..88bb0938cb --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/config-placeholder.yaml @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/etc/trident/config.yaml:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-container-installer/base/files/containerd-mmap-fix.cil b/tests/tailor-images/trident-container-installer/base/files/containerd-mmap-fix.cil new file mode 100644 index 0000000000..f9951716e1 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/containerd-mmap-fix.cil @@ -0,0 +1,7 @@ +; Fix for containerd 2.2+ MountManager plugin SELinux denial. +; containerd 2.2 introduces a MountManager that opens a bbolt DB under +; /run/containerd/ using mmap(). The base refpolicy (RELEASE_2_20240226) +; grants manage_file_perms on container_runtime_t:file but that set does +; not include 'map'. Upstream fixed this in commit 7876e51510 (May 2024). +; This module backports the missing permission. +(allow container_engine_system_domain container_runtime_t (file (map))) diff --git a/tests/tailor-images/trident-container-installer/base/files/getty@.service b/tests/tailor-images/trident-container-installer/base/files/getty@.service new file mode 100644 index 0000000000..10d3131812 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/getty@.service @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty --autologin root --noclear %I linux +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION + +[Install] +WantedBy=getty.target +DefaultInstance=tty1 diff --git a/tests/tailor-images/trident-container-installer/base/files/override-placeholder.conf b/tests/tailor-images/trident-container-installer/base/files/override-placeholder.conf new file mode 100644 index 0000000000..438677498c --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/override-placeholder.conf @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/trident-override.conf:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-container-installer/base/files/root.profile b/tests/tailor-images/trident-container-installer/base/files/root.profile new file mode 100644 index 0000000000..14baf5c9e2 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/root.profile @@ -0,0 +1,2 @@ +# Open journalctl immediately after autologin +journalctl -f --no-tail -u trident-container \ No newline at end of file diff --git a/tests/tailor-images/trident-container-installer/base/files/serial-getty@.service b/tests/tailor-images/trident-container-installer/base/files/serial-getty@.service new file mode 100644 index 0000000000..2f65391a8e --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/serial-getty@.service @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Serial Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +BindsTo=dev-%i.device +After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +[Service] +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I screen +Type=idle +Restart=always +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +[Install] +WantedBy=getty.target diff --git a/tests/tailor-images/trident-container-installer/base/files/trident-container.service b/tests/tailor-images/trident-container-installer/base/files/trident-container.service new file mode 100644 index 0000000000..2c93c93962 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/files/trident-container.service @@ -0,0 +1,16 @@ +[Unit] +Description=Trident Agent +Requires=docker.service +After=network.target network-online.target systemd-udev-settle.service docker.service + +[Service] +Type=oneshot +ExecStartPre=/bin/bash -c "set -e; mkdir -p /var/lib/trident" +ExecStartPre=/bin/bash -c "set -e; if ! docker image ls | grep -q 'trident/trident'; then curl $(grep -oP '^\s*phonehome: \\K.*(?=phonehome)' /etc/trident/config.yaml)files/trident-container.tar.gz -o /var/lib/trident/trident-container.tar.gz -f; fi" +ExecStartPre=/bin/bash -c "set -e; if ! docker image ls | grep -q 'trident/trident'; then docker load --input /var/lib/trident/trident-container.tar.gz; fi" +ExecStart=docker run --name trident_container --pull=never --rm --privileged -v /etc/trident:/etc/trident -v /etc/pki:/etc/pki:ro -v /run/initramfs/live:/trident_cdrom -v /var/lib/trident:/var/lib/trident -v /var/log:/var/log -v /:/host -v /dev:/dev -v /run:/run -v /sys:/sys --pid host --ipc host trident/trident:latest install --verbosity TRACE +StandardOutput=journal+console +StandardError=journal+console + +[Install] +WantedBy=multi-user.target diff --git a/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh new file mode 100644 index 0000000000..f908b04698 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Load SELinux policy module that grants the 'map' permission on +# container_runtime_t:file for container engines. This fixes containerd +# 2.2+ MountManager bbolt mmap() denials under enforcing mode. +semodule -i /usr/share/selinux/packages/containerd-mmap-fix.cil diff --git a/tests/tailor-images/trident-container-installer/base/scripts/post-install.sh b/tests/tailor-images/trident-container-installer/base/scripts/post-install.sh new file mode 100644 index 0000000000..5b2f4f7ca8 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/base/scripts/post-install.sh @@ -0,0 +1,15 @@ +# 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 /etc/trident +fi +ln -s -T /trident_cdrom/trident-config.yaml /etc/trident/config.yaml + +if [ ! -d /etc/systemd/system/trident-container.service.d ]; then + mkdir /etc/systemd/system/trident-container.service.d +fi +ln -s -T /trident_cdrom/trident-override.conf /etc/systemd/system/trident-container.service.d/override.conf \ No newline at end of file diff --git a/tests/tailor-images/trident-container-installer/image.yaml b/tests/tailor-images/trident-container-installer/image.yaml new file mode 100644 index 0000000000..9fca7d3935 --- /dev/null +++ b/tests/tailor-images/trident-container-installer/image.yaml @@ -0,0 +1,13 @@ +name: trident-container-installer + +base: + ref: baremetal + +outputs: + - format: iso + +extraDependencies: + - ./base + +config: + $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml b/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml new file mode 100644 index 0000000000..055f6b5e7b --- /dev/null +++ b/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml @@ -0,0 +1,71 @@ +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: + bootloader: + resetType: hard-reset + hostname: trident-container-mos-testimg + packages: + install: + - curl + - device-mapper + - dnf + - docker-cli + - iproute + - iptables + - mdadm + - moby-engine + - openssh-server + - selinux-policy + - squashfs-tools + - tar + - vim + additionalFiles: + - source: base/files/getty@.service + destination: /usr/lib/systemd/system/getty@.service + - source: base/files/serial-getty@.service + destination: /usr/lib/systemd/system/serial-getty@.service + - source: base/files/root.profile + destination: /root/.profile + - source: base/files/trident-container.service + destination: /usr/lib/systemd/system/trident-container.service + - source: base/files/containerd-mmap-fix.cil + destination: /usr/share/selinux/packages/containerd-mmap-fix.cil + services: + enable: + - trident-container + - sshd +scripts: + postCustomization: + - path: base/scripts/post-install.sh + - path: base/scripts/load-containerd-selinux-fix.sh +iso: + additionalFiles: + - source: base/files/config-placeholder.yaml + destination: /trident-config.yaml + - source: base/files/override-placeholder.conf + destination: /trident-override.conf + kernelCommandLine: + extraCommandLine: + - enforcing=0 + - console=tty0 + - console=ttyS0 + - rd.luks=0 diff --git a/tests/tailor-images/trident-container-testimage/README.md b/tests/tailor-images/trident-container-testimage/README.md new file mode 100644 index 0000000000..004e8cb243 --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/README.md @@ -0,0 +1,19 @@ +# Trident Container Test Image + +This image is an extension of the base baremetal image and includes various +helper utilities along with Docker runtime. It also adds openssh-server to +allow for remote access. + +This image does **not** include Trident RPMs — Trident runs from a container +loaded at runtime. + +## Building + +From the repo root, run: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-container-testimage --output-dir ./artifacts +``` + +Output is written to `artifacts/trident-container-testimage.cosi` by default. +Use `--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil b/tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil new file mode 100644 index 0000000000..f9951716e1 --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil @@ -0,0 +1,7 @@ +; Fix for containerd 2.2+ MountManager plugin SELinux denial. +; containerd 2.2 introduces a MountManager that opens a bbolt DB under +; /run/containerd/ using mmap(). The base refpolicy (RELEASE_2_20240226) +; grants manage_file_perms on container_runtime_t:file but that set does +; not include 'map'. Upstream fixed this in commit 7876e51510 (May 2024). +; This module backports the missing permission. +(allow container_engine_system_domain container_runtime_t (file (map))) diff --git a/tests/tailor-images/trident-container-testimage/base/files/trident-container.service b/tests/tailor-images/trident-container-testimage/base/files/trident-container.service new file mode 100644 index 0000000000..bba22a9650 --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/base/files/trident-container.service @@ -0,0 +1,16 @@ +[Unit] +Description=Trident Agent +Requires=docker.service +After=network.target network-online.target systemd-udev-settle.service docker.service + +[Service] +Type=oneshot +ExecStartPre=/bin/bash -c "set -e; if ! docker image ls | grep -q 'trident/trident'; then docker load --input /var/lib/trident/trident-container.tar.gz; fi" +# TODO: Remove line to enable SELinux, when bug #9508 is fixed. +ExecStartPre=/bin/bash -c "sudo setenforce 0" +ExecStart=docker run --name trident_container --pull=never --rm --privileged -v /etc/trident:/etc/trident -v /var/lib/trident:/var/lib/trident -v /var/log:/var/log -v /:/host -v /dev:/dev -v /run:/run -v /sys:/sys --pid host --ipc host trident/trident:latest commit --verbosity DEBUG +StandardOutput=journal+console +StandardError=journal+console + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh new file mode 100644 index 0000000000..f908b04698 --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Load SELinux policy module that grants the 'map' permission on +# container_runtime_t:file for container engines. This fixes containerd +# 2.2+ MountManager bbolt mmap() denials under enforcing mode. +semodule -i /usr/share/selinux/packages/containerd-mmap-fix.cil diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh b/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh new file mode 100644 index 0000000000..79da025b3b --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh @@ -0,0 +1,2 @@ +# Add the necessary directories for the audit logs so that auditd can start +mkdir -p /var/log/audit diff --git a/tests/tailor-images/trident-container-testimage/image.yaml b/tests/tailor-images/trident-container-testimage/image.yaml new file mode 100644 index 0000000000..69785cda6e --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/image.yaml @@ -0,0 +1,13 @@ +name: trident-container-testimage + +base: + ref: baremetal + +outputs: + - format: cosi + +extraDependencies: + - ./base + +config: + $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml b/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml new file mode 100644 index 0000000000..98cef436fb --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml @@ -0,0 +1,71 @@ +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: + bootloader: + resetType: hard-reset + hostname: trident-container-testimg + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M + packages: + remove: + - grub2-efi-binary + install: + - grub2-efi-binary-noprefix + - curl + - dnf + - efibootmgr + - iproute + - iptables + - lsof + - mdadm + - netplan + - openssh-server + - tpm2-tools + - vim + - device-mapper + - dosfstools + - lvm2 + - veritysetup + - ntfs-3g + - ntfsprogs + - docker-cli + - moby-engine + - selinux-policy + - squashfs-tools + - tar + additionalFiles: + - source: base/files/trident-container.service + destination: /usr/lib/systemd/system/trident-container.service + - source: base/files/containerd-mmap-fix.cil + destination: /usr/share/selinux/packages/containerd-mmap-fix.cil + services: + enable: + - trident-container + - sshd +scripts: + postCustomization: + - path: base/scripts/post-install.sh + - path: base/scripts/load-containerd-selinux-fix.sh diff --git a/tests/tailor-images/trident-functest/image.yaml b/tests/tailor-images/trident-functest/image.yaml new file mode 100644 index 0000000000..4f9d4ff305 --- /dev/null +++ b/tests/tailor-images/trident-functest/image.yaml @@ -0,0 +1,13 @@ +name: trident-functest + +base: + ref: baremetal + +outputs: + - format: qcow2 + +extraDependencies: + - ./base + +config: + $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-functest/tailor/baseimg.yaml b/tests/tailor-images/trident-functest/tailor/baseimg.yaml new file mode 100644 index 0000000000..c087bee4c6 --- /dev/null +++ b/tests/tailor-images/trident-functest/tailor/baseimg.yaml @@ -0,0 +1,75 @@ +storage: + bootType: efi + disks: + - partitionTableType: gpt + maxSize: 15G + partitions: + - id: esp + type: esp + size: 50M + label: esp + - id: root-a + size: 4G + type: root + label: root-a + - id: root-b + size: 4G + type: root + label: root-b + - id: swap + size: 2G + type: swap + label: swap + - id: trident + size: 100M + type: linux-generic + label: trident + filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: root-a + type: ext4 + mountPoint: + path: / + - deviceId: trident + type: ext4 + mountPoint: + path: /var/lib/trident +os: + bootloader: + resetType: hard-reset + hostname: trident-functest + selinux: + mode: permissive + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M + packages: + install: + - curl + - dnf + - efibootmgr + - iproute + - iptables + - lsof + - mdadm + - netplan + - openssh-server + - tpm2-tools + - vim + - audit + - device-mapper + - dosfstools + - lvm2 + - veritysetup + - ntfs-3g + - ntfsprogs + services: + enable: + - sshd diff --git a/tests/tailor-images/trident-installer/README.md b/tests/tailor-images/trident-installer/README.md new file mode 100644 index 0000000000..7226026ce5 --- /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/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/config-placeholder.yaml b/tests/tailor-images/trident-installer/base/files/config-placeholder.yaml new file mode 100644 index 0000000000..88bb0938cb --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/config-placeholder.yaml @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/etc/trident/config.yaml:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ 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/getty@.service b/tests/tailor-images/trident-installer/base/files/getty@.service new file mode 100644 index 0000000000..10d3131812 --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/getty@.service @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty --autologin root --noclear %I linux +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION + +[Install] +WantedBy=getty.target +DefaultInstance=tty1 diff --git a/tests/tailor-images/trident-installer/base/files/override-placeholder.conf b/tests/tailor-images/trident-installer/base/files/override-placeholder.conf new file mode 100644 index 0000000000..438677498c --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/override-placeholder.conf @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/trident-override.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/serial-getty@.service b/tests/tailor-images/trident-installer/base/files/serial-getty@.service new file mode 100644 index 0000000000..2f65391a8e --- /dev/null +++ b/tests/tailor-images/trident-installer/base/files/serial-getty@.service @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Serial Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +BindsTo=dev-%i.device +After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +[Service] +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I screen +Type=idle +Restart=always +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +[Install] +WantedBy=getty.target 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 100644 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..6fe6f6f38d --- /dev/null +++ b/tests/tailor-images/trident-installer/by-arch/arm64.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: core_arm64 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..9469a76c0c --- /dev/null +++ b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml @@ -0,0 +1,52 @@ +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 + 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..328eeb6654 --- /dev/null +++ b/tests/tailor-images/trident-installer/by-variant/split.yaml @@ -0,0 +1,22 @@ +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: base/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..6b187585e7 --- /dev/null +++ b/tests/tailor-images/trident-installer/image.yaml @@ -0,0 +1,60 @@ +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 + +extraDependencies: + - ./base + +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: base/files/config-placeholder.yaml + destination: /trident-config.yaml + - source: base/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..ff0048588d --- /dev/null +++ b/tests/tailor-images/trident-installer/include/common-files.yaml @@ -0,0 +1,6 @@ +- source: base/files/getty@.service + destination: /usr/lib/systemd/system/getty@.service +- source: base/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: / diff --git a/tests/tailor-images/trident-testimage/README.md b/tests/tailor-images/trident-testimage/README.md new file mode 100644 index 0000000000..fb1f2174a2 --- /dev/null +++ b/tests/tailor-images/trident-testimage/README.md @@ -0,0 +1,26 @@ +# Trident Test Image + +This image is used for testing Trident on Azure Linux. For AMD64, the image +is based on the baremetal image, and for ARM64, it is based on the ARM64 core +image. In both cases, the configuration adds Trident as well as its dependencies. +It also includes openssh-server to allow for remote access. + +## Prerequisites + +- **Trident RPMs** in `bin/RPMS/`. Build them with: + ```bash + make bin/trident-rpms.tar.gz + ``` + +## Building + +From the repo root, run: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts +``` + +Use `-s arch=arm64` for the ARM64 variant. + +Output is written to `artifacts/trident-testimage.cosi` by default. Use +`--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-testimage/base/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-testimage/base/files/use-grpc-client-commit.conf new file mode 100644 index 0000000000..958e0095c3 --- /dev/null +++ b/tests/tailor-images/trident-testimage/base/files/use-grpc-client-commit.conf @@ -0,0 +1,5 @@ +[Service] +ExecStart= +ExecStart=trident grpc-client commit +StandardOutput=journal+console +StandardError=journal+console diff --git a/tests/tailor-images/trident-testimage/base/post-install.sh b/tests/tailor-images/trident-testimage/base/post-install.sh new file mode 100644 index 0000000000..79da025b3b --- /dev/null +++ b/tests/tailor-images/trident-testimage/base/post-install.sh @@ -0,0 +1,2 @@ +# Add the necessary directories for the audit logs so that auditd can start +mkdir -p /var/log/audit diff --git a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml new file mode 100644 index 0000000000..6fe6f6f38d --- /dev/null +++ b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: core_arm64 diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml new file mode 100644 index 0000000000..06bd41af16 --- /dev/null +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -0,0 +1,19 @@ +name: trident-testimage + +matrix: + arch: [amd64, arm64] + +base: + ref: baremetal + +outputs: + - format: cosi + +rpmSources: + - ../../../bin/RPMS + +extraDependencies: + - ./base + +config: + $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-testimage/tailor/baseimg.yaml b/tests/tailor-images/trident-testimage/tailor/baseimg.yaml new file mode 100644 index 0000000000..89cbfd7bd9 --- /dev/null +++ b/tests/tailor-images/trident-testimage/tailor/baseimg.yaml @@ -0,0 +1,66 @@ +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: + bootloader: + resetType: hard-reset + hostname: trident-testimg + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M + packages: + remove: + - grub2-efi-binary + install: + - grub2-efi-binary-noprefix + - curl + - dnf + - efibootmgr + - iproute + - iptables + - lsof + - mdadm + - netplan + - openssh-server + - tpm2-tools + - trident-service + - vim + - audit + - device-mapper + - dosfstools + - lvm2 + - veritysetup + - ntfs-3g + - ntfsprogs + services: + enable: + - sshd + - trident + - tridentd.socket + additionalFiles: + - source: base/files/use-grpc-client-commit.conf + destination: /etc/systemd/system/trident.service.d/override.conf +scripts: + postCustomization: + - path: base/post-install.sh diff --git a/tests/tailor-images/trident-verity-testimage/README.md b/tests/tailor-images/trident-verity-testimage/README.md new file mode 100644 index 0000000000..af74e5886b --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/README.md @@ -0,0 +1,31 @@ +# Trident Verity Test Image + +This image is used for testing Trident on Azure Linux with `dm-verity` enabled. It +is based on the baremetal image and adds Trident as well as its dependencies. It +also adds openssh-server to allow for remote access. In addition to the [Trident +Test Image](../trident-testimage/README.md), this image is configured to use +dm-verity. + +## Prerequisites + +- **Trident RPMs** in `bin/RPMS/`. Build them with: + ```bash + make bin/trident-rpms.tar.gz + ``` + +## Building + +From the repo root, run: + +```bash +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-verity-testimage -s deployment=host -s mode=root --output-dir ./artifacts +``` + +Other legacy variants map to selectors on the same family: + +- `trident-usrverity-testimage` → `-s deployment=host -s mode=usr` +- `trident-container-verity-testimage` → `-s deployment=container -s mode=root` +- `trident-container-usrverity-testimage` → `-s deployment=container -s mode=usr` + +Output is written to `artifacts/` using the tailor cell slug by default. Use +`--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh b/tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh new file mode 100644 index 0000000000..71f393a31a --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh @@ -0,0 +1,2 @@ +# Create the web directory for testing +mkdir -p /web \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/etc-mount.service b/tests/tailor-images/trident-verity-testimage/base/etc-mount.service new file mode 100644 index 0000000000..7883ddf82f --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/etc-mount.service @@ -0,0 +1,17 @@ +[Unit] +Description=/etc Mount Service +DefaultDependencies=no +Conflicts=umount.target +Before=local-fs.target umount.target +Requires=etc.mount +After=etc.mount +Requires=var-lib-trident\x2doverlay.mount +After=var-lib-trident\x2doverlay.mount + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=etc-mount.sh + +[Install] +WantedBy=local-fs.target \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/etc-mount.sh b/tests/tailor-images/trident-verity-testimage/base/etc-mount.sh new file mode 100644 index 0000000000..f9feb5db94 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/etc-mount.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -eux + +mount -t overlay overlay -o lowerdir=/etc,upperdir=/var/lib/trident-overlay/etc-rw/upper,workdir=/var/lib/trident-overlay/etc-rw/work /etc +# Workaround for https://dev.azure.com/mariner-org/ECF/_workitems/edit/7349/ +chmod o+rx /etc \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/etc.mount b/tests/tailor-images/trident-verity-testimage/base/etc.mount new file mode 100644 index 0000000000..8dd53647f9 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/etc.mount @@ -0,0 +1,10 @@ +[Unit] +Description=/etc Overlay Mount +DefaultDependencies=no +Conflicts=shutdown.target + +[Mount] +What=overlay +Where=/etc +Type=overlay +Options=lowerdir=/etc,upperdir=/var/lib/trident-overlay/etc/upper,workdir=/var/lib/trident-overlay/etc/work,rw \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/files/trident-container.service b/tests/tailor-images/trident-verity-testimage/base/files/trident-container.service new file mode 100644 index 0000000000..98ce5f3e40 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/files/trident-container.service @@ -0,0 +1,14 @@ +[Unit] +Description=Trident Agent +Requires=docker.service +After=network.target network-online.target systemd-udev-settle.service docker.service + +[Service] +Type=oneshot +ExecStartPre=/bin/bash -c "set -e; if ! docker image ls | grep -q 'trident/trident'; then docker load --input /var/lib/trident/trident-container.tar.gz; fi" +ExecStart=docker run --name trident_container --pull=never --rm --privileged -v /etc/trident:/etc/trident -v /var/lib/trident:/var/lib/trident -v /var/log:/var/log -v /:/host -v /dev:/dev -v /run:/run -v /sys:/sys --pid host --ipc host trident/trident:latest commit --verbosity DEBUG +StandardOutput=journal+console +StandardError=journal+console + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf new file mode 100644 index 0000000000..958e0095c3 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf @@ -0,0 +1,5 @@ +[Service] +ExecStart= +ExecStart=trident grpc-client commit +StandardOutput=journal+console +StandardError=journal+console diff --git a/tests/tailor-images/trident-verity-testimage/base/sudoers-wheel b/tests/tailor-images/trident-verity-testimage/base/sudoers-wheel new file mode 100644 index 0000000000..c8b3629606 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/sudoers-wheel @@ -0,0 +1 @@ +%wheel ALL=(ALL:ALL) NOPASSWD: ALL \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh b/tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh new file mode 100644 index 0000000000..da03d7c143 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sed -i 's/--verbosity INFO/--verbosity DEBUG/' /usr/lib/systemd/system/trident.service \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml new file mode 100644 index 0000000000..8d3e5de076 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml @@ -0,0 +1,19 @@ +config: + os: + hostname: trident-container-verity-testimg + packages: + install: + - dnf + - docker-cli + - moby-engine + - squashfs-tools + - tar + additionalFiles: + - source: base/files/trident-container.service + destination: /usr/lib/systemd/system/trident-container.service + services: + enable: + - trident-container + scripts: + postCustomization: + - path: base/create-web-dir.sh diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml new file mode 100644 index 0000000000..c7eed50273 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml @@ -0,0 +1,15 @@ +config: + os: + hostname: trident-container-usrverity-testimg + packages: + install: + - docker-cli + - moby-engine + - squashfs-tools + - tar + additionalFiles: + - source: usr/files/trident-container.service + destination: /usr/lib/systemd/system/trident-container.service + services: + enable: + - trident-container diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml new file mode 100644 index 0000000000..e75de1bfb6 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml @@ -0,0 +1,17 @@ +config: + os: + hostname: trident-verity-testimg + packages: + install: + - trident-service + additionalFiles: + - source: base/files/use-grpc-client-commit.conf + destination: /etc/systemd/system/trident.service.d/override.conf + services: + enable: + - trident + - tridentd.socket + scripts: + postCustomization: + - path: base/trident-debug-log.sh + - path: base/create-web-dir.sh diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml new file mode 100644 index 0000000000..567cc110db --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml @@ -0,0 +1,17 @@ +config: + os: + hostname: trident-usrverity-testimg + packages: + install: + - binutils + - trident-service + - trident-static-pcrlock-files + - audit + - selinux-policy-devel + additionalFiles: + - source: usr/files/use-grpc-client-commit.conf + destination: /etc/systemd/system/trident.service.d/override.conf + services: + enable: + - trident + - tridentd.socket diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment/container.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment/container.yaml new file mode 100644 index 0000000000..de2ca21c3f --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-deployment/container.yaml @@ -0,0 +1 @@ +features: [] diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml new file mode 100644 index 0000000000..7ef528ff76 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml @@ -0,0 +1,2 @@ +rpmSources: + - ../../../bin/RPMS diff --git a/tests/tailor-images/trident-verity-testimage/by-mode/root.yaml b/tests/tailor-images/trident-verity-testimage/by-mode/root.yaml new file mode 100644 index 0000000000..04d59a7568 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-mode/root.yaml @@ -0,0 +1,5 @@ +config: + os: + $include: ./include/root-os-common.yaml + storage: + $include: ./include/root-storage.yaml diff --git a/tests/tailor-images/trident-verity-testimage/by-mode/usr.yaml b/tests/tailor-images/trident-verity-testimage/by-mode/usr.yaml new file mode 100644 index 0000000000..8a5445367a --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/by-mode/usr.yaml @@ -0,0 +1,14 @@ +signing: true +config: + os: + $include: ./include/usr-os-common.yaml + storage: + $include: ./include/usr-storage.yaml + output: + artifacts: + items: + - ukis + path: ./output + previewFeatures: + - uki + - output-artifacts diff --git a/tests/tailor-images/trident-verity-testimage/image.yaml b/tests/tailor-images/trident-verity-testimage/image.yaml new file mode 100644 index 0000000000..47417c6b27 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/image.yaml @@ -0,0 +1,17 @@ +name: trident-verity-testimage + +matrix: + deployment: [host, container] + mode: [root, usr] + +base: + ref: baremetal + +outputs: + - format: cosi + +extraDependencies: + - ./base + - ./usr + +config: {} diff --git a/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml b/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml new file mode 100644 index 0000000000..16faa0d324 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml @@ -0,0 +1,42 @@ +bootloader: + resetType: hard-reset +selinux: + mode: disabled +kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M +packages: + install: + - grub2-efi-binary-noprefix + - curl + - device-mapper + - dosfstools + - dracut-overlayfs + - efibootmgr + - iproute + - iptables + - lsof + - lvm2 + - mdadm + - netplan + - openssh-server + - systemd-udev + - tpm2-tools + - veritysetup + - vim + remove: + - grub2-efi-binary +additionalFiles: + - source: base/etc-mount.service + destination: /etc/systemd/system/etc-mount.service + - source: base/etc-mount.sh + destination: /usr/local/bin/etc-mount.sh + - source: base/sudoers-wheel + destination: /etc/sudoers.d/wheel +services: + enable: + - etc-mount + - sshd diff --git a/tests/tailor-images/trident-verity-testimage/include/root-storage.yaml b/tests/tailor-images/trident-verity-testimage/include/root-storage.yaml new file mode 100644 index 0000000000..cb38c27f81 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/include/root-storage.yaml @@ -0,0 +1,56 @@ +disks: + - partitionTableType: gpt + maxSize: 5G + partitions: + - id: esp + type: esp + size: 8M + - id: boot + size: 1G + - label: root + id: root + size: 2G + - label: root-hash + id: verityhash + size: 128M + - id: sysexts + size: 1G + - id: confexts + size: 200M + - id: var + size: grow +bootType: efi +verity: + - id: rootverity + name: root + dataDeviceId: root + hashDeviceId: verityhash + dataDeviceMountIdType: part-label + hashDeviceMountIdType: part-label +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: boot + type: ext4 + mountPoint: + path: /boot + - deviceId: rootverity + type: ext4 + mountPoint: + path: / + options: defaults,ro + - deviceId: sysexts + type: ext4 + mountPoint: + path: /var/lib/extensions + - deviceId: confexts + type: ext4 + mountPoint: + path: /var/lib/confexts + - deviceId: var + type: ext4 + mountPoint: + path: /var diff --git a/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml b/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml new file mode 100644 index 0000000000..3817dbcc59 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml @@ -0,0 +1,41 @@ +bootloader: + resetType: hard-reset +selinux: + mode: disabled +uki: + mode: create +kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.info + - log_buf_len=1M + - rd.hostonly=0 +packages: + install: + - curl + - device-mapper + - efibootmgr + - iproute + - iptables + - lvm2 + - mdadm + - netplan + - openssh-server + - systemd-udev + - tpm2-tools + - veritysetup + - vim + - systemd-ukify + - systemd-boot + - efibootmgr + remove: + - grub2-efi-binary +additionalFiles: + - source: usr/files/dracut-nohostonly.conf + destination: /usr/lib/dracut/dracut.conf.d/nohostonly.conf + - source: usr/files/sudoers-wheel + destination: /etc/sudoers.d/wheel +services: + enable: + - sshd diff --git a/tests/tailor-images/trident-verity-testimage/include/usr-storage.yaml b/tests/tailor-images/trident-verity-testimage/include/usr-storage.yaml new file mode 100644 index 0000000000..ce7337eaa0 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/include/usr-storage.yaml @@ -0,0 +1,45 @@ +disks: + - partitionTableType: gpt + maxSize: 5G + partitions: + - id: esp + type: esp + size: 500M + label: esp + - id: boot + size: 150M + - id: root + size: 2G + - id: usr-data + label: usr + size: 1G + - id: usr-hash + label: usr-hash + size: 128M +bootType: efi +verity: + - id: usr + name: usr + dataDeviceId: usr-data + hashDeviceId: usr-hash + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: boot + type: ext4 + mountPoint: + path: /boot + - deviceId: root + type: ext4 + mountPoint: + path: / + - deviceId: usr + type: ext4 + mountPoint: + path: /usr + options: defaults,ro diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/dracut-nohostonly.conf b/tests/tailor-images/trident-verity-testimage/usr/files/dracut-nohostonly.conf new file mode 100644 index 0000000000..18912360ca --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/usr/files/dracut-nohostonly.conf @@ -0,0 +1 @@ +hostonly="no" diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel b/tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel new file mode 100644 index 0000000000..c8b3629606 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel @@ -0,0 +1 @@ +%wheel ALL=(ALL:ALL) NOPASSWD: ALL \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service b/tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service new file mode 100644 index 0000000000..98ce5f3e40 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service @@ -0,0 +1,14 @@ +[Unit] +Description=Trident Agent +Requires=docker.service +After=network.target network-online.target systemd-udev-settle.service docker.service + +[Service] +Type=oneshot +ExecStartPre=/bin/bash -c "set -e; if ! docker image ls | grep -q 'trident/trident'; then docker load --input /var/lib/trident/trident-container.tar.gz; fi" +ExecStart=docker run --name trident_container --pull=never --rm --privileged -v /etc/trident:/etc/trident -v /var/lib/trident:/var/lib/trident -v /var/log:/var/log -v /:/host -v /dev:/dev -v /run:/run -v /sys:/sys --pid host --ipc host trident/trident:latest commit --verbosity DEBUG +StandardOutput=journal+console +StandardError=journal+console + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf new file mode 100644 index 0000000000..958e0095c3 --- /dev/null +++ b/tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf @@ -0,0 +1,5 @@ +[Service] +ExecStart= +ExecStart=trident grpc-client commit +StandardOutput=journal+console +StandardError=journal+console diff --git a/tests/tailor-images/trident-vm-testimage/README.md b/tests/tailor-images/trident-vm-testimage/README.md new file mode 100644 index 0000000000..d7f37b5e38 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/README.md @@ -0,0 +1,51 @@ +# Trident VM Test Image + +This image is used for testing Trident adopting an already produced image (e.g. +generated by MIC). It is based on the baremetal +image and adds Trident as well as its dependencies. It also adds openssh-server +to allow for remote access. Finally, it contains duplicate set of partitions to +setup the disk layout for A/B update. + +Two sets of images are available: + +- regular +- with verity +- with UKI usr-verity for ACL-agent-driven A/B update testing + +For both, a set of corresponding update images is available. The ACL-agent +variant reuses the servicing-style VM image layout but additionally installs +`trident-acl-agent` so storm ACL-agent scenarios can drive a real in-guest +agent talking to `tridentd`. The base (qcow2) image installs the package but +leaves `trident-acl-agent.service` disabled -- the storm scenario delivers a +fake kubeconfig at runtime and enables/starts the service itself. Only the +update image enables `trident-acl-agent.service` by default, since after a +real A/B update boots into it there is no test harness left to `systemctl +enable --now` it. Neither image preseeds `/etc/trident/trident-acl-agent.conf` +-- the harness never writes that file at all; instead it delivers a fake +kubeconfig to `/var/lib/kubelet/kubeconfig` and supplies the Nebraska +endpoint/appId/track per-request via the update-request annotation. + +## Additional Prerequisites + +- Artifacts + - **Trident RPMs**: expected in `bin/RPMS/**/*.rpm`. Can be created with + `make bin/trident-rpms.tar.gz` + +## Building + +To build the base image, run: + +| Image type | Make command | Output path | +| ---------- | ------------ | ----------- | +| Regular | `make artifacts/trident-vm-grub-testimage.qcow2` | `artifacts/trident-vm-grub-testimage.qcow2` | +| With verity `qcow2` | `make artifacts/trident-vm-grub-verity-testimage.qcow2` | `artifacts/trident-vm-grub-verity-testimage.qcow2` | +| With verity fixed size `vhd` | `make artifacts/trident-vm-grub-verity-testimage.vhd` | `artifacts/trident-vm-grub-verity-testimage.vhd` | +| ACL-agent UKI usr-verity `qcow2` | `make artifacts/trident-vm-acl-agent-testimage.qcow2` | `artifacts/trident-vm-acl-agent-testimage.qcow2` | + +To build the update images, run: + +| Image type | Make command | Output path | +| ---------- | ------------ | ----------- | +| Regular | `make trident-vm-grub-testimage` | `artifacts/trident-vm-grub-testimage/*` | +| With verity | `make trident-vm-grub-verity-testimage` | `artifacts/trident-vm-grub-testimage/*` | +| ACL-agent UKI usr-verity | `make artifacts/trident-vm-acl-agent-update-testimage.cosi` | `artifacts/trident-vm-acl-agent-update-testimage.cosi` | diff --git a/tests/tailor-images/trident-vm-testimage/base/.gitignore b/tests/tailor-images/trident-vm-testimage/base/.gitignore new file mode 100644 index 0000000000..6c07ccac55 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/.gitignore @@ -0,0 +1 @@ +mic-config.yaml \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/etc.mount b/tests/tailor-images/trident-vm-testimage/base/etc.mount new file mode 100644 index 0000000000..8dd53647f9 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/etc.mount @@ -0,0 +1,10 @@ +[Unit] +Description=/etc Overlay Mount +DefaultDependencies=no +Conflicts=shutdown.target + +[Mount] +What=overlay +Where=/etc +Type=overlay +Options=lowerdir=/etc,upperdir=/var/lib/trident-overlay/etc/upper,workdir=/var/lib/trident-overlay/etc/work,rw \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/.gitignore b/tests/tailor-images/trident-vm-testimage/base/files/.gitignore new file mode 100644 index 0000000000..7ed8773999 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/.gitignore @@ -0,0 +1,3 @@ +host_status.yaml +config.yaml +id_rsa.pub \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/99-dhcp-eth0.network b/tests/tailor-images/trident-vm-testimage/base/files/99-dhcp-eth0.network new file mode 100644 index 0000000000..5cef9e24f8 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/99-dhcp-eth0.network @@ -0,0 +1,6 @@ +[Match] +Name=eth0 + +[Network] +DHCP=yes +IPv6AcceptRA=no \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/etc-mount-mic.service b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount-mic.service new file mode 100644 index 0000000000..48f05860e4 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount-mic.service @@ -0,0 +1,15 @@ +[Unit] +Description=/etc Mount Service +DefaultDependencies=no +Conflicts=umount.target +Before=local-fs.target umount.target +Requires=var-lib-trident\x2doverlay.mount +After=var-lib-trident\x2doverlay.mount + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=etc-mount.sh commit-machine-id + +[Install] +WantedBy=local-fs.target \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.service b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.service new file mode 100644 index 0000000000..a90c052deb --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.service @@ -0,0 +1,17 @@ +[Unit] +Description=/etc Mount Service +DefaultDependencies=no +Conflicts=umount.target +Before=local-fs.target umount.target systemd-networkd.service +Requires=etc.mount +After=etc.mount +Requires=var-lib-trident\x2doverlay.mount +After=var-lib-trident\x2doverlay.mount + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=etc-mount.sh + +[Install] +WantedBy=local-fs.target \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh new file mode 100644 index 0000000000..b187511aca --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -ex + +# TODO: figure out why we are missing systemd-machine-id-commit service, which should automate this +if [ "$1" == "commit-machine-id" ]; then + MACHINEID=`cat /etc/machine-id` + echo $MACHINEID + # if machine-id has a mount point, unmount it + if grep -q /etc/machine-id /proc/mounts; then + umount /etc/machine-id + fi +fi + +mount -t overlay overlay -o lowerdir=/etc,upperdir=/var/lib/trident-overlay/etc-rw/upper,workdir=/var/lib/trident-overlay/etc-rw/work /etc +# Workaround for dracut overlayfs module mounting /etc overlay as 755 on clean install and +# 750 on abupdate +chmod o+rx /etc + +if [ "$1" == "commit-machine-id" ]; then + echo Committing machine-id + echo $MACHINEID > /etc/machine-id + cat /etc/machine-id +fi \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/sshd-keygen.service b/tests/tailor-images/trident-vm-testimage/base/files/sshd-keygen.service new file mode 100644 index 0000000000..ab8532cd74 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/sshd-keygen.service @@ -0,0 +1,14 @@ +[Unit] +Description=Generate sshd host keys +ConditionPathExists=|!/srv/etc/ssh/ssh_host_rsa_key +ConditionPathExists=|!/srv/etc/ssh/ssh_host_ecdsa_key +ConditionPathExists=|!/srv/etc/ssh/ssh_host_ed25519_key +Before=sshd.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/ssh-keygen -A -f /srv + +[Install] +WantedBy=multi-user.target diff --git a/tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel b/tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel new file mode 100644 index 0000000000..c8b3629606 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel @@ -0,0 +1 @@ +%wheel ALL=(ALL:ALL) NOPASSWD: ALL \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service b/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service new file mode 100644 index 0000000000..9f9b85e086 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service @@ -0,0 +1,28 @@ +[Unit] +Description=Install trident-acl-agent storm test CA cert into system trust store +# Test-harness-only plumbing: this file only exists when a storm test run +# has written an ephemeral CA cert onto the persistent, non-A/B +# /var/lib/trident-acl-agent partition (see prepareVmForAclAgent in +# tools/storm/aclagent/tests/update.go). It never exists on a real +# deployment. Skips as a no-op (not a failure) when absent, e.g. before the +# harness has run at all, or for run-rollback, which never uses Nebraska. +ConditionPathExists=/var/lib/trident-acl-agent/nebraska-ca.pem +Before=trident-acl-agent.service + +[Service] +Type=oneshot +RemainAfterExit=yes +# Re-derives the system trust store install every boot: /etc is part of +# this usr-verity image's A/B-swapped root (an overlay backed by the +# per-slot trident-overlay-a/-b partitions), so neither step below carries +# over across a reboot into the other slot, unlike the source cert on +# /var/lib/trident-acl-agent. +ExecStart=/bin/sh -c ' \ + cp /var/lib/trident-acl-agent/nebraska-ca.pem /etc/pki/ca-trust/source/anchors/trident-acl-agent-storm-test-ca.pem && \ + update-ca-trust extract && \ + cp /etc/pki/ca-trust/source/anchors/trident-acl-agent-storm-test-ca.pem /etc/pki/tls/certs/trident-acl-agent-storm-test-ca.pem && \ + openssl rehash /etc/pki/tls/certs \ + ' + +[Install] +WantedBy=multi-user.target diff --git a/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-override.conf b/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-override.conf new file mode 100644 index 0000000000..9529661983 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-override.conf @@ -0,0 +1,10 @@ +[Unit] +Wants=trident-acl-agent-cert-install.service +After=trident-acl-agent-cert-install.service + +[Service] +Environment=TRIDENT_ACL_AGENT_KUBERNETES_ANNOTATION_PREFIX=acl.azure.com +Environment=TRIDENT_ACL_AGENT_CURRENT_VERSION_KEY=IMAGE_VERSION +Environment=TRIDENT_ACL_AGENT_ORCHESTRATION_MODE=annotations +Environment=TRIDENT_ACL_AGENT_CURRENT_VERSION_PATH=/etc/os-release +Environment=TRIDENT_ACL_AGENT_CURRENT_VERSION_FALLBACK=always diff --git a/tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf new file mode 100644 index 0000000000..958e0095c3 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf @@ -0,0 +1,5 @@ +[Service] +ExecStart= +ExecStart=trident grpc-client commit +StandardOutput=journal+console +StandardError=journal+console diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh new file mode 100644 index 0000000000..56f74ceb13 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh @@ -0,0 +1,2 @@ +mkdir -p /var/lib/trident-overlay/etc-rw/upper +mkdir -p /var/lib/trident-overlay/etc-rw/work \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh new file mode 100644 index 0000000000..6454a7a0e3 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh @@ -0,0 +1,3 @@ +# Move the SSH host keys off the read-only /etc directory, so that sshd can run. +SSH_VAR_DIR="/srv/etc/ssh/" +mkdir -p "$SSH_VAR_DIR" diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh new file mode 100644 index 0000000000..5c35e32cf2 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh @@ -0,0 +1 @@ +sed -i 's/#DUIDType=vendor/DUIDType=link-layer/' /etc/systemd/networkd.conf \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/lsblk.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/lsblk.sh new file mode 100644 index 0000000000..39b5518e72 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/lsblk.sh @@ -0,0 +1 @@ +lsblk --json --output-all --bytes \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh new file mode 100644 index 0000000000..b960507cd1 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh @@ -0,0 +1,2 @@ +# Add the necessary directories for the audit logs so that auditd can start +mkdir -p /var/log/audit \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh new file mode 100644 index 0000000000..82663a13d3 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh @@ -0,0 +1,9 @@ +CONFIG_PATH=/var/lib/trident/update-config.yaml +DOWNLOAD_URL_PREFIX="http://192.168.122.1:8000" + +cp /etc/trident/config.yaml $CONFIG_PATH +cat <> $CONFIG_PATH +image: + url: $DOWNLOAD_URL_PREFIX/usrverity.cosi + sha384: ignored +EOF \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh new file mode 100644 index 0000000000..600151fdd8 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh @@ -0,0 +1,36 @@ +CONFIG_PATH=/var/lib/trident/update-config.yaml +DOWNLOAD_URL_PREFIX="http://192.168.122.1:8000" + +cat < $CONFIG_PATH +image: + url: $DOWNLOAD_URL_PREFIX/verity.cosi + sha384: ignored +EOF + +INTERFACE_MASK='enp*' +if [ "$1" == "eth0" ]; then + INTERFACE_MASK="$1" +fi + +if [ "$1" != "uki" ]; then + cat <> $CONFIG_PATH +scripts: + postConfigure: + - name: rw-overlay + runOn: [all] + content: | + mkdir -p /var/lib/trident-overlay/etc-rw/upper && mkdir -p /var/lib/trident-overlay/etc-rw/work +EOF +fi + +cat <> $CONFIG_PATH +internalParams: + allowUnusedFilesystems: true +EOF + +if [ "$1" == "uki" ]; then + cat <> $CONFIG_PATH + uki: true + disableGrubNoprefixCheck: true +EOF +fi diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh new file mode 100644 index 0000000000..df4ddb8143 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh @@ -0,0 +1,9 @@ +CONFIG_PATH=/var/lib/trident/update-config.yaml +DOWNLOAD_URL_PREFIX="http://192.168.122.1:8000" + +cp /etc/trident/config.yaml $CONFIG_PATH +cat <> $CONFIG_PATH +image: + url: $DOWNLOAD_URL_PREFIX/regular.cosi + sha384: ignored +EOF \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh new file mode 100644 index 0000000000..7891a607ac --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh @@ -0,0 +1,9 @@ +# Move the SSH host keys off the read-only /etc directory, so that sshd can run. +SSH_VAR_DIR="/srv/etc/ssh/" + +cat << EOF >> /etc/ssh/sshd_config + +HostKey $SSH_VAR_DIR/ssh_host_rsa_key +HostKey $SSH_VAR_DIR/ssh_host_ecdsa_key +HostKey $SSH_VAR_DIR/ssh_host_ed25519_key +EOF diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh new file mode 100644 index 0000000000..4a69a02213 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh @@ -0,0 +1 @@ +trident offline-initialize diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh new file mode 100644 index 0000000000..d28e1c109d --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh @@ -0,0 +1,2 @@ +printf -v DATE '%(%Y%m%d)T' -1 +sed -i "s/VERSION=\".*\"/VERSION=\"$DATE\"/" /etc/os-release \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml new file mode 100644 index 0000000000..6fe6f6f38d --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml @@ -0,0 +1,3 @@ +base: + $set: + ref: core_arm64 diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml new file mode 100644 index 0000000000..a2210cc7f8 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -0,0 +1,24 @@ +config: + storage: + $include: ./include/storage-acl-agent.yaml + os: + hostname: trident-acl-agent-testimg + packages: + install: + $append: + - trident-acl + additionalFiles: + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: base/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + - source: base/files/trident-acl-agent-override.conf + destination: /etc/systemd/system/trident-acl-agent.service.d/override.conf + - source: base/files/trident-acl-agent-cert-install.service + destination: /etc/systemd/system/trident-acl-agent-cert-install.service + services: + enable: + - kdump + - tridentd.socket + - trident-acl-agent-cert-install.service + - trident-acl-agent.service diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity+grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity+grub-verity-azure.yaml new file mode 100644 index 0000000000..ad0608c844 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity+grub-verity-azure.yaml @@ -0,0 +1,6 @@ +config: + os: + $include: ./include/grub-verity-os-common.yaml + scripts: + postCustomization: + - $include: ./include/grub-verity-scripts.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml new file mode 100644 index 0000000000..d2b2c5464e --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -0,0 +1,23 @@ +base: + $set: + ref: core_selinux +config: + storage: + $include: ./include/storage-grub-verity.yaml + os: + hostname: trident-vm-testimg + selinux: + mode: + $set: permissive + packages: + install: + $remove: + - netplan + $append: + - selinux-policy + - WALinuxAgent + users: + $replace: + - name: testuser + secondaryGroups: + - wheel diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml new file mode 100644 index 0000000000..413e42b822 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml @@ -0,0 +1,5 @@ +config: + storage: + $include: ./include/storage-grub-verity.yaml + os: + hostname: trident-vm-verity-testimg diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml new file mode 100644 index 0000000000..d9bfa313ae --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml @@ -0,0 +1,55 @@ +config: + storage: + $include: ./include/storage-grub.yaml + os: + bootloader: + resetType: hard-reset + hostname: trident-vm-testimg + selinux: + mode: disabled + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=tty1 + - console=ttyS0 + - rd.debug + - loglevel=6 + - log_buf_len=1M + - systemd.journald.forward_to_console=1 + packages: + install: + - curl + - dnf + - efibootmgr + - grub2-efi-binary-noprefix + - iproute + - iptables + - jq + - lsof + - netplan + - openssh-server + - trident-service + - vim + - netplan + remove: + - grub2-efi-binary + services: + enable: + - trident + - tridentd.socket + users: + - name: testuser + sshPublicKeyPaths: + - base/files/id_rsa.pub + secondaryGroups: + - wheel + additionalFiles: + - source: base/files/sshd-keygen.service + destination: /usr/lib/systemd/system/sshd-keygen.service + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: base/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + scripts: + postCustomization: + - $include: ./include/grub-scripts.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent.yaml new file mode 100644 index 0000000000..ac986e4ae7 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent.yaml @@ -0,0 +1,8 @@ +config: + os: + $include: ./include/uki-verity-os-common.yaml + scripts: + postCustomization: + - $include: ./include/uki-verity-scripts.yaml + previewFeatures: + - uki diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml new file mode 100644 index 0000000000..a19ba87c3e --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml @@ -0,0 +1,24 @@ +config: + storage: + $include: ./include/storage-root-verity.yaml + os: + hostname: trident-vm-root-verity-testimg + additionalFiles: + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: base/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + overlays: + - mountPoint: /etc + lowerDirs: + - /etc + upperDir: /var/lib/overlays/etc/upper + workDir: /var/lib/overlays/etc/work + mountDependencies: + - /var + isInitrdOverlay: true + services: + enable: + - kdump + - trident + - tridentd.socket diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml new file mode 100644 index 0000000000..766620fea4 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml @@ -0,0 +1,15 @@ +config: + storage: + $include: ./include/storage-usr-verity.yaml + os: + hostname: trident-vm-usr-verity-testimg + additionalFiles: + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: base/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + services: + enable: + - kdump + - trident + - tridentd.socket diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml new file mode 100644 index 0000000000..ce0f3c26a3 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -0,0 +1,23 @@ +name: trident-vm-testimage + +matrix: + arch: [amd64, arm64] + scenario: [grub, grub-verity, root-verity, usr-verity, acl-agent, grub-verity-azure] + +selectors: + exclude: + - { arch: arm64, scenario: [root-verity, usr-verity, acl-agent, grub-verity-azure] } + +base: + ref: qemu_guest + +outputs: + - format: cosi + +rpmSources: + - ../../../bin/RPMS + +extraDependencies: + - ./base + +config: {} diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-scripts.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-scripts.yaml new file mode 100644 index 0000000000..cefd80ff51 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/grub-scripts.yaml @@ -0,0 +1,4 @@ +- path: base/scripts/post-install.sh +- path: base/scripts/ssh-move-host-keys.sh +- path: base/scripts/duid-type-to-link-layer.sh +- path: base/scripts/update-os-release.sh diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml new file mode 100644 index 0000000000..6432937bc3 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml @@ -0,0 +1,59 @@ +bootloader: + resetType: hard-reset +selinux: + mode: disabled +kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=tty1 + - console=ttyS0 + - rd.debug + - loglevel=6 + - log_buf_len=1M + - systemd.journald.forward_to_console=1 +packages: + install: + - curl + - device-mapper + - dnf + - dracut-overlayfs + - efibootmgr + - grub2-efi-binary-noprefix + - iproute + - iptables + - jq + - kexec-tools + - lsof + - lvm2 + - netplan + - openssh-server + - systemd-udev + - trident-service + - veritysetup + - vim + - netplan + remove: + - grub2-efi-binary +additionalFiles: + - source: base/files/etc-mount.service + destination: /etc/systemd/system/etc-mount.service + - source: base/files/etc-mount.sh + destination: /usr/local/bin/etc-mount.sh + - source: base/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: base/files/use-grpc-client-commit.conf + destination: /etc/systemd/system/trident.service.d/override.conf +services: + enable: + - etc-mount + - kdump + - trident + - tridentd.socket +users: + - name: testuser + sshPublicKeyPaths: + - base/files/id_rsa.pub + secondaryGroups: + - wheel diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-verity-scripts.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-verity-scripts.yaml new file mode 100644 index 0000000000..db0dca3e4c --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/grub-verity-scripts.yaml @@ -0,0 +1,4 @@ +- path: base/scripts/post-install.sh +- path: base/scripts/ssh-move-host-keys.sh +- path: base/scripts/update-os-release.sh +- path: base/scripts/duid-type-to-link-layer.sh diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-acl-agent.yaml new file mode 100644 index 0000000000..82632328f0 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-acl-agent.yaml @@ -0,0 +1,101 @@ +bootType: efi +disks: + - partitionTableType: gpt + partitions: + - id: esp + type: esp + label: esp + size: 512M + - id: boot-a + size: 256M + - id: boot-b + size: 256M + - id: root-a + size: 4G + - id: root-b + size: 4G + - id: usr-a + size: 1G + - id: usr-b + size: 1G + - id: usr-hash-a + size: 128M + - id: usr-hash-b + size: 128M + - id: trident + label: trident + size: 512M + - id: trident-acl-agent + label: trident-acl-agent + size: 128M + - id: kubelet + label: kubelet + size: 128M + - id: etc-trident + label: etc-trident + size: 128M + - id: home + label: home + size: 1G + - id: srv + label: srv + size: 128M +verity: + - id: usrverity + name: usr + dataDeviceId: usr-a + hashDeviceId: usr-hash-a + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + idType: part-label + path: /boot/efi + options: umask=0077 + - deviceId: boot-a + type: ext4 + mountPoint: + idType: uuid + path: /boot + - deviceId: usrverity + type: ext4 + mountPoint: + path: /usr + options: defaults,ro + - deviceId: root-a + type: ext4 + mountPoint: + idType: uuid + path: / + - deviceId: trident + type: ext4 + mountPoint: + idType: part-label + path: /var/lib/trident + - deviceId: trident-acl-agent + type: ext4 + mountPoint: + idType: part-label + path: /var/lib/trident-acl-agent + - deviceId: kubelet + type: ext4 + mountPoint: + idType: part-label + path: /var/lib/kubelet + - deviceId: etc-trident + type: ext4 + mountPoint: + idType: part-label + path: /etc/trident + - deviceId: home + type: ext4 + mountPoint: + idType: part-label + path: /home + - deviceId: srv + type: ext4 + mountPoint: + idType: part-label + path: /srv diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity.yaml new file mode 100644 index 0000000000..fbe1d145ea --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity.yaml @@ -0,0 +1,54 @@ +bootType: efi +disks: + - partitionTableType: gpt + partitions: + - id: esp + type: esp + size: 8M + - id: boot + size: 256M + - id: root + size: 4G + - id: root-hash + size: 128M + - id: var + size: 1G + - id: trident-overlay + size: 32M + - id: srv + size: 1G + - id: home + size: 32M +verity: + - id: rootverity + name: root + dataDeviceId: root + hashDeviceId: root-hash + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: boot + type: ext4 + mountPoint: /boot + - deviceId: rootverity + type: ext4 + mountPoint: + path: / + options: defaults,ro + - deviceId: var + type: ext4 + mountPoint: /var + - deviceId: trident-overlay + type: ext4 + mountPoint: /var/lib/trident-overlay + - deviceId: srv + type: ext4 + mountPoint: /srv + - deviceId: home + type: ext4 + mountPoint: /home diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-grub.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-grub.yaml new file mode 100644 index 0000000000..f36e7979e8 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-grub.yaml @@ -0,0 +1,31 @@ +bootType: efi +disks: + - partitionTableType: gpt + maxSize: 10G + partitions: + - id: esp + type: esp + size: 16M + - id: root-a + size: 4G + - id: root-b + size: 4G + - id: trident + size: 1G + - id: srv + size: grow +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: root-a + type: ext4 + mountPoint: / + - deviceId: trident + type: ext4 + mountPoint: /var/lib/trident + - deviceId: srv + type: ext4 + mountPoint: /srv diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-root-verity.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-root-verity.yaml new file mode 100644 index 0000000000..e5e3cbd74d --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-root-verity.yaml @@ -0,0 +1,78 @@ +bootType: efi +disks: + - partitionTableType: gpt + partitions: + - id: esp + type: esp + label: esp + size: 512M + - id: boot-a + size: 256M + - id: boot-b + size: 256M + - id: root-a + size: 4G + - id: root-b + size: 4G + - id: root-hash-a + size: 128M + - id: root-hash-b + size: 128M + - id: var-a + size: 1G + - id: var-b + size: 1G + - id: trident + label: trident + size: 512M + - id: home + label: home + size: 1G + - id: srv + label: srv + size: 128M +verity: + - id: rootverity + name: root + dataDeviceId: root-a + hashDeviceId: root-hash-a + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + idType: part-label + path: /boot/efi + options: umask=0077 + - deviceId: boot-a + type: ext4 + mountPoint: + idType: uuid + path: /boot + - deviceId: rootverity + type: ext4 + mountPoint: + path: / + options: defaults,ro + - deviceId: var-a + type: ext4 + mountPoint: + idType: uuid + path: /var + options: defaults,x-initrd.mount + - deviceId: trident + type: ext4 + mountPoint: + idType: part-label + path: /var/lib/trident + - deviceId: home + type: ext4 + mountPoint: + idType: part-label + path: /home + - deviceId: srv + type: ext4 + mountPoint: + idType: part-label + path: /srv diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-usr-verity.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-usr-verity.yaml new file mode 100644 index 0000000000..a380c8eb59 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-usr-verity.yaml @@ -0,0 +1,77 @@ +bootType: efi +disks: + - partitionTableType: gpt + partitions: + - id: esp + type: esp + label: esp + size: 512M + - id: boot-a + size: 256M + - id: boot-b + size: 256M + - id: root-a + size: 4G + - id: root-b + size: 4G + - id: usr-a + size: 1G + - id: usr-b + size: 1G + - id: usr-hash-a + size: 128M + - id: usr-hash-b + size: 128M + - id: trident + label: trident + size: 512M + - id: home + label: home + size: 1G + - id: srv + label: srv + size: 128M +verity: + - id: usrverity + name: usr + dataDeviceId: usr-a + hashDeviceId: usr-hash-a + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + idType: part-label + path: /boot/efi + options: umask=0077 + - deviceId: boot-a + type: ext4 + mountPoint: + idType: uuid + path: /boot + - deviceId: usrverity + type: ext4 + mountPoint: + path: /usr + options: defaults,ro + - deviceId: root-a + type: ext4 + mountPoint: + idType: uuid + path: / + - deviceId: trident + type: ext4 + mountPoint: + idType: part-label + path: /var/lib/trident + - deviceId: home + type: ext4 + mountPoint: + idType: part-label + path: /home + - deviceId: srv + type: ext4 + mountPoint: + idType: part-label + path: /srv diff --git a/tests/tailor-images/trident-vm-testimage/include/uki-verity-os-common.yaml b/tests/tailor-images/trident-vm-testimage/include/uki-verity-os-common.yaml new file mode 100644 index 0000000000..6f277178bd --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/uki-verity-os-common.yaml @@ -0,0 +1,41 @@ +bootloader: + resetType: hard-reset +selinux: + mode: disabled +uki: + mode: create +kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=tty1 + - console=ttyS0 + - rd.debug + - loglevel=6 + - log_buf_len=1M + - systemd.journald.forward_to_console=1 + - rd.hostonly=0 +packages: + install: + - device-mapper + - dnf + - efibootmgr + - iproute + - iptables + - jq + - kexec-tools + - lvm2 + - openssh-server + - systemd-boot + - systemd-udev + - trident-service + - veritysetup + - vim + - netplan + remove: + - grub2-efi-binary +users: + - name: testuser + sshPublicKeyPaths: + - base/files/id_rsa.pub + secondaryGroups: + - wheel diff --git a/tests/tailor-images/trident-vm-testimage/include/uki-verity-scripts.yaml b/tests/tailor-images/trident-vm-testimage/include/uki-verity-scripts.yaml new file mode 100644 index 0000000000..89bf812cc3 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/uki-verity-scripts.yaml @@ -0,0 +1,6 @@ +- path: base/scripts/post-install.sh +- path: base/scripts/update-host-status.sh +- path: base/scripts/prepare-update-config-verity.sh + arguments: + - uki +- path: base/scripts/duid-type-to-link-layer.sh From 6bd26b3d3f33e3449bcf050b079ffcfd4b7d7730 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sat, 10 Oct 2026 17:35:08 +0000 Subject: [PATCH 02/26] tests: point tailor workspace docs at tests/tailor-images Update the copied workspace documentation examples so they consistently reference the standalone tests/tailor-images manifest rather than the original tests/images path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/README.md | 20 +++++++++---------- .../trident-container-installer/README.md | 2 +- .../trident-container-testimage/README.md | 2 +- .../tailor-images/trident-installer/README.md | 2 +- .../tailor-images/trident-testimage/README.md | 2 +- .../trident-verity-testimage/README.md | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/tailor-images/README.md b/tests/tailor-images/README.md index fbd8ac44df..bb9666b62d 100644 --- a/tests/tailor-images/README.md +++ b/tests/tailor-images/README.md @@ -1,6 +1,6 @@ # Test images with tailor -`tests/images/` is now a [tailor](../../tools/tailor/README.md) workspace. +`tests/tailor-images/` is now a [tailor](../../tools/tailor/README.md) workspace. The legacy `testimages.py` / `builder/` flow is removed. ## Build from the repo root @@ -8,38 +8,38 @@ The legacy `testimages.py` / `builder/` flow is removed. Use the in-tree tailor binary via Cargo: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml matrix trident-installer --format json +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml matrix trident-installer --format json ``` Build examples: ```bash # trident-testimage -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts # trident-testimage-arm64 -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-testimage -s arch=arm64 --output-dir ./artifacts +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/images/tailor.yaml build trident-installer -s arch=arm64 -s variant=direct-streaming --output-dir ./artifacts +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 # trident-container-usrverity-testimage (signed) -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-verity-testimage -s deployment=container -s mode=usr --output-dir ./artifacts +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-verity-testimage -s deployment=container -s mode=usr --output-dir ./artifacts ``` ## Base images -The workspace uses a `baseImages:` catalogue in `tests/images/tailor.yaml`. +The workspace uses a `baseImages:` catalogue in `tests/tailor-images/tailor.yaml`. For the Azure Linux base slots you can materialize the defaults locally with: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases download baremetal core_arm64 core_selinux qemu_guest +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases download baremetal core_arm64 core_selinux qemu_guest ``` Verify that every referenced base file exists: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases verify +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases verify ``` Ubuntu / GB200 direct-streaming inputs still come from the pipeline-managed blob @@ -48,7 +48,7 @@ remote source. ## Legacy name mapping -Pipelines still accept the historical image names. `tests/images/legacy-map.json` +Pipelines still accept the historical image names. `tests/tailor-images/legacy-map.json` maps each legacy name to the tailor image family, selectors, expected base slot, and published artifact extension. diff --git a/tests/tailor-images/trident-container-installer/README.md b/tests/tailor-images/trident-container-installer/README.md index 5fadc6fee4..03bbb58f8e 100644 --- a/tests/tailor-images/trident-container-installer/README.md +++ b/tests/tailor-images/trident-container-installer/README.md @@ -13,7 +13,7 @@ container at boot. From the repo root, run: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-container-installer --output-dir ./artifacts +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-container-installer --output-dir ./artifacts ``` Output is written to `artifacts/trident-container-installer.iso` by default. diff --git a/tests/tailor-images/trident-container-testimage/README.md b/tests/tailor-images/trident-container-testimage/README.md index 004e8cb243..f996b9e96c 100644 --- a/tests/tailor-images/trident-container-testimage/README.md +++ b/tests/tailor-images/trident-container-testimage/README.md @@ -12,7 +12,7 @@ loaded at runtime. From the repo root, run: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-container-testimage --output-dir ./artifacts +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-container-testimage --output-dir ./artifacts ``` Output is written to `artifacts/trident-container-testimage.cosi` by default. diff --git a/tests/tailor-images/trident-installer/README.md b/tests/tailor-images/trident-installer/README.md index 7226026ce5..cf24a33a60 100644 --- a/tests/tailor-images/trident-installer/README.md +++ b/tests/tailor-images/trident-installer/README.md @@ -8,7 +8,7 @@ startup and reads a configuration that can be patched into the ISO. From the repo root, run: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-installer -s arch=amd64 -s variant=default --output-dir ./artifacts +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: diff --git a/tests/tailor-images/trident-testimage/README.md b/tests/tailor-images/trident-testimage/README.md index fb1f2174a2..b8f5dd305b 100644 --- a/tests/tailor-images/trident-testimage/README.md +++ b/tests/tailor-images/trident-testimage/README.md @@ -17,7 +17,7 @@ It also includes openssh-server to allow for remote access. From the repo root, run: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts ``` Use `-s arch=arm64` for the ARM64 variant. diff --git a/tests/tailor-images/trident-verity-testimage/README.md b/tests/tailor-images/trident-verity-testimage/README.md index af74e5886b..3625d6dc45 100644 --- a/tests/tailor-images/trident-verity-testimage/README.md +++ b/tests/tailor-images/trident-verity-testimage/README.md @@ -18,7 +18,7 @@ dm-verity. From the repo root, run: ```bash -cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-verity-testimage -s deployment=host -s mode=root --output-dir ./artifacts +cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-verity-testimage -s deployment=host -s mode=root --output-dir ./artifacts ``` Other legacy variants map to selectors on the same family: From ba41b72bc9b0b40f5788158231283510c96f88bb Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sat, 10 Oct 2026 18:24:55 +0000 Subject: [PATCH 03/26] tests/tailor-images: deduplicate files shared across image families Several support files were byte-identical copies maintained separately in each image family directory (getty@.service/serial-getty@.service across azl-installer, trident-installer, and trident-container-installer; use-grpc-client-commit.conf and sudoers-wheel across trident-testimage, trident-verity-testimage, and trident-vm-testimage; config-placeholder.yaml and override-placeholder.conf between trident-installer and trident-container-installer; containerd-mmap-fix.cil and load-containerd-selinux-fix.sh between trident-container-installer and trident-container-testimage; trident-container.service between trident-verity-testimage's host and container deployments; post-install.sh between trident-container-testimage and trident-testimage). Move one canonical copy of each into a new tests/tailor-images/common/ directory (files/ and scripts/ subdirectories) and repoint every reference at the shared copy via a ../common/... relative path - verified this resolves correctly both in tailor's rendered Image Customizer config and in a real (non-dry-run) image build, since tailor mounts the whole tests/tailor-images/ workspace root read-only into the build container, so a path that stays within the workspace (unlike a path escaping it entirely, which is not mounted) resolves correctly. Also remove three files that turned out to be unreferenced by any config in either location they existed (trident-verity-testimage/base/etc.mount, trident-vm-testimage/base/etc.mount, and azurelinux-direct-streaming-testimage/base/post-install.sh) - dead weight left over from copying each family's full support-file tree during the initial tailor-images split, not wired into any image.yaml/by-*/include fragment. Left two look-alikes deliberately unmerged after checking their content differs: trident-container-installer's trident-container.service (hash differs from trident-verity-testimage's) and azl-installer's config-placeholder.yaml (hash differs from trident-installer's) - same filename, different content, not safe to share. The by-arch/arm64.yaml matrix fragment (identical 3-line content in four families) was NOT moved to common/: tailor's $include directive errors with "must be resolved before merge" when used under the base: key (unlike under config:), so this one stays duplicated as the simplest correct option. Verified: `tailor validate` (all 30 cells valid, same count/names as before), `tailor build --dry-run` for a representative cell per touched family, a real `tailor build` of trident-installer confirming the shared files are actually readable at runtime inside the IC container, and `tailor render` inspection confirming the rendered config correctly resolves the new common/ paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azl-installer/installer-iso.yaml | 4 +- .../files/config-placeholder.yaml | 0 .../files/containerd-mmap-fix.cil | 0 .../mos => common}/files/getty@.service | 0 .../files/override-placeholder.conf | 0 .../files/serial-getty@.service | 0 .../base => common/files}/sudoers-wheel | 0 .../files/trident-container.service | 0 .../files/use-grpc-client-commit.conf | 0 .../scripts/load-containerd-selinux-fix.sh | 0 .../base => common/scripts}/post-install.sh | 0 .../base/files/getty@.service | 58 ------------------- .../base/files/serial-getty@.service | 46 --------------- .../tailor/baseimg.yaml | 12 ++-- .../base/files/containerd-mmap-fix.cil | 7 --- .../scripts/load-containerd-selinux-fix.sh | 5 -- .../base/scripts/post-install.sh | 2 - .../tailor/baseimg.yaml | 6 +- .../base/files/config-placeholder.yaml | 1 - .../base/files/getty@.service | 58 ------------------- .../base/files/override-placeholder.conf | 1 - .../base/files/serial-getty@.service | 46 --------------- .../trident-installer/by-variant/split.yaml | 2 +- .../trident-installer/image.yaml | 4 +- .../include/common-files.yaml | 4 +- .../trident-testimage/base/post-install.sh | 2 - .../trident-testimage/tailor/baseimg.yaml | 4 +- .../trident-verity-testimage/base/etc.mount | 10 ---- .../base/files/use-grpc-client-commit.conf | 5 -- .../by-deployment+mode/container+root.yaml | 2 +- .../by-deployment+mode/container+usr.yaml | 2 +- .../by-deployment+mode/host+root.yaml | 2 +- .../by-deployment+mode/host+usr.yaml | 2 +- .../include/root-os-common.yaml | 2 +- .../include/usr-os-common.yaml | 2 +- .../usr/files/sudoers-wheel | 1 - .../usr/files/trident-container.service | 14 ----- .../usr/files/use-grpc-client-commit.conf | 5 -- .../trident-vm-testimage/base/etc.mount | 10 ---- .../base/files/sudoers-wheel | 1 - .../base/files/use-grpc-client-commit.conf | 5 -- .../by-scenario/acl-agent.yaml | 2 +- .../by-scenario/grub.yaml | 2 +- .../by-scenario/root-verity.yaml | 2 +- .../by-scenario/usr-verity.yaml | 2 +- .../include/grub-verity-os-common.yaml | 4 +- 46 files changed, 30 insertions(+), 307 deletions(-) rename tests/tailor-images/{trident-container-installer/base => common}/files/config-placeholder.yaml (100%) rename tests/tailor-images/{trident-container-installer/base => common}/files/containerd-mmap-fix.cil (100%) rename tests/tailor-images/{azl-installer/mos => common}/files/getty@.service (100%) rename tests/tailor-images/{trident-container-installer/base => common}/files/override-placeholder.conf (100%) rename tests/tailor-images/{azl-installer/mos => common}/files/serial-getty@.service (100%) rename tests/tailor-images/{trident-verity-testimage/base => common/files}/sudoers-wheel (100%) rename tests/tailor-images/{trident-verity-testimage/base => common}/files/trident-container.service (100%) rename tests/tailor-images/{trident-testimage/base => common}/files/use-grpc-client-commit.conf (100%) rename tests/tailor-images/{trident-container-installer/base => common}/scripts/load-containerd-selinux-fix.sh (100%) rename tests/tailor-images/{azurelinux-direct-streaming-testimage/base => common/scripts}/post-install.sh (100%) delete mode 100644 tests/tailor-images/trident-container-installer/base/files/getty@.service delete mode 100644 tests/tailor-images/trident-container-installer/base/files/serial-getty@.service delete mode 100644 tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil delete mode 100644 tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh delete mode 100644 tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh delete mode 100644 tests/tailor-images/trident-installer/base/files/config-placeholder.yaml delete mode 100644 tests/tailor-images/trident-installer/base/files/getty@.service delete mode 100644 tests/tailor-images/trident-installer/base/files/override-placeholder.conf delete mode 100644 tests/tailor-images/trident-installer/base/files/serial-getty@.service delete mode 100644 tests/tailor-images/trident-testimage/base/post-install.sh delete mode 100644 tests/tailor-images/trident-verity-testimage/base/etc.mount delete mode 100644 tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf delete mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel delete mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service delete mode 100644 tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf delete mode 100644 tests/tailor-images/trident-vm-testimage/base/etc.mount delete mode 100644 tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel delete mode 100644 tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf diff --git a/tests/tailor-images/azl-installer/installer-iso.yaml b/tests/tailor-images/azl-installer/installer-iso.yaml index a5f63a0a17..79fcf0c032 100644 --- a/tests/tailor-images/azl-installer/installer-iso.yaml +++ b/tests/tailor-images/azl-installer/installer-iso.yaml @@ -65,9 +65,9 @@ os: additionalFiles: # Getty service files for root autologin - - source: mos/files/getty@.service + - source: ../common/files/getty@.service destination: /usr/lib/systemd/system/getty@.service - - source: mos/files/serial-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 diff --git a/tests/tailor-images/trident-container-installer/base/files/config-placeholder.yaml b/tests/tailor-images/common/files/config-placeholder.yaml similarity index 100% rename from tests/tailor-images/trident-container-installer/base/files/config-placeholder.yaml rename to tests/tailor-images/common/files/config-placeholder.yaml diff --git a/tests/tailor-images/trident-container-installer/base/files/containerd-mmap-fix.cil b/tests/tailor-images/common/files/containerd-mmap-fix.cil similarity index 100% rename from tests/tailor-images/trident-container-installer/base/files/containerd-mmap-fix.cil rename to tests/tailor-images/common/files/containerd-mmap-fix.cil diff --git a/tests/tailor-images/azl-installer/mos/files/getty@.service b/tests/tailor-images/common/files/getty@.service similarity index 100% rename from tests/tailor-images/azl-installer/mos/files/getty@.service rename to tests/tailor-images/common/files/getty@.service diff --git a/tests/tailor-images/trident-container-installer/base/files/override-placeholder.conf b/tests/tailor-images/common/files/override-placeholder.conf similarity index 100% rename from tests/tailor-images/trident-container-installer/base/files/override-placeholder.conf rename to tests/tailor-images/common/files/override-placeholder.conf diff --git a/tests/tailor-images/azl-installer/mos/files/serial-getty@.service b/tests/tailor-images/common/files/serial-getty@.service similarity index 100% rename from tests/tailor-images/azl-installer/mos/files/serial-getty@.service rename to tests/tailor-images/common/files/serial-getty@.service diff --git a/tests/tailor-images/trident-verity-testimage/base/sudoers-wheel b/tests/tailor-images/common/files/sudoers-wheel similarity index 100% rename from tests/tailor-images/trident-verity-testimage/base/sudoers-wheel rename to tests/tailor-images/common/files/sudoers-wheel diff --git a/tests/tailor-images/trident-verity-testimage/base/files/trident-container.service b/tests/tailor-images/common/files/trident-container.service similarity index 100% rename from tests/tailor-images/trident-verity-testimage/base/files/trident-container.service rename to tests/tailor-images/common/files/trident-container.service diff --git a/tests/tailor-images/trident-testimage/base/files/use-grpc-client-commit.conf b/tests/tailor-images/common/files/use-grpc-client-commit.conf similarity index 100% rename from tests/tailor-images/trident-testimage/base/files/use-grpc-client-commit.conf rename to tests/tailor-images/common/files/use-grpc-client-commit.conf diff --git a/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/common/scripts/load-containerd-selinux-fix.sh similarity index 100% rename from tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh rename to tests/tailor-images/common/scripts/load-containerd-selinux-fix.sh diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/base/post-install.sh b/tests/tailor-images/common/scripts/post-install.sh similarity index 100% rename from tests/tailor-images/azurelinux-direct-streaming-testimage/base/post-install.sh rename to tests/tailor-images/common/scripts/post-install.sh diff --git a/tests/tailor-images/trident-container-installer/base/files/getty@.service b/tests/tailor-images/trident-container-installer/base/files/getty@.service deleted file mode 100644 index 10d3131812..0000000000 --- a/tests/tailor-images/trident-container-installer/base/files/getty@.service +++ /dev/null @@ -1,58 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Getty on %I -Documentation=man:agetty(8) man:systemd-getty-generator(8) -Documentation=http://0pointer.de/blog/projects/serial-console.html -After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target -After=rc-local.service - -# If additional gettys are spawned during boot then we should make -# sure that this is synchronized before getty.target, even though -# getty.target didn't actually pull it in. -Before=getty.target -IgnoreOnIsolate=yes - -# IgnoreOnIsolate causes issues with sulogin, if someone isolates -# rescue.target or starts rescue.service from multi-user.target or -# graphical.target. -Conflicts=rescue.service -Before=rescue.service - -# On systems without virtual consoles, don't start any getty. Note -# that serial gettys are covered by serial-getty@.service, not this -# unit. -ConditionPathExists=/dev/tty0 - -[Service] -# the VT is cleared by TTYVTDisallocate -# The '-o' option value tells agetty to replace 'login' arguments with an -# option to preserve environment (-p), followed by '--' for safety, and then -# the entered username. -ExecStart=-/sbin/agetty --autologin root --noclear %I linux -Type=idle -Restart=always -RestartSec=0 -UtmpIdentifier=%I -TTYPath=/dev/%I -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes -KillMode=process -IgnoreSIGPIPE=no -SendSIGHUP=yes - -# Unset locale for the console getty since the console has problems -# displaying some internationalized messages. -UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION - -[Install] -WantedBy=getty.target -DefaultInstance=tty1 diff --git a/tests/tailor-images/trident-container-installer/base/files/serial-getty@.service b/tests/tailor-images/trident-container-installer/base/files/serial-getty@.service deleted file mode 100644 index 2f65391a8e..0000000000 --- a/tests/tailor-images/trident-container-installer/base/files/serial-getty@.service +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Serial Getty on %I -Documentation=man:agetty(8) man:systemd-getty-generator(8) -Documentation=http://0pointer.de/blog/projects/serial-console.html -BindsTo=dev-%i.device -After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target -After=rc-local.service - -# If additional gettys are spawned during boot then we should make -# sure that this is synchronized before getty.target, even though -# getty.target didn't actually pull it in. -Before=getty.target -IgnoreOnIsolate=yes - -# IgnoreOnIsolate causes issues with sulogin, if someone isolates -# rescue.target or starts rescue.service from multi-user.target or -# graphical.target. -Conflicts=rescue.service -Before=rescue.service - -[Service] -# The '-o' option value tells agetty to replace 'login' arguments with an -# option to preserve environment (-p), followed by '--' for safety, and then -# the entered username. -ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I screen -Type=idle -Restart=always -UtmpIdentifier=%I -TTYPath=/dev/%I -TTYReset=yes -TTYVHangup=yes -KillMode=process -IgnoreSIGPIPE=no -SendSIGHUP=yes - -[Install] -WantedBy=getty.target diff --git a/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml b/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml index 055f6b5e7b..95934cae00 100644 --- a/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml +++ b/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml @@ -39,15 +39,15 @@ os: - tar - vim additionalFiles: - - source: base/files/getty@.service + - source: ../common/files/getty@.service destination: /usr/lib/systemd/system/getty@.service - - source: base/files/serial-getty@.service + - source: ../common/files/serial-getty@.service destination: /usr/lib/systemd/system/serial-getty@.service - source: base/files/root.profile destination: /root/.profile - source: base/files/trident-container.service destination: /usr/lib/systemd/system/trident-container.service - - source: base/files/containerd-mmap-fix.cil + - source: ../common/files/containerd-mmap-fix.cil destination: /usr/share/selinux/packages/containerd-mmap-fix.cil services: enable: @@ -56,12 +56,12 @@ os: scripts: postCustomization: - path: base/scripts/post-install.sh - - path: base/scripts/load-containerd-selinux-fix.sh + - path: ../common/scripts/load-containerd-selinux-fix.sh iso: additionalFiles: - - source: base/files/config-placeholder.yaml + - source: ../common/files/config-placeholder.yaml destination: /trident-config.yaml - - source: base/files/override-placeholder.conf + - source: ../common/files/override-placeholder.conf destination: /trident-override.conf kernelCommandLine: extraCommandLine: diff --git a/tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil b/tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil deleted file mode 100644 index f9951716e1..0000000000 --- a/tests/tailor-images/trident-container-testimage/base/files/containerd-mmap-fix.cil +++ /dev/null @@ -1,7 +0,0 @@ -; Fix for containerd 2.2+ MountManager plugin SELinux denial. -; containerd 2.2 introduces a MountManager that opens a bbolt DB under -; /run/containerd/ using mmap(). The base refpolicy (RELEASE_2_20240226) -; grants manage_file_perms on container_runtime_t:file but that set does -; not include 'map'. Upstream fixed this in commit 7876e51510 (May 2024). -; This module backports the missing permission. -(allow container_engine_system_domain container_runtime_t (file (map))) diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh deleted file mode 100644 index f908b04698..0000000000 --- a/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Load SELinux policy module that grants the 'map' permission on -# container_runtime_t:file for container engines. This fixes containerd -# 2.2+ MountManager bbolt mmap() denials under enforcing mode. -semodule -i /usr/share/selinux/packages/containerd-mmap-fix.cil diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh b/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh deleted file mode 100644 index 79da025b3b..0000000000 --- a/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add the necessary directories for the audit logs so that auditd can start -mkdir -p /var/log/audit diff --git a/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml b/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml index 98cef436fb..397e8fc3d2 100644 --- a/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml +++ b/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml @@ -59,7 +59,7 @@ os: additionalFiles: - source: base/files/trident-container.service destination: /usr/lib/systemd/system/trident-container.service - - source: base/files/containerd-mmap-fix.cil + - source: ../common/files/containerd-mmap-fix.cil destination: /usr/share/selinux/packages/containerd-mmap-fix.cil services: enable: @@ -67,5 +67,5 @@ os: - sshd scripts: postCustomization: - - path: base/scripts/post-install.sh - - path: base/scripts/load-containerd-selinux-fix.sh + - path: ../common/scripts/post-install.sh + - path: ../common/scripts/load-containerd-selinux-fix.sh diff --git a/tests/tailor-images/trident-installer/base/files/config-placeholder.yaml b/tests/tailor-images/trident-installer/base/files/config-placeholder.yaml deleted file mode 100644 index 88bb0938cb..0000000000 --- a/tests/tailor-images/trident-installer/base/files/config-placeholder.yaml +++ /dev/null @@ -1 +0,0 @@ -#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/etc/trident/config.yaml:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-installer/base/files/getty@.service b/tests/tailor-images/trident-installer/base/files/getty@.service deleted file mode 100644 index 10d3131812..0000000000 --- a/tests/tailor-images/trident-installer/base/files/getty@.service +++ /dev/null @@ -1,58 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Getty on %I -Documentation=man:agetty(8) man:systemd-getty-generator(8) -Documentation=http://0pointer.de/blog/projects/serial-console.html -After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target -After=rc-local.service - -# If additional gettys are spawned during boot then we should make -# sure that this is synchronized before getty.target, even though -# getty.target didn't actually pull it in. -Before=getty.target -IgnoreOnIsolate=yes - -# IgnoreOnIsolate causes issues with sulogin, if someone isolates -# rescue.target or starts rescue.service from multi-user.target or -# graphical.target. -Conflicts=rescue.service -Before=rescue.service - -# On systems without virtual consoles, don't start any getty. Note -# that serial gettys are covered by serial-getty@.service, not this -# unit. -ConditionPathExists=/dev/tty0 - -[Service] -# the VT is cleared by TTYVTDisallocate -# The '-o' option value tells agetty to replace 'login' arguments with an -# option to preserve environment (-p), followed by '--' for safety, and then -# the entered username. -ExecStart=-/sbin/agetty --autologin root --noclear %I linux -Type=idle -Restart=always -RestartSec=0 -UtmpIdentifier=%I -TTYPath=/dev/%I -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes -KillMode=process -IgnoreSIGPIPE=no -SendSIGHUP=yes - -# Unset locale for the console getty since the console has problems -# displaying some internationalized messages. -UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION - -[Install] -WantedBy=getty.target -DefaultInstance=tty1 diff --git a/tests/tailor-images/trident-installer/base/files/override-placeholder.conf b/tests/tailor-images/trident-installer/base/files/override-placeholder.conf deleted file mode 100644 index 438677498c..0000000000 --- a/tests/tailor-images/trident-installer/base/files/override-placeholder.conf +++ /dev/null @@ -1 +0,0 @@ -#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/trident-override.conf:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-installer/base/files/serial-getty@.service b/tests/tailor-images/trident-installer/base/files/serial-getty@.service deleted file mode 100644 index 2f65391a8e..0000000000 --- a/tests/tailor-images/trident-installer/base/files/serial-getty@.service +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Serial Getty on %I -Documentation=man:agetty(8) man:systemd-getty-generator(8) -Documentation=http://0pointer.de/blog/projects/serial-console.html -BindsTo=dev-%i.device -After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target -After=rc-local.service - -# If additional gettys are spawned during boot then we should make -# sure that this is synchronized before getty.target, even though -# getty.target didn't actually pull it in. -Before=getty.target -IgnoreOnIsolate=yes - -# IgnoreOnIsolate causes issues with sulogin, if someone isolates -# rescue.target or starts rescue.service from multi-user.target or -# graphical.target. -Conflicts=rescue.service -Before=rescue.service - -[Service] -# The '-o' option value tells agetty to replace 'login' arguments with an -# option to preserve environment (-p), followed by '--' for safety, and then -# the entered username. -ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I screen -Type=idle -Restart=always -UtmpIdentifier=%I -TTYPath=/dev/%I -TTYReset=yes -TTYVHangup=yes -KillMode=process -IgnoreSIGPIPE=no -SendSIGHUP=yes - -[Install] -WantedBy=getty.target diff --git a/tests/tailor-images/trident-installer/by-variant/split.yaml b/tests/tailor-images/trident-installer/by-variant/split.yaml index 328eeb6654..37c7e69295 100644 --- a/tests/tailor-images/trident-installer/by-variant/split.yaml +++ b/tests/tailor-images/trident-installer/by-variant/split.yaml @@ -18,5 +18,5 @@ config: iso: additionalFiles: $remove: - - source: base/files/override-placeholder.conf + - 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 index 6b187585e7..b38db85fc4 100644 --- a/tests/tailor-images/trident-installer/image.yaml +++ b/tests/tailor-images/trident-installer/image.yaml @@ -51,9 +51,9 @@ config: - path: base/post-install.sh iso: additionalFiles: - - source: base/files/config-placeholder.yaml + - source: ../common/files/config-placeholder.yaml destination: /trident-config.yaml - - source: base/files/override-placeholder.conf + - source: ../common/files/override-placeholder.conf destination: /trident-override.conf kernelCommandLine: extraCommandLine: diff --git a/tests/tailor-images/trident-installer/include/common-files.yaml b/tests/tailor-images/trident-installer/include/common-files.yaml index ff0048588d..8c72875d36 100644 --- a/tests/tailor-images/trident-installer/include/common-files.yaml +++ b/tests/tailor-images/trident-installer/include/common-files.yaml @@ -1,6 +1,6 @@ -- source: base/files/getty@.service +- source: ../common/files/getty@.service destination: /usr/lib/systemd/system/getty@.service -- source: base/files/serial-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-testimage/base/post-install.sh b/tests/tailor-images/trident-testimage/base/post-install.sh deleted file mode 100644 index 79da025b3b..0000000000 --- a/tests/tailor-images/trident-testimage/base/post-install.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add the necessary directories for the audit logs so that auditd can start -mkdir -p /var/log/audit diff --git a/tests/tailor-images/trident-testimage/tailor/baseimg.yaml b/tests/tailor-images/trident-testimage/tailor/baseimg.yaml index 89cbfd7bd9..b49fadee35 100644 --- a/tests/tailor-images/trident-testimage/tailor/baseimg.yaml +++ b/tests/tailor-images/trident-testimage/tailor/baseimg.yaml @@ -59,8 +59,8 @@ os: - trident - tridentd.socket additionalFiles: - - source: base/files/use-grpc-client-commit.conf + - source: ../common/files/use-grpc-client-commit.conf destination: /etc/systemd/system/trident.service.d/override.conf scripts: postCustomization: - - path: base/post-install.sh + - path: ../common/scripts/post-install.sh diff --git a/tests/tailor-images/trident-verity-testimage/base/etc.mount b/tests/tailor-images/trident-verity-testimage/base/etc.mount deleted file mode 100644 index 8dd53647f9..0000000000 --- a/tests/tailor-images/trident-verity-testimage/base/etc.mount +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=/etc Overlay Mount -DefaultDependencies=no -Conflicts=shutdown.target - -[Mount] -What=overlay -Where=/etc -Type=overlay -Options=lowerdir=/etc,upperdir=/var/lib/trident-overlay/etc/upper,workdir=/var/lib/trident-overlay/etc/work,rw \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf deleted file mode 100644 index 958e0095c3..0000000000 --- a/tests/tailor-images/trident-verity-testimage/base/files/use-grpc-client-commit.conf +++ /dev/null @@ -1,5 +0,0 @@ -[Service] -ExecStart= -ExecStart=trident grpc-client commit -StandardOutput=journal+console -StandardError=journal+console diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml index 8d3e5de076..9505750da5 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml @@ -9,7 +9,7 @@ config: - squashfs-tools - tar additionalFiles: - - source: base/files/trident-container.service + - source: ../common/files/trident-container.service destination: /usr/lib/systemd/system/trident-container.service services: enable: diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml index c7eed50273..ad717acca6 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml @@ -8,7 +8,7 @@ config: - squashfs-tools - tar additionalFiles: - - source: usr/files/trident-container.service + - source: ../common/files/trident-container.service destination: /usr/lib/systemd/system/trident-container.service services: enable: diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml index e75de1bfb6..4c55a810da 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml @@ -5,7 +5,7 @@ config: install: - trident-service additionalFiles: - - source: base/files/use-grpc-client-commit.conf + - source: ../common/files/use-grpc-client-commit.conf destination: /etc/systemd/system/trident.service.d/override.conf services: enable: diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml index 567cc110db..1d8d480932 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml @@ -9,7 +9,7 @@ config: - audit - selinux-policy-devel additionalFiles: - - source: usr/files/use-grpc-client-commit.conf + - source: ../common/files/use-grpc-client-commit.conf destination: /etc/systemd/system/trident.service.d/override.conf services: enable: diff --git a/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml b/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml index 16faa0d324..f3f6b9ea78 100644 --- a/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml +++ b/tests/tailor-images/trident-verity-testimage/include/root-os-common.yaml @@ -34,7 +34,7 @@ additionalFiles: destination: /etc/systemd/system/etc-mount.service - source: base/etc-mount.sh destination: /usr/local/bin/etc-mount.sh - - source: base/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel services: enable: diff --git a/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml b/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml index 3817dbcc59..7a63deaf4a 100644 --- a/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml +++ b/tests/tailor-images/trident-verity-testimage/include/usr-os-common.yaml @@ -34,7 +34,7 @@ packages: additionalFiles: - source: usr/files/dracut-nohostonly.conf destination: /usr/lib/dracut/dracut.conf.d/nohostonly.conf - - source: usr/files/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel services: enable: diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel b/tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel deleted file mode 100644 index c8b3629606..0000000000 --- a/tests/tailor-images/trident-verity-testimage/usr/files/sudoers-wheel +++ /dev/null @@ -1 +0,0 @@ -%wheel ALL=(ALL:ALL) NOPASSWD: ALL \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service b/tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service deleted file mode 100644 index 98ce5f3e40..0000000000 --- a/tests/tailor-images/trident-verity-testimage/usr/files/trident-container.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Trident Agent -Requires=docker.service -After=network.target network-online.target systemd-udev-settle.service docker.service - -[Service] -Type=oneshot -ExecStartPre=/bin/bash -c "set -e; if ! docker image ls | grep -q 'trident/trident'; then docker load --input /var/lib/trident/trident-container.tar.gz; fi" -ExecStart=docker run --name trident_container --pull=never --rm --privileged -v /etc/trident:/etc/trident -v /var/lib/trident:/var/lib/trident -v /var/log:/var/log -v /:/host -v /dev:/dev -v /run:/run -v /sys:/sys --pid host --ipc host trident/trident:latest commit --verbosity DEBUG -StandardOutput=journal+console -StandardError=journal+console - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf deleted file mode 100644 index 958e0095c3..0000000000 --- a/tests/tailor-images/trident-verity-testimage/usr/files/use-grpc-client-commit.conf +++ /dev/null @@ -1,5 +0,0 @@ -[Service] -ExecStart= -ExecStart=trident grpc-client commit -StandardOutput=journal+console -StandardError=journal+console diff --git a/tests/tailor-images/trident-vm-testimage/base/etc.mount b/tests/tailor-images/trident-vm-testimage/base/etc.mount deleted file mode 100644 index 8dd53647f9..0000000000 --- a/tests/tailor-images/trident-vm-testimage/base/etc.mount +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=/etc Overlay Mount -DefaultDependencies=no -Conflicts=shutdown.target - -[Mount] -What=overlay -Where=/etc -Type=overlay -Options=lowerdir=/etc,upperdir=/var/lib/trident-overlay/etc/upper,workdir=/var/lib/trident-overlay/etc/work,rw \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel b/tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel deleted file mode 100644 index c8b3629606..0000000000 --- a/tests/tailor-images/trident-vm-testimage/base/files/sudoers-wheel +++ /dev/null @@ -1 +0,0 @@ -%wheel ALL=(ALL:ALL) NOPASSWD: ALL \ No newline at end of file diff --git a/tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf b/tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf deleted file mode 100644 index 958e0095c3..0000000000 --- a/tests/tailor-images/trident-vm-testimage/base/files/use-grpc-client-commit.conf +++ /dev/null @@ -1,5 +0,0 @@ -[Service] -ExecStart= -ExecStart=trident grpc-client commit -StandardOutput=journal+console -StandardError=journal+console diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml index a2210cc7f8..3a65f630aa 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -10,7 +10,7 @@ config: additionalFiles: - source: base/files/99-dhcp-eth0.network destination: /etc/systemd/network/99-dhcp-eth0.network - - source: base/files/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel - source: base/files/trident-acl-agent-override.conf destination: /etc/systemd/system/trident-acl-agent.service.d/override.conf diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml index d9bfa313ae..df3d1e8719 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml @@ -48,7 +48,7 @@ config: destination: /usr/lib/systemd/system/sshd-keygen.service - source: base/files/99-dhcp-eth0.network destination: /etc/systemd/network/99-dhcp-eth0.network - - source: base/files/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel scripts: postCustomization: diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml index a19ba87c3e..79fada92a5 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml @@ -6,7 +6,7 @@ config: additionalFiles: - source: base/files/99-dhcp-eth0.network destination: /etc/systemd/network/99-dhcp-eth0.network - - source: base/files/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel overlays: - mountPoint: /etc diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml index 766620fea4..630db9ee21 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml @@ -6,7 +6,7 @@ config: additionalFiles: - source: base/files/99-dhcp-eth0.network destination: /etc/systemd/network/99-dhcp-eth0.network - - source: base/files/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel services: enable: diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml index 6432937bc3..93bf5ba13f 100644 --- a/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml +++ b/tests/tailor-images/trident-vm-testimage/include/grub-verity-os-common.yaml @@ -39,11 +39,11 @@ additionalFiles: destination: /etc/systemd/system/etc-mount.service - source: base/files/etc-mount.sh destination: /usr/local/bin/etc-mount.sh - - source: base/files/sudoers-wheel + - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel - source: base/files/99-dhcp-eth0.network destination: /etc/systemd/network/99-dhcp-eth0.network - - source: base/files/use-grpc-client-commit.conf + - source: ../common/files/use-grpc-client-commit.conf destination: /etc/systemd/system/trident.service.d/override.conf services: enable: From 17ded0ea492d9c841fb7146d7d2f4cc0e2e72215 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sat, 10 Oct 2026 18:37:23 +0000 Subject: [PATCH 04/26] tests/tailor-images: share the by-arch/arm64.yaml base override Now that tools/tailor resolves $include under base: before merge (previous commit, PR #842), the four identical by-arch/arm64.yaml fragments (azurelinux-direct-streaming-testimage, trident-installer, trident-testimage, trident-vm-testimage) can point at one shared common/matrix/base-core-arm64.yaml snippet instead of repeating `base: { $set: { ref: core_arm64 } }` verbatim in each family. Verified: `tailor validate` (same 30 cells as before), and a dry-run/render of an arm64 cell confirming the rendered Image Customizer invocation still resolves --image-file to artifacts/core_arm64.vhdx and --platform to linux/arm64 exactly as before this change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azurelinux-direct-streaming-testimage/by-arch/arm64.yaml | 3 +-- tests/tailor-images/common/matrix/base-core-arm64.yaml | 2 ++ tests/tailor-images/trident-installer/by-arch/arm64.yaml | 3 +-- tests/tailor-images/trident-testimage/by-arch/arm64.yaml | 3 +-- tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 tests/tailor-images/common/matrix/base-core-arm64.yaml diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml index 6fe6f6f38d..7ff2d78da3 100644 --- a/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml @@ -1,3 +1,2 @@ base: - $set: - ref: core_arm64 + $include: ../common/matrix/base-core-arm64.yaml diff --git a/tests/tailor-images/common/matrix/base-core-arm64.yaml b/tests/tailor-images/common/matrix/base-core-arm64.yaml new file mode 100644 index 0000000000..d28ef19157 --- /dev/null +++ b/tests/tailor-images/common/matrix/base-core-arm64.yaml @@ -0,0 +1,2 @@ +$set: + ref: core_arm64 diff --git a/tests/tailor-images/trident-installer/by-arch/arm64.yaml b/tests/tailor-images/trident-installer/by-arch/arm64.yaml index 6fe6f6f38d..7ff2d78da3 100644 --- a/tests/tailor-images/trident-installer/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-installer/by-arch/arm64.yaml @@ -1,3 +1,2 @@ base: - $set: - ref: core_arm64 + $include: ../common/matrix/base-core-arm64.yaml diff --git a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml index 6fe6f6f38d..7ff2d78da3 100644 --- a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml @@ -1,3 +1,2 @@ base: - $set: - ref: core_arm64 + $include: ../common/matrix/base-core-arm64.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml index 6fe6f6f38d..7ff2d78da3 100644 --- a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml @@ -1,3 +1,2 @@ base: - $set: - ref: core_arm64 + $include: ../common/matrix/base-core-arm64.yaml From d1466cfbd6b9eb956bbddd203ee02007598b1bb3 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sat, 10 Oct 2026 22:31:35 +0000 Subject: [PATCH 05/26] tests/tailor-images: add qcow2/vhd-fixed outputs for VM scenarios that need them Several VM test scenarios (grub-verity, usr-verity, acl-agent, grub-verity-azure) need a "clean install" base disk image in addition to their existing .cosi A/B-update payload, previously produced by a raw `docker run` Makefile section invoking Image Customizer directly against the pre-tailor per-scenario YAML (now deleted). Append the missing output format to each affected scenario fragment's `outputs:` list (qcow2 for the first three, vhd-fixed - which tailor names `.vhd` on disk, matching the legacy filename - for grub-verity-azure) so tailor produces both formats from the exact same cell content; the Makefile/legacy_targets.py side of this migration lands separately. Also: - remove the dangling `extraDependencies: - ./base` from trident-functest, azurelinux-direct-streaming-testimage, and trident-testimage's image.yaml - each family's base/ directory is now either nonexistent (trident-functest never had one) or was emptied by the file-deduplication commit, and Image Customizer's own signing preflight (and tailor's extraDependencies check) both reject a declared dependency path that doesn't exist on disk. - revert the file-deduplication commit's sharing of post-install.sh and load-containerd-selinux-fix.sh specifically: Image Customizer requires every `scripts.postCustomization[].path` to resolve under the image's own config directory (confirmed via a real build failure: "script file is not under config directory"), unlike `additionalFiles.source`, which has no such restriction (already proven working for every other deduplicated file). These two scripts go back to small per-family duplicates; every other shared common/ file is unaffected. Verified: `tailor validate` (30 -> 34 cells, +4 for the new qcow2/vhd-fixed cells, otherwise unchanged) and real (non-dry-run) builds of the three new qcow2 cells (grub-verity, usr-verity, acl-agent), each producing both the existing .cosi and the new .qcow2 artifact from one invocation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azurelinux-direct-streaming-testimage/image.yaml | 3 --- .../base}/scripts/load-containerd-selinux-fix.sh | 0 .../trident-container-installer/tailor/baseimg.yaml | 2 +- .../base/scripts/load-containerd-selinux-fix.sh | 5 +++++ .../base}/scripts/post-install.sh | 0 .../trident-container-testimage/tailor/baseimg.yaml | 4 ++-- tests/tailor-images/trident-functest/image.yaml | 3 --- tests/tailor-images/trident-testimage/base/post-install.sh | 2 ++ tests/tailor-images/trident-testimage/image.yaml | 3 --- tests/tailor-images/trident-testimage/tailor/baseimg.yaml | 2 +- .../trident-vm-testimage/by-scenario/acl-agent.yaml | 3 +++ .../trident-vm-testimage/by-scenario/grub-verity-azure.yaml | 3 +++ .../trident-vm-testimage/by-scenario/grub-verity.yaml | 3 +++ .../trident-vm-testimage/by-scenario/usr-verity.yaml | 3 +++ 14 files changed, 23 insertions(+), 13 deletions(-) rename tests/tailor-images/{common => trident-container-installer/base}/scripts/load-containerd-selinux-fix.sh (100%) create mode 100644 tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh rename tests/tailor-images/{common => trident-container-testimage/base}/scripts/post-install.sh (100%) create mode 100644 tests/tailor-images/trident-testimage/base/post-install.sh diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml index c6cca2f107..c9925dc1ea 100644 --- a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml @@ -12,8 +12,5 @@ outputs: rpmSources: - ../../../bin/RPMS -extraDependencies: - - ./base - config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/common/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh similarity index 100% rename from tests/tailor-images/common/scripts/load-containerd-selinux-fix.sh rename to tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh diff --git a/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml b/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml index 95934cae00..926fc52269 100644 --- a/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml +++ b/tests/tailor-images/trident-container-installer/tailor/baseimg.yaml @@ -56,7 +56,7 @@ os: scripts: postCustomization: - path: base/scripts/post-install.sh - - path: ../common/scripts/load-containerd-selinux-fix.sh + - path: base/scripts/load-containerd-selinux-fix.sh iso: additionalFiles: - source: ../common/files/config-placeholder.yaml diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh new file mode 100644 index 0000000000..f908b04698 --- /dev/null +++ b/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Load SELinux policy module that grants the 'map' permission on +# container_runtime_t:file for container engines. This fixes containerd +# 2.2+ MountManager bbolt mmap() denials under enforcing mode. +semodule -i /usr/share/selinux/packages/containerd-mmap-fix.cil diff --git a/tests/tailor-images/common/scripts/post-install.sh b/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh similarity index 100% rename from tests/tailor-images/common/scripts/post-install.sh rename to tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh diff --git a/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml b/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml index 397e8fc3d2..8eb64082e2 100644 --- a/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml +++ b/tests/tailor-images/trident-container-testimage/tailor/baseimg.yaml @@ -67,5 +67,5 @@ os: - sshd scripts: postCustomization: - - path: ../common/scripts/post-install.sh - - path: ../common/scripts/load-containerd-selinux-fix.sh + - path: base/scripts/post-install.sh + - path: base/scripts/load-containerd-selinux-fix.sh diff --git a/tests/tailor-images/trident-functest/image.yaml b/tests/tailor-images/trident-functest/image.yaml index 4f9d4ff305..ede199be9e 100644 --- a/tests/tailor-images/trident-functest/image.yaml +++ b/tests/tailor-images/trident-functest/image.yaml @@ -6,8 +6,5 @@ base: outputs: - format: qcow2 -extraDependencies: - - ./base - config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-testimage/base/post-install.sh b/tests/tailor-images/trident-testimage/base/post-install.sh new file mode 100644 index 0000000000..79da025b3b --- /dev/null +++ b/tests/tailor-images/trident-testimage/base/post-install.sh @@ -0,0 +1,2 @@ +# Add the necessary directories for the audit logs so that auditd can start +mkdir -p /var/log/audit diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml index 06bd41af16..57bbde6029 100644 --- a/tests/tailor-images/trident-testimage/image.yaml +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -12,8 +12,5 @@ outputs: rpmSources: - ../../../bin/RPMS -extraDependencies: - - ./base - config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-testimage/tailor/baseimg.yaml b/tests/tailor-images/trident-testimage/tailor/baseimg.yaml index b49fadee35..943e888789 100644 --- a/tests/tailor-images/trident-testimage/tailor/baseimg.yaml +++ b/tests/tailor-images/trident-testimage/tailor/baseimg.yaml @@ -63,4 +63,4 @@ os: destination: /etc/systemd/system/trident.service.d/override.conf scripts: postCustomization: - - path: ../common/scripts/post-install.sh + - path: base/post-install.sh diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml index 3a65f630aa..34750aba91 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -1,3 +1,6 @@ +outputs: + $append: + - format: qcow2 config: storage: $include: ./include/storage-acl-agent.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml index d2b2c5464e..663f1da06a 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -1,3 +1,6 @@ +outputs: + $append: + - format: vhd-fixed base: $set: ref: core_selinux diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml index 413e42b822..ef66bc49c4 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml @@ -1,3 +1,6 @@ +outputs: + $append: + - format: qcow2 config: storage: $include: ./include/storage-grub-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml index 630db9ee21..2218facfe5 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml @@ -1,3 +1,6 @@ +outputs: + $append: + - format: qcow2 config: storage: $include: ./include/storage-usr-verity.yaml From ecabc7ef40fc60d6b0897642ba80a84ed2e84506 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sat, 10 Oct 2026 23:34:45 +0000 Subject: [PATCH 06/26] tests: name tailor outputs for legacy artifacts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/azl-installer/image.yaml | 1 + .../azurelinux-direct-streaming-testimage/image.yaml | 1 + .../by-arch+source/arm64+ubuntu-2204.yaml | 5 +++++ .../by-arch+source/arm64+ubuntu-2404.yaml | 5 +++++ .../by-source/gb200-2404.yaml | 5 +++++ .../by-source/ubuntu-2404.yaml | 5 +++++ .../foreign-direct-streaming-testimage/image.yaml | 1 + tests/tailor-images/trident-container-installer/image.yaml | 1 + tests/tailor-images/trident-container-testimage/image.yaml | 1 + tests/tailor-images/trident-functest/image.yaml | 1 + tests/tailor-images/trident-installer/by-arch/arm64.yaml | 5 +++++ .../trident-installer/by-variant/direct-streaming.yaml | 5 +++++ tests/tailor-images/trident-installer/by-variant/split.yaml | 5 +++++ tests/tailor-images/trident-installer/image.yaml | 1 + tests/tailor-images/trident-testimage/by-arch/arm64.yaml | 5 +++++ tests/tailor-images/trident-testimage/image.yaml | 1 + .../by-deployment+mode/container+root.yaml | 5 +++++ .../by-deployment+mode/container+usr.yaml | 5 +++++ .../by-deployment+mode/host+root.yaml | 5 +++++ .../by-deployment+mode/host+usr.yaml | 5 +++++ .../by-arch+scenario/arm64+grub-verity.yaml | 6 ++++++ tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml | 5 +++++ .../trident-vm-testimage/by-scenario/acl-agent.yaml | 5 ++++- .../trident-vm-testimage/by-scenario/grub-verity-azure.yaml | 5 ++++- .../trident-vm-testimage/by-scenario/grub-verity.yaml | 5 ++++- .../trident-vm-testimage/by-scenario/root-verity.yaml | 5 +++++ .../trident-vm-testimage/by-scenario/usr-verity.yaml | 5 ++++- tests/tailor-images/trident-vm-testimage/image.yaml | 1 + 28 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml diff --git a/tests/tailor-images/azl-installer/image.yaml b/tests/tailor-images/azl-installer/image.yaml index 0622ba3131..480f57c9e0 100644 --- a/tests/tailor-images/azl-installer/image.yaml +++ b/tests/tailor-images/azl-installer/image.yaml @@ -5,6 +5,7 @@ base: outputs: - format: iso + name: azl-installer rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml index c9925dc1ea..c177b9f81f 100644 --- a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml @@ -8,6 +8,7 @@ base: outputs: - format: baremetal-image + name: "azurelinux-direct-streaming-testimage-${arch}" rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml index 3f1dcbc0e4..2501102a10 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml @@ -1,3 +1,8 @@ base: $set: ref: ubuntu_2204_arm64 + +outputs: + $replace: + - format: baremetal-image + name: ubuntu-direct-streaming-testimage-2204-arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml index 94f6b20459..fc906ed3d4 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml @@ -1,3 +1,8 @@ base: $set: ref: ubuntu_2404_arm64 + +outputs: + $replace: + - format: baremetal-image + name: ubuntu-direct-streaming-testimage-2404-arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml index 6799181856..a323fd6c82 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml @@ -1,3 +1,8 @@ base: $set: ref: gb200_2404_arm64 + +outputs: + $replace: + - format: baremetal-image + name: gb200-direct-streaming-testimage-2404-arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml index 1fc2ef81f2..45eff4d1b6 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml @@ -1,3 +1,8 @@ base: $set: ref: ubuntu_2404_amd64 + +outputs: + $replace: + - format: baremetal-image + name: "ubuntu-direct-streaming-testimage-2404-${arch}" diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml index 3d006bffb6..097d4876bb 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml @@ -14,3 +14,4 @@ base: outputs: - format: baremetal-image + name: ubuntu-direct-streaming-testimage-2204-amd64 diff --git a/tests/tailor-images/trident-container-installer/image.yaml b/tests/tailor-images/trident-container-installer/image.yaml index 9fca7d3935..269dadf529 100644 --- a/tests/tailor-images/trident-container-installer/image.yaml +++ b/tests/tailor-images/trident-container-installer/image.yaml @@ -5,6 +5,7 @@ base: outputs: - format: iso + name: trident-container-installer extraDependencies: - ./base diff --git a/tests/tailor-images/trident-container-testimage/image.yaml b/tests/tailor-images/trident-container-testimage/image.yaml index 69785cda6e..c7c0b19bdb 100644 --- a/tests/tailor-images/trident-container-testimage/image.yaml +++ b/tests/tailor-images/trident-container-testimage/image.yaml @@ -5,6 +5,7 @@ base: outputs: - format: cosi + name: trident-container-testimage extraDependencies: - ./base diff --git a/tests/tailor-images/trident-functest/image.yaml b/tests/tailor-images/trident-functest/image.yaml index ede199be9e..e8b508000e 100644 --- a/tests/tailor-images/trident-functest/image.yaml +++ b/tests/tailor-images/trident-functest/image.yaml @@ -5,6 +5,7 @@ base: outputs: - format: qcow2 + name: trident-functest config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-installer/by-arch/arm64.yaml b/tests/tailor-images/trident-installer/by-arch/arm64.yaml index 7ff2d78da3..27dcdf6d33 100644 --- a/tests/tailor-images/trident-installer/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-installer/by-arch/arm64.yaml @@ -1,2 +1,7 @@ base: $include: ../common/matrix/base-core-arm64.yaml + +outputs: + $replace: + - format: iso + name: trident-installer-arm64 diff --git a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml index 9469a76c0c..0d1389d386 100644 --- a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml +++ b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: iso + name: "trident-direct-streaming-installer-${arch}" + config: os: hostname: diff --git a/tests/tailor-images/trident-installer/by-variant/split.yaml b/tests/tailor-images/trident-installer/by-variant/split.yaml index 37c7e69295..fac8ce21cd 100644 --- a/tests/tailor-images/trident-installer/by-variant/split.yaml +++ b/tests/tailor-images/trident-installer/by-variant/split.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: iso + name: trident-split-installer + config: os: packages: diff --git a/tests/tailor-images/trident-installer/image.yaml b/tests/tailor-images/trident-installer/image.yaml index b38db85fc4..71e3e2e05b 100644 --- a/tests/tailor-images/trident-installer/image.yaml +++ b/tests/tailor-images/trident-installer/image.yaml @@ -13,6 +13,7 @@ base: outputs: - format: iso + name: trident-installer rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml index 7ff2d78da3..7e08fdee83 100644 --- a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml @@ -1,2 +1,7 @@ base: $include: ../common/matrix/base-core-arm64.yaml + +outputs: + $replace: + - format: cosi + name: trident-testimage-arm64 diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml index 57bbde6029..fb20970756 100644 --- a/tests/tailor-images/trident-testimage/image.yaml +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -8,6 +8,7 @@ base: outputs: - format: cosi + name: trident-testimage rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml index 9505750da5..1633e35c77 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: cosi + name: trident-container-verity-testimage + config: os: hostname: trident-container-verity-testimg diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml index ad717acca6..8ed2a8129a 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: cosi + name: trident-container-usrverity-testimage + config: os: hostname: trident-container-usrverity-testimg diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml index 4c55a810da..4898710f8e 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: cosi + name: trident-verity-testimage + config: os: hostname: trident-verity-testimg diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml index 1d8d480932..2327ee4e64 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: cosi + name: trident-usrverity-testimage + config: os: hostname: trident-usrverity-testimg diff --git a/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml new file mode 100644 index 0000000000..6629807e87 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml @@ -0,0 +1,6 @@ +outputs: + $replace: + - format: cosi + name: trident-vm-grub-verity-testimage-arm64 + - format: qcow2 + name: trident-vm-grub-verity-testimage-arm64 diff --git a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml index 7ff2d78da3..f3addeff82 100644 --- a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml @@ -1,2 +1,7 @@ base: $include: ../common/matrix/base-core-arm64.yaml + +outputs: + $replace: + - format: cosi + name: trident-vm-grub-testimage-arm64 diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml index 34750aba91..d771339405 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -1,6 +1,9 @@ outputs: - $append: + $replace: + - format: cosi + name: trident-vm-acl-agent-update-testimage - format: qcow2 + name: trident-vm-acl-agent-testimage config: storage: $include: ./include/storage-acl-agent.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml index 663f1da06a..424e002175 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -1,6 +1,9 @@ outputs: - $append: + $replace: + - format: cosi + name: trident-vm-grub-verity-azure-testimage - format: vhd-fixed + name: trident-vm-grub-verity-azure-testimage base: $set: ref: core_selinux diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml index ef66bc49c4..c2ebf358f3 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml @@ -1,6 +1,9 @@ outputs: - $append: + $replace: + - format: cosi + name: trident-vm-grub-verity-testimage - format: qcow2 + name: trident-vm-grub-verity-testimage config: storage: $include: ./include/storage-grub-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml index 79fada92a5..65790316e9 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml @@ -1,3 +1,8 @@ +outputs: + $replace: + - format: cosi + name: trident-vm-root-verity-testimage + config: storage: $include: ./include/storage-root-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml index 2218facfe5..97500fe7c4 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml @@ -1,6 +1,9 @@ outputs: - $append: + $replace: + - format: cosi + name: trident-vm-usr-verity-testimage - format: qcow2 + name: trident-vm-usr-verity-testimage config: storage: $include: ./include/storage-usr-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml index ce0f3c26a3..73ca153d6f 100644 --- a/tests/tailor-images/trident-vm-testimage/image.yaml +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -13,6 +13,7 @@ base: outputs: - format: cosi + name: trident-vm-grub-testimage rpmSources: - ../../../bin/RPMS From 4b4261d1521b3f4fe19a0bddbe81e1a85094017a Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Sun, 11 Oct 2026 22:03:53 +0000 Subject: [PATCH 07/26] fix: split qemu grub-verity base and update layouts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../by-scenario/grub-verity-base.yaml | 12 ++++ .../by-scenario/grub-verity.yaml | 2 - .../trident-vm-testimage/image.yaml | 4 +- .../include/grub-verity-base-os-common.yaml | 53 ++++++++++++++ .../include/grub-verity-base-scripts.yaml | 7 ++ .../include/storage-grub-verity-base.yaml | 69 +++++++++++++++++++ 6 files changed, 143 insertions(+), 4 deletions(-) create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/grub-verity-base-os-common.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/grub-verity-base-scripts.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-base.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml new file mode 100644 index 0000000000..d51f302712 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml @@ -0,0 +1,12 @@ +outputs: + $replace: + - format: qcow2 + name: trident-vm-grub-verity-testimage +config: + storage: + $include: ./include/storage-grub-verity-base.yaml + os: + $include: ./include/grub-verity-base-os-common.yaml + scripts: + postCustomization: + - $include: ./include/grub-verity-base-scripts.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml index c2ebf358f3..ed1b1f5c22 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml @@ -2,8 +2,6 @@ outputs: $replace: - format: cosi name: trident-vm-grub-verity-testimage - - format: qcow2 - name: trident-vm-grub-verity-testimage config: storage: $include: ./include/storage-grub-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml index 73ca153d6f..8afac2b806 100644 --- a/tests/tailor-images/trident-vm-testimage/image.yaml +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -2,11 +2,11 @@ name: trident-vm-testimage matrix: arch: [amd64, arm64] - scenario: [grub, grub-verity, root-verity, usr-verity, acl-agent, grub-verity-azure] + scenario: [grub, grub-verity, grub-verity-base, root-verity, usr-verity, acl-agent, grub-verity-azure] selectors: exclude: - - { arch: arm64, scenario: [root-verity, usr-verity, acl-agent, grub-verity-azure] } + - { arch: arm64, scenario: [grub-verity-base, root-verity, usr-verity, acl-agent, grub-verity-azure] } base: ref: qemu_guest diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-verity-base-os-common.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-verity-base-os-common.yaml new file mode 100644 index 0000000000..7aceedaad1 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/grub-verity-base-os-common.yaml @@ -0,0 +1,53 @@ +bootloader: + resetType: hard-reset +hostname: trident-vm-verity-testimg +selinux: + mode: disabled +kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=tty1 + - console=ttyS0 + - rd.debug + - loglevel=6 + - log_buf_len=1M + - systemd.journald.forward_to_console=1 +packages: + install: + - device-mapper + - dnf + - efibootmgr + - grub2-efi-binary + - iproute + - iptables + - jq + - kexec-tools + - lvm2 + - openssh-server + - systemd-udev + - trident + - veritysetup + - vim + - netplan +additionalFiles: + - source: base/files/etc-mount-mic.service + destination: /etc/systemd/system/etc-mount.service + - source: base/files/etc-mount.sh + destination: /usr/local/bin/etc-mount.sh + - source: base/files/sshd-keygen.service + destination: /usr/lib/systemd/system/sshd-keygen.service + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: ../common/files/sudoers-wheel + destination: /etc/sudoers.d/wheel +services: + enable: + - etc-mount + - kdump + - tridentd.socket +users: + - name: testuser + sshPublicKeyPaths: + - base/files/id_rsa.pub + secondaryGroups: + - wheel diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-verity-base-scripts.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-verity-base-scripts.yaml new file mode 100644 index 0000000000..d43975b098 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/grub-verity-base-scripts.yaml @@ -0,0 +1,7 @@ +- path: base/scripts/post-install.sh +- path: base/scripts/create-rw-overlay-dirs.sh +- path: base/scripts/update-host-status.sh +- path: base/scripts/prepare-update-config-verity.sh +- path: base/scripts/ssh-move-host-keys.sh +- path: base/scripts/create-ssh-dirs.sh +- path: base/scripts/duid-type-to-link-layer.sh diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-base.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-base.yaml new file mode 100644 index 0000000000..28bcd41bb0 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-base.yaml @@ -0,0 +1,69 @@ +bootType: efi +disks: + - partitionTableType: gpt + partitions: + - id: esp + type: esp + size: 512M + - id: boot-a + size: 256M + - id: boot-b + size: 256M + - id: root-a + size: 4G + - id: root-b + size: 4G + - id: root-hash-a + size: 128M + - id: root-hash-b + size: 128M + - id: var-a + size: 1G + - id: var-b + size: 1G + - id: trident-overlay-a + size: 32M + - id: trident-overlay-b + size: 32M + - id: trident + size: 512M + - id: home + size: 1G + - id: srv + size: 128M +verity: + - id: rootverity + name: root + dataDeviceId: root-a + hashDeviceId: root-hash-a + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: boot-a + type: ext4 + mountPoint: /boot + - deviceId: rootverity + type: ext4 + mountPoint: + path: / + options: defaults,ro + - deviceId: var-a + type: ext4 + mountPoint: /var + - deviceId: trident-overlay-a + type: ext4 + mountPoint: /var/lib/trident-overlay + - deviceId: trident + type: ext4 + mountPoint: /var/lib/trident + - deviceId: home + type: ext4 + mountPoint: /home + - deviceId: srv + type: ext4 + mountPoint: /srv From ed8a6ae11e07eb32d565f46cf777147a53e5554b Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Mon, 12 Oct 2026 16:27:25 +0000 Subject: [PATCH 08/26] fix: restore executable bit on shell scripts lost during tailor migration Nearly all .sh files under tests/tailor-images had their executable bit (755) silently dropped to 644 during the testimages.py -> tailor migration (likely lost during file moves/copies). This caused etc-mount.service (which execs etc-mount.sh directly, no shell wrapper) to fail to start at boot, breaking the root-verity container deployment and contributing to post-boot configuration failures. Restored 755 on all scripts that were 755 upstream on main; left the handful that were already 644 upstream unchanged. --- tests/tailor-images/azl-installer/mos/scripts/startup-command.sh | 0 .../trident-container-installer/base/scripts/post-install.sh | 0 .../trident-container-testimage/base/scripts/post-install.sh | 0 tests/tailor-images/trident-installer/base/post-install.sh | 0 tests/tailor-images/trident-testimage/base/post-install.sh | 0 .../tailor-images/trident-verity-testimage/base/create-web-dir.sh | 0 tests/tailor-images/trident-verity-testimage/base/etc-mount.sh | 0 .../trident-verity-testimage/base/trident-debug-log.sh | 0 tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh | 0 .../trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh | 0 .../trident-vm-testimage/base/scripts/create-ssh-dirs.sh | 0 .../trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh | 0 .../trident-vm-testimage/base/scripts/post-install.sh | 0 .../base/scripts/prepare-update-config-usrverity.sh | 0 .../base/scripts/prepare-update-config-verity.sh | 0 .../trident-vm-testimage/base/scripts/prepare-update-config.sh | 0 .../trident-vm-testimage/base/scripts/ssh-move-host-keys.sh | 0 .../trident-vm-testimage/base/scripts/update-host-status.sh | 0 .../trident-vm-testimage/base/scripts/update-os-release.sh | 0 19 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/tailor-images/azl-installer/mos/scripts/startup-command.sh mode change 100644 => 100755 tests/tailor-images/trident-container-installer/base/scripts/post-install.sh mode change 100644 => 100755 tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh mode change 100644 => 100755 tests/tailor-images/trident-installer/base/post-install.sh mode change 100644 => 100755 tests/tailor-images/trident-testimage/base/post-install.sh mode change 100644 => 100755 tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh mode change 100644 => 100755 tests/tailor-images/trident-verity-testimage/base/etc-mount.sh mode change 100644 => 100755 tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh mode change 100644 => 100755 tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh diff --git a/tests/tailor-images/azl-installer/mos/scripts/startup-command.sh b/tests/tailor-images/azl-installer/mos/scripts/startup-command.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-container-installer/base/scripts/post-install.sh b/tests/tailor-images/trident-container-installer/base/scripts/post-install.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh b/tests/tailor-images/trident-container-testimage/base/scripts/post-install.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-installer/base/post-install.sh b/tests/tailor-images/trident-installer/base/post-install.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-testimage/base/post-install.sh b/tests/tailor-images/trident-testimage/base/post-install.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh b/tests/tailor-images/trident-verity-testimage/base/create-web-dir.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-verity-testimage/base/etc-mount.sh b/tests/tailor-images/trident-verity-testimage/base/etc-mount.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh b/tests/tailor-images/trident-verity-testimage/base/trident-debug-log.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh b/tests/tailor-images/trident-vm-testimage/base/files/etc-mount.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/create-rw-overlay-dirs.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/create-ssh-dirs.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/duid-type-to-link-layer.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/post-install.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-usrverity.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config-verity.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/prepare-update-config.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/ssh-move-host-keys.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/update-host-status.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh b/tests/tailor-images/trident-vm-testimage/base/scripts/update-os-release.sh old mode 100644 new mode 100755 From 4fcb3e7b259aef90a0c94600e8ec91f6f59ba216 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Mon, 12 Oct 2026 18:36:49 +0000 Subject: [PATCH 09/26] tests: fix tailor image-config review findings - Split acl-agent.yaml into a cosi (update) scenario that enables trident-acl-agent.service by default, and a new acl-agent-base.yaml qcow2 scenario that does not: the real A/B reboot lands on a different root than the one SSHed into pre-stage, so the service can only safely auto-enable on the update target. - Split grub-verity-azure.yaml the same way: a cosi update scenario keeps the single-slot layout, and a new grub-verity-azure-base.yaml vhd-fixed scenario gets the dual-slot layout via a new grub-verity-base+grub-verity-azure-base.yaml disjunction fragment, mirroring the existing grub-verity-base split. - Add ../common to extraDependencies in every image family that references common/ files, so edits to shared files correctly invalidate the fingerprint cache. - Fix README.md: drop the stale legacy-map.json reference (removed before this migration was split into stacked PRs). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/README.md | 10 ++---- tests/tailor-images/azl-installer/image.yaml | 1 + .../image.yaml | 3 ++ .../trident-container-installer/image.yaml | 1 + .../trident-container-testimage/image.yaml | 1 + .../trident-installer/image.yaml | 1 + .../trident-testimage/image.yaml | 3 ++ .../trident-verity-testimage/image.yaml | 1 + .../by-scenario/acl-agent-base.yaml | 34 +++++++++++++++++++ .../by-scenario/acl-agent.yaml | 2 -- .../by-scenario/grub-verity-azure-base.yaml | 34 +++++++++++++++++++ .../by-scenario/grub-verity-azure.yaml | 2 -- ...ub-verity-base+grub-verity-azure-base.yaml | 6 ++++ .../by-scenario/grub-verity-base.yaml | 5 --- .../trident-vm-testimage/image.yaml | 5 +-- 15 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base+grub-verity-azure-base.yaml diff --git a/tests/tailor-images/README.md b/tests/tailor-images/README.md index bb9666b62d..b2a5d585eb 100644 --- a/tests/tailor-images/README.md +++ b/tests/tailor-images/README.md @@ -1,7 +1,7 @@ # Test images with tailor -`tests/tailor-images/` is now a [tailor](../../tools/tailor/README.md) workspace. -The legacy `testimages.py` / `builder/` flow is removed. +`tests/tailor-images/` is a [tailor](../../tools/tailor/README.md) workspace. +It replaces the legacy `testimages.py` / `builder/` flow, which has been removed. ## Build from the repo root @@ -46,11 +46,7 @@ Ubuntu / GB200 direct-streaming inputs still come from the pipeline-managed blob staging flow; those slots are intentionally catalogued without an in-workspace remote source. -## Legacy name mapping - -Pipelines still accept the historical image names. `tests/tailor-images/legacy-map.json` -maps each legacy name to the tailor image family, selectors, expected base slot, -and published artifact extension. +## Image families The current families are: diff --git a/tests/tailor-images/azl-installer/image.yaml b/tests/tailor-images/azl-installer/image.yaml index 480f57c9e0..af97a87a7d 100644 --- a/tests/tailor-images/azl-installer/image.yaml +++ b/tests/tailor-images/azl-installer/image.yaml @@ -14,6 +14,7 @@ extraDependencies: - ./installer-iso.yaml - ./mos - ./iso + - ../common config: $include: ./installer-iso.yaml diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml index c177b9f81f..71bbba5c82 100644 --- a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml @@ -13,5 +13,8 @@ outputs: rpmSources: - ../../../bin/RPMS +extraDependencies: + - ../common + config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-container-installer/image.yaml b/tests/tailor-images/trident-container-installer/image.yaml index 269dadf529..a010619403 100644 --- a/tests/tailor-images/trident-container-installer/image.yaml +++ b/tests/tailor-images/trident-container-installer/image.yaml @@ -9,6 +9,7 @@ outputs: extraDependencies: - ./base + - ../common config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-container-testimage/image.yaml b/tests/tailor-images/trident-container-testimage/image.yaml index c7c0b19bdb..e9204d64c6 100644 --- a/tests/tailor-images/trident-container-testimage/image.yaml +++ b/tests/tailor-images/trident-container-testimage/image.yaml @@ -9,6 +9,7 @@ outputs: extraDependencies: - ./base + - ../common config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-installer/image.yaml b/tests/tailor-images/trident-installer/image.yaml index 71e3e2e05b..54304c1496 100644 --- a/tests/tailor-images/trident-installer/image.yaml +++ b/tests/tailor-images/trident-installer/image.yaml @@ -20,6 +20,7 @@ rpmSources: extraDependencies: - ./base + - ../common config: storage: diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml index fb20970756..49a964bc8d 100644 --- a/tests/tailor-images/trident-testimage/image.yaml +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -13,5 +13,8 @@ outputs: rpmSources: - ../../../bin/RPMS +extraDependencies: + - ../common + config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-verity-testimage/image.yaml b/tests/tailor-images/trident-verity-testimage/image.yaml index 47417c6b27..01e01ba3da 100644 --- a/tests/tailor-images/trident-verity-testimage/image.yaml +++ b/tests/tailor-images/trident-verity-testimage/image.yaml @@ -13,5 +13,6 @@ outputs: extraDependencies: - ./base - ./usr + - ../common config: {} diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml new file mode 100644 index 0000000000..31c7718803 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml @@ -0,0 +1,34 @@ +# Base (qcow2) counterpart to acl-agent.yaml. The real A/B reboot lands on a +# different root than the one the storm harness SSHes into pre-stage, and +# /etc/trident + /var/lib/kubelet live on per-root ext4 partitions, so a live +# "systemctl enable --now" on the old root has no effect on the new one. +# trident-acl-agent.service is therefore only enabled by default on the +# cosi (update) counterpart; the qcow2 base image enables it live via SSH +# during initial deploy. +outputs: + $replace: + - format: qcow2 + name: trident-vm-acl-agent-testimage +config: + storage: + $include: ./include/storage-acl-agent.yaml + os: + hostname: trident-acl-agent-testimg + packages: + install: + $append: + - trident-acl + additionalFiles: + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: ../common/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + - source: base/files/trident-acl-agent-override.conf + destination: /etc/systemd/system/trident-acl-agent.service.d/override.conf + - source: base/files/trident-acl-agent-cert-install.service + destination: /etc/systemd/system/trident-acl-agent-cert-install.service + services: + enable: + - kdump + - tridentd.socket + - trident-acl-agent-cert-install.service diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml index d771339405..92721c253c 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -2,8 +2,6 @@ outputs: $replace: - format: cosi name: trident-vm-acl-agent-update-testimage - - format: qcow2 - name: trident-vm-acl-agent-testimage config: storage: $include: ./include/storage-acl-agent.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml new file mode 100644 index 0000000000..e6de868d42 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml @@ -0,0 +1,34 @@ +# Base (vhd-fixed) counterpart to grub-verity-azure.yaml. The VHD is the +# initial-deploy image and needs the dual-slot A/B partition layout (like +# grub-verity-base.yaml), unlike the cosi update target which only ever +# lands on a single slot. Shared os/scripts content comes from +# grub-verity-base+grub-verity-azure-base.yaml; this file only layers the +# azure-specific overrides on top. +outputs: + $replace: + - format: vhd-fixed + name: trident-vm-grub-verity-azure-testimage +base: + $set: + ref: core_selinux +config: + storage: + $include: ./include/storage-grub-verity-base.yaml + os: + hostname: + $set: trident-vm-testimg + selinux: + mode: + $set: permissive + packages: + install: + $remove: + - netplan + $append: + - selinux-policy + - WALinuxAgent + users: + $replace: + - name: testuser + secondaryGroups: + - wheel diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml index 424e002175..0b125d1c16 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -2,8 +2,6 @@ outputs: $replace: - format: cosi name: trident-vm-grub-verity-azure-testimage - - format: vhd-fixed - name: trident-vm-grub-verity-azure-testimage base: $set: ref: core_selinux diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base+grub-verity-azure-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base+grub-verity-azure-base.yaml new file mode 100644 index 0000000000..a5d3f9648a --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base+grub-verity-azure-base.yaml @@ -0,0 +1,6 @@ +config: + os: + $include: ./include/grub-verity-base-os-common.yaml + scripts: + postCustomization: + - $include: ./include/grub-verity-base-scripts.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml index d51f302712..2ca2a954c8 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml @@ -5,8 +5,3 @@ outputs: config: storage: $include: ./include/storage-grub-verity-base.yaml - os: - $include: ./include/grub-verity-base-os-common.yaml - scripts: - postCustomization: - - $include: ./include/grub-verity-base-scripts.yaml diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml index 8afac2b806..b3e54b4215 100644 --- a/tests/tailor-images/trident-vm-testimage/image.yaml +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -2,11 +2,11 @@ name: trident-vm-testimage matrix: arch: [amd64, arm64] - scenario: [grub, grub-verity, grub-verity-base, root-verity, usr-verity, acl-agent, grub-verity-azure] + scenario: [grub, grub-verity, grub-verity-base, root-verity, usr-verity, acl-agent, acl-agent-base, grub-verity-azure, grub-verity-azure-base] selectors: exclude: - - { arch: arm64, scenario: [grub-verity-base, root-verity, usr-verity, acl-agent, grub-verity-azure] } + - { arch: arm64, scenario: [grub-verity-base, root-verity, usr-verity, acl-agent, acl-agent-base, grub-verity-azure, grub-verity-azure-base] } base: ref: qemu_guest @@ -20,5 +20,6 @@ rpmSources: extraDependencies: - ./base + - ../common config: {} From 79584627bea8ac00d41dbb0d238ae513335e165f Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Mon, 12 Oct 2026 20:01:05 +0000 Subject: [PATCH 10/26] tests: fix additional tailor image-config review findings - Include acl-agent-base in the root-verity+usr-verity+acl-agent disjunction fragment (renamed to .../acl-agent+acl-agent-base.yaml), which it was missing from -- it had no UKI os-common/scripts, no systemd-boot, and no previewFeatures: uki, breaking the qcow2. - Restore a qcow2-producing grub-base scenario, matching the pre-migration baseimg-grub.yaml/updateimg-grub.yaml split: the base image is dual-slot (storage-grub.yaml, unchanged), the cosi update target gets its own single-slot layout (new storage-grub-update.yaml) instead of borrowing the base's. - Fix README.md wording: trident-verity-testimage's output uses each variant's configured outputs[].name, not the cell slug; the VM testimage's "With verity" update row had a copy-pasted Regular path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-verity-testimage/README.md | 5 +- .../trident-vm-testimage/README.md | 2 +- .../by-scenario/grub-base.yaml | 57 +++++++++++++++++++ .../by-scenario/grub.yaml | 2 +- ...+usr-verity+acl-agent+acl-agent-base.yaml} | 0 .../trident-vm-testimage/image.yaml | 4 +- .../include/grub-base-scripts.yaml | 6 ++ .../include/storage-grub-update.yaml | 19 +++++++ 8 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml rename tests/tailor-images/trident-vm-testimage/by-scenario/{root-verity+usr-verity+acl-agent.yaml => root-verity+usr-verity+acl-agent+acl-agent-base.yaml} (100%) create mode 100644 tests/tailor-images/trident-vm-testimage/include/grub-base-scripts.yaml create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-grub-update.yaml diff --git a/tests/tailor-images/trident-verity-testimage/README.md b/tests/tailor-images/trident-verity-testimage/README.md index 3625d6dc45..9740d2769c 100644 --- a/tests/tailor-images/trident-verity-testimage/README.md +++ b/tests/tailor-images/trident-verity-testimage/README.md @@ -27,5 +27,6 @@ Other legacy variants map to selectors on the same family: - `trident-container-verity-testimage` → `-s deployment=container -s mode=root` - `trident-container-usrverity-testimage` → `-s deployment=container -s mode=usr` -Output is written to `artifacts/` using the tailor cell slug by default. Use -`--output-dir ` to change the output location. +Output is written to `artifacts/` using each variant's configured `outputs[].name` +(e.g. the host/root build above publishes `trident-verity-testimage.cosi`), not the +cell slug. Use `--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-vm-testimage/README.md b/tests/tailor-images/trident-vm-testimage/README.md index d7f37b5e38..beaeb56cce 100644 --- a/tests/tailor-images/trident-vm-testimage/README.md +++ b/tests/tailor-images/trident-vm-testimage/README.md @@ -47,5 +47,5 @@ To build the update images, run: | Image type | Make command | Output path | | ---------- | ------------ | ----------- | | Regular | `make trident-vm-grub-testimage` | `artifacts/trident-vm-grub-testimage/*` | -| With verity | `make trident-vm-grub-verity-testimage` | `artifacts/trident-vm-grub-testimage/*` | +| With verity | `make trident-vm-grub-verity-testimage` | `artifacts/trident-vm-grub-verity-testimage/*` | | ACL-agent UKI usr-verity | `make artifacts/trident-vm-acl-agent-update-testimage.cosi` | `artifacts/trident-vm-acl-agent-update-testimage.cosi` | diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml new file mode 100644 index 0000000000..227f9eb713 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml @@ -0,0 +1,57 @@ +# Base (qcow2) counterpart to grub.yaml, matching the pre-migration +# baseimg-grub.yaml / updateimg-grub.yaml split: the base image is a +# dual-slot A/B layout (storage-grub.yaml, unchanged), while the cosi +# update target uses a single slot (storage-grub-update.yaml). +outputs: + $replace: + - format: qcow2 + name: trident-vm-grub-testimage +config: + storage: + $include: ./include/storage-grub.yaml + os: + bootloader: + resetType: hard-reset + hostname: trident-vm-testimg + selinux: + mode: disabled + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=tty1 + - console=ttyS0 + - rd.debug + - loglevel=6 + - log_buf_len=1M + - systemd.journald.forward_to_console=1 + packages: + install: + - dnf + - efibootmgr + - grub2-efi-binary + - iproute + - iptables + - jq + - openssh-server + - trident-service + - vim + - netplan + services: + enable: + - tridentd.socket + users: + - name: testuser + sshPublicKeyPaths: + - base/files/id_rsa.pub + secondaryGroups: + - wheel + additionalFiles: + - source: base/files/sshd-keygen.service + destination: /usr/lib/systemd/system/sshd-keygen.service + - source: base/files/99-dhcp-eth0.network + destination: /etc/systemd/network/99-dhcp-eth0.network + - source: ../common/files/sudoers-wheel + destination: /etc/sudoers.d/wheel + scripts: + postCustomization: + - $include: ./include/grub-base-scripts.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml index df3d1e8719..ee58ee7f8c 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml @@ -1,6 +1,6 @@ config: storage: - $include: ./include/storage-grub.yaml + $include: ./include/storage-grub-update.yaml os: bootloader: resetType: hard-reset diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent+acl-agent-base.yaml similarity index 100% rename from tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent.yaml rename to tests/tailor-images/trident-vm-testimage/by-scenario/root-verity+usr-verity+acl-agent+acl-agent-base.yaml diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml index b3e54b4215..5eead2314a 100644 --- a/tests/tailor-images/trident-vm-testimage/image.yaml +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -2,11 +2,11 @@ name: trident-vm-testimage matrix: arch: [amd64, arm64] - scenario: [grub, grub-verity, grub-verity-base, root-verity, usr-verity, acl-agent, acl-agent-base, grub-verity-azure, grub-verity-azure-base] + scenario: [grub, grub-base, grub-verity, grub-verity-base, root-verity, usr-verity, acl-agent, acl-agent-base, grub-verity-azure, grub-verity-azure-base] selectors: exclude: - - { arch: arm64, scenario: [grub-verity-base, root-verity, usr-verity, acl-agent, acl-agent-base, grub-verity-azure, grub-verity-azure-base] } + - { arch: arm64, scenario: [grub-base, grub-verity-base, root-verity, usr-verity, acl-agent, acl-agent-base, grub-verity-azure, grub-verity-azure-base] } base: ref: qemu_guest diff --git a/tests/tailor-images/trident-vm-testimage/include/grub-base-scripts.yaml b/tests/tailor-images/trident-vm-testimage/include/grub-base-scripts.yaml new file mode 100644 index 0000000000..b5dfd7894f --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/grub-base-scripts.yaml @@ -0,0 +1,6 @@ +- path: base/scripts/post-install.sh +- path: base/scripts/update-host-status.sh +- path: base/scripts/prepare-update-config.sh +- path: base/scripts/ssh-move-host-keys.sh +- path: base/scripts/create-ssh-dirs.sh +- path: base/scripts/duid-type-to-link-layer.sh diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-grub-update.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-grub-update.yaml new file mode 100644 index 0000000000..affd3e7254 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-grub-update.yaml @@ -0,0 +1,19 @@ +bootType: efi +disks: + - partitionTableType: gpt + maxSize: 5G + partitions: + - id: esp + type: esp + size: 8M + - id: root + size: 4G +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: root + type: ext4 + mountPoint: / From d1770fcaf01904ed596d844efc36a16e482a94b5 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Mon, 12 Oct 2026 23:03:13 +0000 Subject: [PATCH 11/26] tests: drop outputs[].name overrides; fix arm64 qcow2, azure hostname, README Per the row-13 decision to remove outputs[].name from tailor entirely (prior commit), all 34 per-image `name:` overrides across these configs are now unsupported/unknown fields -- remove them (cells now publish under their slug; the Make layer maps legacy filenames, next commit). Also fixes three additional review findings: - trident-vm-testimage's arm64+grub-verity composite declared a qcow2 output alongside cosi, but the matched scenario is the single-slot update layout (no arm64 "-base" dual-slot scenario exists -- arm64 is excluded from grub-verity-base in image.yaml's matrix). Legacy arm64 only ever produced a COSI; drop the qcow2 entry. - grub-verity-azure-base.yaml overrode hostname to the update image's value (trident-vm-testimg) instead of the inherited base hostname from grub-verity-base-os-common.yaml (trident-vm-verity-testimg). Drop the override. - trident-vm-testimage/README.md's fixed-vhd row named a Make target that doesn't exist (trident-vm-grub-verity-testimage.vhd); the real target is trident-vm-grub-verity-azure-testimage.vhd. - trident-verity-testimage/README.md's direct-build note described the old outputs[].name-based clone filenames; updated to the actual slug-based ones. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/azl-installer/image.yaml | 1 - .../azurelinux-direct-streaming-testimage/image.yaml | 1 - .../by-arch+source/arm64+ubuntu-2204.yaml | 1 - .../by-arch+source/arm64+ubuntu-2404.yaml | 1 - .../by-source/gb200-2404.yaml | 1 - .../by-source/ubuntu-2404.yaml | 1 - .../foreign-direct-streaming-testimage/image.yaml | 1 - tests/tailor-images/trident-container-installer/image.yaml | 1 - tests/tailor-images/trident-container-testimage/image.yaml | 1 - tests/tailor-images/trident-functest/image.yaml | 1 - tests/tailor-images/trident-installer/by-arch/arm64.yaml | 1 - .../trident-installer/by-variant/direct-streaming.yaml | 1 - tests/tailor-images/trident-installer/by-variant/split.yaml | 1 - tests/tailor-images/trident-installer/image.yaml | 1 - tests/tailor-images/trident-testimage/by-arch/arm64.yaml | 1 - tests/tailor-images/trident-testimage/image.yaml | 1 - tests/tailor-images/trident-verity-testimage/README.md | 6 +++--- .../by-deployment+mode/container+root.yaml | 1 - .../by-deployment+mode/container+usr.yaml | 1 - .../by-deployment+mode/host+root.yaml | 1 - .../by-deployment+mode/host+usr.yaml | 1 - tests/tailor-images/trident-vm-testimage/README.md | 2 +- .../by-arch+scenario/arm64+grub-verity.yaml | 3 --- tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml | 1 - .../trident-vm-testimage/by-scenario/acl-agent-base.yaml | 1 - .../trident-vm-testimage/by-scenario/acl-agent.yaml | 1 - .../trident-vm-testimage/by-scenario/grub-base.yaml | 1 - .../by-scenario/grub-verity-azure-base.yaml | 3 --- .../trident-vm-testimage/by-scenario/grub-verity-azure.yaml | 1 - .../trident-vm-testimage/by-scenario/grub-verity-base.yaml | 1 - .../trident-vm-testimage/by-scenario/grub-verity.yaml | 1 - .../trident-vm-testimage/by-scenario/root-verity.yaml | 1 - .../trident-vm-testimage/by-scenario/usr-verity.yaml | 2 -- tests/tailor-images/trident-vm-testimage/image.yaml | 1 - 34 files changed, 4 insertions(+), 41 deletions(-) diff --git a/tests/tailor-images/azl-installer/image.yaml b/tests/tailor-images/azl-installer/image.yaml index af97a87a7d..9880ea3b9c 100644 --- a/tests/tailor-images/azl-installer/image.yaml +++ b/tests/tailor-images/azl-installer/image.yaml @@ -5,7 +5,6 @@ base: outputs: - format: iso - name: azl-installer rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml index 71bbba5c82..351a708c46 100644 --- a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml @@ -8,7 +8,6 @@ base: outputs: - format: baremetal-image - name: "azurelinux-direct-streaming-testimage-${arch}" rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml index 2501102a10..42a5d73548 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2204.yaml @@ -5,4 +5,3 @@ base: outputs: $replace: - format: baremetal-image - name: ubuntu-direct-streaming-testimage-2204-arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml index fc906ed3d4..19c7d4ce27 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-arch+source/arm64+ubuntu-2404.yaml @@ -5,4 +5,3 @@ base: outputs: $replace: - format: baremetal-image - name: ubuntu-direct-streaming-testimage-2404-arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml index a323fd6c82..274d1a2b3e 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/gb200-2404.yaml @@ -5,4 +5,3 @@ base: outputs: $replace: - format: baremetal-image - name: gb200-direct-streaming-testimage-2404-arm64 diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml index 45eff4d1b6..888cdf330e 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/by-source/ubuntu-2404.yaml @@ -5,4 +5,3 @@ base: outputs: $replace: - format: baremetal-image - name: "ubuntu-direct-streaming-testimage-2404-${arch}" diff --git a/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml b/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml index 097d4876bb..3d006bffb6 100644 --- a/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/foreign-direct-streaming-testimage/image.yaml @@ -14,4 +14,3 @@ base: outputs: - format: baremetal-image - name: ubuntu-direct-streaming-testimage-2204-amd64 diff --git a/tests/tailor-images/trident-container-installer/image.yaml b/tests/tailor-images/trident-container-installer/image.yaml index a010619403..46126e9637 100644 --- a/tests/tailor-images/trident-container-installer/image.yaml +++ b/tests/tailor-images/trident-container-installer/image.yaml @@ -5,7 +5,6 @@ base: outputs: - format: iso - name: trident-container-installer extraDependencies: - ./base diff --git a/tests/tailor-images/trident-container-testimage/image.yaml b/tests/tailor-images/trident-container-testimage/image.yaml index e9204d64c6..8f08e93d1f 100644 --- a/tests/tailor-images/trident-container-testimage/image.yaml +++ b/tests/tailor-images/trident-container-testimage/image.yaml @@ -5,7 +5,6 @@ base: outputs: - format: cosi - name: trident-container-testimage extraDependencies: - ./base diff --git a/tests/tailor-images/trident-functest/image.yaml b/tests/tailor-images/trident-functest/image.yaml index e8b508000e..ede199be9e 100644 --- a/tests/tailor-images/trident-functest/image.yaml +++ b/tests/tailor-images/trident-functest/image.yaml @@ -5,7 +5,6 @@ base: outputs: - format: qcow2 - name: trident-functest config: $include: ./tailor/baseimg.yaml diff --git a/tests/tailor-images/trident-installer/by-arch/arm64.yaml b/tests/tailor-images/trident-installer/by-arch/arm64.yaml index 27dcdf6d33..02f51548c7 100644 --- a/tests/tailor-images/trident-installer/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-installer/by-arch/arm64.yaml @@ -4,4 +4,3 @@ base: outputs: $replace: - format: iso - name: trident-installer-arm64 diff --git a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml index 0d1389d386..90fc5585d7 100644 --- a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml +++ b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: iso - name: "trident-direct-streaming-installer-${arch}" config: os: diff --git a/tests/tailor-images/trident-installer/by-variant/split.yaml b/tests/tailor-images/trident-installer/by-variant/split.yaml index fac8ce21cd..65614b47f1 100644 --- a/tests/tailor-images/trident-installer/by-variant/split.yaml +++ b/tests/tailor-images/trident-installer/by-variant/split.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: iso - name: trident-split-installer config: os: diff --git a/tests/tailor-images/trident-installer/image.yaml b/tests/tailor-images/trident-installer/image.yaml index 54304c1496..365a15eaa4 100644 --- a/tests/tailor-images/trident-installer/image.yaml +++ b/tests/tailor-images/trident-installer/image.yaml @@ -13,7 +13,6 @@ base: outputs: - format: iso - name: trident-installer rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml index 7e08fdee83..95935de4b2 100644 --- a/tests/tailor-images/trident-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-testimage/by-arch/arm64.yaml @@ -4,4 +4,3 @@ base: outputs: $replace: - format: cosi - name: trident-testimage-arm64 diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml index 49a964bc8d..6f29e277c0 100644 --- a/tests/tailor-images/trident-testimage/image.yaml +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -8,7 +8,6 @@ base: outputs: - format: cosi - name: trident-testimage rpmSources: - ../../../bin/RPMS diff --git a/tests/tailor-images/trident-verity-testimage/README.md b/tests/tailor-images/trident-verity-testimage/README.md index 9740d2769c..5604cf1778 100644 --- a/tests/tailor-images/trident-verity-testimage/README.md +++ b/tests/tailor-images/trident-verity-testimage/README.md @@ -27,6 +27,6 @@ Other legacy variants map to selectors on the same family: - `trident-container-verity-testimage` → `-s deployment=container -s mode=root` - `trident-container-usrverity-testimage` → `-s deployment=container -s mode=usr` -Output is written to `artifacts/` using each variant's configured `outputs[].name` -(e.g. the host/root build above publishes `trident-verity-testimage.cosi`), not the -cell slug. Use `--output-dir ` to change the output location. +Output is written to `artifacts/` using the cell's slug (e.g. the host/root build +above publishes `trident-verity-testimage_host_root_amd64_cosi.cosi`). Use +`--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml index 1633e35c77..765fa22857 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+root.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-container-verity-testimage config: os: diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml index 8ed2a8129a..a5f9a8d916 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/container+usr.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-container-usrverity-testimage config: os: diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml index 4898710f8e..caeaf2c0b7 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+root.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-verity-testimage config: os: diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml index 2327ee4e64..1ff0b914da 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment+mode/host+usr.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-usrverity-testimage config: os: diff --git a/tests/tailor-images/trident-vm-testimage/README.md b/tests/tailor-images/trident-vm-testimage/README.md index beaeb56cce..0f8c1012b9 100644 --- a/tests/tailor-images/trident-vm-testimage/README.md +++ b/tests/tailor-images/trident-vm-testimage/README.md @@ -39,7 +39,7 @@ To build the base image, run: | ---------- | ------------ | ----------- | | Regular | `make artifacts/trident-vm-grub-testimage.qcow2` | `artifacts/trident-vm-grub-testimage.qcow2` | | With verity `qcow2` | `make artifacts/trident-vm-grub-verity-testimage.qcow2` | `artifacts/trident-vm-grub-verity-testimage.qcow2` | -| With verity fixed size `vhd` | `make artifacts/trident-vm-grub-verity-testimage.vhd` | `artifacts/trident-vm-grub-verity-testimage.vhd` | +| With verity fixed size `vhd` | `make artifacts/trident-vm-grub-verity-azure-testimage.vhd` | `artifacts/trident-vm-grub-verity-azure-testimage.vhd` | | ACL-agent UKI usr-verity `qcow2` | `make artifacts/trident-vm-acl-agent-testimage.qcow2` | `artifacts/trident-vm-acl-agent-testimage.qcow2` | To build the update images, run: diff --git a/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml index 6629807e87..59e00d5894 100644 --- a/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-arch+scenario/arm64+grub-verity.yaml @@ -1,6 +1,3 @@ outputs: $replace: - format: cosi - name: trident-vm-grub-verity-testimage-arm64 - - format: qcow2 - name: trident-vm-grub-verity-testimage-arm64 diff --git a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml index f3addeff82..95935de4b2 100644 --- a/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-arch/arm64.yaml @@ -4,4 +4,3 @@ base: outputs: $replace: - format: cosi - name: trident-vm-grub-testimage-arm64 diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml index 31c7718803..f323a0fe25 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml @@ -8,7 +8,6 @@ outputs: $replace: - format: qcow2 - name: trident-vm-acl-agent-testimage config: storage: $include: ./include/storage-acl-agent.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml index 92721c253c..e27fa3a874 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-vm-acl-agent-update-testimage config: storage: $include: ./include/storage-acl-agent.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml index 227f9eb713..4362d99abf 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-base.yaml @@ -5,7 +5,6 @@ outputs: $replace: - format: qcow2 - name: trident-vm-grub-testimage config: storage: $include: ./include/storage-grub.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml index e6de868d42..237f06b0e7 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml @@ -7,7 +7,6 @@ outputs: $replace: - format: vhd-fixed - name: trident-vm-grub-verity-azure-testimage base: $set: ref: core_selinux @@ -15,8 +14,6 @@ config: storage: $include: ./include/storage-grub-verity-base.yaml os: - hostname: - $set: trident-vm-testimg selinux: mode: $set: permissive diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml index 0b125d1c16..90d66a2e8d 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-vm-grub-verity-azure-testimage base: $set: ref: core_selinux diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml index 2ca2a954c8..c81b5fdd7f 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-base.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: qcow2 - name: trident-vm-grub-verity-testimage config: storage: $include: ./include/storage-grub-verity-base.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml index ed1b1f5c22..03400b8530 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-vm-grub-verity-testimage config: storage: $include: ./include/storage-grub-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml index 65790316e9..998af51365 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml @@ -1,7 +1,6 @@ outputs: $replace: - format: cosi - name: trident-vm-root-verity-testimage config: storage: diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml index 97500fe7c4..c631ce4892 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/usr-verity.yaml @@ -1,9 +1,7 @@ outputs: $replace: - format: cosi - name: trident-vm-usr-verity-testimage - format: qcow2 - name: trident-vm-usr-verity-testimage config: storage: $include: ./include/storage-usr-verity.yaml diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml index 5eead2314a..a67aa6930c 100644 --- a/tests/tailor-images/trident-vm-testimage/image.yaml +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -13,7 +13,6 @@ base: outputs: - format: cosi - name: trident-vm-grub-testimage rpmSources: - ../../../bin/RPMS From d9258edb498e6b03bc2a97c852aeabb1616de5e8 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 00:40:05 +0000 Subject: [PATCH 12/26] tests: restore legacy Azure disk layout, fix stale README paths Fixes three more review findings: - grub-verity-azure-base.yaml used the generic QEMU grub-verity-base storage sizing instead of the Azure base image's legacy layout (15G disk cap, 16M ESP, growable /srv vs. the QEMU include's no cap, 512M ESP, fixed 128M /srv). Added a dedicated storage-grub-verity-azure-base.yaml include carrying the legacy sizes and selected it here. - trident-container-installer/README.md, trident-container-testimage/README.md, and trident-testimage/README.md documented the removed legacy basename as the direct-build output path; a non-matrix (or arch-only) cell's slug always carries the resolved arch/format, so the real output is e.g. trident-container-installer_amd64_iso.iso, not trident-container-installer.iso. Updated all three to the slug-based paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-container-installer/README.md | 3 +- .../trident-container-testimage/README.md | 3 +- .../tailor-images/trident-testimage/README.md | 5 +- .../by-scenario/grub-verity-azure-base.yaml | 6 +- .../storage-grub-verity-azure-base.yaml | 70 +++++++++++++++++++ 5 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure-base.yaml diff --git a/tests/tailor-images/trident-container-installer/README.md b/tests/tailor-images/trident-container-installer/README.md index 03bbb58f8e..ab32274c66 100644 --- a/tests/tailor-images/trident-container-installer/README.md +++ b/tests/tailor-images/trident-container-installer/README.md @@ -16,5 +16,6 @@ From the repo root, run: cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-container-installer --output-dir ./artifacts ``` -Output is written to `artifacts/trident-container-installer.iso` by default. +Output is written to `artifacts/trident-container-installer_amd64_iso.iso` by default +(tailor publishes under the cell's slug). Use `--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-container-testimage/README.md b/tests/tailor-images/trident-container-testimage/README.md index f996b9e96c..619c7da2ee 100644 --- a/tests/tailor-images/trident-container-testimage/README.md +++ b/tests/tailor-images/trident-container-testimage/README.md @@ -15,5 +15,6 @@ From the repo root, run: cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-container-testimage --output-dir ./artifacts ``` -Output is written to `artifacts/trident-container-testimage.cosi` by default. +Output is written to `artifacts/trident-container-testimage_amd64_cosi.cosi` by default +(tailor publishes under the cell's slug). Use `--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-testimage/README.md b/tests/tailor-images/trident-testimage/README.md index b8f5dd305b..cb27652f49 100644 --- a/tests/tailor-images/trident-testimage/README.md +++ b/tests/tailor-images/trident-testimage/README.md @@ -22,5 +22,6 @@ cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-i Use `-s arch=arm64` for the ARM64 variant. -Output is written to `artifacts/trident-testimage.cosi` by default. Use -`--output-dir ` to change the output location. +Output is written to `artifacts/trident-testimage_amd64_cosi.cosi` by default +(tailor publishes under the cell's slug; substitute `arm64` for the ARM64 +variant). Use `--output-dir ` to change the output location. diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml index 237f06b0e7..669be03657 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure-base.yaml @@ -3,7 +3,9 @@ # grub-verity-base.yaml), unlike the cosi update target which only ever # lands on a single slot. Shared os/scripts content comes from # grub-verity-base+grub-verity-azure-base.yaml; this file only layers the -# azure-specific overrides on top. +# azure-specific overrides on top. Storage uses the Azure-specific legacy +# layout (15G disk cap, 16M ESP, growable /srv), not the generic QEMU +# grub-verity-base sizing -- see storage-grub-verity-azure-base.yaml. outputs: $replace: - format: vhd-fixed @@ -12,7 +14,7 @@ base: ref: core_selinux config: storage: - $include: ./include/storage-grub-verity-base.yaml + $include: ./include/storage-grub-verity-azure-base.yaml os: selinux: mode: diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure-base.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure-base.yaml new file mode 100644 index 0000000000..a5b0e7e571 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure-base.yaml @@ -0,0 +1,70 @@ +bootType: efi +disks: + - partitionTableType: gpt + maxSize: 15G + partitions: + - id: esp + type: esp + size: 16M + - id: boot-a + size: 256M + - id: boot-b + size: 256M + - id: root-a + size: 4G + - id: root-b + size: 4G + - id: root-hash-a + size: 128M + - id: root-hash-b + size: 128M + - id: var-a + size: 1G + - id: var-b + size: 1G + - id: trident-overlay-a + size: 32M + - id: trident-overlay-b + size: 32M + - id: trident + size: 512M + - id: home + size: 1G + - id: srv + size: grow +verity: + - id: rootverity + name: root + dataDeviceId: root-a + hashDeviceId: root-hash-a + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: boot-a + type: ext4 + mountPoint: /boot + - deviceId: rootverity + type: ext4 + mountPoint: + path: / + options: defaults,ro + - deviceId: var-a + type: ext4 + mountPoint: /var + - deviceId: trident-overlay-a + type: ext4 + mountPoint: /var/lib/trident-overlay + - deviceId: trident + type: ext4 + mountPoint: /var/lib/trident + - deviceId: home + type: ext4 + mountPoint: /home + - deviceId: srv + type: ext4 + mountPoint: /srv From 5e697540342b40a18b3d1e1ad3ad376b39daca08 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 01:14:50 +0000 Subject: [PATCH 13/26] tests: add ./base to trident-testimage extraDependencies tailor/baseimg.yaml references base/post-install.sh, but only ../common was declared, so editing that script left the fingerprint unchanged and could reuse a cached image with the old script contents. Matches the other migrated families (trident-verity-testimage, trident-container-testimage). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/trident-testimage/image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml index 6f29e277c0..5dd9136120 100644 --- a/tests/tailor-images/trident-testimage/image.yaml +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -13,6 +13,7 @@ rpmSources: - ../../../bin/RPMS extraDependencies: + - ./base - ../common config: From abd08d363e3104bc1aa062ac49d8e79ffab18639 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 15:16:05 +0000 Subject: [PATCH 14/26] tests: restore missing trident.service override, fix README output paths - grub.yaml (regular, non-verity update image) was missing the use-grpc-client-commit.conf override that the legacy updateimg-grub.yaml had and that grub-verity still carries; without it, rollback tests exercised the wrong trident commit path. - README.md: the update-image table described single .cosi file outputs as directory globs; document the actual make command/output path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/trident-vm-testimage/README.md | 4 ++-- .../tailor-images/trident-vm-testimage/by-scenario/grub.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tailor-images/trident-vm-testimage/README.md b/tests/tailor-images/trident-vm-testimage/README.md index 0f8c1012b9..e4dc5a3dd2 100644 --- a/tests/tailor-images/trident-vm-testimage/README.md +++ b/tests/tailor-images/trident-vm-testimage/README.md @@ -46,6 +46,6 @@ To build the update images, run: | Image type | Make command | Output path | | ---------- | ------------ | ----------- | -| Regular | `make trident-vm-grub-testimage` | `artifacts/trident-vm-grub-testimage/*` | -| With verity | `make trident-vm-grub-verity-testimage` | `artifacts/trident-vm-grub-verity-testimage/*` | +| Regular | `make artifacts/trident-vm-grub-testimage.cosi` | `artifacts/trident-vm-grub-testimage.cosi` | +| With verity | `make artifacts/trident-vm-grub-verity-testimage.cosi` | `artifacts/trident-vm-grub-verity-testimage.cosi` | | ACL-agent UKI usr-verity | `make artifacts/trident-vm-acl-agent-update-testimage.cosi` | `artifacts/trident-vm-acl-agent-update-testimage.cosi` | diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml index ee58ee7f8c..0024e36cef 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub.yaml @@ -50,6 +50,8 @@ config: destination: /etc/systemd/network/99-dhcp-eth0.network - source: ../common/files/sudoers-wheel destination: /etc/sudoers.d/wheel + - source: ../common/files/use-grpc-client-commit.conf + destination: /etc/systemd/system/trident.service.d/override.conf scripts: postCustomization: - $include: ./include/grub-scripts.yaml From 1d53cf67f6d24efe1021d03c935b9cf18c2497fe Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 16:02:38 +0000 Subject: [PATCH 15/26] tests: explicitly disable trident-install on direct-streaming images direct-streaming.yaml removed trident-install from services.enable but never added it to services.disable (unlike the legacy baseimg-direct-streaming.yaml, which had both). Not enabling a unit does not prevent a package preset from auto-enabling it, so trident-install.service could start alongside rcp-agent and launch the normal installer path on a direct-streaming image. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-installer/by-variant/direct-streaming.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml index 90fc5585d7..aa8dd57e6e 100644 --- a/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml +++ b/tests/tailor-images/trident-installer/by-variant/direct-streaming.yaml @@ -24,6 +24,8 @@ config: - trident-install $append: - rcp-agent + disable: + - trident-install additionalFiles: $remove: - source: base/files/trident-install.service From 3385f24218bafcb1a1da88b3dbba492b2622f66a Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 16:43:49 +0000 Subject: [PATCH 16/26] tests: restore missing root-verity qcow2 base-image output root-verity.yaml only declared a cosi output, but the legacy baseimg-root-verity.yaml also built a bootable dual-slot qcow2 base image (the Makefile had a dedicated artifacts/trident-vm-root-verity-testimage.qcow2 rule). A prior qcow2/vhd-fixed-output migration added qcow2 to grub-verity, usr-verity, acl-agent, and grub-verity-azure but never to root-verity, silently dropping the capability to build this base image via Tailor. Add format: qcow2 alongside the existing cosi output, mirroring the single-scenario, dual-format pattern already used by usr-verity.yaml (root-verity, like usr-verity, only ever had one legacy config, not a separate base/update split like grub-verity). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-vm-testimage/by-scenario/root-verity.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml index 998af51365..153202d9c1 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/root-verity.yaml @@ -1,6 +1,7 @@ outputs: $replace: - format: cosi + - format: qcow2 config: storage: From da2fb6f9c67f045d74df667d382ab66d79802777 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 17:22:10 +0000 Subject: [PATCH 17/26] tests: restore netplan on Azure update image, drop trident-service from ACL images - grub-verity-azure.yaml (update/COSI scenario) was removing netplan, but the legacy updateimg-grub-verity-azure.yaml explicitly installed it; only the base-image counterpart should drop it, and grub-verity-azure-base.yaml already does. Removing the here restores network-configuration support after a COSI update. - acl-agent.yaml and acl-agent-base.yaml inherit trident-service from the shared uki-verity-os-common.yaml include (meant for root-verity/ usr-verity), but legacy ACL-agent configs only ever installed trident-acl. Explicitly trident-service from both ACL fragments so these images don't also enable the normal trident.service boot-time commit path alongside trident-acl-agent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-vm-testimage/by-scenario/acl-agent-base.yaml | 2 ++ .../trident-vm-testimage/by-scenario/acl-agent.yaml | 2 ++ .../trident-vm-testimage/by-scenario/grub-verity-azure.yaml | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml index f323a0fe25..8624b33ee1 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml @@ -15,6 +15,8 @@ config: hostname: trident-acl-agent-testimg packages: install: + $remove: + - trident-service $append: - trident-acl additionalFiles: diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml index e27fa3a874..b00bb504ad 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml @@ -8,6 +8,8 @@ config: hostname: trident-acl-agent-testimg packages: install: + $remove: + - trident-service $append: - trident-acl additionalFiles: diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml index 90d66a2e8d..510683e85a 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -14,8 +14,6 @@ config: $set: permissive packages: install: - $remove: - - netplan $append: - selinux-policy - WALinuxAgent From 97d6a088e5ee01f9a9ec3f5a059d680e7a1bff9c Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 17:38:53 +0000 Subject: [PATCH 18/26] tests: migrate trident-mos to the Tailor workspace bin/trident-mos.iso and the default run-netlaunch flow depended on tests/images/trident-mos/*, deleted by the legacy-workspace cleanup -- confirmed via 9+ recurring Copilot review summaries and a real build attempt ("No rule to make target ..."). trident-mos was never migrated to Tailor in the first place, unlike every other test image. Add tests/tailor-images/trident-mos/ (image.yaml, iso.yaml, files/, post-install.sh), mirroring the legacy iso.yaml 1:1: same storage layout, packages, hostname, and the rcp-agent/netlaunch-driven service set (enables rcp-agent + tridentd.socket, disables trident-install -- distinct from trident-installer's standard auto-install flow). Reuses already-migrated common/files/{getty@.service,serial-getty@.service, config-placeholder.yaml} (confirmed byte-identical to legacy). The legacy config referenced packaging/, tools/cmd/rcp-agent/, and bin/rcp-agent directly via repo-root-relative paths -- that worked under the old raw invocation, but tailor's IC container only bind-mounts the workspace root, the output directory, and explicitly-declared base/rpmSources paths (confirmed via a real build attempt and tailor-exec's push_out_of_workspace_inputs, which only special-cases those two). Copied the static packaging files locally into files/ (matching every other migrated image's existing convention), and reference the rcp-agent binary via ../../../artifacts/rcp-agent -- staged there by the Makefile before invoking tailor, same as trident-installer's direct-streaming variant already does -- since a built artifact can't be copied into the workspace ahead of time. Registered in tailor.yaml's images.members (explicit allowlist, not a bare glob). Verified with a real end-to-end build producing a working 265 MiB ISO. The Makefile routing (bin/trident-mos.iso -> this image) lands in #844. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/tailor.yaml | 1 + .../trident-mos/files/pre-trident-script.sh | 1 + .../trident-mos/files/rcp-agent.service | 14 + .../trident-mos/files/rcp-agent.yaml | 1 + .../trident-mos/files/root.profile | 2 + .../350-action-efi-application.pcrlock | 1 + .../300-0x00000000.pcrlock | 1 + .../600-0xffffffff.pcrlock | 1 + .../300-0x00000000.pcrlock | 1 + .../600-0xffffffff.pcrlock | 1 + .../300-present.pcrlock | 1 + .../600-absent.pcrlock | 1 + .../750-enter-initrd.pcrlock | 1 + .../800-leave-initrd.pcrlock | 1 + .../static-pcrlock-files/850-sysinit.pcrlock | 1 + .../static-pcrlock-files/900-ready.pcrlock | 1 + .../static-pcrlock-files/950-shutdown.pcrlock | 1 + .../static-pcrlock-files/990-final.pcrlock | 1 + .../trident-mos/files/trident-install.service | 11 + .../trident-mos/files/trident.fc | 3 + .../trident-mos/files/trident.if | 163 ++ .../trident-mos/files/trident.te | 1339 +++++++++++++++++ .../trident-mos/files/tridentd.service | 5 + .../trident-mos/files/tridentd.socket | 11 + tests/tailor-images/trident-mos/image.yaml | 16 + tests/tailor-images/trident-mos/iso.yaml | 130 ++ .../tailor-images/trident-mos/post-install.sh | 21 + 27 files changed, 1731 insertions(+) create mode 100644 tests/tailor-images/trident-mos/files/pre-trident-script.sh create mode 100644 tests/tailor-images/trident-mos/files/rcp-agent.service create mode 100644 tests/tailor-images/trident-mos/files/rcp-agent.yaml create mode 100644 tests/tailor-images/trident-mos/files/root.profile create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/350-action-efi-application.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/300-0x00000000.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/600-0xffffffff.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/300-0x00000000.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/600-0xffffffff.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/300-present.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/600-absent.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/750-enter-initrd.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/800-leave-initrd.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/850-sysinit.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/900-ready.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/950-shutdown.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/static-pcrlock-files/990-final.pcrlock create mode 100644 tests/tailor-images/trident-mos/files/trident-install.service create mode 100644 tests/tailor-images/trident-mos/files/trident.fc create mode 100644 tests/tailor-images/trident-mos/files/trident.if create mode 100644 tests/tailor-images/trident-mos/files/trident.te create mode 100644 tests/tailor-images/trident-mos/files/tridentd.service create mode 100644 tests/tailor-images/trident-mos/files/tridentd.socket create mode 100644 tests/tailor-images/trident-mos/image.yaml create mode 100644 tests/tailor-images/trident-mos/iso.yaml create mode 100644 tests/tailor-images/trident-mos/post-install.sh diff --git a/tests/tailor-images/tailor.yaml b/tests/tailor-images/tailor.yaml index 2d7b1d5a75..66bc741425 100644 --- a/tests/tailor-images/tailor.yaml +++ b/tests/tailor-images/tailor.yaml @@ -71,6 +71,7 @@ images: - trident-container-testimage - trident-functest - trident-installer + - trident-mos - trident-testimage - trident-verity-testimage - trident-vm-testimage diff --git a/tests/tailor-images/trident-mos/files/pre-trident-script.sh b/tests/tailor-images/trident-mos/files/pre-trident-script.sh new file mode 100644 index 0000000000..2f58380523 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/pre-trident-script.sh @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/pre-trident-script.sh:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-mos/files/rcp-agent.service b/tests/tailor-images/trident-mos/files/rcp-agent.service new file mode 100644 index 0000000000..1522e80f9d --- /dev/null +++ b/tests/tailor-images/trident-mos/files/rcp-agent.service @@ -0,0 +1,14 @@ +[Unit] +Description=Netlaunch RCP proxy +After=network.target network-online.target +Before=tridentd.service + +[Service] +Type=simple +ExecStart=/usr/bin/rcp-agent +Restart=on-failure +StandardOutput=journal+console +StandardError=journal+console + +[Install] +WantedBy=multi-user.target tridentd.service diff --git a/tests/tailor-images/trident-mos/files/rcp-agent.yaml b/tests/tailor-images/trident-mos/files/rcp-agent.yaml new file mode 100644 index 0000000000..f67f224a79 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/rcp-agent.yaml @@ -0,0 +1 @@ +#8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/trident_cdrom/rcp-agent.yaml:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################ diff --git a/tests/tailor-images/trident-mos/files/root.profile b/tests/tailor-images/trident-mos/files/root.profile new file mode 100644 index 0000000000..0e0a03dc66 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/root.profile @@ -0,0 +1,2 @@ +# Open journalctl immediately after autologin +journalctl -f --no-tail -u trident-install.service -p emerg..info \ No newline at end of file diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/350-action-efi-application.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/350-action-efi-application.pcrlock new file mode 100644 index 0000000000..2baaa9ceb1 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/350-action-efi-application.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":4,"digests":[{"hashAlg":"sha1","digest":"cd0fdb4531a6ec41be2753ba042637d6e5f7f256"},{"hashAlg":"sha256","digest":"3d6772b4f84ed47595d72a2c4c5ffd15f5bb72c7507fe26f2aaee2c69d5633ba"},{"hashAlg":"sha384","digest":"77a0dab2312b4e1e57a84d865a21e5b2ee8d677a21012ada819d0a98988078d3d740f6346bfe0abaa938ca20439a8d71"},{"hashAlg":"sha512","digest":"03020279c5ea3676d6630c82a9931343225e8eab81529b65c786aeb6a445d3852a34dd193178f938b6b47345a72d4b647df309c971f7c02f0ede296a136a1086"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/300-0x00000000.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/300-0x00000000.pcrlock new file mode 100644 index 0000000000..c577c9874b --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/300-0x00000000.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":7,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/600-0xffffffff.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/600-0xffffffff.pcrlock new file mode 100644 index 0000000000..2e86898c99 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/400-secureboot-separator.pcrlock.d/600-0xffffffff.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":7,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/300-0x00000000.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/300-0x00000000.pcrlock new file mode 100644 index 0000000000..f1e473f1a3 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/300-0x00000000.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":0,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]},{"pcr":1,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]},{"pcr":2,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]},{"pcr":3,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]},{"pcr":4,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]},{"pcr":5,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]},{"pcr":6,"digests":[{"hashAlg":"sha1","digest":"9069ca78e7450a285173431b3e52c5c25299e473"},{"hashAlg":"sha256","digest":"df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119"},{"hashAlg":"sha384","digest":"394341b7182cd227c5c6b07ef8000cdfd86136c4292b8e576573ad7ed9ae41019f5818b4b971c9effc60e1ad9f1289f0"},{"hashAlg":"sha512","digest":"ec2d57691d9b2d40182ac565032054b7d784ba96b18bcb5be0bb4e70e3fb041eff582c8af66ee50256539f2181d7f9e53627c0189da7e75a4d5ef10ea93b20b3"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/600-0xffffffff.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/600-0xffffffff.pcrlock new file mode 100644 index 0000000000..0b8d20b9c0 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/500-separator.pcrlock.d/600-0xffffffff.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":0,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]},{"pcr":1,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]},{"pcr":2,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]},{"pcr":3,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]},{"pcr":4,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]},{"pcr":5,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]},{"pcr":6,"digests":[{"hashAlg":"sha1","digest":"d9be6524a5f5047db5866813acf3277892a7a30a"},{"hashAlg":"sha256","digest":"ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e"},{"hashAlg":"sha384","digest":"4a06b879c7eedbe01c945d46b5bd785b59203dce81ea6a1206c28091ca285365f760d9167778f0dc1763d4854aafd40a"},{"hashAlg":"sha512","digest":"ea71bb243b0b2db729b9eb88e3c55a3f490fbff23457825051224a1fe6e6d3f480590cfa3a4a6b12c622d6ac366feb03cd17004ed004cb3f0d52731626946679"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/300-present.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/300-present.pcrlock new file mode 100644 index 0000000000..d7012df2e7 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/300-present.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":5,"digests":[{"hashAlg":"sha1","digest":"443a6b7b82b7af564f2e393cd9d5a388b7fa4a98"},{"hashAlg":"sha256","digest":"d8043d6b7b85ad358eb3b6ae6a873ab7ef23a26352c5dc4faa5aeedacf5eb41b"},{"hashAlg":"sha384","digest":"214b0bef1379756011344877743fdc2a5382bac6e70362d624ccf3f654407c1b4badf7d8f9295dd3dabdef65b27677e0"},{"hashAlg":"sha512","digest":"0fed3a4c9552021436534d27f3adb481e22b50b29e4b37a63f518540a651a174f149b69f500b0bdb2cb3bf4e0e21e0781451090af33e88f6bee4cbebd15c1668"}]},{"pcr":5,"digests":[{"hashAlg":"sha1","digest":"475545ddc978d7bfd036facc7e2e987f48189f0d"},{"hashAlg":"sha256","digest":"b54f7542cbd872a81a9d9dea839b2b8d747c7ebd5ea6615c40f42f44a6dbeba0"},{"hashAlg":"sha384","digest":"0a2e01c85deae718a530ad8c6d20a84009babe6c8989269e950d8cf440c6e997695e64d455c4174a652cd080f6230b74"},{"hashAlg":"sha512","digest":"1bb30cdbd6da78fe2a8a161ef51176e22d64dce305b40b47243673af64a2b16fca6182116433e3891be94773f6d7d411275721d5bf7d40ea51a274d5c891637c"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/600-absent.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/600-absent.pcrlock new file mode 100644 index 0000000000..a16142b6e9 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/700-action-efi-exit-boot-services.pcrlock.d/600-absent.pcrlock @@ -0,0 +1 @@ +{"records":[]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/750-enter-initrd.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/750-enter-initrd.pcrlock new file mode 100644 index 0000000000..a2332dc324 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/750-enter-initrd.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":11,"digests":[{"hashAlg":"sha1","digest":"b1b01d5f73f321eb70e76f8a0e241ac0a3fa4a6e"},{"hashAlg":"sha256","digest":"51e6b92f405d1f98d96e3de343d61d420ad6923b25de21d766f9298192f14fed"},{"hashAlg":"sha384","digest":"687eef3a3a8c716439b5ed583657e8668401630c321f2f35d19b953ddf20b68a96474d0c2e5f0e1757bfa5ba70b9fc32"},{"hashAlg":"sha512","digest":"ab0ddfdabe43f1d06b3e58fbe17439a0f7f552e9e228d85665d485ececf7e733bae4cd7e0a17e5456e2ee7e412f5a0f37de05a782cce781e173ee26958de7f30"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/800-leave-initrd.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/800-leave-initrd.pcrlock new file mode 100644 index 0000000000..bd8f436a7e --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/800-leave-initrd.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":11,"digests":[{"hashAlg":"sha1","digest":"865e1ff2cc5b8db815313b23fe3d8b561212f5d1"},{"hashAlg":"sha256","digest":"3be261aff7db92bf507eae947f4003ffa2bcad0bffe3524601d62d0bc8be7135"},{"hashAlg":"sha384","digest":"9c0743b7a2e1ee06c70b7137b763cd2205c26ced274149959b05bd5a51bfa96b4fedaa4f87398b5c88986d1ff0879910"},{"hashAlg":"sha512","digest":"01b8ca86b9f8fac967f383380aff7cdffd2ef0c496574517c25398f7c74aa611821dd469ba021b2aa9b9a7232865708ca45c79368f2e7fffda3dd6b308264008"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/850-sysinit.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/850-sysinit.pcrlock new file mode 100644 index 0000000000..3bae4452f6 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/850-sysinit.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":11,"digests":[{"hashAlg":"sha1","digest":"aeabcf402223916e804cce79778a55d5a9276983"},{"hashAlg":"sha256","digest":"730bb5a583ba880c277e656d2dc8aba1a314a11b14d25b05153d2bab82567a48"},{"hashAlg":"sha384","digest":"955cc8939f81d862b3119aabe612fd36bf91668bb62397f5e4126085d79ba6d7cbfa4e3a2345747f0b476ce4b1cbc2c9"},{"hashAlg":"sha512","digest":"a9eb62cdd1cd8292b6325a8ee3770d6f1b613426a749e17ffba8f90bdd6c41806468fb79d01276de7cc791877dfebae165d4ed07585154acf96652c6db92acc1"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/900-ready.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/900-ready.pcrlock new file mode 100644 index 0000000000..9a0e82f6e5 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/900-ready.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":11,"digests":[{"hashAlg":"sha1","digest":"75c0533730caf1f78561c0883fb87bc8d98ef04b"},{"hashAlg":"sha256","digest":"b24d6d33736ecd5604a4b17bc9c6481039fac362bb7df044ef1c10a2bfd21db6"},{"hashAlg":"sha384","digest":"23ed5781da39fe6dc17f79478aeeb9eb2bca1d776061da188e10f9c85f7933fb39cfdba50f39af8aed24e5b45b80d006"},{"hashAlg":"sha512","digest":"ca6616f94a209e53f6fdc526b473172eb4b2157cf4809c31e36ad52db614ed352e68407be53c238ba17a561c4fde43f4a859aa8711f9781a0c934296d4d7571b"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/950-shutdown.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/950-shutdown.pcrlock new file mode 100644 index 0000000000..1bc3f76e0a --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/950-shutdown.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":11,"digests":[{"hashAlg":"sha1","digest":"53669f193b2174641c72654b5c3e5b67950334ae"},{"hashAlg":"sha256","digest":"08434ba9cdf55a02284e2913400586cd289878e0f055f7bb0b07ce392caeb989"},{"hashAlg":"sha384","digest":"186e2d6603b9755221b7ef894dd52b1154b48ef4786aec06ab6f7709e639715e89bd59fa80736bb45f0ca88583c212c1"},{"hashAlg":"sha512","digest":"9e5549deb36fc48768cb80e03bc91c36cf549ff5921e05bab5b68faefda7fac8c8a0755db783cbf1c1b98c80dc22ef06ff3f4a0a16704749f5cd4acf40e42a94"}]}]} diff --git a/tests/tailor-images/trident-mos/files/static-pcrlock-files/990-final.pcrlock b/tests/tailor-images/trident-mos/files/static-pcrlock-files/990-final.pcrlock new file mode 100644 index 0000000000..77081ae754 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/static-pcrlock-files/990-final.pcrlock @@ -0,0 +1 @@ +{"records":[{"pcr":11,"digests":[{"hashAlg":"sha1","digest":"d594c2cc0a53025004791399d80e20852af4c988"},{"hashAlg":"sha256","digest":"2443630b4620165c8b173e7265e17526fe2787ae594364dd6d839ad58f2fc007"},{"hashAlg":"sha384","digest":"90697eec39ed47f2b7ed278aa6fe6a1c073fcc7f3af54299fb95ac8a18c771acbac71e25b5a5639554943bfdfab76737"},{"hashAlg":"sha512","digest":"b3d9598ca0aa5da28be1c97a45d53cc5c72a80e61c439c8bf3e89c5c0661f49df8fa34019a21cd5e31261ae3a3a87ef4592d8010aad6a5ecdc9dbaae38cd1470"}]}]} diff --git a/tests/tailor-images/trident-mos/files/trident-install.service b/tests/tailor-images/trident-mos/files/trident-install.service new file mode 100644 index 0000000000..9b2b3c16d3 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/trident-install.service @@ -0,0 +1,11 @@ +[Unit] +Description=Trident Provisioning Service +After=network.target network-online.target systemd-udev-settle.service trident-network.service +ConditionPathExists=/etc/trident/config.yaml + +[Service] +ExecStart=trident install +Type=oneshot + +[Install] +WantedBy=multi-user.target diff --git a/tests/tailor-images/trident-mos/files/trident.fc b/tests/tailor-images/trident-mos/files/trident.fc new file mode 100644 index 0000000000..1fe2cea996 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/trident.fc @@ -0,0 +1,3 @@ +/usr/bin/trident -- gen_context(system_u:object_r:trident_exec_t,s0) + +/var/lib/trident(/.*)? gen_context(system_u:object_r:trident_var_lib_t,s0) \ No newline at end of file diff --git a/tests/tailor-images/trident-mos/files/trident.if b/tests/tailor-images/trident-mos/files/trident.if new file mode 100644 index 0000000000..0d5a5cf707 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/trident.if @@ -0,0 +1,163 @@ + +## policy for trident + +######################################## +## +## Execute trident_exec_t in the trident domain. +## +## +## +## Domain allowed to transition. +## +## +# +interface(`trident_domtrans',` + gen_require(` + type trident_t, trident_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, trident_exec_t, trident_t) +') + +###################################### +## +## Execute trident in the caller domain. +## +## +## +## Domain allowed access. +## +## +# +interface(`trident_exec',` + gen_require(` + type trident_exec_t; + ') + + corecmd_search_bin($1) + can_exec($1, trident_exec_t) +') + +######################################## +## +## Search trident lib directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`trident_search_lib',` + gen_require(` + type trident_var_lib_t; + ') + + allow $1 trident_var_lib_t:dir search_dir_perms; + files_search_var_lib($1) +') + +######################################## +## +## Read trident lib files. +## +## +## +## Domain allowed access. +## +## +# +interface(`trident_read_lib_files',` + gen_require(` + type trident_var_lib_t; + ') + + files_search_var_lib($1) + read_files_pattern($1, trident_var_lib_t, trident_var_lib_t) +') + +######################################## +## +## Manage trident lib files. +## +## +## +## Domain allowed access. +## +## +# +interface(`trident_manage_lib_files',` + gen_require(` + type trident_var_lib_t; + ') + + files_search_var_lib($1) + manage_files_pattern($1, trident_var_lib_t, trident_var_lib_t) +') + +######################################## +## +## Manage trident lib directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`trident_manage_lib_dirs',` + gen_require(` + type trident_var_lib_t; + ') + + files_search_var_lib($1) + manage_dirs_pattern($1, trident_var_lib_t, trident_var_lib_t) +') + + +######################################## +## +## All of the rules required to administrate +## an trident environment +## +## +## +## Domain allowed access. +## +## +## +## +## Role allowed access. +## +## +## +# +interface(`trident_admin',` + gen_require(` + type trident_t; + type trident_var_lib_t; + ') + + allow $1 trident_t:process { signal_perms }; + ps_process_pattern($1, trident_t) + + optional_policy(` + tunable_policy(`allow_ptrace',` + allow $1 trident_t:process ptrace; + ') + ') + + optional_policy(` + tunable_policy(`deny_ptrace',` + allow $1 trident_t:process ptrace; + ') + ') + + files_search_var_lib($1) + admin_pattern($1, trident_var_lib_t) + optional_policy(` + systemd_passwd_agent_exec($1) + systemd_read_fifo_file_passwd_run($1) + ') +') diff --git a/tests/tailor-images/trident-mos/files/trident.te b/tests/tailor-images/trident-mos/files/trident.te new file mode 100644 index 0000000000..740c1e263f --- /dev/null +++ b/tests/tailor-images/trident-mos/files/trident.te @@ -0,0 +1,1339 @@ +policy_module(trident, 1.0.0) + +######################################## +# +# Platform compatibility (AZL3 refpolicy vs AZL4 Fedora policy) +# +# AZL3 uses refpolicy 2.20240226: types named *_runtime_t, interfaces named *_runtime_* +# AZL4 uses Fedora selinux-policy 43.4: types named *_var_run_t, interfaces named *_pid_* +# +# We use a sentinel interface (raid_manage_mdadm_runtime_files) that exists only in +# refpolicy to detect the platform at m4 preprocessing time, then define type-name +# macros accordingly. Interface calls use per-call ifdef. +# +ifdef(`raid_manage_mdadm_runtime_files',` + define(`INIT_RUNTIME_T',`init_runtime_t') + define(`LVM_RUNTIME_T',`lvm_runtime_t') + define(`SYSLOGD_RUNTIME_T',`syslogd_runtime_t') + define(`SYSTEMD_NETWORKD_RUNTIME_T',`systemd_networkd_runtime_t') + define(`MDADM_RUNTIME_T',`mdadm_runtime_t') + define(`MOUNT_RUNTIME_T',`mount_runtime_t') + define(`UDEV_RUNTIME_T',`udev_runtime_t') +',` + define(`INIT_RUNTIME_T',`init_var_run_t') + define(`LVM_RUNTIME_T',`lvm_var_run_t') + define(`SYSLOGD_RUNTIME_T',`syslogd_var_run_t') + define(`SYSTEMD_NETWORKD_RUNTIME_T',`systemd_networkd_var_run_t') + define(`MDADM_RUNTIME_T',`mdadm_var_run_t') + define(`MOUNT_RUNTIME_T',`mount_var_run_t') + define(`UDEV_RUNTIME_T',`udev_var_run_t') +') + +######################################## +# +# Declarations +# + +type trident_t; +type trident_exec_t; + +# Creates a domain for long running process (daemon), which is started by an init script. Domain is trident_t and entry_point is tridnet_exec_t. +init_daemon_domain(trident_t, trident_exec_t) + +# Create type to label files and directories in /var/lib that are specific to Trident, in particular the Trident datastore. +type trident_var_lib_t; +files_type(trident_var_lib_t) + +#################### +# +# Trident policy +# +require { + type admin_passwd_exec_t; + type anacron_exec_t; + type audisp_remote_exec_t; + type audit_spool_t; + type auditctl_exec_t; + type auditd_exec_t; + type auditd_unit_t; + type boot_t; + type bpf_t; + type bootloader_t; + type chfn_exec_t; + type chkpwd_exec_t; + + type container_conf_home_t; + type container_unit_t; + type container_var_lib_t; + type crack_db_t; + type crack_exec_t; + type cron_spool_t; + type crond_unit_t; + type dbusd_unit_t; + type debugfs_t; + type default_t; + type device_t; + type devpts_t; + type dhcpc_exec_t; + type dhcpc_state_t; + type dmesg_exec_t; + type dosfs_t; + type efivarfs_t; + type etc_runtime_t; + type fs_t; + type fsadm_exec_t; + type fsadm_t; + type fuse_device_t; + type fusefs_t; + type getty_exec_t; + type groupadd_exec_t; + type home_root_t; + type http_cache_port_t; + type http_port_t; + type init_t; + type init_exec_t; + type INIT_RUNTIME_T; + type init_var_lib_t; + type initctl_t; + type iptables_unit_t; + type kernel_t; + type kmod_exec_t; + type ld_so_t; + type ldconfig_cache_t; + type lib_t; + type load_policy_t; + type locale_t; + type lost_found_t; + type lvm_metadata_t; + type LVM_RUNTIME_T; + type lvm_t; + type lvm_unit_t; + type mail_spool_t; + type memory_pressure_t; + type mnt_t; + type modules_conf_t; + type modules_dep_t; + type modules_object_t; + type mount_t; + type mount_exec_t; + type mptctl_device_t; + type net_conf_t; + type power_unit_t; + type proc_t; + type proc_kcore_t; + type proc_mdstat_t; + type proc_net_t; + type root_t; + type security_t; + type setfiles_t; + type semanage_t; + type semanage_exec_t; + type shadow_lock_t; + type shadow_t; + type shell_exec_t; + type ssh_agent_exec_t; + type ssh_exec_t; + type ssh_home_t; + type ssh_port_t; + type sshd_t; + type sshd_key_t; + type sshd_keygen_unit_t; + type sshd_unit_t; + type sulogin_exec_t; + type sysctl_fs_t; + type sysctl_kernel_t; + type sysctl_vm_overcommit_t; + type sysctl_vm_t; + type sysfs_t; + type syslog_conf_t; + type syslogd_exec_t; + type SYSLOGD_RUNTIME_T; + type syslogd_unit_t; + type systemd_analyze_exec_t; + type systemd_backlight_exec_t; + type systemd_backlight_unit_t; + type systemd_binfmt_exec_t; + type systemd_binfmt_unit_t; + type systemd_cgroups_exec_t; + type systemd_cgtop_exec_t; + type systemd_coredump_exec_t; + type systemd_coredump_var_lib_t; + type systemd_factory_conf_t; + type systemd_generator_t; + type systemd_generator_exec_t; + type systemd_homed_exec_t; + type systemd_homework_exec_t; + type systemd_hostnamed_exec_t; + type systemd_hw_exec_t; + type systemd_hwdb_t; + type systemd_journalctl_exec_t; + type systemd_locale_exec_t; + type systemd_logind_exec_t; + type systemd_machine_id_setup_exec_t; + type systemd_modules_load_exec_t; + type systemd_networkd_t; + type systemd_networkd_unit_t; + type systemd_networkd_exec_t; + type SYSTEMD_NETWORKD_RUNTIME_T; + type MOUNT_RUNTIME_T; + type UDEV_RUNTIME_T; + type systemd_notify_exec_t; + type systemd_passwd_agent_exec_t; + type systemd_pcrphase_t; + type systemd_pcrphase_exec_t; + type systemd_pstore_exec_t; + type systemd_resolved_exec_t; + type systemd_rfkill_exec_t; + type systemd_rfkill_unit_t; + type systemd_sessions_exec_t; + type systemd_socket_proxyd_exec_t; + type systemd_stdio_bridge_exec_t; + type systemd_sysctl_exec_t; + type systemd_sysusers_exec_t; + type systemd_tmpfiles_exec_t; + type systemd_unit_t; + type systemd_update_done_exec_t; + type systemd_user_manager_unit_t; + type systemd_user_runtime_dir_exec_t; + type systemd_userdbd_exec_t; + type systemd_userdbd_unit_t; + type tmp_t; + type tmpfs_t; + type trident_t; + type udev_exec_t; + type udev_t; + type udevadm_t; + type unlabeled_t; + type unreserved_port_t; + type updpwd_exec_t; + type useradd_exec_t; + type user_tmp_t; + type user_devpts_t; + type usr_t; + type var_run_t; + + + # Types previously implicit via interface gen_require; declared + # explicitly for cross-distro compatibility (AZL3 + AZL4). + type auditd_log_t; + type devlog_t; + type faillog_t; + type fixed_disk_device_t; + type initrc_t; + type lastlog_t; + type pstore_t; + type selinux_config_t; + type semanage_read_lock_t; + type semanage_store_t; + type semanage_trans_lock_t; + type setfiles_exec_t; + type system_dbusd_var_lib_t; + type system_map_t; + type tpm_device_t; + type udev_rules_t; + type var_lib_t; + type var_lock_t; + type var_log_t; + type var_spool_t; + type var_t; + type wtmp_t; + + # Define object classes that SELinux can protect + class dir { add_name create getattr open read remove_name search write }; + class file { create getattr ioctl lock open read rename setattr relabelto unlink write map execute execute_no_trans }; + class chr_file getattr; + class filesystem getattr; + class lnk_file read; + class netlink_route_socket { bind create getattr getopt nlmsg_read read setopt write }; + class process { getsched noatsecure rlimitinh siginh }; + class capability sys_admin; + class security read_policy; + class service start; + class tcp_socket { connect create getattr getopt name_connect read setopt shutdown write }; + class udp_socket { create ioctl }; + + attribute can_change_object_identity; + + role unconfined_r; + role system_r; +} + +# Allow Trident to change (relabel) the security context of a file or directory +typeattribute trident_t can_change_object_identity; + +# Defines transition from trident_t to fsadm_t domain when Trident executes fsadm tool (i.e. mkfs) +type_transition trident_t fsadm_exec_t:process fsadm_t; + +# Defines transition from ci_unconfined_t to trident_t when Steamboat executes Trident, as well as +# specific permissions necessary for Steamboat testing +optional_policy(` + require { + type ci_unconfined_t; + role ci_unconfined_r; + } + type_transition ci_unconfined_t trident_exec_t:process trident_t; + allow ci_unconfined_t trident_exec_t:file { getattr open read execute }; + allow trident_t trident_exec_t:file entrypoint; + role ci_unconfined_r types trident_t; + + allow trident_t ci_unconfined_t:fd use; + seutil_run_setfiles(trident_t, ci_unconfined_r); +') + +# Allow transition between unconfined_t and trident_t domains; necessary for an interactive run +optional_policy(` + unconfined_run_to(trident_t, trident_exec_t) +') + +#============= trident_t ============== +# Gives trident_t the following elevated privileges: +# dac_override and dac_read_search - allow access files and directories without necessary DAC permissions +# sys_ptrace - allow trident_t to trace or debug other processes +# sys_rawio - allow trident_t to perform I/O operations directly on hardware devices +allow trident_t self:capability { dac_override dac_read_search sys_ptrace sys_rawio }; + +allow trident_t self:alg_socket { accept bind create read write }; +allow trident_t self:capability { audit_write chown mknod net_admin sys_chroot sys_resource sys_admin fowner fsetid sys_boot ipc_lock sys_nice linux_immutable sys_module setgid setuid }; +allow trident_t self:fifo_file manage_fifo_file_perms; +allow trident_t self:netlink_audit_socket { create nlmsg_relay read write }; +allow trident_t self:netlink_kobject_uevent_socket { bind create getattr getopt read setopt }; +allow trident_t self:netlink_route_socket { bind create getattr nlmsg_read read write }; +allow trident_t self:process { getattr getcap getsched setfscreate setpgid setsched signal signull }; +allow trident_t self:tcp_socket { connect create getattr getopt read setopt shutdown write }; +allow trident_t self:unix_dgram_socket { connect create write }; +allow trident_t self:udp_socket { connect create getattr setopt read write }; +allow trident_t self:key { search write }; +allow trident_t self:sem { associate create destroy read unix_read unix_write write }; + +# Ensure any new files, directories, or symbolic links created by trident_t are automatically labeled with type trident_var_lib_t +files_var_lib_filetrans(trident_t, trident_var_lib_t, { dir file lnk_file }) + +# Allow trident_t domain to interact with files and directories labeled as trident_var_lib_t +# Necessary so Trident can interact with the datastore at /var/lib/trident +allow trident_t trident_var_lib_t:dir { getattr search read write add_name create remove_name open mounton relabelto rmdir }; +allow trident_t trident_var_lib_t:file { getattr setattr create open read write unlink lock relabelto rename }; + +# Allow Trident to relabel its executable +allow trident_t trident_exec_t:file relabelto; + +allow trident_t audit_spool_t:dir { getattr open read relabelto }; +allow trident_t auditctl_exec_t:file getattr; +allow trident_t auditd_exec_t:file getattr; +allow trident_t auditd_log_t:dir relabelto; +allow trident_t auditd_unit_t:file getattr; +allow trident_t admin_passwd_exec_t:file getattr; +allow trident_t anacron_exec_t:file getattr; +allow trident_t audisp_remote_exec_t:file getattr; +allow trident_t boot_t:dir { mounton create relabelto }; +allow trident_t boot_t:file relabelto; +allow trident_t bpf_t:dir search; +optional_policy(` + require { + type cgroup_t; + } + allow trident_t cgroup_t:filesystem getattr; +') +allow trident_t chfn_exec_t:file getattr; +allow trident_t chkpwd_exec_t:file getattr; +optional_policy(` + require { + type chronyc_exec_t; + type chronyd_unit_t; + type chronyd_var_lib_t; + type chronyd_var_log_t; + } + allow trident_t chronyc_exec_t:file getattr; + allow trident_t chronyd_unit_t:file getattr; + allow trident_t chronyd_var_lib_t:dir { getattr open read relabelto }; + allow trident_t chronyd_var_log_t:dir { getattr open read relabelto }; +') +allow trident_t container_conf_home_t:dir search; # Allow access to ~/.docker directory +allow trident_t container_conf_home_t:file { open read }; # Allow access to ~/.docker/config.json +allow trident_t container_unit_t:file getattr; +allow trident_t container_var_lib_t:file getattr; +allow trident_t crack_db_t:dir { getattr open search read }; +allow trident_t crack_db_t:file getattr; +allow trident_t crack_db_t:lnk_file getattr; +allow trident_t crack_exec_t:file getattr; +allow trident_t cron_spool_t:dir { read relabelto }; +allow trident_t crond_unit_t:file { getattr read open ioctl }; +allow trident_t dbusd_unit_t:file getattr; +allow trident_t debugfs_t:filesystem getattr; +allow trident_t debugfs_t:dir search; +allow trident_t default_t:dir { getattr open read relabelto search }; +allow trident_t default_t:file relabelto; +allow trident_t device_t:filesystem { getattr mount unmount }; +allow trident_t devpts_t:chr_file { read write ioctl getattr }; +allow trident_t devlog_t:sock_file { getattr write }; +allow trident_t dhcpc_exec_t:file getattr; +allow trident_t dhcpc_state_t:dir { getattr open read relabelto }; +allow trident_t dmesg_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t dosfs_t:filesystem { getattr mount unmount }; +allow trident_t efivarfs_t:filesystem getattr; +allow trident_t efivarfs_t:dir search; +allow trident_t etc_runtime_t:file { getattr open read relabelto relabelfrom rename setattr unlink }; +allow trident_t etc_t:file { create execute execute_no_trans link relabelfrom relabelto rename setattr unlink write append }; +allow trident_t etc_t:dir { mounton relabelfrom }; +allow trident_t faillog_t:file relabelto; +allow trident_t fs_t:filesystem { mount unmount }; +allow trident_t fsadm_t:process { siginh rlimitinh noatsecure transition }; +allow trident_t fsadm_t:fd use; +allow trident_t fsadm_t:fifo_file { read write }; +allow trident_t fsadm_exec_t:file { getattr open read execute execute_no_trans relabelto setattr unlink write }; +allow trident_t fuse_device_t:chr_file { read write open }; +allow trident_t fusefs_t:dir getattr; +allow trident_t fusefs_t:filesystem { mount unmount getattr }; +allow trident_t getty_exec_t:file getattr; +optional_policy(` + require { + type gpg_pinentry_exec_t; + type gpg_secret_t; + } + allow trident_t gpg_pinentry_exec_t:file getattr; + allow trident_t gpg_secret_t:file getattr; +') +allow trident_t groupadd_exec_t:file getattr; +allow trident_t home_root_t:dir { mounton read relabelto add_name create relabelfrom setattr write }; +allow trident_t home_root_t:file { create getattr ioctl open relabelfrom setattr read write }; +allow trident_t http_cache_port_t:tcp_socket name_connect; # Allow Trident to initiate connection to HTTP proxy port +allow trident_t http_port_t:tcp_socket name_connect; +allow trident_t init_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t init_t:system { reboot reload start status }; +allow trident_t init_t:key search; +allow trident_t init_t:unix_stream_socket connectto; +allow trident_t initctl_t:fifo_file getattr; +allow trident_t INIT_RUNTIME_T:dir { add_name remove_name write }; +allow trident_t INIT_RUNTIME_T:file { create getattr open setattr read rename unlink write }; +allow trident_t INIT_RUNTIME_T:lnk_file { create unlink }; +allow trident_t INIT_RUNTIME_T:service { start status }; +allow trident_t init_var_lib_t:dir { add_name getattr open read relabelto remove_name search write }; +allow trident_t init_var_lib_t:file { create getattr open read rename setattr unlink write }; +allow trident_t iptables_unit_t:file getattr; +# Required for veritysetup to search for keys in the kernel's keyring when launched by trident. +allow trident_t kernel_t:key search; +allow trident_t kernel_t:process setsched; +allow trident_t kernel_t:system { module_request ipc_info }; +allow trident_t kernel_t:unix_dgram_socket sendto; +allow trident_t kmod_exec_t:file { execute execute_no_trans getattr map open read relabelto setattr unlink write }; +optional_policy(` + require { + type krb5kdc_exec_t; + } + allow trident_t krb5kdc_exec_t:file getattr; +') +allow trident_t lastlog_t:file relabelto; +allow trident_t ld_so_t:file { execute_no_trans relabelto setattr unlink write }; +allow trident_t ldconfig_cache_t:dir { getattr open read search relabelto }; +allow trident_t ldconfig_cache_t:file { getattr relabelto }; +allow trident_t lib_t:file { create relabelto rename setattr unlink write }; +allow trident_t locale_t:dir { add_name relabelto remove_name rmdir setattr write }; +allow trident_t locale_t:file { link relabelto rename setattr unlink write }; +optional_policy(` + require { + type locate_exec_t; + } + allow trident_t locate_exec_t:file getattr; +') +optional_policy(` + require { + type logrotate_unit_t; + type logrotate_var_lib_t; + } + allow trident_t logrotate_unit_t:file getattr; + allow trident_t logrotate_var_lib_t:dir { getattr open read relabelto }; +') +allow trident_t lost_found_t:dir { getattr open read relabelto }; +allow trident_t lvm_metadata_t:dir { getattr open read }; +allow trident_t LVM_RUNTIME_T:dir { add_name open read remove_name search write }; +allow trident_t lvm_unit_t:file getattr; +allow trident_t mail_spool_t:dir { list_dir_perms relabelto }; +allow trident_t memory_pressure_t:file { read open getattr setattr }; +allow trident_t mnt_t:dir { add_name create getattr mounton open read search write }; +allow trident_t mnt_t:lnk_file read; +allow trident_t modules_conf_t:file { create execute relabelto rename setattr unlink write }; +allow trident_t modules_conf_t:dir { write add_name remove_name }; +allow trident_t modules_dep_t:file { getattr ioctl map open read relabelto setattr unlink }; +allow trident_t modules_object_t:file { getattr map open read relabelto setattr unlink }; +allow trident_t mount_exec_t:file { execute execute_no_trans getattr map open read relabelto setattr unlink write }; +allow trident_t mptctl_device_t:chr_file getattr; +allow trident_t net_conf_t:file { relabelto setattr unlink }; +optional_policy(` + require { + type ntpd_exec_t; + type ntpd_unit_t; + } + allow trident_t ntpd_exec_t:file { execute getattr }; + allow trident_t ntpd_unit_t:file getattr; +') +optional_policy(` + require { + type oddjob_mkhomedir_exec_t; + } + allow trident_t oddjob_mkhomedir_exec_t:file getattr; +') +allow trident_t power_unit_t:file { getattr open read relabelto setattr unlink }; +allow trident_t proc_t:dir read; +allow trident_t proc_t:file { getattr open read ioctl }; +allow trident_t proc_t:filesystem { getattr mount unmount }; +allow trident_t proc_kcore_t:file getattr; +allow trident_t proc_mdstat_t:file { getattr open read }; +allow trident_t proc_net_t:file { open read }; +allow trident_t root_t:dir { add_name create mounton write }; +allow trident_t root_t:file { create getattr map open read relabelfrom write }; +optional_policy(` + require { + type rpm_unit_t; + type rpm_var_cache_t; + type rpm_var_lib_t; + } + allow trident_t rpm_unit_t:file getattr; + allow trident_t rpm_var_cache_t:dir relabelto; + allow trident_t rpm_var_cache_t:file relabelto; + allow trident_t rpm_var_lib_t:dir { add_name relabelto }; + allow trident_t rpm_var_lib_t:file { create relabelto setattr write }; +') +allow trident_t security_t:file { map write }; +allow trident_t security_t:filesystem getattr; +allow trident_t security_t:security read_policy; +allow trident_t selinux_config_t:dir relabelfrom; +allow trident_t selinux_config_t:file relabelfrom; +allow trident_t semanage_exec_t:file { execute execute_no_trans entrypoint getattr ioctl open read map }; +allow trident_t semanage_read_lock_t:file relabelto; +allow trident_t semanage_store_t:dir relabelto; +allow trident_t semanage_store_t:file relabelto; +allow trident_t semanage_trans_lock_t:file relabelto; +allow trident_t setfiles_exec_t:file entrypoint; +allow trident_t shadow_t:file { getattr open read relabelto setattr link unlink write append relabelfrom }; +allow trident_t shadow_lock_t:file { create getattr lock open read link unlink write setattr relabelfrom }; +allow trident_t shell_exec_t:file { execute execute_no_trans getattr map open read relabelto setattr unlink write }; +allow trident_t ssh_agent_exec_t:file getattr; +allow trident_t ssh_exec_t:file { execute getattr }; +allow trident_t ssh_home_t:dir { setattr relabelto }; +allow trident_t ssh_home_t:file relabelto; +allow trident_t ssh_port_t:tcp_socket name_connect; +allow trident_t sshd_t:fd use; +allow trident_t sshd_t:fifo_file { read write getattr ioctl }; # Allow Trident to read/write stdin/stdout/stderr +allow trident_t sshd_key_t:file { getattr manage_file_perms }; # Allow Trident to copy SSH keys +allow trident_t sshd_keygen_unit_t:file getattr; +allow trident_t sshd_unit_t:file getattr; +allow trident_t sulogin_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t sysctl_fs_t:dir search; +allow trident_t sysctl_fs_t:file { getattr ioctl open read }; +allow trident_t sysctl_kernel_t:dir search; +allow trident_t sysctl_kernel_t:file { getattr ioctl open read }; +allow trident_t sysctl_vm_overcommit_t:file { open read }; +allow trident_t sysctl_vm_t:dir search; +allow trident_t sysfs_t:filesystem { mount unmount }; +allow trident_t syslog_conf_t:file { getattr open read relabelto setattr unlink }; +allow trident_t syslogd_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t SYSLOGD_RUNTIME_T:dir search; +allow trident_t syslogd_unit_t:file { getattr open read relabelto setattr unlink }; +# AZL4: system_cron_spool_t does not exist +optional_policy(` + require { + type system_cron_spool_t; + } + allow trident_t system_cron_spool_t:dir relabelto; +') +allow trident_t system_dbusd_var_lib_t:dir relabelto; +allow trident_t system_dbusd_var_lib_t:lnk_file relabelto; +allow trident_t system_map_t:file relabelto; +allow trident_t systemd_analyze_exec_t:file getattr; +allow trident_t systemd_backlight_exec_t:file getattr; +allow trident_t systemd_backlight_unit_t:file getattr; +allow trident_t systemd_binfmt_exec_t:file getattr; +allow trident_t systemd_binfmt_unit_t:file getattr; +allow trident_t systemd_cgroups_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_cgtop_exec_t:file getattr; +allow trident_t systemd_coredump_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_coredump_var_lib_t:dir { getattr open read relabelto }; +allow trident_t systemd_factory_conf_t:dir { getattr open read search }; +allow trident_t systemd_factory_conf_t:file getattr; +allow trident_t systemd_generator_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_homed_exec_t:file getattr; +allow trident_t systemd_homework_exec_t:file getattr; +allow trident_t systemd_hostnamed_exec_t:file { execute getattr }; +allow trident_t systemd_hw_exec_t:file getattr; +allow trident_t systemd_hwdb_t:file { getattr open read relabelto setattr unlink }; +# AZL4: systemd_journal_t does not exist (journal handled differently) +optional_policy(` + require { + type systemd_journal_t; + } + allow trident_t systemd_journal_t:file { relabelfrom_file_perms map open read relabelto }; + allow trident_t systemd_journal_t:dir relabelto; +') +allow trident_t systemd_journalctl_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_locale_exec_t:file getattr; +allow trident_t systemd_logind_exec_t:file getattr; +allow trident_t systemd_machine_id_setup_exec_t:file getattr; +allow trident_t systemd_modules_load_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_networkd_unit_t:service { start status }; +allow trident_t systemd_networkd_exec_t:file { execute getattr }; +allow trident_t SYSTEMD_NETWORKD_RUNTIME_T:dir { add_name getattr open read remove_name search write }; +allow trident_t SYSTEMD_NETWORKD_RUNTIME_T:file { create getattr open read rename setattr unlink write }; +allow trident_t systemd_notify_exec_t:file getattr; +allow trident_t systemd_passwd_agent_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_pcrphase_exec_t:file { execute execute_no_trans getattr map open read }; +allow trident_t pstore_t:dir search; +allow trident_t systemd_pstore_exec_t:file { execute getattr }; +allow trident_t systemd_resolved_exec_t:file { execute getattr }; +allow trident_t systemd_rfkill_exec_t:file getattr; +allow trident_t systemd_rfkill_unit_t:file getattr; +allow trident_t systemd_sessions_exec_t:file getattr; +allow trident_t systemd_socket_proxyd_exec_t:file getattr; +allow trident_t systemd_stdio_bridge_exec_t:file getattr; +allow trident_t systemd_sysctl_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_sysusers_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_tmpfiles_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +allow trident_t systemd_unit_t:dir { read add_name create write reparent rename setattr relabelfrom }; +allow trident_t systemd_unit_t:file { getattr ioctl link open read relabelto relabelfrom rename setattr unlink write create }; +allow trident_t systemd_unit_t:lnk_file { getattr read create relabelfrom }; +allow trident_t systemd_unit_t:service { start status }; +allow trident_t systemd_update_done_exec_t:file getattr; +allow trident_t systemd_user_manager_unit_t:file getattr; +allow trident_t systemd_user_runtime_dir_exec_t:file getattr; +allow trident_t systemd_userdbd_exec_t:file getattr; +allow trident_t systemd_userdbd_unit_t:file getattr; +allow trident_t tmp_t:chr_file { create getattr unlink }; +allow trident_t tmp_t:dir { add_name create getattr mounton open read relabelfrom remove_name rmdir search setattr write relabelto }; +allow trident_t tmp_t:file { append create getattr ioctl open read relabelfrom rename setattr unlink write map execute link }; +allow trident_t tmp_t:lnk_file { create getattr read rename unlink }; +allow trident_t tmpfs_t:file { append create execute getattr ioctl link lock map mounton open read relabelto rename setattr unlink write }; +allow trident_t tmpfs_t:filesystem { getattr mount unmount }; +allow trident_t udev_exec_t:file { execute execute_no_trans getattr map open read relabelto setattr unlink write }; +allow trident_t UDEV_RUNTIME_T:dir { add_name create read remove_name watch write }; +allow trident_t UDEV_RUNTIME_T:file { create rename setattr unlink write }; +allow trident_t UDEV_RUNTIME_T:sock_file write; +allow trident_t unlabeled_t:chr_file { create getattr link rename unlink }; +allow trident_t unlabeled_t:dir { create add_name getattr setattr open read remove_name search write mounton relabelfrom ioctl rename reparent rmdir }; +allow trident_t unlabeled_t:file { create getattr lock open read setattr unlink write ioctl relabelfrom append execute execute_no_trans link map relabelto rename }; +allow trident_t unlabeled_t:lnk_file { create getattr read relabelfrom rename unlink }; +allow trident_t unreserved_port_t:tcp_socket name_connect; +allow trident_t updpwd_exec_t:file getattr; +allow trident_t useradd_exec_t:file { execute execute_no_trans getattr map open read }; +allow trident_t user_tmp_t:file { getattr open read }; +allow trident_t user_devpts_t:chr_file { ioctl read write }; +allow trident_t usr_t:dir { add_name create read relabelto remove_name rmdir setattr write relabelto mounton }; +allow trident_t usr_t:file { create execute execute_no_trans getattr ioctl link open read relabelto rename setattr unlink write }; +optional_policy(` + require { + type uuidd_exec_t; + type uuidd_var_lib_t; + } + allow trident_t uuidd_exec_t:file getattr; + allow trident_t uuidd_var_lib_t:dir relabelto; +') +allow trident_t var_t:dir { mounton relabelto }; +allow trident_t var_lib_t:dir relabelto; +allow trident_t var_lib_t:file relabelto; +allow trident_t var_lib_t:lnk_file relabelto; +allow trident_t var_lock_t:lnk_file relabelto; +allow trident_t var_log_t:dir relabelto; +allow trident_t var_log_t:lnk_file relabelto; +allow trident_t var_run_t:dir { add_name create remove_name write }; +allow trident_t var_run_t:file { create getattr lock open read unlink write }; +allow trident_t var_run_t:lnk_file relabelto; +allow trident_t var_run_t:sock_file write; +allow trident_t var_spool_t:dir relabelto; +allow trident_t wtmp_t:file relabelto; + +# Optional policies for modifying cloud-init settings +optional_policy(` + require { + type cloud_init_exec_t; + type cloud_init_state_t; + } + allow trident_t cloud_init_exec_t:file getattr; + allow trident_t cloud_init_state_t:dir { list_dir_perms relabelto }; + allow trident_t cloud_init_state_t:lnk_file read_lnk_file_perms; + allow trident_t cloud_init_state_t:file getattr; +') + +# Policies below must be optional for Steamboat +optional_policy(` + require { + type trident_t; + type bluetooth_unit_t; + } + allow trident_t bluetooth_unit_t:file getattr; +') +optional_policy(` + require { + type trident_t; + type colord_var_lib_t; + } + allow trident_t colord_var_lib_t:dir { getattr open read relabelto }; +') +optional_policy(` + require { + type trident_t; + type dhcpd_unit_t; + } + allow trident_t dhcpd_unit_t:file getattr; +') +optional_policy(` + require { + type trident_t; + type loadkeys_exec_t; + } + allow trident_t loadkeys_exec_t:file { execute getattr map open read relabelto setattr unlink write }; +') +optional_policy(` + require { + type trident_t; + type mdadm_exec_t; + type mdadm_unit_t; + type MDADM_RUNTIME_T; + } + allow trident_t mdadm_exec_t:file { open read getattr map relabelto setattr unlink write execute execute_no_trans }; + allow trident_t mdadm_unit_t:file { getattr open read relabelto setattr unlink }; + allow trident_t MDADM_RUNTIME_T:dir { add_name remove_name search write }; + ifdef(`raid_manage_mdadm_runtime_files',` + raid_manage_mdadm_runtime_files(trident_t) + ',` + raid_manage_mdadm_pid(trident_t) + ') +') + +#============= interfaces ============== +########################################### +# Authentication and User Management +########################################### +# AZL3: auth_create_faillog_files / AZL4: auth_manage_faillog +ifdef(`auth_create_faillog_files',` + auth_create_faillog_files(trident_t) +',` + auth_manage_faillog(trident_t) +') +auth_exec_pam(trident_t) +auth_login_entry_type(trident_t) +auth_read_lastlog(trident_t) +auth_read_login_records(trident_t) +optional_policy(` + require { + type gpg_exec_t; + type gpg_agent_exec_t; + type gpg_secret_t; + } + allow trident_t gpg_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; + allow trident_t gpg_agent_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; + allow trident_t gpg_secret_t:dir list_dir_perms; + allow trident_t gpg_secret_t:file read_file_perms; + allow trident_t gpg_secret_t:lnk_file read_lnk_file_perms; +') +su_exec(trident_t) +usermanage_check_exec_passwd(trident_t) +userdom_list_user_home_dirs(trident_t) +userdom_read_user_home_content_files(trident_t) +# AZL3: userdom_search_user_runtime_root / AZL4: removed (covered by var_run_t allow rules) +ifdef(`userdom_search_user_runtime_root',` + userdom_search_user_runtime_root(trident_t) +') +# AZL3: userdom_relabel_generic_user_home_files / AZL4: userdom_relabel_user_home_files +ifdef(`userdom_relabel_generic_user_home_files',` + userdom_relabel_generic_user_home_files(trident_t) +',` + userdom_relabel_user_home_files(trident_t) +') +userdom_relabelto_user_home_dirs(trident_t) + +########################################### +# System Services and Daemons +########################################### +bootloader_exec(trident_t) +optional_policy(` + require { + type chronyd_exec_t; + type chronyd_etc_t; + type chronyd_keys_t; + } + allow trident_t chronyd_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; + allow trident_t chronyd_etc_t:dir list_dir_perms; + allow trident_t chronyd_etc_t:file read_file_perms; + allow trident_t chronyd_keys_t:file read_file_perms; +') +clock_exec(trident_t) +optional_policy(` + require { + type cgroup_t; + } + create_files_pattern(trident_t, cgroup_t, cgroup_t) +') +cron_exec(trident_t) +# AZL3: cron_exec_crontab / AZL4: removed (covered by cron_exec) +ifdef(`cron_exec_crontab',` + cron_exec_crontab(trident_t) +') +# AZL3: cron_read_system_spool / AZL4: cron_manage_system_spool (superset) +ifdef(`cron_read_system_spool',` + cron_read_system_spool(trident_t) +',` + cron_manage_system_spool(trident_t) +') +# AZL3: dbus_exec / AZL4: dbus_exec_dbusd +ifdef(`dbus_exec',` + dbus_exec(trident_t) +',` + dbus_exec_dbusd(trident_t) +') +dbus_manage_lib_files(trident_t) +dbus_read_config(trident_t) +dbus_read_lib_files(trident_t) +# AZL3: dbus_list_system_bus_runtime / AZL4: removed, use dbus_read_pid_files +ifdef(`dbus_list_system_bus_runtime',` + dbus_list_system_bus_runtime(trident_t) +',` + dbus_read_pid_files(trident_t) +') +dbus_system_bus_client(trident_t) +domain_read_all_domains_state(trident_t) +hostname_exec(trident_t) +init_domtrans(trident_t) +init_rw_stream_sockets(trident_t) +optional_policy(` + require { + type logrotate_exec_t; + } + allow trident_t logrotate_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; +') +ssh_domtrans(trident_t) +ssh_domtrans_keygen(trident_t) +ssh_manage_home_files(trident_t) +# AZL3: systemd_list_journal_dirs / AZL4: removed (no systemd_journal_t type on AZL4) +ifdef(`systemd_list_journal_dirs',` + systemd_list_journal_dirs(trident_t) +') +# AZL3: systemd_read_networkd_units / AZL4: systemd_read_unit_files (generic) +ifdef(`systemd_read_networkd_units',` + systemd_read_networkd_units(trident_t) +',` + systemd_read_unit_files(trident_t) +') +# AZL3: systemd_read_user_runtime_units_files / AZL4: removed, covered by systemd_read_unit_files above +ifdef(`systemd_read_user_runtime_units_files',` + systemd_read_user_runtime_units_files(trident_t) +') +systemd_dbus_chat_logind(trident_t) +# AZL3: systemd_read_user_unit_files / AZL4: systemd_read_unit_files (generic) +ifdef(`systemd_read_user_unit_files',` + systemd_read_user_unit_files(trident_t) +',` + systemd_read_unit_files(trident_t) +') + +# Optional read access to cloud init state +optional_policy(` + require { + type cloud_init_t; + } + ps_process_pattern(trident_t, cloud_init_t) # equivalent to cloud_init_read_state(trident_t) +') + +########################################### +# File System Operations +########################################### +files_create_boot_dirs(trident_t) +files_list_kernel_modules(trident_t) +files_list_spool(trident_t) +files_list_var(trident_t) +files_manage_boot_files(trident_t) +files_manage_etc_dirs(trident_t) +files_manage_etc_symlinks(trident_t) +# AZL3: files_mounton_runtime_dirs / AZL4: removed, inline equivalent +ifdef(`files_mounton_runtime_dirs',` + files_mounton_runtime_dirs(trident_t) +',` + allow trident_t var_run_t:dir mounton; +') +files_read_etc_files(trident_t) +files_read_default_symlinks(trident_t) +files_read_kernel_symbol_table(trident_t) +files_read_usr_src_files(trident_t) +files_read_usr_symlinks(trident_t) +files_read_var_lib_files(trident_t) +files_search_etc(trident_t) +files_search_kernel_modules(trident_t) +files_search_locks(trident_t) +files_search_spool(trident_t) +files_search_var_lib(trident_t) +files_rw_etc_runtime_files(trident_t) +fstools_domtrans(trident_t) +fstools_relabelto_entry_files(trident_t) +fs_getattr_hugetlbfs(trident_t) +fs_getattr_iso9660_files(trident_t) +fs_getattr_iso9660_fs(trident_t) +# AZL3: fs_getattr_pstorefs / AZL4: removed +ifdef(`fs_getattr_pstorefs',` + fs_getattr_pstorefs(trident_t) +') +# AZL3: fs_getattr_tracefs / AZL4: removed +ifdef(`fs_getattr_tracefs',` + fs_getattr_tracefs(trident_t) +') +fs_getattr_xattr_fs(trident_t) +# AZL3: fs_list_efivars / AZL4: removed +ifdef(`fs_list_efivars',` + fs_list_efivars(trident_t) +') +fs_list_hugetlbfs(trident_t) +fs_manage_dos_dirs(trident_t) +fs_manage_dos_files(trident_t) +fs_manage_efivarfs_files(trident_t) +fs_manage_tmpfs_dirs(trident_t) +fs_manage_tmpfs_symlinks(trident_t) +fs_mounton_tmpfs(trident_t) +fs_read_iso9660_files(trident_t) +optional_policy(` + require { + type cgroup_t; + } + allow trident_t cgroup_t:file { ioctl read write getattr setattr lock append open }; +') +# AZL3: mount_list_runtime / AZL4: removed, inline equivalent +ifdef(`mount_list_runtime',` + mount_list_runtime(trident_t) +',` + allow trident_t MOUNT_RUNTIME_T:dir list_dir_perms; +') + +########################################### +# Network Management +########################################### +iptables_exec(trident_t) +iptables_read_config(trident_t) +# AZL3: iptables_status / AZL4: iptables_systemctl +ifdef(`iptables_status',` + iptables_status(trident_t) +',` + iptables_systemctl(trident_t) +') +sysnet_exec_ifconfig(trident_t) +sysnet_read_config(trident_t) +sysnet_read_dhcp_config(trident_t) +# AZL3: sysnet_relabel_config / AZL4: split into relabelto + relabelfrom +ifdef(`sysnet_relabel_config',` + sysnet_relabel_config(trident_t) +',` + sysnet_relabelto_net_conf(trident_t) + sysnet_relabelfrom_net_conf(trident_t) +') +sysnet_write_config(trident_t) + +########################################### +# Storage Management +########################################### +dev_rw_loop_control(trident_t) +dev_rw_lvm_control(trident_t) +lvm_exec(trident_t) +lvm_domtrans(trident_t) +# AZL3: lvm_manage_runtime_files / AZL4: lvm_manage_var_run +ifdef(`lvm_manage_runtime_files',` + lvm_manage_runtime_files(trident_t) +',` + lvm_manage_var_run(trident_t) +') +lvm_read_config(trident_t) +manage_files_pattern(trident_t, MOUNT_RUNTIME_T, MOUNT_RUNTIME_T) +storage_getattr_fuse_dev(trident_t) +storage_getattr_scsi_generic_dev(trident_t) +storage_raw_read_removable_device(trident_t) +storage_raw_read_fixed_disk(trident_t) +storage_raw_write_fixed_disk(trident_t) + +########################################### +# SELinux Management +########################################### +corecmd_relabel_bin_files(trident_t) +files_relabel_etc_files(trident_t) +files_relabel_kernel_modules(trident_t) +# AZL3: files_relabelto_etc_runtime_files / AZL4: removed, inline equivalent +ifdef(`files_relabelto_etc_runtime_files',` + files_relabelto_etc_runtime_files(trident_t) +',` + allow trident_t etc_runtime_t:file relabelto; +') +files_relabelto_usr_files(trident_t) +libs_relabel_ld_so(trident_t) +libs_relabelto_lib_files(trident_t) +miscfiles_relabel_localization(trident_t) +relabel_files_pattern(trident_t, udev_rules_t, udev_rules_t) +selinux_load_policy(trident_t) +seutil_exec_checkpolicy(trident_t) +seutil_exec_loadpolicy(trident_t) +seutil_exec_setfiles(trident_t) +seutil_get_semanage_read_lock(trident_t) +seutil_get_semanage_trans_lock(trident_t) +seutil_manage_bin_policy(trident_t) +seutil_manage_config(trident_t) +seutil_manage_config_dirs(trident_t) +seutil_manage_file_contexts(trident_t) +seutil_manage_module_store(trident_t) +seutil_read_default_contexts(trident_t) +seutil_read_bin_policy(trident_t) +seutil_run_setfiles(trident_t, system_r) +seutil_run_setfiles(trident_t, unconfined_r) +# AZL3: udev_relabel_rules_files / AZL4: removed, inline equivalent +ifdef(`udev_relabel_rules_files',` + udev_relabel_rules_files(trident_t) +',` + allow trident_t udev_rules_t:file relabel_file_perms; +') + +########################################### +# Package Management +########################################### +optional_policy(` + require { + type rpm_exec_t; + type rpm_var_cache_t; + type rpm_var_lib_t; + } + allow trident_t rpm_var_lib_t:dir { manage_dir_perms relabelto }; + allow trident_t rpm_var_lib_t:file { manage_file_perms map relabelto }; + allow trident_t rpm_var_lib_t:lnk_file { read_lnk_file_perms }; + allow trident_t rpm_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; + allow trident_t rpm_var_cache_t:dir list_dir_perms; + allow trident_t rpm_var_cache_t:file read_file_perms; + allow trident_t rpm_var_cache_t:lnk_file { read_lnk_file_perms }; +') + +########################################### +# Device Management +########################################### +corenet_getattr_ppp_dev(trident_t) +# AZL3: corenet_read_tun_tap_dev / AZL4: removed +ifdef(`corenet_read_tun_tap_dev',` + corenet_read_tun_tap_dev(trident_t) +') +# AZL3: dev_getattr_acpi_bios_dev / AZL4: dev_getattr_apm_bios_dev +ifdef(`dev_getattr_acpi_bios_dev',` + dev_getattr_acpi_bios_dev(trident_t) +',` + dev_getattr_apm_bios_dev(trident_t) +') +dev_getattr_autofs_dev(trident_t) +dev_getattr_framebuffer_dev(trident_t) +dev_getattr_generic_usb_dev(trident_t) +dev_getattr_mouse_dev(trident_t) +# AZL3: dev_getattr_pmqos_dev / AZL4: removed +ifdef(`dev_getattr_pmqos_dev',` + dev_getattr_pmqos_dev(trident_t) +') +# AZL3: dev_getattr_sysfs / AZL4: dev_getattr_sysfs_fs +ifdef(`dev_getattr_sysfs',` + dev_getattr_sysfs(trident_t) +',` + dev_getattr_sysfs_fs(trident_t) +') +dev_getattr_xserver_misc_dev(trident_t) +dev_list_sysfs(trident_t) +dev_manage_generic_blk_files(trident_t) +dev_manage_generic_dirs(trident_t) +dev_mounton(trident_t) +# AZL3: dev_mounton_sysfs_dirs / AZL4: dev_mounton_sysfs +ifdef(`dev_mounton_sysfs_dirs',` + dev_mounton_sysfs_dirs(trident_t) +',` + dev_mounton_sysfs(trident_t) +') +# AZL3: dev_read_input_dev / AZL4: dev_read_input +ifdef(`dev_read_input_dev',` + dev_read_input_dev(trident_t) +',` + dev_read_input(trident_t) +') +dev_read_kmsg(trident_t) +dev_read_rand(trident_t) +dev_read_raw_memory(trident_t) +dev_read_realtime_clock(trident_t) +dev_read_sysfs(trident_t) +dev_read_watchdog(trident_t) +dev_read_urand(trident_t) +dev_relabelfrom_generic_chr_files(trident_t) +# AZL3: dev_relabelfrom_vfio_dev / AZL4: removed +ifdef(`dev_relabelfrom_vfio_dev',` + dev_relabelfrom_vfio_dev(trident_t) +') +dev_rw_nvram(trident_t) +dev_rw_tpm(trident_t) +dev_rw_vhost(trident_t) +dev_search_sysfs(trident_t) +dev_write_sysfs(trident_t) +dev_write_urand(trident_t) +term_getattr_ptmx(trident_t) +term_use_virtio_console(trident_t) +term_getattr_pty_fs(trident_t) +udev_manage_rules_files(trident_t) +# AZL3: udev_read_runtime_files / AZL4: udev_read_pid_files +ifdef(`udev_read_runtime_files',` + udev_read_runtime_files(trident_t) +',` + udev_read_pid_files(trident_t) +') +udev_read_state(trident_t) + +########################################### +# System Command Execution +########################################### +optional_policy(` + require { + type sudo_exec_t; + } + allow trident_t sudo_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; +') +corecmd_manage_bin_files(trident_t) +corecmd_bin_entry_type(trident_t) +corecmd_shell_entry_type(trident_t) +corecmd_search_bin(trident_t) +corecmd_exec_bin(trident_t) +optional_policy(` + require { + type kadmind_exec_t; + type krb5_conf_t; + } + allow trident_t kadmind_exec_t:file { ioctl read getattr lock map execute execute_no_trans open }; + allow trident_t krb5_conf_t:dir list_dir_perms; + allow trident_t krb5_conf_t:file read_file_perms; +') +libs_exec_ldconfig(trident_t) +libs_manage_lib_dirs(trident_t) +modutils_read_module_config(trident_t) +optional_policy(` + require { + type uuidd_var_lib_t; + } + allow trident_t uuidd_var_lib_t:dir manage_dir_perms; +') +optional_policy(` + require { + type tcsd_var_lib_t; + } + allow trident_t tcsd_var_lib_t:dir { manage_dir_perms relabelto }; +') + +########################################### +# Logging and Monitoring +########################################### +logging_read_audit_config(trident_t) +logging_read_audit_log(trident_t) +# AZL3: logging_relabelto_devlog_sock_files / AZL4: logging_relabel_devlog_dev +ifdef(`logging_relabelto_devlog_sock_files',` + logging_relabelto_devlog_sock_files(trident_t) +',` + logging_relabel_devlog_dev(trident_t) +') +logging_search_logs(trident_t) +# AZL3: logging_stream_connect_journald_varlink / AZL4: logging_stream_connect_syslog +ifdef(`logging_stream_connect_journald_varlink',` + logging_stream_connect_journald_varlink(trident_t) +',` + logging_stream_connect_syslog(trident_t) +') +# AZL3: logging_manage_generic_log_dirs / AZL4: removed (covered by logging_manage_generic_logs) +ifdef(`logging_manage_generic_log_dirs',` + logging_manage_generic_log_dirs(trident_t) +') +logging_manage_generic_logs(trident_t) + +########################################### +# Miscellaneous +########################################### +optional_policy(` + ifdef(`miscfiles_read_generic_tls_privkey',` + miscfiles_read_generic_tls_privkey(trident_t) + ',` + miscfiles_read_all_certs(trident_t) + ') +') +optional_policy(` + miscfiles_read_man_pages(trident_t) +') +optional_policy(` + miscfiles_read_localization(trident_t) +') +optional_policy(` + miscfiles_read_generic_certs(trident_t) +') +optional_policy(` + require { + type xkb_var_lib_t; + } + allow trident_t xkb_var_lib_t:dir list_dir_perms; + allow trident_t xkb_var_lib_t:file read_file_perms; + allow trident_t xkb_var_lib_t:lnk_file read_lnk_file_perms; +') + +#################### +# +# Additional permissions given to external domains +# +#============= bootloader_t ============== +# List the contents of generic tmpfs directories; required for RAID +fs_list_tmpfs(bootloader_t) + +#============= cloud_init_t ============== +optional_policy(` + require { + type cloud_init_t; + } + allow cloud_init_t unlabeled_t:dir { add_name getattr remove_name search write }; + allow cloud_init_t unlabeled_t:file { create getattr ioctl open read rename write }; + allow cloud_init_t usr_t:dir { add_name create remove_name write }; + + files_exec_usr_files(cloud_init_t) + files_manage_usr_files(cloud_init_t) +') + +#============= fsadm_t ============== +role unconfined_r types fsadm_t; + +# Get the attributes of efivarfs filesystems +allow fsadm_t efivarfs_t:filesystem getattr; +allow fsadm_t trident_t:process { siginh rlimitinh noatsecure transition sigchld }; +allow fsadm_t fixed_disk_device_t:blk_file { open read write getattr ioctl }; +allow fsadm_t unlabeled_t:file map; + +# Allow fsadm_t to use losetup utility on Trident-created files in /var/lib/. Necessary to attach device to extension image. +allow fsadm_t trident_var_lib_t:file { getattr open read write }; + +# Create, read, write, and delete files on a efivarfs filesystem +fs_manage_efivarfs_files(fsadm_t) +fs_manage_tmpfs_dirs(fsadm_t) +fs_manage_tmpfs_files(fsadm_t) + +#============= loadkeys_t ============== +optional_policy(` + require { + type trident_t; + type loadkeys_t; + } + files_read_default_symlinks(loadkeys_t) + fs_search_tmpfs(loadkeys_t) +') + +#============= lvm_t ============== +# This is necessary for Trident to create encrypted volumes +allow lvm_t trident_t:sem { associate read unix_read unix_write write }; +allow lvm_t initrc_t:sem { associate read unix_read unix_write write }; + +# These permissions are necessary for cryptsetup luksOpen to succeed. +allow lvm_t init_t:key search; # Allows LVM to write to search the kernel keyring. +allow lvm_t tpm_device_t:chr_file write; # Allows LVM to write to the TPM device. + +# This is necessary for veritysetup to be able to read a key file in /tmp. +allow lvm_t tmp_t:file { getattr ioctl open read }; + +#============= mount_t ============= +allow mount_t trident_var_lib_t:dir mounton; + +#============= systemd_pcrphase_t ============== +allow systemd_pcrphase_t tmpfs_t:dir { getattr open read search }; +allow systemd_pcrphase_t tmpfs_t:file { getattr lock open setattr write }; + +#============= rpm_t ============== +optional_policy(` + require { + type rpm_t; + type rpm_script_t; + } + allow rpm_t unlabeled_t:dir { add_name getattr remove_name search write }; + allow rpm_t unlabeled_t:file { create getattr ioctl open read rename write }; + allow rpm_t rpm_script_t:process { noatsecure rlimitinh siginh }; + + #============= rpm_script_t ============== + # Allow RPM scripts to read SELinux policy (we currently apply trident.pp as a module in the Trident spec) + allow rpm_script_t security_t:security read_policy; + + allow rpm_script_t kernel_t:fd use; + allow rpm_script_t unlabeled_t:dir { add_name getattr remove_name search write }; + allow rpm_script_t unlabeled_t:file { create getattr ioctl open read rename write }; +') + +#============= semanage_t ============== +allow semanage_t proc_t:filesystem getattr; +allow semanage_t load_policy_t:process { noatsecure rlimitinh siginh }; +allow semanage_t setfiles_t:process { noatsecure rlimitinh siginh }; + +libs_manage_lib_dirs(semanage_t) +libs_manage_lib_files(semanage_t) + +#============= setfiles_t ============== +allow setfiles_t proc_t:filesystem getattr; +allow setfiles_t unlabeled_t:file { map open read }; +allow setfiles_t container_var_lib_t:blk_file relabelto; + +#============= systemd_generator_t ============== +allow systemd_generator_t home_root_t:dir read; + +#============= udev_t ============== +optional_policy(` + require { + type cloud_init_t; + } + allow udev_t cloud_init_t:fd use; + allow udev_t cloud_init_t:fifo_file { append write getattr }; +') +allow udev_t lvm_t:process { noatsecure rlimitinh siginh }; +allow udev_t unlabeled_t:file getattr; + +# Allow losetup to attach an extension image file as a loopback device. +allow udev_t trident_var_lib_t:file getattr; + +files_read_generic_tmp_files(udev_t) + +#============= udevadm_t ============== +optional_policy(` + require { + type cgroup_t; + } + allow udevadm_t cgroup_t:filesystem getattr; +') +allow udevadm_t self:netlink_route_socket { bind create getattr getopt nlmsg_read read setopt write }; +allow udevadm_t self:udp_socket { create ioctl }; +allow udevadm_t self:capability { sys_admin }; +allow udevadm_t systemd_hwdb_t:file { getattr map open read }; +allow udevadm_t kernel_t:fd use; + +# Allow udevadm to search kernel modules, read module configurations and dependencies +files_search_kernel_modules(udevadm_t) +modutils_read_module_config(udevadm_t) +modutils_read_module_deps(udevadm_t) + +# Read system network configuration files +sysnet_read_config(udevadm_t) + +# List systemd networkd runtime files +# AZL3: systemd_list_networkd_runtime / AZL4: removed, inline equivalent +ifdef(`systemd_list_networkd_runtime',` + systemd_list_networkd_runtime(udevadm_t) +',` + allow udevadm_t SYSTEMD_NETWORKD_RUNTIME_T:dir list_dir_perms; +') + +# Manage udev rules, runtime directories, and files +udev_manage_rules_files(udevadm_t) +# AZL3: udev_manage_runtime_dirs / AZL4: udev_manage_pid_dirs +ifdef(`udev_manage_runtime_dirs',` + udev_manage_runtime_dirs(udevadm_t) +',` + udev_manage_pid_dirs(udevadm_t) +') +# AZL3: udev_manage_runtime_files / AZL4: udev_manage_pid_files +ifdef(`udev_manage_runtime_files',` + udev_manage_runtime_files(udevadm_t) +',` + udev_manage_pid_files(udevadm_t) +') + +# Read symbolic links in cgroup directories and search sysfs +optional_policy(` + require { + type cgroup_t; + } + read_lnk_files_pattern(udevadm_t, cgroup_t, cgroup_t) +') +dev_search_sysfs(udevadm_t) + +#============= unlabeled_t ============== +fs_associate_tmpfs(unlabeled_t) \ No newline at end of file diff --git a/tests/tailor-images/trident-mos/files/tridentd.service b/tests/tailor-images/trident-mos/files/tridentd.service new file mode 100644 index 0000000000..85613bd130 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/tridentd.service @@ -0,0 +1,5 @@ +[Unit] +Description=Trident Daemon + +[Service] +ExecStart=trident daemon diff --git a/tests/tailor-images/trident-mos/files/tridentd.socket b/tests/tailor-images/trident-mos/files/tridentd.socket new file mode 100644 index 0000000000..79e3711c31 --- /dev/null +++ b/tests/tailor-images/trident-mos/files/tridentd.socket @@ -0,0 +1,11 @@ +[Unit] +Description=Trident Daemon gRPC Socket + +[Socket] +ListenStream=/run/trident/trident.sock +SocketMode=0600 +SocketUser=root +SocketGroup=root + +[Install] +WantedBy=sockets.target \ No newline at end of file diff --git a/tests/tailor-images/trident-mos/image.yaml b/tests/tailor-images/trident-mos/image.yaml new file mode 100644 index 0000000000..4726196a0f --- /dev/null +++ b/tests/tailor-images/trident-mos/image.yaml @@ -0,0 +1,16 @@ +name: trident-mos + +base: + ref: baremetal + +outputs: + - format: iso + +extraDependencies: + - ./iso.yaml + - ./files + - ./post-install.sh + - ../../../artifacts/rcp-agent + +config: + $include: ./iso.yaml diff --git a/tests/tailor-images/trident-mos/iso.yaml b/tests/tailor-images/trident-mos/iso.yaml new file mode 100644 index 0000000000..ea73cb15de --- /dev/null +++ b/tests/tailor-images/trident-mos/iso.yaml @@ -0,0 +1,130 @@ +storage: + bootType: efi + + disks: + - partitionTableType: gpt + maxSize: 4G + partitions: + - id: esp + type: esp + start: 1M + end: 9M + + - id: rootfs + start: 9M + filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + + - deviceId: rootfs + type: ext4 + mountPoint: + path: / + +os: + bootloader: + resetType: hard-reset + hostname: trident-mos-testimage + + packages: + update: + - systemd + + install: + - binutils + - curl + - device-mapper + - dnf + - dosfstools + - efibootmgr + - iproute + - iptables + - lsof + - mdadm + - netplan + # Support for mounting NTFS filesystems + - ntfs-3g + # Support for creating NTFS filesystems + - ntfsprogs + - openssh-server + - squashfs-tools + - tar + - tpm2-tools + - veritysetup + - vim + # Support for building SELinux module and debugging + - selinux-policy-devel + - setools-console + + additionalDirs: + # Required for systemd-pcrlock & PCR-based encryption; can be removed once + # AZL 4.0 merges a fix to provide statically defined files inside the same + # package as the systemd-pcrlock binary, i.e. systemd-udev. + - source: "files/static-pcrlock-files/" + destination: "/var/lib/pcrlock.d/" + + additionalFiles: + - 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: files/root.profile + destination: /root/.profile + - source: files/trident-install.service + destination: /usr/lib/systemd/system/trident-install.service + - source: files/trident.if + destination: /usr/share/selinux/packages/trident/trident.if + - source: files/trident.fc + destination: /usr/share/selinux/packages/trident/trident.fc + - source: files/trident.te + destination: /usr/share/selinux/packages/trident/trident.te + + # Trident daemon service files + - source: files/tridentd.socket + destination: /usr/lib/systemd/system/tridentd.socket + - source: files/tridentd.service + destination: /usr/lib/systemd/system/tridentd.service + + # Netlaunch RCP files -- rcp-agent is a built Go binary staged into + # artifacts/ by the Makefile before invoking tailor (the IC container + # only mounts the tailor workspace root and the output directory, not + # arbitrary repo paths, so a built artifact must land under artifacts/ + # to be reachable here). + - source: ../../../artifacts/rcp-agent + destination: /usr/bin/rcp-agent + - source: files/rcp-agent.service + destination: /usr/lib/systemd/system/rcp-agent.service + + services: + enable: + - rcp-agent + - tridentd.socket + disable: + - trident-install + +scripts: + postCustomization: + - path: post-install.sh + +iso: + additionalFiles: + # Add placeholder config for Trident + - source: ../common/files/config-placeholder.yaml + destination: /trident-config.yaml + # Add pre-trident script to be run early by rcp-agent + - source: files/pre-trident-script.sh + destination: /pre-trident-script.sh + # Add overridable default config for rcp-agent + - source: files/rcp-agent.yaml + destination: /rcp-agent.yaml + + kernelCommandLine: + extraCommandLine: + - console=tty0 + - console=ttyS0 + - rd.luks=0 + - selinux=1 + - enforcing=0 diff --git a/tests/tailor-images/trident-mos/post-install.sh b/tests/tailor-images/trident-mos/post-install.sh new file mode 100644 index 0000000000..927f9e3cbe --- /dev/null +++ b/tests/tailor-images/trident-mos/post-install.sh @@ -0,0 +1,21 @@ +# Use more intuitive path for the ISO mount +ln -s /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 +ln -s /trident_cdrom/trident-config.yaml /etc/trident/config.yaml + +# 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 /trident_cdrom/rcp-agent.yaml /etc/rcp-agent/config.yaml + +# Compile and load Trident SELinux module (this is otherwise handled in trident.spec) +cd /usr/share/selinux/packages/trident +make -f /usr/share/selinux/devel/Makefile trident.pp +semodule -i trident.pp \ No newline at end of file From a27f8cb424dd204524b6203fb899f0684242a67c Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 18:15:15 +0000 Subject: [PATCH 19/26] tests: fix trident-mos cache fingerprint, document it in the workspace README - trident-mos consumes three files from ../common (getty units, config-placeholder.yaml) but omitted it from extraDependencies, so Tailor's fingerprint never covered them -- an edit to a shared common/ file could reuse a stale ISO. Added ../common, matching every other migrated family. - README.md's "current families" list predated trident-mos; added it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/README.md | 1 + tests/tailor-images/trident-mos/image.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/tailor-images/README.md b/tests/tailor-images/README.md index b2a5d585eb..91519189ce 100644 --- a/tests/tailor-images/README.md +++ b/tests/tailor-images/README.md @@ -57,6 +57,7 @@ The current families are: - `trident-container-testimage` - `trident-functest` - `trident-installer` +- `trident-mos` - `trident-testimage` - `trident-verity-testimage` - `trident-vm-testimage` diff --git a/tests/tailor-images/trident-mos/image.yaml b/tests/tailor-images/trident-mos/image.yaml index 4726196a0f..7ceb0c70eb 100644 --- a/tests/tailor-images/trident-mos/image.yaml +++ b/tests/tailor-images/trident-mos/image.yaml @@ -10,6 +10,7 @@ extraDependencies: - ./iso.yaml - ./files - ./post-install.sh + - ../common - ../../../artifacts/rcp-agent config: From 3cccd4bbf642ba7bff027245f04086431ecbf202 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 18:49:31 +0000 Subject: [PATCH 20/26] docs: fix acl-agent-base.yaml comment about per-root paths /etc/trident and /var/lib/kubelet are persistent, part-labeled partitions shared by both A/B roots (see storage-acl-agent.yaml), not per-root filesystems. The actual reason systemctl enable --now on the old root has no effect on the new one is that the enablement symlink it writes lives under the root filesystem itself, which the real A/B reboot does not carry forward. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-vm-testimage/by-scenario/acl-agent-base.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml index 8624b33ee1..bc4ee9fe07 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent-base.yaml @@ -1,7 +1,9 @@ # Base (qcow2) counterpart to acl-agent.yaml. The real A/B reboot lands on a -# different root than the one the storm harness SSHes into pre-stage, and -# /etc/trident + /var/lib/kubelet live on per-root ext4 partitions, so a live -# "systemctl enable --now" on the old root has no effect on the new one. +# different root than the one the storm harness SSHes into pre-stage. /etc/trident +# and /var/lib/kubelet are persistent, part-labeled partitions shared by both +# roots (see storage-acl-agent.yaml), but the systemd enablement symlink that +# "systemctl enable --now" writes lives under the root filesystem itself, so a +# live enable on the old root has no effect once the new root is booted. # trident-acl-agent.service is therefore only enabled by default on the # cosi (update) counterpart; the qcow2 base image enables it live via SSH # during initial deploy. From 227409971bee5a943b8269206b7b1cdd24e557f4 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 21:29:26 +0000 Subject: [PATCH 21/26] docs: fix overlay-partition comment in trident-acl-agent-cert-install.service (split from 9148f30e -- the config-file portion only; the extra_dependencies double-hashing fix and image-yaml.md doc now live on PR842, which owns those source files) The comment claimed /etc lives on an overlay backed by nonexistent per-slot trident-overlay-a/-b partitions. storage-acl-agent.yaml defines no such overlay -- /etc is just part of the plain A/B-swapped root-a/root-b filesystem directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../trident-acl-agent-cert-install.service | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service b/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service index 9f9b85e086..4033001c9f 100644 --- a/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service +++ b/tests/tailor-images/trident-vm-testimage/base/files/trident-acl-agent-cert-install.service @@ -1,28 +1,28 @@ -[Unit] -Description=Install trident-acl-agent storm test CA cert into system trust store -# Test-harness-only plumbing: this file only exists when a storm test run -# has written an ephemeral CA cert onto the persistent, non-A/B -# /var/lib/trident-acl-agent partition (see prepareVmForAclAgent in -# tools/storm/aclagent/tests/update.go). It never exists on a real -# deployment. Skips as a no-op (not a failure) when absent, e.g. before the -# harness has run at all, or for run-rollback, which never uses Nebraska. -ConditionPathExists=/var/lib/trident-acl-agent/nebraska-ca.pem -Before=trident-acl-agent.service - -[Service] -Type=oneshot -RemainAfterExit=yes -# Re-derives the system trust store install every boot: /etc is part of -# this usr-verity image's A/B-swapped root (an overlay backed by the -# per-slot trident-overlay-a/-b partitions), so neither step below carries -# over across a reboot into the other slot, unlike the source cert on -# /var/lib/trident-acl-agent. -ExecStart=/bin/sh -c ' \ - cp /var/lib/trident-acl-agent/nebraska-ca.pem /etc/pki/ca-trust/source/anchors/trident-acl-agent-storm-test-ca.pem && \ - update-ca-trust extract && \ - cp /etc/pki/ca-trust/source/anchors/trident-acl-agent-storm-test-ca.pem /etc/pki/tls/certs/trident-acl-agent-storm-test-ca.pem && \ - openssl rehash /etc/pki/tls/certs \ - ' - -[Install] -WantedBy=multi-user.target +[Unit] +Description=Install trident-acl-agent storm test CA cert into system trust store +# Test-harness-only plumbing: this file only exists when a storm test run +# has written an ephemeral CA cert onto the persistent, non-A/B +# /var/lib/trident-acl-agent partition (see prepareVmForAclAgent in +# tools/storm/aclagent/tests/update.go). It never exists on a real +# deployment. Skips as a no-op (not a failure) when absent, e.g. before the +# harness has run at all, or for run-rollback, which never uses Nebraska. +ConditionPathExists=/var/lib/trident-acl-agent/nebraska-ca.pem +Before=trident-acl-agent.service + +[Service] +Type=oneshot +RemainAfterExit=yes +# Re-derives the system trust store install every boot: /etc is part of +# this usr-verity image's plain A/B-swapped root filesystem (root-a/root-b, +# see storage-acl-agent.yaml -- no overlay involved), so neither step below +# carries over across a reboot into the other slot, unlike the source cert +# on /var/lib/trident-acl-agent. +ExecStart=/bin/sh -c ' \ + cp /var/lib/trident-acl-agent/nebraska-ca.pem /etc/pki/ca-trust/source/anchors/trident-acl-agent-storm-test-ca.pem && \ + update-ca-trust extract && \ + cp /etc/pki/ca-trust/source/anchors/trident-acl-agent-storm-test-ca.pem /etc/pki/tls/certs/trident-acl-agent-storm-test-ca.pem && \ + openssl rehash /etc/pki/tls/certs \ + ' + +[Install] +WantedBy=multi-user.target From 85870e77726456e3c78c0f8dbc42b6efd6388d73 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 22:03:25 +0000 Subject: [PATCH 22/26] docs: fix stale README removal claim (split from cf436a60 -- the tests/tailor-images/README.md portion only; the Cell::extra_dependencies doc-comment fix now lives on PR842, which owns that source file) tests/tailor-images/README.md said the legacy testimages.py/builder/ flow "has been removed" -- it still exists on this branch, removal is a later PR in the stack. Reworded to describe this workspace as the parallel replacement until that cleanup lands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/tailor-images/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tailor-images/README.md b/tests/tailor-images/README.md index 91519189ce..96018d802d 100644 --- a/tests/tailor-images/README.md +++ b/tests/tailor-images/README.md @@ -1,7 +1,8 @@ # Test images with tailor `tests/tailor-images/` is a [tailor](../../tools/tailor/README.md) workspace. -It replaces the legacy `testimages.py` / `builder/` flow, which has been removed. +It replaces the legacy `testimages.py` / `builder/` flow, which runs alongside it +for now and is removed in a follow-up cleanup PR. ## Build from the repo root From 43af2c55309453d63e318ba75d70cf0a097c6333 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 13 Oct 2026 22:29:16 +0000 Subject: [PATCH 23/26] fix: restore executable bit on 3 IC postCustomization scripts Image Customizer requires path-based postCustomization scripts to be executable; these were committed as mode 0664, so the affected builds would fail before producing output: - trident-container-installer/base/scripts/load-containerd-selinux-fix.sh - trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh - trident-mos/post-install.sh (registered as a path-based script in iso.yaml) chmod +x all three. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../base/scripts/load-containerd-selinux-fix.sh | 0 .../base/scripts/load-containerd-selinux-fix.sh | 0 tests/tailor-images/trident-mos/post-install.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh mode change 100644 => 100755 tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh mode change 100644 => 100755 tests/tailor-images/trident-mos/post-install.sh diff --git a/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-installer/base/scripts/load-containerd-selinux-fix.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh b/tests/tailor-images/trident-container-testimage/base/scripts/load-containerd-selinux-fix.sh old mode 100644 new mode 100755 diff --git a/tests/tailor-images/trident-mos/post-install.sh b/tests/tailor-images/trident-mos/post-install.sh old mode 100644 new mode 100755 From 4b7b0fa67de30bc630ea04865654e2cd667db915 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Wed, 14 Oct 2026 00:11:31 +0000 Subject: [PATCH 24/26] fix: restore the Azure update image's 7G disk-size cap The migrated grub-verity-azure scenario included the generic storage-grub-verity.yaml, which has no disks[].maxSize -- the generic grub-verity update intentionally has none, but the legacy Azure update image (updateimg-grub-verity-azure.yaml) always capped at 7G, giving it a fixed update-image layout. Without the cap, the migrated Azure COSI could inherit the core base disk size instead. Add an Azure-specific storage-grub-verity-azure.yaml (a copy of the generic include plus the 7G cap) and point the Azure scenario at it, leaving the generic (non-Azure) scenario untouched. Verified via `tailor export`: the Azure variant now renders maxSize: 7G, the generic variant still renders none. --- .../by-scenario/grub-verity-azure.yaml | 2 +- .../include/storage-grub-verity-azure.yaml | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure.yaml diff --git a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml index 510683e85a..9e572bc9df 100644 --- a/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml +++ b/tests/tailor-images/trident-vm-testimage/by-scenario/grub-verity-azure.yaml @@ -6,7 +6,7 @@ base: ref: core_selinux config: storage: - $include: ./include/storage-grub-verity.yaml + $include: ./include/storage-grub-verity-azure.yaml os: hostname: trident-vm-testimg selinux: diff --git a/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure.yaml b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure.yaml new file mode 100644 index 0000000000..d5ea899248 --- /dev/null +++ b/tests/tailor-images/trident-vm-testimage/include/storage-grub-verity-azure.yaml @@ -0,0 +1,57 @@ +bootType: efi +disks: + - partitionTableType: gpt + # Azure's fixed update-image layout needs a bounded disk size (unlike the generic grub-verity + # scenario, which has none) -- matches the legacy image's `updateimg-grub-verity-azure.yaml`. + maxSize: 7G + partitions: + - id: esp + type: esp + size: 8M + - id: boot + size: 256M + - id: root + size: 4G + - id: root-hash + size: 128M + - id: var + size: 1G + - id: trident-overlay + size: 32M + - id: srv + size: 1G + - id: home + size: 32M +verity: + - id: rootverity + name: root + dataDeviceId: root + hashDeviceId: root-hash + dataDeviceMountIdType: uuid + hashDeviceMountIdType: uuid +filesystems: + - deviceId: esp + type: fat32 + mountPoint: + path: /boot/efi + options: umask=0077 + - deviceId: boot + type: ext4 + mountPoint: /boot + - deviceId: rootverity + type: ext4 + mountPoint: + path: / + options: defaults,ro + - deviceId: var + type: ext4 + mountPoint: /var + - deviceId: trident-overlay + type: ext4 + mountPoint: /var/lib/trident-overlay + - deviceId: srv + type: ext4 + mountPoint: /srv + - deviceId: home + type: ext4 + mountPoint: /home From 6e40419d031f5ffb5c5c42bca8361d0d706509b7 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Wed, 14 Oct 2026 00:48:13 +0000 Subject: [PATCH 25/26] tests: declare artifacts/rpm-overrides as an RPM source Wire artifacts/rpm-overrides (created by the pipeline for dev RPM builds, but never consumed) into rpmSources for every family that already reads bin/RPMS, matching the old Makefile recipes' order. trident-verity-testimage's host.yaml was previously missing it, unlike the other host-build families. --- tests/tailor-images/azl-installer/image.yaml | 1 + tests/tailor-images/trident-installer/image.yaml | 1 + tests/tailor-images/trident-testimage/image.yaml | 1 + .../trident-verity-testimage/by-deployment/host.yaml | 1 + tests/tailor-images/trident-vm-testimage/image.yaml | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/tailor-images/azl-installer/image.yaml b/tests/tailor-images/azl-installer/image.yaml index 9880ea3b9c..c7ca49d701 100644 --- a/tests/tailor-images/azl-installer/image.yaml +++ b/tests/tailor-images/azl-installer/image.yaml @@ -8,6 +8,7 @@ outputs: rpmSources: - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides extraDependencies: - ./installer-iso.yaml diff --git a/tests/tailor-images/trident-installer/image.yaml b/tests/tailor-images/trident-installer/image.yaml index 365a15eaa4..dc7bc48d07 100644 --- a/tests/tailor-images/trident-installer/image.yaml +++ b/tests/tailor-images/trident-installer/image.yaml @@ -16,6 +16,7 @@ outputs: rpmSources: - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides extraDependencies: - ./base diff --git a/tests/tailor-images/trident-testimage/image.yaml b/tests/tailor-images/trident-testimage/image.yaml index 5dd9136120..f77d6ace50 100644 --- a/tests/tailor-images/trident-testimage/image.yaml +++ b/tests/tailor-images/trident-testimage/image.yaml @@ -11,6 +11,7 @@ outputs: rpmSources: - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides extraDependencies: - ./base diff --git a/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml b/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml index 7ef528ff76..71cb3154a6 100644 --- a/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml +++ b/tests/tailor-images/trident-verity-testimage/by-deployment/host.yaml @@ -1,2 +1,3 @@ rpmSources: - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides diff --git a/tests/tailor-images/trident-vm-testimage/image.yaml b/tests/tailor-images/trident-vm-testimage/image.yaml index a67aa6930c..e99dd1136a 100644 --- a/tests/tailor-images/trident-vm-testimage/image.yaml +++ b/tests/tailor-images/trident-vm-testimage/image.yaml @@ -16,6 +16,7 @@ outputs: rpmSources: - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides extraDependencies: - ./base From b6a3908bdc4036863c5b98b51ee8b6dae3ecfefd Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Wed, 14 Oct 2026 18:25:16 +0000 Subject: [PATCH 26/26] tests: declare artifacts/rpm-overrides for azurelinux-direct-streaming-testimage Follow-up to the prior commit wiring artifacts/rpm-overrides into rpmSources for host-build families: azurelinux-direct-streaming-testimage reads bin/RPMS too and was missed. Moved here from PR 844, which had picked it up incidentally in an unrelated review-findings commit. --- .../azurelinux-direct-streaming-testimage/image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml index 351a708c46..5249abc246 100644 --- a/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml +++ b/tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml @@ -11,6 +11,7 @@ outputs: rpmSources: - ../../../bin/RPMS + - ../../../artifacts/rpm-overrides extraDependencies: - ../common