aboutsummaryrefslogtreecommitdiff
path: root/nixos/tests
diff options
context:
space:
mode:
authorTim Steinbach <tim@nequissimus.com>2020-11-28 12:42:10 -0500
committerTim Steinbach <tim@nequissimus.com>2020-11-28 12:43:17 -0500
commit0dc74a15ad55f0882895319eb16b0aa9a9f4f82d (patch)
treeaf5c1dd2fa3a9ef05c1864bf65aa828410b9ee9e /nixos/tests
parenteb2a3a040cefc6649a117925832b23059fc79b7c (diff)
minecraft: Add test
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/minecraft.nix28
2 files changed, 29 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 771ee9bdbd33..f6c0c2483928 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -208,6 +208,7 @@ in
mediawiki = handleTest ./mediawiki.nix {};
memcached = handleTest ./memcached.nix {};
metabase = handleTest ./metabase.nix {};
+ minecraft = handleTest ./minecraft.nix {};
miniflux = handleTest ./miniflux.nix {};
minio = handleTest ./minio.nix {};
minidlna = handleTest ./minidlna.nix {};
diff --git a/nixos/tests/minecraft.nix b/nixos/tests/minecraft.nix
new file mode 100644
index 000000000000..e0c35f2d2769
--- /dev/null
+++ b/nixos/tests/minecraft.nix
@@ -0,0 +1,28 @@
+import ./make-test-python.nix ({ pkgs, lib, ... }: {
+ name = "minecraft";
+ meta = with lib.maintainers; { maintainers = [ nequissimus ]; };
+
+ nodes.client = { nodes, ... }:
+ let user = nodes.client.config.users.users.alice;
+ in {
+ imports = [ ./common/user-account.nix ./common/x11.nix ];
+
+ environment.systemPackages = [ pkgs.minecraft ];
+
+ nixpkgs.config.allowUnfree = true;
+
+ test-support.displayManager.auto.user = user.name;
+ };
+
+ enableOCR = true;
+
+ testScript = { nodes, ... }:
+ let user = nodes.client.config.users.users.alice;
+ in ''
+ client.wait_for_x()
+ client.execute("su - alice -c minecraft-launcher &")
+ client.wait_for_text("CONTINUE WITHOUT LOGIN")
+ client.sleep(10)
+ client.screenshot("launcher")
+ '';
+})