summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/common/acme/certs/output/acme.nixos_test.cert.pem11
-rw-r--r--tests/common/acme/certs/output/acme.nixos_test.key.pem25
-rw-r--r--tests/infrastructure/clean.awk13
-rw-r--r--tests/old/README.md (renamed from tests/README.md)16
-rw-r--r--tests/old/by-name/le/less/data/test.file (renamed from tests/by-name/le/less/data/test.file)0
-rw-r--r--tests/old/by-name/le/less/data/test.file.license9
-rw-r--r--tests/old/by-name/le/less/test.desc (renamed from tests/by-name/le/less/test.desc)0
-rw-r--r--tests/old/by-name/le/less/test.desc.license9
-rw-r--r--tests/old/by-name/le/less/test.nix (renamed from tests/by-name/le/less/test.nix)9
-rw-r--r--tests/old/by-name/nv/nvim-checkhealth/test.desc (renamed from tests/by-name/nv/nvim-checkhealth/test.desc)0
-rw-r--r--tests/old/by-name/nv/nvim-checkhealth/test.desc.license9
-rw-r--r--tests/old/by-name/nv/nvim-checkhealth/test.nix (renamed from tests/by-name/nv/nvim-checkhealth/test.nix)9
-rw-r--r--tests/old/by-name/nv/nvim-neorg/data/index.norg (renamed from tests/by-name/nv/nvim-neorg/data/index.norg)0
-rw-r--r--tests/old/by-name/nv/nvim-neorg/data/index.norg.license9
-rw-r--r--tests/old/by-name/nv/nvim-neorg/data/reference.norg (renamed from tests/by-name/nv/nvim-neorg/data/reference.norg)0
-rw-r--r--tests/old/by-name/nv/nvim-neorg/data/reference.norg.license9
-rw-r--r--tests/old/by-name/nv/nvim-neorg/test.desc (renamed from tests/by-name/nv/nvim-neorg/test.desc)0
-rw-r--r--tests/old/by-name/nv/nvim-neorg/test.desc.license9
-rw-r--r--tests/old/by-name/nv/nvim-neorg/test.nix (renamed from tests/by-name/nv/nvim-neorg/test.nix)13
-rw-r--r--tests/old/by-name/ya/yambar/test.desc (renamed from tests/by-name/ya/yambar/test.desc)0
-rw-r--r--tests/old/by-name/ya/yambar/test.desc.license9
-rw-r--r--tests/old/by-name/ya/yambar/test.nix (renamed from tests/by-name/ya/yambar/test.nix)9
-rw-r--r--tests/old/default.nix (renamed from tests/default.nix)9
-rw-r--r--tests/old/infrastructure/clean.awk23
-rw-r--r--tests/old/infrastructure/default.nix (renamed from tests/infrastructure/default.nix)11
-rw-r--r--tests/old/infrastructure/driver.sh (renamed from tests/infrastructure/driver.sh)11
-rw-r--r--tests/old/infrastructure/run.nix (renamed from tests/infrastructure/run.nix)9
27 files changed, 213 insertions, 18 deletions
diff --git a/tests/common/acme/certs/output/acme.nixos_test.cert.pem b/tests/common/acme/certs/output/acme.nixos_test.cert.pem
new file mode 100644
index 00000000..58b4de18
--- /dev/null
+++ b/tests/common/acme/certs/output/acme.nixos_test.cert.pem
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE-----
+MIIBmjCCAUygAwIBAgIUFdLqU4Nnr7S1XID2wC9T77hCOFwwBQYDK2VwMCoxCzAJ
+BgNVBAYTAkVVMRswGQYDVQQKExJWaGFjay5ldSBUZXN0IEtleXMwIBcNMjYxMTI1
+MjEyNzIxWhgPMjM2NDExMjkyMTI3MjFaMB0xGzAZBgNVBAoTElZoYWNrLmV1IFRl
+c3QgS2V5czAqMAUGAytlcAMhAMkG/QPjjHnBb+hbKplpVFB6H+UgW/ZvBvlBT1aE
+0AvDo4GOMIGLMAwGA1UdEwEB/wQCMAAwKwYDVR0RBCQwIoIPYWNtZS5uaXhvc190
+ZXN0gg9hY21lLm5peG9zX3Rlc3QwDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBRo
+0ehOg4DRs1umtKC2Ao1flvI0HjAfBgNVHSMEGDAWgBQixZzNSQAtj5IS+2AEQBEa
+PJoG3jAFBgMrZXADQQAL7KGrXQvFi5Qf68VQmTYush5rKCaplI9Dyx6q2bjY/CdL
+0Ru36eyHML25kHdH1O/uATOUzcQ2ktQr/32rYeEF
+-----END CERTIFICATE-----
diff --git a/tests/common/acme/certs/output/acme.nixos_test.key.pem b/tests/common/acme/certs/output/acme.nixos_test.key.pem
new file mode 100644
index 00000000..6917ca3d
--- /dev/null
+++ b/tests/common/acme/certs/output/acme.nixos_test.key.pem
@@ -0,0 +1,25 @@
+Public Key Info:
+ Public Key Algorithm: EdDSA (Ed25519)
+ Key Security Level: High (256 bits)
+
+curve: Ed25519
+private key:
+ 32:d5:dd:08:b1:9f:8e:6d:6a:dc:7d:95:56:ea:93:2e
+ 8a:58:95:24:ea:83:81:1a:f1:a0:91:67:98:d2:db:58
+
+
+x:
+ c9:06:fd:03:e3:8c:79:c1:6f:e8:5b:2a:99:69:54:50
+ 7a:1f:e5:20:5b:f6:6f:06:f9:41:4f:56:84:d0:0b:c3
+
+
+
+Public Key PIN:
+ pin-sha256:eavyvA0AGilDRJLrGi6ZQbJsvmglZJbNNtu43TccUUU=
+Public Key ID:
+ sha256:79abf2bc0d001a29434492eb1a2e9941b26cbe68256496cd36dbb8dd371c5145
+ sha1:68d1e84e8380d1b35ba6b4a0b6028d5f96f2341e
+
+-----BEGIN PRIVATE KEY-----
+MC4CAQAwBQYDK2VwBCIEIDLV3Qixn45tatx9lVbqky6KWJUk6oOBGvGgkWeY0ttY
+-----END PRIVATE KEY-----
diff --git a/tests/infrastructure/clean.awk b/tests/infrastructure/clean.awk
deleted file mode 100644
index 1208b1ef..00000000
--- a/tests/infrastructure/clean.awk
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- # Shell like comments
- gsub(/^#.*$/, "", $0)
-
- # Strip leading and trailing white space
- gsub(/^[[:blank:]]*/, "", $0)
- gsub(/[[:blank:]]*$/, "", $0)
-
- # Only accept the line, if it contains something
- if (NF) {
- print $0
- }
-}
diff --git a/tests/README.md b/tests/old/README.md
index f789c990..34dc9255 100644
--- a/tests/README.md
+++ b/tests/old/README.md
@@ -1,6 +1,18 @@
+<!--
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+-->
+
# How to write a test
-Test are simple derivations, put into the `by-name` directory. As you
+Test are simple derivations, put into the `by-name` directory. As you
often want to test configuration, the 'standard' nixos-vm-test function
starts a vm with the specified configuration and lets you run a python
test script.
@@ -78,7 +90,7 @@ Sleep for `ARGS` seconds.
#### `Expect`
-Grep the currently visible screen for the regex `ARGS`. This regex
+Grep the currently visible screen for the regex `ARGS`. This regex
must match.
#### `ExpectNot`
diff --git a/tests/by-name/le/less/data/test.file b/tests/old/by-name/le/less/data/test.file
index 9e9f8931..9e9f8931 100644
--- a/tests/by-name/le/less/data/test.file
+++ b/tests/old/by-name/le/less/data/test.file
diff --git a/tests/old/by-name/le/less/data/test.file.license b/tests/old/by-name/le/less/data/test.file.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/le/less/data/test.file.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/le/less/test.desc b/tests/old/by-name/le/less/test.desc
index a0c49e7b..a0c49e7b 100644
--- a/tests/by-name/le/less/test.desc
+++ b/tests/old/by-name/le/less/test.desc
diff --git a/tests/old/by-name/le/less/test.desc.license b/tests/old/by-name/le/less/test.desc.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/le/less/test.desc.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/le/less/test.nix b/tests/old/by-name/le/less/test.nix
index cdd8209c..c9716ffc 100644
--- a/tests/by-name/le/less/test.nix
+++ b/tests/old/by-name/le/less/test.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{mkTest, ...}:
mkTest {
name = "less";
diff --git a/tests/by-name/nv/nvim-checkhealth/test.desc b/tests/old/by-name/nv/nvim-checkhealth/test.desc
index 169cf49f..169cf49f 100644
--- a/tests/by-name/nv/nvim-checkhealth/test.desc
+++ b/tests/old/by-name/nv/nvim-checkhealth/test.desc
diff --git a/tests/old/by-name/nv/nvim-checkhealth/test.desc.license b/tests/old/by-name/nv/nvim-checkhealth/test.desc.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/nv/nvim-checkhealth/test.desc.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/nv/nvim-checkhealth/test.nix b/tests/old/by-name/nv/nvim-checkhealth/test.nix
index 399a25ff..cb04e758 100644
--- a/tests/by-name/nv/nvim-checkhealth/test.nix
+++ b/tests/old/by-name/nv/nvim-checkhealth/test.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
mkTest,
extraModules,
diff --git a/tests/by-name/nv/nvim-neorg/data/index.norg b/tests/old/by-name/nv/nvim-neorg/data/index.norg
index 4d643019..4d643019 100644
--- a/tests/by-name/nv/nvim-neorg/data/index.norg
+++ b/tests/old/by-name/nv/nvim-neorg/data/index.norg
diff --git a/tests/old/by-name/nv/nvim-neorg/data/index.norg.license b/tests/old/by-name/nv/nvim-neorg/data/index.norg.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/nv/nvim-neorg/data/index.norg.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/nv/nvim-neorg/data/reference.norg b/tests/old/by-name/nv/nvim-neorg/data/reference.norg
index b572a469..b572a469 100644
--- a/tests/by-name/nv/nvim-neorg/data/reference.norg
+++ b/tests/old/by-name/nv/nvim-neorg/data/reference.norg
diff --git a/tests/old/by-name/nv/nvim-neorg/data/reference.norg.license b/tests/old/by-name/nv/nvim-neorg/data/reference.norg.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/nv/nvim-neorg/data/reference.norg.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/nv/nvim-neorg/test.desc b/tests/old/by-name/nv/nvim-neorg/test.desc
index bd1e8f49..bd1e8f49 100644
--- a/tests/by-name/nv/nvim-neorg/test.desc
+++ b/tests/old/by-name/nv/nvim-neorg/test.desc
diff --git a/tests/old/by-name/nv/nvim-neorg/test.desc.license b/tests/old/by-name/nv/nvim-neorg/test.desc.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/nv/nvim-neorg/test.desc.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/nv/nvim-neorg/test.nix b/tests/old/by-name/nv/nvim-neorg/test.nix
index ee0e1b52..82cb533d 100644
--- a/tests/by-name/nv/nvim-neorg/test.nix
+++ b/tests/old/by-name/nv/nvim-neorg/test.nix
@@ -1,6 +1,15 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
mkTest,
- extraModules,
+ extra_modules,
pkgs,
...
}:
@@ -25,7 +34,7 @@ mkTest {
};
home-manager.users.soispha = {
imports = [
- extraModules.nixvim.homeManagerModule
+ extra_modules.home.nixvim
];
};
};
diff --git a/tests/by-name/ya/yambar/test.desc b/tests/old/by-name/ya/yambar/test.desc
index 067c201e..067c201e 100644
--- a/tests/by-name/ya/yambar/test.desc
+++ b/tests/old/by-name/ya/yambar/test.desc
diff --git a/tests/old/by-name/ya/yambar/test.desc.license b/tests/old/by-name/ya/yambar/test.desc.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/tests/old/by-name/ya/yambar/test.desc.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/tests/by-name/ya/yambar/test.nix b/tests/old/by-name/ya/yambar/test.nix
index c0e94110..0e4d0033 100644
--- a/tests/by-name/ya/yambar/test.nix
+++ b/tests/old/by-name/ya/yambar/test.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{mkTest, ...}:
mkTest {
name = "yambar";
diff --git a/tests/default.nix b/tests/old/default.nix
index af004feb..d13723b4 100644
--- a/tests/default.nix
+++ b/tests/old/default.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
lib,
nixLib,
diff --git a/tests/old/infrastructure/clean.awk b/tests/old/infrastructure/clean.awk
new file mode 100644
index 00000000..0362d38b
--- /dev/null
+++ b/tests/old/infrastructure/clean.awk
@@ -0,0 +1,23 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
+{
+ # Shell like comments
+ gsub(/^#.*$/, "", $0)
+
+ # Strip leading and trailing white space
+ gsub(/^[[:blank:]]*/, "", $0)
+ gsub(/[[:blank:]]*$/, "", $0)
+
+ # Only accept the line, if it contains something
+ if (NF) {
+ print $0
+ }
+}
diff --git a/tests/infrastructure/default.nix b/tests/old/infrastructure/default.nix
index 9e6ab08c..4696a99f 100644
--- a/tests/infrastructure/default.nix
+++ b/tests/old/infrastructure/default.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
pkgs,
myPkgs,
@@ -38,7 +47,7 @@ nixos-lib.runTest {
machine = {config, ...}: {
imports =
[
- extraModules.home-manager
+ extra_modules.home.home-manager
../../modules/by-name/us/users/module.nix
]
++ configuration.imports;
diff --git a/tests/infrastructure/driver.sh b/tests/old/infrastructure/driver.sh
index 4992b5bc..a8b241d2 100644
--- a/tests/infrastructure/driver.sh
+++ b/tests/old/infrastructure/driver.sh
@@ -1,4 +1,15 @@
#! /usr/bin/env bash
+
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
set -e
msg() {
diff --git a/tests/infrastructure/run.nix b/tests/old/infrastructure/run.nix
index 5bab3dc4..3148a2d9 100644
--- a/tests/infrastructure/run.nix
+++ b/tests/old/infrastructure/run.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
pkgs,
lib,