summary refs log tree commit diff
path: root/nixos/tests/nextcloud
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-05-24 00:01:06 +0200
committerFlorian Klink <flokli@flokli.de>2020-05-24 01:07:56 +0200
commit75e18ab32379377d445ebee04d355125627e3d19 (patch)
treedb5fa88c5c14a68fe70a88bab51e5da678da2050 /nixos/tests/nextcloud
parentb0b3c30361daafacb8e10acfa3cb1293f421f174 (diff)
downloadnixpkgs-75e18ab32379377d445ebee04d355125627e3d19.tar
nixpkgs-75e18ab32379377d445ebee04d355125627e3d19.tar.gz
nixpkgs-75e18ab32379377d445ebee04d355125627e3d19.tar.bz2
nixpkgs-75e18ab32379377d445ebee04d355125627e3d19.tar.lz
nixpkgs-75e18ab32379377d445ebee04d355125627e3d19.tar.xz
nixpkgs-75e18ab32379377d445ebee04d355125627e3d19.tar.zst
nixpkgs-75e18ab32379377d445ebee04d355125627e3d19.zip
nixosTests.nextcloud: Add davfs2 example to the VM test
Some people use davfs2 to mount a NextCloud instance, so make sure this
works as well.
Diffstat (limited to 'nixos/tests/nextcloud')
-rw-r--r--nixos/tests/nextcloud/basic.nix18
1 files changed, 17 insertions, 1 deletions
diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix
index 92ac5c46e8f..9cbecf01f57 100644
--- a/nixos/tests/nextcloud/basic.nix
+++ b/nixos/tests/nextcloud/basic.nix
@@ -9,7 +9,22 @@ in {
 
   nodes = {
     # The only thing the client needs to do is download a file.
-    client = { ... }: {};
+    client = { ... }: {
+      services.davfs2.enable = true;
+      system.activationScripts.davfs2-secrets = ''
+        echo "http://nextcloud/remote.php/webdav/ ${adminuser} ${adminpass}" > /tmp/davfs2-secrets
+        chmod 600 /tmp/davfs2-secrets
+      '';
+      fileSystems = pkgs.lib.mkVMOverride {
+        "/mnt/dav" = {
+          device = "http://nextcloud/remote.php/webdav/";
+          fsType = "davfs";
+          options = let
+            davfs2Conf = (pkgs.writeText "davfs2.conf" "secrets /tmp/davfs2-secrets");
+          in [ "conf=${davfs2Conf}" "x-systemd.automount" "noauto"];
+        };
+      };
+    };
 
     nextcloud = { config, pkgs, ... }: {
       networking.firewall.allowedTCPPorts = [ 80 ];
@@ -60,5 +75,6 @@ in {
     client.succeed(
         "${withRcloneEnv} ${diffSharedFile}"
     )
+    assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
   '';
 })