No description
Find a file
Carlos Nihelton 12ab98c081
feat: Adds an integration test workflow (#27)
Looks like we can go quite far with GitHub hosted runners these days
(since they made large runners generally available).

I devised an integration test workflow for `wsl-setup` that:
- Downloads and caches the daily-live/current image from
cdimages.ubuntu.com
- In parallel, it builds the wsl-setup debian package from git
- When above are done:
  * sets up a WSL instance,
  * installs the deb built by CI, 
  * clean up cloud-init state, 
  * writes some cloud-init user data, 
* does some actions to prevent the test from being stuck in case
cloud-init fails,
* runs the initial setup via WSL itself (with just `wsl -d DISTRO`) and
* runs some assertions based on the results of having wsl-setup
installed.
  
To support development time, part of the assertions are placed in a
separate shell script that we can run inside a VM, LXD container or WSL
instance at development time (though some can only pass on WSL),
assertions which are really coupled to the contents of the package, thus
we should pay attention to them when changing the package. Unfortunately
I'm not bold enough to put those assertions in an override_build step of
debian/rules because I that could result in unnecessary breakages.

My image caching system saves more bandwidth than time. I was pleased to
see that CI was taking less than 30s to download a WSL image (building
the deb takes much longer, there's probably some caching opportunity in
the callee side?). The cache key is the image checksum read from the
SHA256SUMS file hosted aside from the image. I had to learn a few tricks
to make the cache working cross OSes.

The WSL instance is created from the cached image with `wsl --install
--from-file ... --no-launch ...` so we can further customise it with
other `wsl -d DISTRO -- <COMMANDS>` without those counting as if the
OOBE script was run, that is, WSL keeps track of that instance as still
non-initialized.

This whole scheme allows us to:
- claim that the package builds both source and binary outputs
- claim that the installed package behaves as expected on a target
- smoke test the latest images, preventing late breakages if breaking
changes appear in them without us noticing.

---

UDENG-7866
2025-09-08 22:03:18 -03:00
.github/workflows Clean up always() 2025-09-08 21:56:39 -03:00
cloud/cloud.cfg.d fix(cloud-init): DS List should contain one additional datasource in order to skip running cloud-init when there is no user-data file 2024-07-19 11:33:36 -03:00
debian Update the changelog 2025-09-04 11:09:55 -03:00
systemd/system Remove the systemd-binfmt override 2025-07-24 17:17:41 -03:00
test Fixes integration-test shell script 2025-09-08 16:11:16 -03:00
update-motd.d Check if cloud-init log is readable by the current user in 99-wsl 2024-09-17 09:57:33 -03:00
wsl Fix terminal profile syntax 2024-12-04 18:03:27 -03:00
LICENSE Initial commit 2021-10-11 11:19:27 +02:00
README.md New readme description 2024-02-05 11:57:33 +01:00
wait-for-cloud-init Make wait-for-cloud-init executable 2025-03-11 11:18:33 -03:00
wsl-setup PowerShell to output Windows username case-folded 2025-09-04 11:05:01 -03:00

wsl-setup

WSL integration setup. This project helps setting up a working WSL environment with systemd enabled by default.