summary refs log tree commit diff
path: root/nixos/tests/fluentd.nix
diff options
context:
space:
mode:
authorJan Hrnko <jan.hrnko@satoshilabs.com>2019-11-09 19:45:52 +0100
committerFlorian Klink <flokli@flokli.de>2019-11-22 20:38:56 +0100
commitc999eab3e78484e75d44536f8e20229fc738d2ed (patch)
tree4cde0d09e6a2d4378f5ef0fd62dd3220b4887d7f /nixos/tests/fluentd.nix
parenta0a07e39360c1732b24f7a01fe59ad84a6d49310 (diff)
nixos/fluentd: port test to python
Diffstat (limited to 'nixos/tests/fluentd.nix')
-rw-r--r--nixos/tests/fluentd.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/nixos/tests/fluentd.nix b/nixos/tests/fluentd.nix
index e5c4c3d216319..918f2f87db17f 100644
--- a/nixos/tests/fluentd.nix
+++ b/nixos/tests/fluentd.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, lib, ... }: {
+import ./make-test-python.nix ({ pkgs, lib, ... }: {
   name = "fluentd";
 
   machine = { pkgs, ... }: {
@@ -33,14 +33,17 @@ import ./make-test.nix ({ pkgs, lib, ... }: {
       inherit testMessage;
     });
   in ''
-    $machine->start;
-    $machine->waitForUnit('fluentd.service');
-    $machine->waitForOpenPort(9880);
+    machine.start()
+    machine.wait_for_unit("fluentd.service")
+    machine.wait_for_open_port(9880)
 
-    $machine->succeed("curl -fsSL -X POST -H 'Content-type: application/json' -d @${payload} http://localhost:9880/test.tag");
+    machine.succeed(
+        "curl -fsSL -X POST -H 'Content-type: application/json' -d @${payload} http://localhost:9880/test.tag"
+    )
 
-    $machine->succeed("systemctl stop fluentd"); # blocking flush
+    # blocking flush
+    machine.succeed("systemctl stop fluentd")
 
-    $machine->succeed("grep '${testMessage}' /tmp/current-log");
+    machine.succeed("grep '${testMessage}' /tmp/current-log")
   '';
 })