summary refs log tree commit diff
path: root/nixos/tests/common
Commit message (Collapse)AuthorAge
* nixos/tests/lxd: move into subdir, use minimal init, remove sleepsAdam Stephens2023-08-17
|
* nixos/tests: use sensible key type for gpg keyringnikstur2023-07-26
| | | | | If someone blindly copies this code, at least they have a sensible key type.
* nixos/tests: refactor gpg-keyring test utilitynikstur2023-07-26
|
* treewide: use lib.optional instead of 'then []'Felix Buehler2023-07-12
|
* nixos/qemu-vm: use persistent block device namesnikstur2023-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | This change removes the bespoke logic around identifying block devices. Instead of trying to find the right device by iterating over `qemu.drives` and guessing the right partition number (e.g. /dev/vda{1,2}), devices are now identified by persistent names provided by udev in /dev/disk/by-*. Before this change, the root device was formatted on demand in the initrd. However, this makes it impossible to use filesystem identifiers to identify devices. Now, the formatting step is performed before the VM is started. Because some tests, however, rely on this behaviour, a utility function to replace this behaviour in added in /nixos/tests/common/auto-format-root-device.nix. Devices that contain neither a partition table nor a filesystem are identified by their hardware serial number which is injecetd via QEMU (and is thus persistent and predictable). PCI paths are not a reliably way to identify devices because their availability and numbering depends on the QEMU machine type. This change makes the module more robust against changes in QEMU and the kernel (non-persistent device naming) and by decoupling abstractions (i.e. rootDevice, bootPartition, and bootLoaderDevice) enables further improvement down the line.
* nixos/tests/common/auto.nix: get rid of `with lib`Anderson Torres2023-05-12
|
* nixos/tests/common/acme/server/default.nix: get rid of `with lib`Anderson Torres2023-05-12
|
* nixos/tests/ec2: Fix test toolingLeon Barrett2023-04-16
| | | | | | | | This change fixes two problems with the qemu testing code: 1. Previously, the qemu-img command was missing a disk image format argument. 2. Previously, if a test assertion failed, the test hung because the VM was not torn down.
* nixos/tests/acme/generate-certs: deprecate phasesFelix Buehler2023-01-12
|
* nixos: fix typosfigsoda2022-12-17
|
* nixos/tests/acme/server: generate certs with longer validityajs1242022-11-21
|
* nixos/tests/acme/server: patch certificate generation for longer validityajs1242022-11-21
|
* nixos/tests/acme/server: regenerate certsajs1242022-11-20
| | | | expired today
* nixos/acme: Disable lego renew sleepingLucas Savva2022-10-06
| | | | | | | | | | | Lego has a built-in mechanism for sleeping for a random amount of time before renewing a certificate. In our environment this is not only unnecessary (as our systemd timer takes care of it) but also unwanted since it slows down the execution of the systemd service encompassing it, thus also slowing down the start up of any services its depending on. Also added FixedRandomDelay to the timer for more predictability.
* nixos/acme: Make account creds check more robustLucas Savva2022-10-06
| | | | | | | | | Fixes #190493 Check if an actual key file exists. This does not completely cover the work accountHash does to ensure that a new account is registered when account related options are changed.
* nixosTests.acme: Use module system based runnerRobert Hensing2022-09-21
|
* nixos/*: convert internal option descriptions to MDpennae2022-08-31
| | | | we'll have to do it eventually, may as well be now.
* nixos/*: automatically convert option descriptionspennae2022-08-31
| | | | | | | | | | | | conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
* nixos/lxd: improve testsPatryk Wychowaniec2022-05-03
| | | | | | | | | - Make tests/lxd.nix use NixOS's lxdMeta & lxdImage to avoid relying on 3rd party containers such as Alpine Linux for testing purposes. - Merge tests/lxd-image.nix into tests/lxd.nix, since now both have a similar structure. - Extract duplicated inline LXD configuration into a separate file, - Add passthru.lxd-nftables & passthru.lxd-image-server.
* nixos/acme: Add defaults and inheritDefaults optionLucas Savva2021-12-26
| | | | | | | | | | | | | | | | | | | | | Allows configuring many default settings for certificates, all of which can still be overridden on a per-cert basis. Some options have been moved into .defaults from security.acme, namely email, server, validMinDays and renewInterval. These changes will not break existing configurations thanks to mkChangedOptionModule. With this, it is also now possible to configure DNS-01 with web servers whose virtualHosts utilise enableACME. The only requirement is you set `acmeRoot = null` for each vhost. The test suite has been revamped to cover these additions and also to generally make it easier to maintain. Test config for apache and nginx has been fully standardised, and it is now much easier to add a new web server if it follows the same configuration patterns as those two. I have also optimised the use of switch-to-configuration which should speed up testing.
* nixos/qemu-vm: default memorySize 384 -> 1024Artturin2021-11-21
| | | | | | | | | the default hasn't been changed since 2009 this can improve our test performances nixos/tests: remove explicit memorySize <1024 1024MiB is now the default
* nixos/tests/vscodium-wayland: initPatrick Hilhorst2021-11-19
|
* nixos/test: some test fixes in succession of #125992David Arnold2021-08-20
|
* nixos/tests/acme: Hard code test certificatesLucas Savva2020-10-22
| | | | The added README.md explains why this has been done.
* nixos/acme: Fix ocspMustStaple option and add testLucas Savva2020-10-07
| | | | | Some of the testing setup for OCSP checking was wrong and has been fixed too.
* nixosTests.ec2-config: avoid an evaluation problemVladimír Čunát2020-10-03
| | | | | The problem was introduced by commit 97a32bc (within PR #79696). nixos/tests/common/ec2.nix:6:17 called with unexpected argument 'meta'
* nixos/acme: Restructure moduleLucas Savva2020-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use an acme user and group, allow group override only - Use hashes to determine when certs actually need to regenerate - Avoid running lego more than necessary - Harden permissions - Support "systemctl clean" for cert regeneration - Support reuse of keys between some configuration changes - Permissions fix services solves for previously root owned certs - Add a note about multiple account creation and emails - Migrate extraDomains to a list - Deprecate user option - Use minica for self-signed certs - Rewrite all tests I thought of a few more cases where things may go wrong, and added tests to cover them. In particular, the web server reload services were depending on the target - which stays alive, meaning that the renewal timer wouldn't be triggering a reload and old certs would stay on the web servers. I encountered some problems ensuring that the reload took place without accidently triggering it as part of the test. The sync commands I added ended up being essential and I'm not sure why, it seems like either node.succeed ends too early or there's an oddity of the vm's filesystem I'm not aware of. - Fix duplicate systemd rules on reload services Since useACMEHost is not unique to every vhost, if one cert was reused many times it would create duplicate entries in ${server}-config-reload.service for wants, before and ConditionPathExists
* nixos/acme: fix subjectAltName in test snakeoil certsJamie McClymont2020-08-24
|
* nixosTests.ec2: Port tests that depend on common/ec2.nixJacek Galowicz2020-08-23
|
* nixos/displayManager: make autoLogin options independent of DM typeworldofpeace2020-07-09
| | | | Co-authored-by: volth <volth@volth.com>
* nixos/tests/common/acme: don't set nameservers for clientEmily2020-04-18
| | | | | The resolver is mainly useful for the ACME server, and acme.nix uses its own DNS server to test DNS-01 challenges.
* nixos/tests/common/acme: enable Pebble strict modeEmily2020-04-18
| | | | | | | | This lets us get early warning about any bugs or backwards-compatibility hazards in lego. Pebble will default to this in the future, but doesn't currently; see https://github.com/letsencrypt/pebble/blob/v2.3.0/README.md#strict-mode.
* nixos/tests/acme: use CAP_NET_BIND_SERVICEEmily2020-04-18
|
* nixos/tests/acme: use *.test domainsEmily2020-04-18
| | | | | | | | | | | | | | | | | | | | | Shimming out the Let's Encrypt domain name to reuse client configuration doesn't work properly (Pebble uses different endpoint URL formats), is recommended against by upstream,[1] and is unnecessary now that the ACME module supports specifying an ACME server. This commit changes the tests to use the domain name acme.test instead, and renames the letsencrypt node to acme to reflect that it has nothing to do with the ACME server that Let's Encrypt runs. The imports are renamed for clarity: * nixos/tests/common/{letsencrypt => acme}/{common.nix => client} * nixos/tests/common/{letsencrypt => acme}/{default.nix => server} The test's other domain names are also adjusted to use *.test for consistency (and to avoid misuse of non-reserved domain names such as standalone.com). [1] https://github.com/letsencrypt/pebble/issues/283#issuecomment-545123242 Co-authored-by: Yegor Timoshenko <yegortimoshenko@riseup.net>
* nixos/acme: Update release note, remove redundant requiresLucas Savva2020-02-09
|\ | | | | | | Merge remote-tracking branch 'remotes/upstream/master'
| * nixos/display-managers/auto: removeworldofpeace2020-01-29
| | | | | | | | | | | | | | | | This module allows root autoLogin, so we would break that for users, but they shouldn't be using it anyways. This gives the impression like auto is some special display manager, when it's just lightdm and special pam rules to allow root autoLogin. It was created for NixOS's testing so I believe this is where it belongs.
| * nixos/tests/ec2: return to passing stateAndrew Childs2020-01-13
| | | | | | | | | | | | | | | | | | | | | | | | Updates required: - Use vpc image format (new default, supported by Amazon) - Pass full image filename to makeEc2Test - Increase memory allocation for nixos-rebuild - Set a networking.hostName for services.httpd - Add appropriate escaping in literal userdata While I'm here, try to make it fail fast.
* | nixos/acme: add dns-01 test, fix cert locating bugLucas Savva2020-02-09
|/
* nixos/tests/user-account: add static uid for aliceworldofpeace2019-12-21
| | | | | | A lot of tests assume that the alice user will have a uid of 1000. Let's make that a guarantee and be able to reference this value.
* nixos/displayManager: deprecate separate options for default wm/dmJan Tojnar2019-12-15
| | | | | | | | | | | The upstream session files display managers use have no concept of sessions being composed from desktop manager and window manager. To be able to set upstream session files as default session, we need a single option. Having two different ways to set default session would be confusing, though, so we decided to deprecate the old method. We also created separate script for each session, just like we already had a separate desktop file for each one, and started using displayManager.sessionPackages mechanism to make the session handling more uniform.
* nixos/tests/acme.nix: remove pebble custom endpoint patchFélix Baylac-Jacqué2019-10-30
| | | | | | | | The recent custom endpoint addition allows us to directly point certbot to the custom Pebble directory endpoint. Thanks to that, we can ditch the Pebble patch we were using so far; making this test maintenance easier.
* nixos/tests/letsencrypt: use Pebble instead of BoulderFélix Baylac-Jacqué2019-10-23
| | | | | | | | | | | | | | | Let's encrypt bumped ACME to V2. We need to update our nixos test to be compatible with this new protocol version. We decided to drop the Boulder ACME server in favor of the more integration test friendly Pebble. - overriding cacert not necessary - this avoids rebuilding lots of packages needlessly - nixos/tests/acme: use pebble's ca for client tests - pebble always generates its own ca which has to be fetched TODO: write proper commit msg :)
* treewide: name -> pname (easy cases) (#66585)volth2019-08-15
| | | | | | | | | treewide replacement of stdenv.mkDerivation rec { name = "*-${version}"; version = "*"; to pname
* nixos/tests/acme: Use exact match in TOS locationaszlig2019-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the switch to check the nginx config with gixy in 59fac1a6d7e1983a1e7bd518129ff9ef39a013dd, the ACME test doesn't build anymore, because gixy reports the following false-positive (reindented): >> Problem: [alias_traversal] Path traversal via misconfigured alias. Severity: MEDIUM Description: Using alias in a prefixed location that doesn't ends with directory separator could lead to path traversal vulnerability. Additional info: https://github.com/yandex/gixy/blob/master/docs/en/plugins/aliastraversal.md Pseudo config: server { server_name letsencrypt.org; location /documents/2017.11.15-LE-SA-v1.2.pdf { alias /nix/store/y4h5ryvnvxkajkmqxyxsk7qpv7bl3vq7-2017.11.15-LE-SA-v1.2.pdf; } } The reason this is a false-positive is because the destination is not a directory, so something like "/foo.pdf../other.txt" won't work here, because the resulting path would be ".../destfile.pdf../other.txt". Nevertheless it's a good idea to use the exact match operator (=), to not only shut up gixy but also gain a bit of performance in lookup (not that it would matter in our test). Signed-off-by: aszlig <aszlig@nix.build>
* nixos docs: run the formatting tool (no content change)Vladimír Čunát2019-03-22
| | | | As documented in the docs themselves :-)
* nixos/tests/ec2: reuse ssh keys from ssh-keys.nixAntoine Eiche2019-02-11
|
* nova-image: use wget instead of cloud-init (via EC2 API)Antoine Eiche2019-01-28
| | | | | | | | | | | | The Openstack metadata service exposes the EC2 API. We use the existing `ec2.nix` module to configure the hostname and ssh keys of an Openstack Instance. A test checks the ssh server is well configured. This is mainly to reduce the size of the image (700MB). Also, declarative features provided by cloud-init are not really useful since we would prefer to use our `configuration.nix` file instead.
* rss2email module: initLéo Gaspard2018-11-15
| | | | | Also adding `system-sendmail` package for sharing the code with other modules or packages needing it.
* nixos tests: move common configuration into separate fileDomen Kožar2018-09-24
| | | | This allows tests outside nixos to use acme setup.
* fix build with allowAliases=falsevolth2018-07-23
|