NixOS has traditionally enabled the `ext` family of file systems by
default. Originally, when switching to systemd initrd, we wanted to
transition to making this explicit so that initrds could be made
without `ext`. The problem is that anyone with `fsType = "auto";` for
an `ext` file system in initrd will fail to boot, which is not really
an acceptable regression as we switch to systemd initrd by default.
By removing `default = "auto"` from `fsType`, we rule out the vast
majority of these regressions as eval errors, since most users of
`fsType = "auto"` for ext file systems are using it because of the
default value.
In hindsight, this is probably what #225352 was really about.
In 401e2b5e84, these sanity check curl
commands were uncommented. Since this scripted install process is rather
fragile, these requests change some internal state which in turn breaks
the installer, because the conf.php file does not get written properly.
Note that these lines have always been commented from the first commit
(c2563fe476) until they were uncommented
and broke the test.
coreutils 9.10 man pages are generated by help2man 1.50 which embeds
tty hyperlink escape codes (\X'tty: link ...'). These break fish's
create_manpage_completions.py parser, so coreutils.fish is no longer
generated.
Switch to coreutils-full (the minimal coreutils has no man pages at
all) and check for chmod.fish which still parses successfully.
The recent changes to the man page made is so that when rendering
on a terminal, which is width justified, the man viewer adds a
double space between "NixOS" and "module", which fails the test.
Yes, this is real. Somehow. Just remove any chances of this happening
ever again.
Paths are purposedly not changing for now.
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
Signed-off-by: Nicolas Dumazet <nicdumz.commits@gmail.com>
makeEc2Test's userData parameter is required but image-contents.nix
passes null, triggering a deprecation warning from writeText. Make
userData optional (defaulting to null) and create an empty user-data
file when it's not provided.
The decompression subtests restart fetch-ec2-metadata multiple times
in quick succession, hitting systemd's rate limiter. Reset the failure
counter before each restart.
The test hardcoded "/nixos.qcow2" but the actual output filename
is derived from image.baseName and image.extension (e.g.
"nixos-image-...-x86_64-linux.qcow2"). Use image.fileName to get
the correct path, matching the pattern in ec2-image.nix.
Also make the IMDS server's token validation conditional: when no
token file exists in the metadata directory, requests are served
without authentication. This supports both EC2 (IMDSv2 with tokens)
and OpenStack (plain GET) metadata fetchers.
- Extract imds-server derivation into common/imds-server.nix so both
ec2-image.nix and common/ec2.nix share the same definition.
- Update common/ec2.nix (makeEc2Test) to use the IMDSv2 server
instead of micro_httpd, and add token/instance-id to the metadata
directory so the full IMDSv2 flow works.
- Simplify ec2-image.nix to import from the shared definition.
micro_httpd returns 501 for PUT requests, so IMDSv2 token acquisition
was never actually tested. Replace it with a minimal Python IMDS server
that handles the full IMDSv2 flow: PUT for token, token validation on
GET requests, and file serving from a metadata directory.
This means the test now validates that:
- The fetcher correctly obtains an IMDSv2 token via PUT
- The token is passed on subsequent metadata GET requests
- Requests without a valid token are rejected (401)
Tests that the EC2 metadata fetcher falls back to the IPv6 IMDS
endpoint (fd00:ec2::254) when the IPv4 endpoint is unreachable.
Works around QEMU guestfwd being IPv4-only by running socat +
micro_httpd inside the guest on the IPv6 address, then blocking
IPv4 IMDS with iptables and re-running the fetcher.
Refactor try_decompress to use a decompress_cmd variable, making it
straightforward to add new compression formats. Add bzip2 support
and a corresponding NixOS test.
Verify that fetch-ec2-metadata correctly decompresses gzip-compressed
EC2 user data. Adds a test helper for reuse by subsequent compression
format tests.