about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/tomcat.nix9
-rw-r--r--nixos/tests/vaultwarden.nix4
-rw-r--r--nixos/tests/wg-access-server.nix28
4 files changed, 38 insertions, 4 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index d9551c33d8f6a..ad9025a917c38 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -1042,6 +1042,7 @@ in {
   wiki-js = handleTest ./wiki-js.nix {};
   wine = handleTest ./wine.nix {};
   wireguard = handleTest ./wireguard {};
+  wg-access-server = handleTest ./wg-access-server.nix {};
   without-nix = handleTest ./without-nix.nix {};
   wmderland = handleTest ./wmderland.nix {};
   workout-tracker = handleTest ./workout-tracker.nix {};
diff --git a/nixos/tests/tomcat.nix b/nixos/tests/tomcat.nix
index df5cb033b78f0..c5e6e65ac600e 100644
--- a/nixos/tests/tomcat.nix
+++ b/nixos/tests/tomcat.nix
@@ -5,23 +5,24 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
   nodes.machine = { pkgs, ... }: {
     services.tomcat = {
       enable = true;
+      port = 8001;
       axis2.enable = true;
     };
   };
 
   testScript = ''
     machine.wait_for_unit("tomcat.service")
-    machine.wait_for_open_port(8080)
+    machine.wait_for_open_port(8001)
     machine.wait_for_file("/var/tomcat/webapps/examples");
 
     machine.succeed(
-        "curl -sS --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
+        "curl -sS --fail http://localhost:8001/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
     )
     machine.succeed(
-        "curl -sS --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
+        "curl -sS --fail http://localhost:8001/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
     )
     machine.succeed(
-        "curl -sS --fail http://localhost:8080/axis2/axis2-web/HappyAxis.jsp | grep 'Found Axis2'"
+        "curl -sS --fail http://localhost:8001/axis2/axis2-web/HappyAxis.jsp | grep 'Found Axis2'"
     )
   '';
 })
diff --git a/nixos/tests/vaultwarden.nix b/nixos/tests/vaultwarden.nix
index baefa67dbf535..a60cb3af5535c 100644
--- a/nixos/tests/vaultwarden.nix
+++ b/nixos/tests/vaultwarden.nix
@@ -208,6 +208,10 @@ builtins.mapAttrs (k: v: makeVaultwardenTest k v) {
           server.succeed('[ -d "/var/lib/vaultwarden/backups" ]')
           server.succeed('[ -f "/var/lib/vaultwarden/backups/db.sqlite3" ]')
           server.succeed('[ -d "/var/lib/vaultwarden/backups/attachments" ]')
+          server.succeed('[ -f "/var/lib/vaultwarden/backups/rsa_key.pem" ]')
+          server.succeed('[ -f "/var/lib/vaultwarden/backups/rsa_key.pub.pem" ]')
+          # Ensure only the db backed up with the backup command exists and not the other db files.
+          server.succeed('[ ! -f "/var/lib/vaultwarden/backups/db.sqlite3-shm" ]')
     '';
   };
 }
diff --git a/nixos/tests/wg-access-server.nix b/nixos/tests/wg-access-server.nix
new file mode 100644
index 0000000000000..84fdf43e7943b
--- /dev/null
+++ b/nixos/tests/wg-access-server.nix
@@ -0,0 +1,28 @@
+import ./make-test-python.nix ({ pkgs, lib, kernelPackages ? null, ... }:
+{
+  name = "wg-access-server";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ xanderio ];
+  };
+
+  nodes = {
+    server = {
+      services.wg-access-server = {
+        enable = true;
+        settings = {
+          adminUsername = "admin";
+        };
+        secretsFile = (pkgs.writers.writeYAML "secrets.yaml" {
+          adminPassword = "hunter2";
+        });
+      };
+    };
+  };
+
+  testScript = ''
+    start_all()
+
+    server.wait_for_unit("wg-access-server.service")
+  '';
+}
+)