about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-11-24 20:32:11 +0100
committerGitHub <noreply@github.com>2019-11-24 20:32:11 +0100
commitf8117905f120a3eb3548ddf4dab6b38f852ce31f (patch)
tree8e4a99b27489b8edbe0c6560a59406a85c83bd12 /nixos
parent3cd94080ebe3c3370a5200fa82fc0c25d3700972 (diff)
parentb86d62006da45246c84f82e5ee5ceeff3744d3e3 (diff)
downloadnixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.tar
nixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.tar.gz
nixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.tar.bz2
nixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.tar.lz
nixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.tar.xz
nixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.tar.zst
nixlib-f8117905f120a3eb3548ddf4dab6b38f852ce31f.zip
Merge pull request #74070 from mayflower/tests-python-minio
nixosTests.minio: port to python
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/minio.nix32
1 files changed, 16 insertions, 16 deletions
diff --git a/nixos/tests/minio.nix b/nixos/tests/minio.nix
index f1218b537711..3b0619742671 100644
--- a/nixos/tests/minio.nix
+++ b/nixos/tests/minio.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, ...} :
+import ./make-test-python.nix ({ pkgs, ...} :
 let
     accessKey = "BKIKJAA5BMMU2RHO6IBB";
     secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
@@ -18,7 +18,7 @@ let
       sio.seek(0)
       minioClient.put_object('test-bucket', 'test.txt', sio, sio_len, content_type='text/plain')
     '';
-  in {
+in {
   name = "minio";
   meta = with pkgs.stdenv.lib.maintainers; {
     maintainers = [ bachp ];
@@ -37,19 +37,19 @@ let
     };
   };
 
-  testScript =
-    ''
-      startAll;
-      $machine->waitForUnit("minio.service");
-      $machine->waitForOpenPort(9000);
+  testScript = ''
+    start_all()
+    machine.wait_for_unit("minio.service")
+    machine.wait_for_open_port(9000)
 
-      # Create a test bucket on the server
-      $machine->succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} S3v4");
-      $machine->succeed("mc mb minio/test-bucket");
-      $machine->succeed("${minioPythonScript}");
-      $machine->succeed("mc ls minio") =~ /test-bucket/ or die;
-      $machine->succeed("mc cat minio/test-bucket/test.txt") =~ /Test from Python/ or die;
-      $machine->shutdown;
-
-    '';
+    # Create a test bucket on the server
+    machine.succeed(
+        "mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} S3v4"
+    )
+    machine.succeed("mc mb minio/test-bucket")
+    machine.succeed("${minioPythonScript}")
+    assert "test-bucket" in machine.succeed("mc ls minio")
+    assert "Test from Python" in machine.succeed("mc cat minio/test-bucket/test.txt")
+    machine.shutdown()
+  '';
 })