summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarijan <marijan.petricevic@hotmail.de>2019-11-06 19:42:58 +0100
committerMarijan Petricevic <marijan.petricevic94@gmail.com>2019-11-07 10:55:15 +0100
commit30d1dfef4b984d30b50cb9fe6e8811269af1989c (patch)
tree05cea61c0c392042ca49f94ffdbc1c86faf0d870
parente05f546f3ac6633db1c24ae165f2322806ece31d (diff)
downloadnixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.tar
nixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.tar.gz
nixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.tar.bz2
nixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.tar.lz
nixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.tar.xz
nixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.tar.zst
nixpkgs-30d1dfef4b984d30b50cb9fe6e8811269af1989c.zip
nixos/cloud-init: port test to python
-rw-r--r--nixos/tests/cloud-init.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/nixos/tests/cloud-init.nix b/nixos/tests/cloud-init.nix
index 516d29c9036..aafa6e24e84 100644
--- a/nixos/tests/cloud-init.nix
+++ b/nixos/tests/cloud-init.nix
@@ -3,7 +3,7 @@
   pkgs ? import ../.. { inherit system config; }
 }:
 
-with import ../lib/testing.nix { inherit system pkgs; };
+with import ../lib/testing-python.nix { inherit system pkgs; };
 with pkgs.lib;
 
 let
@@ -30,6 +30,7 @@ let
       '';
   };
 in makeTest {
+  name = "cloud-init";
   meta = with pkgs.stdenv.lib.maintainers; {
     maintainers = [ lewo ];
   };
@@ -40,10 +41,12 @@ in makeTest {
       services.cloud-init.enable = true;
     };
   testScript = ''
-     $machine->start;
-     $machine->waitForUnit("cloud-init.service");
-     $machine->succeed("cat /tmp/cloudinit-write-file | grep -q 'cloudinit'");
+      machine.start()
+      machine.wait_for_unit("cloud-init.service")
+      machine.succeed("cat /tmp/cloudinit-write-file | grep -q 'cloudinit'")
 
-     $machine->waitUntilSucceeds("cat /root/.ssh/authorized_keys | grep -q 'should be a key!'");
+      machine.wait_until_succeeds(
+          "cat /root/.ssh/authorized_keys | grep -q 'should be a key!'"
+      )
   '';
 }