about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/heinrich.nix51
-rw-r--r--tests/i3.nix31
-rw-r--r--tests/make-test.nix28
3 files changed, 31 insertions, 79 deletions
diff --git a/tests/heinrich.nix b/tests/heinrich.nix
deleted file mode 100644
index c524835e..00000000
--- a/tests/heinrich.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-import ./make-test.nix {
-  name = "heinrich";
-
-  nodes = let
-    common = { lib, ... }: {
-      networking.useNetworkd = true;
-      systemd.network.netdevs."40-eth0".netdevConfig = {
-        Name = "eth0";
-        Kind = "dummy";
-      };
-    };
-  in {
-    heinrich = {
-      imports = [ common ../machines/heinrich.nix ];
-      virtualisation.vlans = [ 1 8 14 ];
-      heinrich.internalInterface = "eth1";
-      heinrich.externalInterface = "eth2";
-    };
-    hotelturm = { lib, ... }: {
-      imports = [ common ];
-      virtualisation.vlans = [ 8 ];
-      networking.useDHCP = false;
-      networking.interfaces.eth1.ip4 = lib.singleton {
-        address = "10.11.77.16";
-        prefixLength = 24;
-      };
-    };
-    moritz = { lib, ... }: {
-      imports = [ common ];
-      virtualisation.vlans = [ 14 ];
-      networking.useDHCP = false;
-      networking.interfaces.eth1.ip4 = lib.singleton {
-        address = "192.168.0.1";
-        prefixLength = 24;
-      };
-    };
-    client = {
-      imports = [ common ];
-      virtualisation.vlans = [ 1 ];
-    };
-  };
-
-  testScript = ''
-    startAll;
-    $heinrich->waitForUnit("dnsmasq.service");
-    $client->waitForUnit("network-interfaces.target");
-    $client->waitForUnit("network.target");
-
-    $client->succeed("ip addr >&2");
-  '';
-}
diff --git a/tests/i3.nix b/tests/i3.nix
new file mode 100644
index 00000000..0505b67f
--- /dev/null
+++ b/tests/i3.nix
@@ -0,0 +1,31 @@
+import <nixpkgs/nixos/tests/make-test.nix> ({ pkgs, ... }: {
+  name = "i3";
+
+  machine = { lib, ... }: {
+    imports = [
+      ../common.nix
+      <nixpkgs/nixos/tests/common/x11.nix>
+    ];
+    services.xserver.windowManager.default = lib.mkForce "i3";
+    /* XXX */
+    fonts = {
+      enableCoreFonts = true;
+      enableFontDir = true;
+      enableGhostscriptFonts = true;
+      fonts = [
+        pkgs.dosemu_fonts
+        pkgs.liberation_ttf
+      ];
+    };
+    /* !XXX */
+    vuizvui = {
+      i3.enable = true;
+    };
+  };
+
+  testScript = { nodes, ... }: ''
+    $machine->waitForX;
+    $machine->sleep(20);
+    $machine->screenshot("i3");
+  '';
+})
diff --git a/tests/make-test.nix b/tests/make-test.nix
deleted file mode 100644
index 10381afd..00000000
--- a/tests/make-test.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-f: { system ? builtins.currentSystem, ... } @ args: let
-  lib = import <nixpkgs/lib>;
-
-  testLib = import <nixpkgs/nixos/lib/testing.nix> {
-    inherit system;
-  };
-
-  pkgs = import <nixpkgs> { inherit system; };
-
-  testArgs = if builtins.isFunction f then f (args // {
-    pkgs = pkgs // {
-      labernix = import ../pkgs { inherit pkgs; };
-    };
-  }) else f;
-
-  nodes = testArgs.nodes or (if testArgs ? machine then {
-    inherit (testArgs) machine;
-  } else {});
-
-  injectCommon = name: conf: {
-    imports = [ ../common.nix conf ];
-  };
-
-  testArgsWithCommon = removeAttrs testArgs [ "machine" ] // {
-    nodes = lib.mapAttrs injectCommon nodes;
-  };
-
-in testLib.makeTest testArgsWithCommon