summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2019-11-26 22:29:27 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2019-11-26 22:29:27 +0100
commit88a40abc92e54aaa934914eb8e1e2fc1daaa8754 (patch)
treef73cd90e3b5b073ce8b4d1cb6858ce4db83fad30 /nixos/tests
parentec0590c566459a234064406ceb8c7f1b8efbf995 (diff)
downloadnixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.tar
nixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.tar.gz
nixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.tar.bz2
nixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.tar.lz
nixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.tar.xz
nixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.tar.zst
nixpkgs-88a40abc92e54aaa934914eb8e1e2fc1daaa8754.zip
nixos/iftop: port test to python test-driver
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/iftop.nix25
1 files changed, 12 insertions, 13 deletions
diff --git a/nixos/tests/iftop.nix b/nixos/tests/iftop.nix
index a4f524ceb27..8a161027c2a 100644
--- a/nixos/tests/iftop.nix
+++ b/nixos/tests/iftop.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, lib, ... }:
+import ./make-test-python.nix ({ pkgs, lib, ... }:
 
 with lib;
 
@@ -18,17 +18,16 @@ with lib;
   };
 
   testScript = ''
-    subtest "machine with iftop enabled", sub {
-      $withIftop->waitForUnit("default.target");
-      # limit to eth1 (eth0 is the test driver's control interface)
-      # and don't try name lookups
-      $withIftop->succeed("su -l alice -c 'iftop -t -s 1 -n -i eth1'");
-    };
-    subtest "machine without iftop", sub {
-      $withoutIftop->waitForUnit("default.target");
-      # check that iftop is there but user alice lacks capabilities
-      $withoutIftop->succeed("iftop -t -s 1 -n -i eth1");
-      $withoutIftop->fail("su -l alice -c 'iftop -t -s 1 -n -i eth1'");
-    };
+    with subtest("machine with iftop enabled"):
+        withIftop.wait_for_unit("default.target")
+        # limit to eth1 (eth0 is the test driver's control interface)
+        # and don't try name lookups
+        withIftop.succeed("su -l alice -c 'iftop -t -s 1 -n -i eth1'")
+
+    with subtest("machine without iftop"):
+        withoutIftop.wait_for_unit("default.target")
+        # check that iftop is there but user alice lacks capabilitie
+        withoutIftop.succeed("iftop -t -s 1 -n -i eth1")
+        withoutIftop.fail("su -l alice -c 'iftop -t -s 1 -n -i eth1'")
   '';
 })