about summary refs log tree commit diff
path: root/nixos/tests/common
AgeCommit message (Collapse)AuthorFilesLines
2022-12-17nixos: fix typosfigsoda1-1/+1
2022-11-21nixos/tests/acme/server: generate certs with longer validityajs1244-83/+83
2022-11-21nixos/tests/acme/server: patch certificate generation for longer validityajs1241-1/+5
2022-11-20nixos/tests/acme/server: regenerate certsajs1244-83/+83
expired today
2022-10-06nixos/acme: Disable lego renew sleepingLucas Savva1-5/+0
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.
2022-10-06nixos/acme: Make account creds check more robustLucas Savva1-0/+5
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.
2022-09-21nixosTests.acme: Use module system based runnerRobert Hensing2-5/+5
2022-08-31nixos/*: convert internal option descriptions to MDpennae1-3/+3
we'll have to do it eventually, may as well be now.
2022-08-31nixos/*: automatically convert option descriptionspennae2-8/+8
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.
2022-05-03nixos/lxd: improve testsPatryk Wychowaniec1-0/+24
- 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.
2021-12-26nixos/acme: Add defaults and inheritDefaults optionLucas Savva2-2/+9
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.
2021-11-21nixos/qemu-vm: default memorySize 384 -> 1024Artturin1-1/+0
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
2021-11-19nixos/tests/vscodium-wayland: initPatrick Hilhorst1-0/+14
2021-08-20nixos/test: some test fixes in succession of #125992David Arnold1-0/+1
2020-10-22nixos/tests/acme: Hard code test certificatesLucas Savva8-32/+148
The added README.md explains why this has been done.
2020-10-07nixos/acme: Fix ocspMustStaple option and add testLucas Savva1-1/+1
Some of the testing setup for OCSP checking was wrong and has been fixed too.
2020-10-03nixosTests.ec2-config: avoid an evaluation problemVladimír Čunát1-1/+3
The problem was introduced by commit 97a32bc (within PR #79696). nixos/tests/common/ec2.nix:6:17 called with unexpected argument 'meta'
2020-09-02nixos/acme: Restructure moduleLucas Savva5-286/+79
- 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
2020-08-24nixos/acme: fix subjectAltName in test snakeoil certsJamie McClymont2-153/+155
2020-08-23nixosTests.ec2: Port tests that depend on common/ec2.nixJacek Galowicz1-22/+36
2020-07-09nixos/displayManager: make autoLogin options independent of DM typeworldofpeace1-2/+2
Co-authored-by: volth <volth@volth.com>
2020-04-18nixos/tests/common/acme: don't set nameservers for clientEmily2-6/+2
The resolver is mainly useful for the ACME server, and acme.nix uses its own DNS server to test DNS-01 challenges.
2020-04-18nixos/tests/common/acme: enable Pebble strict modeEmily1-0/+1
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.
2020-04-18nixos/tests/acme: use CAP_NET_BIND_SERVICEEmily1-2/+1
2020-04-18nixos/tests/acme: use *.test domainsEmily8-284/+207
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>
2020-02-09nixos/acme: Update release note, remove redundant requiresLucas Savva3-4/+77
Merge remote-tracking branch 'remotes/upstream/master'
2020-02-09nixos/acme: add dns-01 test, fix cert locating bugLucas Savva1-0/+3
2020-01-29nixos/display-managers/auto: removeworldofpeace2-2/+75
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.
2020-01-13nixos/tests/ec2: return to passing stateAndrew Childs1-2/+2
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.
2019-12-21nixos/tests/user-account: add static uid for aliceworldofpeace1-0/+1
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.
2019-12-15nixos/displayManager: deprecate separate options for default wm/dmJan Tojnar1-4/+4
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.
2019-10-30nixos/tests/acme.nix: remove pebble custom endpoint patchFélix Baylac-Jacqué2-36/+1
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.
2019-10-23nixos/tests/letsencrypt: use Pebble instead of BoulderFélix Baylac-Jacqué5-587/+295
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 :)
2019-08-15treewide: name -> pname (easy cases) (#66585)volth1-2/+2
treewide replacement of stdenv.mkDerivation rec { name = "*-${version}"; version = "*"; to pname
2019-04-06nixos/tests/acme: Use exact match in TOS locationaszlig1-1/+1
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>
2019-03-22nixos docs: run the formatting tool (no content change)Vladimír Čunát1-7/+19
As documented in the docs themselves :-)
2019-02-11nixos/tests/ec2: reuse ssh keys from ssh-keys.nixAntoine Eiche1-12/+0
2019-01-28nova-image: use wget instead of cloud-init (via EC2 API)Antoine Eiche1-0/+61
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.
2018-11-15rss2email module: initLéo Gaspard1-0/+15
Also adding `system-sendmail` package for sharing the code with other modules or packages needing it.
2018-09-24nixos tests: move common configuration into separate fileDomen Kožar1-0/+27
This allows tests outside nixos to use acme setup.
2018-07-23fix build with allowAliases=falsevolth1-2/+2
2018-07-20[bot] nixos/*: remove unused arguments in lambdasvolth1-1/+1
2018-07-12nixos/tests/letsencrypt: Hardcode certs and keysaszlig5-51/+341
In 0c7c1660f78e4f6befe0a210e1a9efae783a1733 I have set allowSubstitutes to false, which avoided the substitution of the certificates. Unfortunately substitution may still happen later when the certificate is merged with the CA bundle. So the merged CA bundle might be substituted from a binary cache but the certificate itself is built locally, which could result in a different certificate in the bundle. So instead of adding just yet another workaround, I've now hardcoded all the certificates and keys in a separate file. This also moves letsencrypt.nix into its own directory so we don't mess up nixos/tests/common too much. This was long overdue and should finally make the dependency graph for the ACME test more deterministic. Signed-off-by: aszlig <aszlig@nix.build>
2018-07-12nixos/tests/letsencrypt: Fix go source installaszlig1-0/+15
Since e95f17e2720e67e2eabd59d7754c814d3e27a0b2, Go packages no longer contain the source tree, however Boulder seems to need that as it generates a few files during build. Ideally we would only pick the files that are needed and put it into a separate output, but I currently don't have time for this so I'm marking this with XXX to get back to it later. Signed-off-by: aszlig <aszlig@nix.build>
2018-07-02Merge pull request #42798 from flokli/users-usersMichael Raskin1-2/+2
tree-wide: users.extraUsers -> users.users, users.extraGroups -> users.groups
2018-06-30nixos/tests/letsencrypt: Don't substitute certsaszlig1-0/+2
If one of the certificates of the chain gets substituted from a binary cache and the rest is generated locally it might turn out that we get invalid certificates, which in turn cause tests using this module to fail. So let's set allowSubstitutes to false for all derivations that are involved with certificate/key generation. Signed-off-by: aszlig <aszlig@nix.build>
2018-06-30nixos/tests: users.(extraUsers|extraGroup->users|group)Florian Klink1-2/+2
2018-05-13nixos/tests/acme: fix on i686, improve timing (#40410)xeji1-0/+4
... to prevent non-deterministic failures
2018-03-08nixos/tests/acme: use mail-test-srv tls certs from sourceSarah Brofeldt1-1/+5
2018-03-08nixos/tests/acme: go compat update, unvendor pkcs11Sarah Brofeldt1-3/+15