summary refs log tree commit diff
path: root/nixos/tests/taskserver.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-04-12 03:42:13 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-04-12 03:42:13 +0200
commita41b109bc10e66824af5e1f150cb741f9f9399c2 (patch)
tree0cee8f306bd1f8b2a6ad285e9c45c63dec09fb12 /nixos/tests/taskserver.nix
parent9586795ef27ac4d406c10c12f92fc735b5f4ff24 (diff)
downloadnixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.tar
nixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.tar.gz
nixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.tar.bz2
nixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.tar.lz
nixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.tar.xz
nixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.tar.zst
nixpkgs-a41b109bc10e66824af5e1f150cb741f9f9399c2.zip
nixos/taskserver: Don't change imperative users
Whenever the nixos-taskserver tool was invoked manually for creating an
organisation/group/user we now add an empty file called .imperative to
the data directory.

During the preStart of the Taskserver service, we use process-json which
in turn now checks whether those .imperative files exist and if so, it
doesn't do anything with it.

This should now ensure that whenever there is a manually created user,
it doesn't get killed off by the declarative configuration in case it
shouldn't exist within that configuration.

In addition, we also add a small subtest to check whether this is
happening or not and fail if the imperatively created user got deleted
by process-json.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/tests/taskserver.nix')
-rw-r--r--nixos/tests/taskserver.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/tests/taskserver.nix b/nixos/tests/taskserver.nix
index 5d2e030a8f6..79a7703f037 100644
--- a/nixos/tests/taskserver.nix
+++ b/nixos/tests/taskserver.nix
@@ -41,7 +41,8 @@ import ./make-test.nix {
       for my $client ($client1, $client2) {
         $client->nest("initialize client for user $user", sub {
           $client->succeed(
-            su $user, "task rc.confirmation=no config confirmation no"
+            (su $user, "rm -rf /home/$user/.task"),
+            (su $user, "task rc.confirmation=no config confirmation no")
           );
 
           my $exportinfo = $server->succeed(
@@ -156,5 +157,12 @@ import ./make-test.nix {
       $client1->succeed(su "bar", "task add destroy even more >&2");
       $client1->fail(su "bar", "task sync >&2");
     };
+
+    readdImperativeUser;
+
+    subtest "check whether declarative config overrides user bar", sub {
+      restartServer;
+      testSync "bar";
+    };
   '';
 }