summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-06-25 12:06:04 +0000
committerGitHub <noreply@github.com>2021-06-25 12:06:04 +0000
commitbae6b2055f9877347ab7e131548c29bb5c6d6ad4 (patch)
tree2058d77beaeb5dd33eef67bd2ed41b469ad371ca /nixos/tests
parentc1dca92daf8de1a7421d412f2fa68fab16a0289a (diff)
parent370a10c27fc13f2b70dfee2284b30d6989b4336b (diff)
downloadnixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.tar
nixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.tar.gz
nixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.tar.bz2
nixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.tar.lz
nixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.tar.xz
nixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.tar.zst
nixpkgs-bae6b2055f9877347ab7e131548c29bb5c6d6ad4.zip
Merge master into staging-next
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/sway.nix2
-rw-r--r--nixos/tests/txredisapi.nix27
3 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index abc4d9b9b8f..b5126be8af7 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -432,6 +432,7 @@ in
   trezord = handleTest ./trezord.nix {};
   trickster = handleTest ./trickster.nix {};
   trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
+  txredisapi = handleTest ./txredisapi.nix {};
   tuptime = handleTest ./tuptime.nix {};
   turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix {};
   ucarp = handleTest ./ucarp.nix {};
diff --git a/nixos/tests/sway.nix b/nixos/tests/sway.nix
index 21900ee4c01..01240ef572a 100644
--- a/nixos/tests/sway.nix
+++ b/nixos/tests/sway.nix
@@ -104,6 +104,8 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
 
     # Exit Sway and verify process exit status 0:
     machine.succeed("su - alice -c 'swaymsg exit || true'")
+    machine.wait_until_fails("pgrep -x sway")
+
     # TODO: Sway currently segfaults after "swaymsg exit" but only in this VM test:
     # machine # [  104.090032] sway[921]: segfault at 3f800008 ip 00007f7dbdc25f10 sp 00007ffe282182f8 error 4 in libwayland-server.so.0.1.0[7f7dbdc1f000+8000]
     # machine.wait_for_file("/tmp/sway-exit-ok")
diff --git a/nixos/tests/txredisapi.nix b/nixos/tests/txredisapi.nix
new file mode 100644
index 00000000000..bc3814a7137
--- /dev/null
+++ b/nixos/tests/txredisapi.nix
@@ -0,0 +1,27 @@
+import ./make-test-python.nix ({ pkgs, ... }:
+{
+  name = "txredisapi";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ dandellion ];
+  };
+
+  nodes = {
+    machine =
+      { pkgs, ... }:
+
+      {
+        services.redis.enable = true;
+        services.redis.unixSocket = "/run/redis/redis.sock";
+
+        environment.systemPackages = with pkgs; [ (python38.withPackages (ps: [ ps.twisted ps.txredisapi ps.mock ]))];
+      };
+  };
+
+  testScript = ''
+    start_all()
+    machine.wait_for_unit("redis")
+    machine.wait_for_open_port("6379")
+
+    tests = machine.succeed("PYTHONPATH=\"${pkgs.python3Packages.txredisapi.src}\" python -m twisted.trial ${pkgs.python3Packages.txredisapi.src}/tests")
+  '';
+})