summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorBenjamin Koch <bbbsnowball@gmail.com>2021-03-09 01:44:18 +0100
committerBenjamin Koch <bbbsnowball@gmail.com>2021-03-09 01:44:18 +0100
commitd83a43a396c7ec5ac2cd633262648306e25c6789 (patch)
treef02f0fe8c127e1995f3c6a2d3d9410fa5d87c4f6 /nixos
parent6e6f5f09234d3744eb87c92b95f4a795867676f9 (diff)
nixos/nextcloud: Add test for services.nextcloud.disableImagemagick
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/nextcloud/basic.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix
index 0b8e1937128c..5d31165208cb 100644
--- a/nixos/tests/nextcloud/basic.nix
+++ b/nixos/tests/nextcloud/basic.nix
@@ -7,7 +7,7 @@ in {
maintainers = [ globin eqyiel ];
};
- nodes = {
+ nodes = rec {
# The only thing the client needs to do is download a file.
client = { ... }: {
services.davfs2.enable = true;
@@ -47,6 +47,11 @@ in {
environment.systemPackages = [ cfg.services.nextcloud.occ ];
};
+
+ nextcloudWithoutMagick = args@{ config, pkgs, lib, ... }:
+ lib.mkMerge
+ [ (nextcloud args)
+ { services.nextcloud.disableImagemagick = true; } ];
};
testScript = let
@@ -69,7 +74,8 @@ in {
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
'';
in ''
- start_all()
+ nextcloud.start()
+ client.start()
nextcloud.wait_for_unit("multi-user.target")
# This is just to ensure the nextcloud-occ program is working
nextcloud.succeed("nextcloud-occ status")
@@ -82,5 +88,13 @@ in {
"${withRcloneEnv} ${diffSharedFile}"
)
assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
+
+ #client.succeed("nix path-info -r " + nextcloud.script + " | grep imagick")
+ #client.fail("nix path-info -r " + nextcloudWithoutMagick.script + " | grep imagick")
+ assert os.system("nix path-info -r " + nextcloud.script + " | grep imagick") == 0
+ assert (
+ os.system("nix path-info -r " + nextcloudWithoutMagick.script + " | grep imagick")
+ != 0
+ )
'';
})