30 Commits

Author SHA1 Message Date
Sjoerd Simons
862d06e26e Merge pull request #597 from go-debos/copilot/fix-d5fc231f-957e-4e33-8683-9d0d0b3f27aa
Add overlay-non-existent-destination test to CI
2025-11-01 21:32:52 +00:00
Sjoerd Simons
1b22166517 tests: templating: Add yaml anchors
Add some yaml anchors in the templating test to ensure those are
correctly handled. This is in preperation for switching the yaml
package.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-11-01 22:04:02 +01:00
copilot-swe-agent[bot]
6d347a63b1 Make origin property optional for raw action, default to recipe directory
Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-11-01 16:04:11 +01:00
copilot-swe-agent[bot]
ee5d15231b Test overlay-non-existent-destination in CI
Move te overlay-non-existent-destination test to be part of the
various exit_test tests so it can be ran in CI.

Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-11-01 14:06:17 +01:00
Christopher Obbard
be3b6d4df8 ci: disable user-mode-linux tests
The user-mode-linux backend appears to be buggy in trixie. Disable
the user-mode-linux backend tests.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Sjoerd Simons
b59af4ed28 actions/mmdebstrap_action.go: persist cleaned keyring paths
Let verify (indirectly) save the cleaned keyring paths back to the
action arguments so those are used for the Run as well

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-10-26 10:47:46 +01:00
Ed Smith
550218b96d Add exit code test to validate logic is as expected 2025-06-12 12:20:28 +02:00
Sjoerd Simons
ba4449b7b4 Merge pull request #536 from julien-massot/main
Add support for alternate sector size
2025-03-04 10:38:37 +00:00
Sjoerd Simons
1c95fe3b0e Merge pull request #539 from iwamatsu/fix-mmdebstrap
Fix mmdebstrap action
2025-03-04 06:29:52 +00:00
Julien Massot
396bf430a1 Add test for partitioning with alternate sector size
parted will return an error code if the partition
table is not found, and will print the message:
"unrecognised disk label"

Signed-off-by: Julien Massot <julien.massot@collabora.com>
2025-03-04 07:16:15 +01:00
Julien Massot
f0b70e0bac Add test for raw action
Since the introduction of sectorsize header,
the raw action have to handle sector size computation.

Add a test recipe, to cover this feature.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
2025-03-04 07:16:15 +01:00
Julien Massot
840b1df5c2 Add support for alternate sectorsize
Newer storage, such as UFS or NVMe disk, may not support the
default 512 sector size.

For these devices, the partition table and the partition offset
need to be aligned with sector size boundaries. The GPT partition
table is 34 sectors in length, so we can't have compatible disk images
between 512 and 4096 sector-size devices.

This patch introduces a major breakage with the {{ sector 64 }}
template.
At template processing, we can't guess the appropriate sector size
for the image since this value can be defined as a YAML header.
Instead of multiplying the sector number by the default 512 bytes
boundary, append a 's' suffix. This defers the work of computing
the value to the different Actions.
The 's' suffix is chosen to be compatible with parted (ImagePartition)
and support has been added to raw action.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
2025-03-04 07:16:15 +01:00
Sjoerd Simons
fcf40bb960 tests: arch: remove deprecated repositories
The community repositories were merged into extra around to years ago.
Recently the database files got cleaned up on the mirrors, causing
errors in CI. Adjust pacman.conf to remove these deprecated repositories

See https://archlinux.org/news/cleaning-up-old-repositories/ for more
details
2025-03-03 21:25:34 +01:00
Nobuhiro Iwamatsu
ddd1c63de7 test: mmdebstrap: Add test for dpkg-opts and apt-opts
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
2025-03-03 13:18:51 +01:00
Nicolai Buchwitz
53a1656028 tests: debian: Update suite to bookworm
Update suite to bookworm which represents stable at the time being.

Signed-off-by: Nicolai Buchwitz <nb+github@tipi-net.de>
2025-02-24 13:18:58 +01:00
Nicolai Buchwitz
b58fb75f5e actions: Add mmdebstrap action
Add mmdebstrap [1] as a faster and more flexible alternative to debootstrap.

[1] https://gitlab.mister-muffin.de/josch/mmdebstrap

