summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2023-06-18 11:14:54 +0200
committerGitHub <noreply@github.com>2023-06-18 11:14:54 +0200
commit30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea (patch)
tree1ff5d0aebaaa0bc71ebc81b390488ae316945e45 /nixos
parent6069d0b4972eb6c7b0c4b29cf9d19d91edce742f (diff)
parentcac7282c17494c669d7e42cdad70da428e1f045a (diff)
downloadnixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.tar
nixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.tar.gz
nixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.tar.bz2
nixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.tar.lz
nixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.tar.xz
nixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.tar.zst
nixpkgs-30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea.zip
Merge pull request #238250 from Ma27/nextcloud-declarative-test-fix
nixos/tests/nextcloud: fix more issues related to redis tests
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix15
-rw-r--r--nixos/tests/nextcloud/with-postgresql-and-redis.nix3
2 files changed, 13 insertions, 5 deletions
diff --git a/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix b/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix
index 80151947800..915fa58ab14 100644
--- a/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix
+++ b/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix
@@ -1,4 +1,5 @@
-import ../make-test-python.nix ({ pkgs, ...}: let
+args@{ nextcloudVersion ? 27, ... }:
+(import ../make-test-python.nix ({ pkgs, ...}: let
   username = "custom_admin_username";
   # This will be used both for redis and postgresql
   pass = "hunter2";
@@ -9,7 +10,7 @@ import ../make-test-python.nix ({ pkgs, ...}: let
 in {
   name = "nextcloud-with-declarative-redis";
   meta = with pkgs.lib.maintainers; {
-    maintainers = [ eqyiel ];
+    maintainers = [ eqyiel ma27 ];
   };
 
   nodes = {
@@ -22,6 +23,7 @@ in {
       services.nextcloud = {
         enable = true;
         hostName = "nextcloud";
+        package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
         caching = {
           apcu = false;
           redis = true;
@@ -47,8 +49,11 @@ in {
         configureRedis = true;
       };
 
-      services.redis.servers."nextcloud".enable = true;
-      services.redis.servers."nextcloud".port = 6379;
+      services.redis.servers."nextcloud" = {
+        enable = true;
+        port = 6379;
+        requirePass = "secret";
+      };
 
       systemd.services.nextcloud-setup= {
         requires = ["postgresql.service"];
@@ -114,4 +119,4 @@ in {
     # redis cache should not be empty
     nextcloud.fail('test "[]" = "$(redis-cli --json KEYS "*")"')
   '';
-})
+})) args
diff --git a/nixos/tests/nextcloud/with-postgresql-and-redis.nix b/nixos/tests/nextcloud/with-postgresql-and-redis.nix
index 1cbb1310428..a91208e6cdc 100644
--- a/nixos/tests/nextcloud/with-postgresql-and-redis.nix
+++ b/nixos/tests/nextcloud/with-postgresql-and-redis.nix
@@ -89,5 +89,8 @@ in {
         "${withRcloneEnv} ${diffSharedFile}"
     )
     nextcloud.wait_until_succeeds("journalctl -u nextcloud-notify_push | grep -q \"Sending ping to ${adminuser}\"")
+
+    # redis cache should not be empty
+    nextcloud.fail('test "[]" = "$(redis-cli --json KEYS "*")"')
   '';
 })) args