about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2019-09-02 23:25:24 +0200
committerVladimír Čunát <v@cunat.cz>2019-09-02 23:25:24 +0200
commitf21211ebfe21797c6f0444d42ec7cb835c737388 (patch)
tree816465981f650242d4b22e0f01b912917e7008f8 /nixos/tests
parentb291f2a9953d48d6edc5c73776db9ba289ccf213 (diff)
parent12ae04518b004adf949a43125954b99c05189e6f (diff)
Merge branch 'master' into staging
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix2
-rw-r--r--nixos/tests/fontconfig-default-fonts.nix28
-rw-r--r--nixos/tests/hocker-fetchdocker/machine.nix4
-rw-r--r--nixos/tests/redis.nix26
4 files changed, 58 insertions, 2 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 557ee78df7c69..8ee4dfbf13bc5 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -87,6 +87,7 @@ in
   flatpak = handleTest ./flatpak.nix {};
   flatpak-builder = handleTest ./flatpak-builder.nix {};
   fluentd = handleTest ./fluentd.nix {};
+  fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
   fsck = handleTest ./fsck.nix {};
   fwupd = handleTestOn ["x86_64-linux"] ./fwupd.nix {}; # libsmbios is unsupported on aarch64
   gdk-pixbuf = handleTest ./gdk-pixbuf.nix {};
@@ -233,6 +234,7 @@ in
   rabbitmq = handleTest ./rabbitmq.nix {};
   radarr = handleTest ./radarr.nix {};
   radicale = handleTest ./radicale.nix {};
+  redis = handleTest ./redis.nix {};
   redmine = handleTest ./redmine.nix {};
   roundcube = handleTest ./roundcube.nix {};
   rspamd = handleTest ./rspamd.nix {};
diff --git a/nixos/tests/fontconfig-default-fonts.nix b/nixos/tests/fontconfig-default-fonts.nix
new file mode 100644
index 0000000000000..1991cec92189f
--- /dev/null
+++ b/nixos/tests/fontconfig-default-fonts.nix
@@ -0,0 +1,28 @@
+import ./make-test.nix ({ lib, ... }:
+{
+  name = "fontconfig-default-fonts";
+
+  machine = { config, pkgs, ... }: {
+    fonts.enableDefaultFonts = true; # Background fonts
+    fonts.fonts = with pkgs; [
+      noto-fonts-emoji
+      cantarell-fonts
+      twitter-color-emoji
+      source-code-pro
+      gentium
+    ];
+    fonts.fontconfig.defaultFonts = {
+      serif = [ "Gentium Plus" ];
+      sansSerif = [ "Cantarell" ];
+      monospace = [ "Source Code Pro" ];
+      emoji = [ "Twitter Color Emoji" ];
+    };
+  };
+
+  testScript = ''
+    $machine->succeed("fc-match serif | grep '\"Gentium Plus\"'");
+    $machine->succeed("fc-match sans-serif | grep '\"Cantarell\"'");
+    $machine->succeed("fc-match monospace | grep '\"Source Code Pro\"'");
+    $machine->succeed("fc-match emoji | grep '\"Twitter Color Emoji\"'");
+  '';
+})
diff --git a/nixos/tests/hocker-fetchdocker/machine.nix b/nixos/tests/hocker-fetchdocker/machine.nix
index 78343f0e02f0f..885adebe14985 100644
--- a/nixos/tests/hocker-fetchdocker/machine.nix
+++ b/nixos/tests/hocker-fetchdocker/machine.nix
@@ -11,8 +11,8 @@
   systemd.services.docker-load-fetchdocker-image = {
     description = "Docker load hello-world-container";
     wantedBy    = [ "multi-user.target" ];
-    wants       = [ "docker.service" "local-fs.target" ];
-    after       = [ "docker.service" "local-fs.target" ];
+    wants       = [ "docker.service" ];
+    after       = [ "docker.service" ];
 
     script = ''
       ${pkgs.hello-world-container}/compositeImage.sh | ${pkgs.docker}/bin/docker load
diff --git a/nixos/tests/redis.nix b/nixos/tests/redis.nix
new file mode 100644
index 0000000000000..325d93424dd7d
--- /dev/null
+++ b/nixos/tests/redis.nix
@@ -0,0 +1,26 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "redis";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ flokli ];
+  };
+
+  nodes = {
+    machine =
+      { pkgs, ... }:
+
+      {
+        services.redis.enable = true;
+        services.redis.unixSocket = "/run/redis/redis.sock";
+      };
+  };
+
+  testScript = ''
+    startAll;
+
+    $machine->waitForUnit("redis");
+    $machine->waitForOpenPort("6379");
+
+    $machine->succeed("redis-cli ping | grep PONG");
+    $machine->succeed("redis-cli -s /run/redis/redis.sock ping | grep PONG");
+  '';
+})