summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2018-06-09 07:41:38 +0000
committerOrivej Desh <orivej@gmx.fr>2018-06-09 07:41:38 +0000
commita448357dc62b26c95c3df84a156656e54aaf58b1 (patch)
treef12d66a0b81f2fbaa70db89b516a66bddc1b838c /nixos/tests
parent06fa8674984e8ab637a29b91bdaa11dc5cbacb80 (diff)
parent0e07efa3c53b588dcd2efca8fafb35c779869d4e (diff)
downloadnixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.tar
nixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.tar.gz
nixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.tar.bz2
nixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.tar.lz
nixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.tar.xz
nixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.tar.zst
nixlib-a448357dc62b26c95c3df84a156656e54aaf58b1.zip
Merge branch 'master' into staging
* master: (71 commits)
  xen: enable parallel building
  spice: 0.13.3 -> 0.14.0
  powerline-rs: 0.1.7 -> 0.1.8 (#41736)
  xidlehook: 0.4.6 -> 0.4.8 (#41094)
  serf: update scons patch, enable kerberos on darwin
  firefox-bin: Add ffmpeg to lib path
  firefox-beta-bin: 61.0b10 -> 61.0b12
  firefox-devedition-bin: 61.0b10 -> 61.0b12
  wireguard-go: assign yegortimoshenko as maintainer
  wireguard-go: 0.0.20180519 -> 0.0.20180531
  zfs: Fix "zfs-sync" for modern systemd
  nixos/memcached: added simple set/get test
  jenkins: 2.89.4 -> 2.107.3 (#41618)
  focuswriter: 1.6.12 -> 1.6.13 (#41567)
  ne: 3.0.1 -> 3.1.1 (#41536)
  libpqxx: 6.2.3 -> 6.2.4 (#41547)
  mate.mate-applets: 1.20.1 -> 1.20.2 (#41546)
  mate.mate-themes: 3.22.16 -> 3.22.17 (#41541)
  nixos/munge: run munge as user munge instead of root. (#41509)
  pstoedit: 3.71 -> 3.73 (#41528)
  ...
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/haproxy.nix41
-rw-r--r--nixos/tests/memcached.nix28
-rw-r--r--nixos/tests/slurm.nix1
3 files changed, 70 insertions, 0 deletions
diff --git a/nixos/tests/haproxy.nix b/nixos/tests/haproxy.nix
new file mode 100644
index 000000000000..ce4094237db2
--- /dev/null
+++ b/nixos/tests/haproxy.nix
@@ -0,0 +1,41 @@
+import ./make-test.nix ({ pkgs, ...}: {
+  name = "haproxy";
+  nodes = {
+    machine = { config, ...}: {
+      imports = [ ../modules/profiles/minimal.nix ];
+      services.haproxy = {
+        enable = true;
+        config = ''
+          defaults
+            timeout connect 10s
+
+          backend http_server
+            mode http
+            server httpd [::1]:8000
+
+          frontend http
+            bind *:80
+            mode http
+            use_backend http_server
+        '';
+      };
+      services.httpd = {
+        enable = true;
+        documentRoot = pkgs.writeTextDir "index.txt" "We are all good!";
+        adminAddr = "notme@yourhost.local";
+        listen = [{
+          ip = "::1";
+          port = 8000;
+        }];
+      };
+    };
+  };
+  testScript = ''
+    startAll;
+    $machine->waitForUnit('multi-user.target');
+    $machine->waitForUnit('haproxy.service');
+    $machine->waitForUnit('httpd.service');
+    $machine->succeed('curl -k http://localhost:80/index.txt | grep "We are all good!"');
+
+  '';
+})
diff --git a/nixos/tests/memcached.nix b/nixos/tests/memcached.nix
new file mode 100644
index 000000000000..f9ef3647bd1a
--- /dev/null
+++ b/nixos/tests/memcached.nix
@@ -0,0 +1,28 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "memcached";
+
+  nodes = {
+    machine =
+      { config, pkgs, ... }:
+      {
+        imports = [ ../modules/profiles/minimal.nix ];
+        services.memcached.enable = true;
+      };
+  };
+
+  testScript = let
+    testScript = pkgs.writeScript "testScript.py" ''
+      #!${pkgs.python3.withPackages (p: [p.memcached])}/bin/python
+
+      import memcache
+      c = memcache.Client(['localhost:11211'])
+      c.set('key', 'value')
+      assert 'value' == c.get('key')
+    '';
+  in ''
+    startAll;
+    $machine->waitForUnit("memcached.service");
+    $machine->waitForOpenPort("11211");
+    $machine->succeed("${testScript}");
+  '';
+})
diff --git a/nixos/tests/slurm.nix b/nixos/tests/slurm.nix
index c23d85e40020..ec67ea092874 100644
--- a/nixos/tests/slurm.nix
+++ b/nixos/tests/slurm.nix
@@ -61,6 +61,7 @@ in {
     $node->succeed("mkdir /etc/munge");
     $node->succeed("echo '${mungekey}' > /etc/munge/munge.key");
     $node->succeed("chmod 0400 /etc/munge/munge.key");
+    $node->succeed("chown munge:munge /etc/munge/munge.key");
     $node->succeed("systemctl restart munged");
   }