nixos/nextcloud: Add test for services.nextcloud.disableImagemagick
This commit is contained in:
parent
6e6f5f0923
commit
d83a43a396
|
@ -7,7 +7,7 @@ in {
|
||||||
maintainers = [ globin eqyiel ];
|
maintainers = [ globin eqyiel ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nodes = {
|
nodes = rec {
|
||||||
# The only thing the client needs to do is download a file.
|
# The only thing the client needs to do is download a file.
|
||||||
client = { ... }: {
|
client = { ... }: {
|
||||||
services.davfs2.enable = true;
|
services.davfs2.enable = true;
|
||||||
|
@ -47,6 +47,11 @@ in {
|
||||||
|
|
||||||
environment.systemPackages = [ cfg.services.nextcloud.occ ];
|
environment.systemPackages = [ cfg.services.nextcloud.occ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nextcloudWithoutMagick = args@{ config, pkgs, lib, ... }:
|
||||||
|
lib.mkMerge
|
||||||
|
[ (nextcloud args)
|
||||||
|
{ services.nextcloud.disableImagemagick = true; } ];
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = let
|
testScript = let
|
||||||
|
@ -69,7 +74,8 @@ in {
|
||||||
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
|
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
|
||||||
'';
|
'';
|
||||||
in ''
|
in ''
|
||||||
start_all()
|
nextcloud.start()
|
||||||
|
client.start()
|
||||||
nextcloud.wait_for_unit("multi-user.target")
|
nextcloud.wait_for_unit("multi-user.target")
|
||||||
# This is just to ensure the nextcloud-occ program is working
|
# This is just to ensure the nextcloud-occ program is working
|
||||||
nextcloud.succeed("nextcloud-occ status")
|
nextcloud.succeed("nextcloud-occ status")
|
||||||
|
@ -82,5 +88,13 @@ in {
|
||||||
"${withRcloneEnv} ${diffSharedFile}"
|
"${withRcloneEnv} ${diffSharedFile}"
|
||||||
)
|
)
|
||||||
assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
|
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
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue