about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2022-11-25 14:48:48 +0300
committerManuel Bärenz <programming@manuelbaerenz.de>2022-11-25 15:00:19 +0100
commit5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb (patch)
tree874dd4f8748bae801bb1281e081377ce425286cc /nixos
parente8927f2631084705318d97794334cb7ffe70aa1a (diff)
downloadnixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.tar
nixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.tar.gz
nixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.tar.bz2
nixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.tar.lz
nixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.tar.xz
nixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.tar.zst
nixlib-5cfb7fb7165b988b391e4d721fc4db4ff17d6fbb.zip
nixos/tests/mastodon: update test
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/web-apps/mastodon.nix30
1 files changed, 12 insertions, 18 deletions
diff --git a/nixos/tests/web-apps/mastodon.nix b/nixos/tests/web-apps/mastodon.nix
index 528246a684a2..d3d53dc31946 100644
--- a/nixos/tests/web-apps/mastodon.nix
+++ b/nixos/tests/web-apps/mastodon.nix
@@ -7,7 +7,7 @@ let
   '';
 
   hosts = ''
-    192.168.2.11 mastodon.local
+    192.168.2.101 mastodon.local
   '';
 
 in
@@ -23,7 +23,7 @@ in
       networking = {
         interfaces.eth1 = {
           ipv4.addresses = [
-            { address = "192.168.2.11"; prefixLength = 24; }
+            { address = "192.168.2.101"; prefixLength = 24; }
           ];
         };
         extraHosts = hosts;
@@ -45,16 +45,6 @@ in
         configureNginx = true;
         localDomain = "mastodon.local";
         enableUnixSocket = false;
-        redis = {
-          createLocally = true;
-          host = "127.0.0.1";
-          port = 31637;
-        };
-        database = {
-          createLocally = true;
-          host = "/run/postgresql";
-          port = 5432;
-        };
         smtp = {
           createLocally = false;
           fromAddress = "mastodon@mastodon.local";
@@ -78,7 +68,7 @@ in
       networking = {
         interfaces.eth1 = {
           ipv4.addresses = [
-            { address = "192.168.2.12"; prefixLength = 24; }
+            { address = "192.168.2.102"; prefixLength = 24; }
           ];
         };
         extraHosts = hosts;
@@ -93,9 +83,6 @@ in
   testScript = ''
     start_all()
 
-    # Check that mastodon-media-auto-remove is scheduled
-    server.succeed("systemctl status mastodon-media-auto-remove.timer")
-
     server.wait_for_unit("nginx.service")
     server.wait_for_unit("redis-mastodon.service")
     server.wait_for_unit("postgresql.service")
@@ -105,10 +92,17 @@ in
     server.wait_for_open_port(55000)
     server.wait_for_open_port(55001)
 
+    # Check that mastodon-media-auto-remove is scheduled
+    server.succeed("systemctl status mastodon-media-auto-remove.timer")
+
     # Check Mastodon version from remote client
     client.succeed("curl --fail https://mastodon.local/api/v1/instance | jq -r '.version' | grep '${pkgs.mastodon.version}'")
 
-    # Check using admin CLI
+    # Check access from remote client
+    client.succeed("curl --fail https://mastodon.local/about | grep 'Mastodon hosted on mastodon.local'")
+    client.succeed("curl --fail $(curl https://mastodon.local/api/v1/instance 2> /dev/null | jq -r .thumbnail) --output /dev/null")
+
+    # Simple check tootctl commands
     # Check Mastodon version
     server.succeed("su - mastodon -s /bin/sh -c 'mastodon-env tootctl version' | grep '${pkgs.mastodon.version}'")
 
@@ -125,7 +119,7 @@ in
     # Manage IP access
     server.succeed("su - mastodon -s /bin/sh -c 'mastodon-env tootctl ip_blocks add 192.168.0.0/16 --severity=no_access'")
     server.succeed("su - mastodon -s /bin/sh -c 'mastodon-env tootctl ip_blocks export' | grep '192.168.0.0/16'")
-    server.fail("su - mastodon -s /bin/sh -c 'mastodon-env tootctl p_blocks export' | grep '172.16.0.0/16'")
+    server.fail("su - mastodon -s /bin/sh -c 'mastodon-env tootctl ip_blocks export' | grep '172.16.0.0/16'")
     client.fail("curl --fail https://mastodon.local/about")
     server.succeed("su - mastodon -s /bin/sh -c 'mastodon-env tootctl ip_blocks remove 192.168.0.0/16'")
     client.succeed("curl --fail https://mastodon.local/about")