diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-11-07 14:30:09 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-11-07 14:30:09 +0100 |
| commit | b4502785a52fa64f634d712fd0094edc8d77575d (patch) | |
| tree | 25cc8cd7ae7034656b0cd6a30fad8dfc7197624e /docs/contributing | |
| parent | 27845af752771961a9c147530af569de94020a35 (diff) | |
| download | vyos-documentation-b4502785a52fa64f634d712fd0094edc8d77575d.tar.gz vyos-documentation-b4502785a52fa64f634d712fd0094edc8d77575d.zip | |
docs: build-vyos: document vyos-build smoketests
Add a "Smoketests" section explaining how to verify a freshly built ISO
with the QEMU based test targets from the vyos-build Makefile. It covers
the requirements (development build, root, KVM), all test targets
available on the circinus branch, the MATCH filter and passing extra
options to scripts/check-qemu-install.
(cherry picked from commit c4ab7ac4bef7da9d8884904b52999de965b9ca24)
Diffstat (limited to 'docs/contributing')
| -rw-r--r-- | docs/contributing/build-vyos.md | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/docs/contributing/build-vyos.md b/docs/contributing/build-vyos.md index e8890070..0732ff32 100644 --- a/docs/contributing/build-vyos.md +++ b/docs/contributing/build-vyos.md @@ -245,6 +245,103 @@ $ vyos_bld@8153428c7e1f:/vyos$ sudo ./build-vyos-image --help Custom package to install from repositories ``` +(build_smoketests)= + +### Smoketests + +The `vyos-build` repository ships a set of test targets that verify a freshly +built ISO image. Each test installs the ISO into a new QEMU virtual machine, +boots the installed system and runs the testcases on it. The testcases +themselves come from the `vyos-1x-smoketest` package, which is only included +in `development` builds (the default build type). + +The tests are run from the root of your `vyos-build` checkout inside the +build container, after a successful ISO build. They require root privileges +and use the ISO from the `build` directory, e.g.: + +```none +vyos_bld@8153428c7e1f:/vyos$ sudo make test +``` + +:::{note} +The tests need KVM. The container started with `--privileged` has access to +`/dev/kvm` of the host. Without KVM, the tests fall back to software +emulation, which is much slower. + +Most VMs get 2 vCPUs and 4 GB of memory. The `test`, `test-no-interfaces`, +`test-vpp` and `testcvpp` targets use 4 vCPUs and 8 GB of memory, `testc` +uses 7 GB. A single test can run for several hours. +::: + +The following test targets are available: + +`test` +: Runs all CLI smoketests. Limit the run to selected tests with `MATCH`, + e.g. `sudo make test MATCH="protocols_bgp|vrf"`. Multiple names are + separated by `|`. + +`test-interfaces` +: Runs only the interface CLI smoketests (`test_interfaces_*`). + +`test-no-interfaces` +: Runs all CLI smoketests including VPP, but without the interface tests. + +`test-no-interfaces-no-vpp` +: Runs all CLI smoketests except the interface and VPP tests. + +`test-vpp` +: Runs the VPP CLI smoketests. The VM reserves 1800 huge pages of 2 MB and + isolates vCPUs 2-3 for VPP. + +`testc` +: Runs the configuration load tests (`vyos-configtest`) for all reference + configurations except the VPP ones. Each configuration is loaded and + committed, which also verifies the configuration migration scripts. + +`testcvpp` +: Runs the configuration load tests for the VPP reference configurations. + +`testraid` +: Installs VyOS onto two disks as a RAID-1 array. It then replaces one disk + with an empty one, boots from the remaining disk and re-adds the new disk + until the array is fully re-synced. + +`testtpm` +: Uses an emulated TPM (`swtpm`) to encrypt the configuration with + `encryption enable`. It verifies the encrypted config volume and its + contents after a reboot, then clears the TPM and loads the configuration + with the recovery key. Finally, it repeats the encryption on a system + without a TPM, using only the recovery key. + +`test-secure-boot` +: Boots the VM with UEFI Secure Boot enabled and verifies that the kernel + is signed by the VyOS Secure Boot CA, or by your own signing certificate + if one is present in `data/certificates`. + +`test-image-update` +: Adds a new system image with `add system image` over HTTP, both in the + default VRF and in a custom VRF. + +`test-ci-qcow2` +: Runs the cloud-init tests against the newest QCOW2 image in the `build` + directory. + +`test-oci` +: Tests the OCI container image created by `make oci`. + +`qemu-live` +: Does not run a test. It only prints the QEMU command used to boot the ISO. + +Additional options are passed to the test script after `--`. For example, +`--keep` keeps the VM disk image after the test and `--logfile` writes the +output to a file: + +```none +vyos_bld@8153428c7e1f:/vyos$ sudo make testraid -- --keep --logfile testraid.log +``` + +Leftover disk images and test data are removed with `sudo make purge`. + (build_custom_packages)= ### Custom Packages |
