Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pipelines/templates/stages/azl_installer/azl-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ stages:
- bash: |
set -ex

mkdir -p tests/tailor-images/azl-installer/iso/bin
mkdir -p tests/tailor-images/azl-installer/iso/images
mkdir -p tests/images/azl-installer/iso/bin
mkdir -p tests/images/azl-installer/iso/images

# Move liveinstaller to bin directory
mv "$(Build.ArtifactStagingDirectory)/installer-tools/liveinstaller" tests/tailor-images/azl-installer/iso/bin/
chmod +x tests/tailor-images/azl-installer/iso/bin/liveinstaller
mv "$(Build.ArtifactStagingDirectory)/installer-tools/liveinstaller" tests/images/azl-installer/iso/bin/
chmod +x tests/images/azl-installer/iso/bin/liveinstaller

# Move .cosi file to the ISO directory. When there are clones (multiple .cosi files), we pick the first one.
mv $(ls $(Build.ArtifactStagingDirectory)/testimage/*.cosi | head -n 1) tests/tailor-images/azl-installer/iso/images/trident-testimage.cosi
mv $(ls $(Build.ArtifactStagingDirectory)/testimage/*.cosi | head -n 1) tests/images/azl-installer/iso/images/trident-testimage.cosi
displayName: "Prepare installer dependencies"
workingDirectory: $(TRIDENT_SOURCE_DIR)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,19 @@ steps:
;;
esac

manifest_path=tests/tailor-images/tailor.yaml
manifest_path=tests/images/tailor.yaml
if [[ "${{ parameters.micBuildType }}" == "dev" ]]; then
manifest_path=tests/tailor-images/.tailor.pipeline.yaml
manifest_path=tests/images/.tailor.pipeline.yaml
python3 - <<'PY'
from pathlib import Path
text = Path('tests/tailor-images/tailor.yaml').read_text()
text = Path('tests/images/tailor.yaml').read_text()
needle = 'toolchains:\n default: ic\n entries:\n - name: ic\n container: mcr.microsoft.com/azurelinux/imagecustomizer\n tag: latest\n'
replacement = 'toolchains:\n default: ic-dev\n entries:\n - name: ic\n container: mcr.microsoft.com/azurelinux/imagecustomizer\n tag: latest\n - name: ic-dev\n container: imagecustomizer\n tag: dev\n pull: never\n'
Path('tests/tailor-images/.tailor.pipeline.yaml').write_text(text.replace(needle, replacement, 1))
Path('tests/images/.tailor.pipeline.yaml').write_text(text.replace(needle, replacement, 1))
PY
fi

rm -f tests/tailor-images/artifacts/ca_cert.pem
rm -f tests/images/artifacts/ca_cert.pem
cargo run --manifest-path tools/tailor/Cargo.toml --quiet -- \
-vvv \
--log-dir $(ob_outputDirectory)/tailor-logs \
Expand All @@ -340,10 +340,10 @@ steps:
"$(ob_outputDirectory)/${legacy_name}.${artifact_ext}"
fi

if [ -f tests/tailor-images/artifacts/ca_cert.pem ]; then
cp tests/tailor-images/artifacts/ca_cert.pem "$(ob_outputDirectory)/ca_cert.pem"
if [ -f tests/images/artifacts/ca_cert.pem ]; then
cp tests/images/artifacts/ca_cert.pem "$(ob_outputDirectory)/ca_cert.pem"
fi

rm -f tests/tailor-images/.tailor.pipeline.yaml
rm -f tests/images/.tailor.pipeline.yaml
displayName: "Build ${{ parameters.imageName }}"
workingDirectory: ${{ parameters.tridentSourceDirectory }}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ steps:
displayName: Copy SSH Keys

- script: |
echo "##[warning]THE PIPELINE TEMPLATE trident-testimg-template.yaml IS DEPRECATED. PLEASE SWITCH TO USING the tailor workspace under tests/tailor-images."
echo "##[warning]THE PIPELINE TEMPLATE trident-testimg-template.yaml IS DEPRECATED. PLEASE SWITCH TO USING the tailor workspace under tests/images."
cat /etc/os-release
displayName: "Report Host Info"

Expand Down Expand Up @@ -325,9 +325,9 @@ steps:
# downloadable artifact too) is still available for diagnosing the failure.
- script: |
set -ex
if [ -d "tests/tailor-images/artifacts/tailor-logs" ]; then
if [ -d "tests/images/artifacts/tailor-logs" ]; then
mkdir -p "${{ parameters.outputDirectory }}/tailor-logs"
sudo cp -rv tests/tailor-images/artifacts/tailor-logs/. "${{ parameters.outputDirectory }}/tailor-logs/"
sudo cp -rv tests/images/artifacts/tailor-logs/. "${{ parameters.outputDirectory }}/tailor-logs/"
fi
workingDirectory: ${{ parameters.tridentSourceDirectory }}
displayName: "Copy tailor logs to output directory"
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ generate-functional-test-manifest: .cargo/config

.PHONY: validate-configs
validate-configs: target/release/trident
$(eval DETECTED_HC_FILES := $(shell grep -R '^storage:' . --include '*.yaml' -l | grep -E -v '\./(target|dev|azure-linux-image-tools|crates/docbuilder|tests/tailor-images|tests/images|tests/azl-installer)'))
$(eval DETECTED_HC_FILES := $(shell grep -R '^storage:' . --include '*.yaml' -l | grep -E -v '\./(target|dev|azure-linux-image-tools|crates/docbuilder|tests/images|tests/images|tests/azl-installer)'))
@for file in $(DETECTED_HC_FILES); do \
echo "Validating $$file"; \
$< validate $$file -v info || exit 1; \
Expand Down Expand Up @@ -627,13 +627,13 @@ run-attendedinstaller-simulator: bin/attendedinstaller-simulator

# Test image paths
ARTIFACTS_TEST_IMAGE_DIR := artifacts/test-image
AZL_INSTALLER_DIR := tests/tailor-images/azl-installer
AZL_INSTALLER_DIR := tests/images/azl-installer
AZL_INSTALLER_ISO_DIR := $(AZL_INSTALLER_DIR)/iso

# If regular.cosi is not present, download runtime images
$(ARTIFACTS_TEST_IMAGE_DIR)/regular.cosi: download-runtime-images

include tests/tailor-images/targets.mk
include tests/images/targets.mk

.PHONY: validate
validate: $(TRIDENT_CONFIG) target/release/trident
Expand Down Expand Up @@ -931,7 +931,7 @@ download-trident-container-installer-iso:

# TRIDENT VM UPDATE IMAGES

VM_IMAGE_PATH_PREFIX = tests/tailor-images/trident-vm-testimage/base
VM_IMAGE_PATH_PREFIX = tests/images/trident-vm-testimage/base

artifacts/rpm-overrides:
@mkdir -p artifacts/rpm-overrides
Expand Down Expand Up @@ -966,12 +966,12 @@ $(QEMU_GUEST_IMAGE):
BAREMETAL_IMAGE = artifacts/baremetal.vhdx
$(BAREMETAL_IMAGE):
@mkdir -p artifacts
$(CARGO_TAILOR) run --manifest-path tools/tailor/Cargo.toml --quiet -- --manifest tests/tailor-images/tailor.yaml bases download baremetal
$(CARGO_TAILOR) run --manifest-path tools/tailor/Cargo.toml --quiet -- --manifest tests/images/tailor.yaml bases download baremetal

CORE_SELINUX_IMAGE = artifacts/core_selinux.vhdx
$(CORE_SELINUX_IMAGE):
@mkdir -p artifacts
$(CARGO_TAILOR) run --manifest-path tools/tailor/Cargo.toml --quiet -- --manifest tests/tailor-images/tailor.yaml bases download core_selinux
$(CARGO_TAILOR) run --manifest-path tools/tailor/Cargo.toml --quiet -- --manifest tests/images/tailor.yaml bases download core_selinux

CORE_ARM64_IMAGE_NAME ?= core_vhdx-arm64-3.0-stable
CORE_ARM64_IMAGE_VERSION ?= *
Expand Down
18 changes: 9 additions & 9 deletions docs/Development/Testing/E2E-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ make bin/rcp-agent # Remote control plane agent
### 4. Build Trident RPMs

The **host** test images include Trident packages built from your local tree.
This step builds the RPMs into `bin/RPMS/`, which the `tests/tailor-images` tailor
This step builds the RPMs into `bin/RPMS/`, which the `tests/images` tailor
workspace passes to Image Customizer via `rpmSources:`:

```bash
Expand Down Expand Up @@ -168,7 +168,7 @@ make artifacts/id_rsa
### 7. Download Base Image

```bash
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases download baremetal
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases download baremetal
```

### 8. Build COSI Images
Expand All @@ -193,7 +193,7 @@ mkdir -p artifacts/test-image

# Build two clones (produces trident-testimage_amd64_cosi_clone0.cosi and
# trident-testimage_amd64_cosi_clone1.cosi)
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts/test-image --clones 2
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts/test-image --clones 2

# Rename clones to the filenames referenced by Host Configurations
mv artifacts/test-image/trident-testimage_amd64_cosi_clone0.cosi artifacts/test-image/regular.cosi
Expand All @@ -204,12 +204,12 @@ Repeat for other image types as needed:

```bash
# Verity image (for root-verity configuration)
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/test-image --clones 2
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/test-image --clones 2
mv artifacts/test-image/trident-verity-testimage_host_root_amd64_cosi_clone0.cosi artifacts/test-image/verity.cosi
mv artifacts/test-image/trident-verity-testimage_host_root_amd64_cosi_clone1.cosi artifacts/test-image/verity_v2.cosi

# UKI/usr-verity image (for usr-verity, combined configurations)
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-verity-testimage -s deployment=host -s mode=usr --output-dir ./artifacts/test-image --clones 2
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-verity-testimage -s deployment=host -s mode=usr --output-dir ./artifacts/test-image --clones 2
mv artifacts/test-image/trident-verity-testimage_host_usr_amd64_cosi_clone0.cosi artifacts/test-image/usrverity.cosi
mv artifacts/test-image/trident-verity-testimage_host_usr_amd64_cosi_clone1.cosi artifacts/test-image/usrverity_v2.cosi
```
Expand All @@ -225,23 +225,23 @@ URLs work unchanged:
mkdir -p artifacts/test-image

# Regular container image
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-container-testimage --output-dir ./artifacts/test-image --clones 2
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-container-testimage --output-dir ./artifacts/test-image --clones 2
mv artifacts/test-image/trident-container-testimage_amd64_cosi_clone0.cosi artifacts/test-image/regular.cosi
mv artifacts/test-image/trident-container-testimage_amd64_cosi_clone1.cosi artifacts/test-image/regular_v2.cosi

# Verity container image (for root-verity configuration)
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-verity-testimage -s deployment=container -s mode=root --output-dir ./artifacts/test-image --clones 2
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-verity-testimage -s deployment=container -s mode=root --output-dir ./artifacts/test-image --clones 2
mv artifacts/test-image/trident-verity-testimage_container_root_amd64_cosi_clone0.cosi artifacts/test-image/verity.cosi
mv artifacts/test-image/trident-verity-testimage_container_root_amd64_cosi_clone1.cosi artifacts/test-image/verity_v2.cosi

# UKI/usr-verity container image (for usr-verity, combined configurations)
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/test-image --clones 2
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/test-image --clones 2
mv artifacts/test-image/trident-verity-testimage_container_usr_amd64_cosi_clone0.cosi artifacts/test-image/usrverity.cosi
mv artifacts/test-image/trident-verity-testimage_container_usr_amd64_cosi_clone1.cosi artifacts/test-image/usrverity_v2.cosi
```

The workspace defaults to the Image Customizer container declared in
`tests/tailor-images/tailor.yaml` (`mcr.microsoft.com/azurelinux/imagecustomizer:latest`).
`tests/images/tailor.yaml` (`mcr.microsoft.com/azurelinux/imagecustomizer:latest`).

### 9. Build the Installer ISO

Expand Down
6 changes: 3 additions & 3 deletions docs/Development/Testing/Functional-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ and a base image also from MCR.
1. **Download the base image:**

```bash
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases download baremetal
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases download baremetal
```

2. **Build the functional test image:**

```bash
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-functest --output-dir ./artifacts
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-functest --output-dir ./artifacts
```

This produces `artifacts/trident-functest_amd64_qcow2.qcow2` (tailor
publishes under the cell's slug; use `make artifacts/trident-functest.qcow2`
for the legacy-named compatibility output). The image is selected from
the `trident-functest` family in `tests/tailor-images/tailor.yaml`.
the `trident-functest` family in `tests/images/tailor.yaml`.

## Building Test Dependencies

Expand Down
4 changes: 2 additions & 2 deletions docs/Development/Testing/Rollback-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 8
Rollback tests validate manual rollback and runtime update workflows using
`storm-trident run rollback`. Like [servicing tests](Servicing-Tests.md),
they start from a pre-built VM image defined in
`tests/tailor-images/trident-vm-testimage/`, but focus specifically on the rollback
`tests/images/trident-vm-testimage/`, but focus specifically on the rollback
chain: A/B updates, runtime updates (sysexts and netplan), and rolling each
back in sequence.

Expand All @@ -21,7 +21,7 @@ extensions:
| `trident-vm-usr-verity-testimage` | systemd-boot | `/usr` verity | Yes | Sysexts supported | Required |
| `trident-vm-grub-verity-testimage` | grub2 | Root verity | No | Not supported | Not needed |

All image configs live under `tests/tailor-images/trident-vm-testimage/`: the
All image configs live under `tests/images/trident-vm-testimage/`: the
matrix is defined in `image.yaml`, and each scenario's specific configuration
lives under `by-scenario/` (e.g. `by-scenario/usr-verity.yaml` and
`by-scenario/grub-verity.yaml`). The base image is `qemu_guest` (see
Expand Down
8 changes: 4 additions & 4 deletions docs/Development/Testing/Servicing-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Servicing tests validate multi-update workflows on pre-built VM images using
from a QCOW2 image that already has Trident and an OS installed, then run
repeated A/B updates with optional rollback testing.

The VM images are defined in `tests/tailor-images/trident-vm-testimage/` and built
The VM images are defined in `tests/images/trident-vm-testimage/` and built
with Image Customizer from a `qemu_guest` base image downloaded from MCR.

## VM Image Types
Expand All @@ -24,7 +24,7 @@ image types are:
| `trident-vm-grub-verity-testimage` | grub2 | Root verity | No | `by-scenario/grub-verity-base.yaml` (base), `by-scenario/grub-verity.yaml` (update) |
| `trident-vm-usr-verity-testimage` | systemd-boot | `/usr` verity | Yes | `by-scenario/usr-verity.yaml` |

All image configs live under `tests/tailor-images/trident-vm-testimage/`: the
All image configs live under `tests/images/trident-vm-testimage/`: the
matrix is defined in `image.yaml`, and each scenario's specific configuration
lives under `by-scenario/`. The base image is `qemu_guest` (see [step 4](#4-download-the-qemu_guest-base-image)
for how to obtain it).
Expand Down Expand Up @@ -106,7 +106,7 @@ step, so the base image's pre-installed package set does not matter.
:::tip Internal shortcut
If you have access to the internal Azure DevOps artifacts feed, the Makefile
downloads `qemu_guest` automatically (requires `az login`). You can also
download it directly: `cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases download qemu_guest`
download it directly: `cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml bases download qemu_guest`
:::

### 5. Build the VM Image
Expand Down Expand Up @@ -139,7 +139,7 @@ mkdir -p artifacts/update-a artifacts/update-b
mkdir -p artifacts/rpm-overrides

# Build two clones of the COSI image
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-vm-testimage -s arch=amd64 -s scenario=grub-verity --output-dir ./artifacts --clones 2
cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/images/tailor.yaml build trident-vm-testimage -s arch=amd64 -s scenario=grub-verity --output-dir ./artifacts --clones 2

# Move the clones into the update directories with the same filename
mv artifacts/trident-vm-testimage_amd64_grub-verity_cosi_clone0.cosi artifacts/update-a/trident-vm-grub-verity-testimage.cosi
Expand Down
2 changes: 1 addition & 1 deletion docs/Development/Testing/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ See [E2E Tests](E2E-Tests.md) for full setup and run instructions.
## Servicing and Rollback Testing

Servicing and rollback tests use pre-built VM images (defined in
`tests/tailor-images/trident-vm-testimage/`) to test multi-update workflows and
`tests/images/trident-vm-testimage/`) to test multi-update workflows and
manual rollback chains without using `netlaunch` or an installer ISO.

- [Servicing Tests](Servicing-Tests.md) — multi-update loop with optional
Expand Down
2 changes: 1 addition & 1 deletion docs/Explanation/Trident-ACL-Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ files. Installing the package does not by itself enable or start the
service — a deployment decides when that happens, e.g. by running
`systemctl enable --now trident-acl-agent.service` on the node, or by
baking that enablement into the image build (as this repo's own
`tests/tailor-images/trident-vm-testimage/by-scenario/acl-agent.yaml` Tailor image config does via
`tests/images/trident-vm-testimage/by-scenario/acl-agent.yaml` Tailor image config does via
Image Customizer's `services: enable` list).

The shipped unit carries no `Environment=` lines beyond `ExecStart`, so
Expand Down
Loading
Loading