Signed-off-by: Nicolai Buchwitz <nb+github@tipi-net.de>
2025-02-23 23:32:17 +01:00
Sjoerd Simons
325c8f76c7 Expand gpt partitioning tests to more then 4 partitions
The msdos partitioning now handles more then 4 partitions by inserting
an extended partition. To test this doesn't confuse the gpt partitioning
expand that test to more then 4 partitions as well.
2024-01-20 11:25:41 +01:00
Sjoerd Simons
bf30a29445 tests: Merge uuid5 test with general templating tests
Setting up the test fixtures takes quite some time, so merge the uuid5
tests into the templating tests. Also simplify it somewhat by just using
`test` rather then diff

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2024-01-15 10:37:59 +00:00
venkata pyla
8cd111941b Add CI test for uuid5 function
Test uuid5 generates same value with given same input and vice-versa

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
2024-01-15 10:37:59 +00:00
Sjoerd Simons
9051908056 tests: add test for msdos partitioning
Add a test for partitioning an msdos label with more then 4 partitions.
The expectation is that the 4th partition will be an extended partition
in this case.
2024-01-13 14:14:08 +00:00
Sjoerd Simons
94d061083e Add test for more templating functions
Renaming the escaping test to a general templating test and add tests
for a selection of functions from sprig-slim as well as the builtin
sector function

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-12-30 22:26:48 +00:00
Sjoerd Simons
659acaa0b5 Add CI test for escaping
Test both escaping variables passed into debos and the new escaping
template function

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-11-11 09:53:47 +00:00
Christopher Obbard
d08d5d1cfb Add test to overlay into a non-existent destination
Attempt to overlay a file into a directory in the filesystem which doesn't
exist. The expected behavior is to cause an error.

This test is currently a manual test case and is not hooked into the CI.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2023-07-10 19:42:19 +00:00
Emil Velikov
0f5cc52e07 tests: add basic Arch test suite
Nothing special here - a simple test.yaml akin to the existing ones.

The pacman.conf file is effectively vanilla config that comes with the
pacman package, while the mirrorlist file is a list of UK https mirrors
that I've been using for years.

Note that there is no canonical mirror for Arch. The top-level/tier 1
Arch server should _not_ be used as per the official recommendation.
Instead we use the mirrors set in the official arch docker tooling.

v2:
 - Also install archlinux-keyring and makepkg
 - Use arch + backend=qemu only testing matrix

v3:
 - Use the same mirrors as the Arch docker images tooling
 - Build and install pacman locally, until we get an official package

v4:
 - Remove the local pacman build - it's available in backports

v5:
 - Explicitly pull arch-install-scripts from backports, normal one lack
   pacstrap

v6:
 - Manually pull the latest keyring - Debian one is outdated

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2022-12-15 14:25:05 +00:00
Emil Velikov
5ab3792a81 tests: process json files throgh jq prior to comparing
There are various whitespace changes that can occur in json files. Use
the same pretty-format in both files to ensure the output is stable and
consistent.

Note: we need to explicitly call "bash -c" here otherwise, we'll end up
with pure POSIX shell (sh), where anonymous pipes are not a thing.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2022-11-02 17:31:59 +00:00
Sjoerd Simons
114028f32b Test build apertis to test non-debian distros
Apertis is a Debian derivative, bootstrap that to test that a non-debian
based distribution with a different codenames for release can be
successfully bootstrapped by go-debos.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-09-22 13:12:20 +02:00
Sjoerd Simons
69d35a46df Run a matrix of debos recipes as test
The docker-compose test strategy was mainly done for integration with
dockerhub, but as dockerhub no longer builds our images it's not that
relevant.

What's more interesting is to use the docker container we've build to
run a selection of debos recipes, whose successfull build indicate
success. This both makes it easier to test locally as well (just run the
debos recipe) and makes the test jobs more specific.

On top of the existing test this also adds a "debian" test which does some basic
debian smoketesting (debootstrap and apt) as well as a basic
"partitioning" test. The partitioning test unforutunately doesn't work
in the nofakemachine run as udev isn't available in the container, so
that only runs on UML and Qemu based backends.

Current the kvm backend isn't tested because the standard github action
runners don't support kvm. But qemu, though being lots slower, covers
some part of it.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-04-27 17:18:51 +02:00
Christopher Obbard
ea8aca057e tests: Make sure stdin is set to /dev/null
UML has some issues in some environments when stdin isn't set to
/dev/null, let's just set stdin to /dev/null for all tests.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
9bb2764c12 tests: Allow arguments to be passed to debos
Currently we assume all of the tests are run without fakemachine;
since we are looking to run the tests with fakemachine as well,
let's allow arguments to be passed to the test script which are
then passed to debos.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
21fdbc283a docker: recipes-test: move tests to project root directory
The tests are first-class citizens; they should be present in the
directory as such.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00