diff options
author | John Soo <john.soo@arista.com> | 2023-03-13 18:01:16 -0700 |
---|---|---|
committer | John Soo <john.soo@arista.com> | 2023-03-13 18:01:16 -0700 |
commit | 29523c05e444e8f56e1f9ebed6a85b2168f80916 (patch) | |
tree | c4111f3ce694809969a396a4b250e040e14e5a8b /nixos/tests | |
parent | 4400f7d72ff5ce35d3be07cb7fd6906f5bcb4c9c (diff) |
nixosTests/minio: format with nixpkgs-fmt
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/minio.nix | 81 |
1 files changed, 41 insertions, 40 deletions
diff --git a/nixos/tests/minio.nix b/nixos/tests/minio.nix index bbea6f523f34a..ece4864f771c0 100644 --- a/nixos/tests/minio.nix +++ b/nixos/tests/minio.nix @@ -1,5 +1,5 @@ -import ./make-test-python.nix ({ pkgs, ...} : -let +import ./make-test-python.nix ({ pkgs, ... }: + let accessKey = "BKIKJAA5BMMU2RHO6IBB"; secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12"; minioPythonScript = pkgs.writeScript "minio-test.py" '' @@ -19,53 +19,54 @@ let minioClient.put_object('test-bucket', 'test.txt', sio, sio_len, content_type='text/plain') ''; rootCredentialsFile = "/etc/nixos/minio-root-credentials"; - credsPartial = pkgs.writeText "minio-credentials-partial" '' + credsPartial = pkgs.writeText "minio-credentials-partial" '' MINIO_ROOT_USER=${accessKey} ''; - credsFull = pkgs.writeText "minio-credentials-full" '' + credsFull = pkgs.writeText "minio-credentials-full" '' MINIO_ROOT_USER=${accessKey} MINIO_ROOT_PASSWORD=${secretKey} ''; -in { - name = "minio"; - meta = with pkgs.lib.maintainers; { - maintainers = [ bachp ]; - }; + in + { + name = "minio"; + meta = with pkgs.lib.maintainers; { + maintainers = [ bachp ]; + }; - nodes = { - machine = { pkgs, ... }: { - services.minio = { - enable = true; - inherit rootCredentialsFile; - }; - environment.systemPackages = [ pkgs.minio-client ]; + nodes = { + machine = { pkgs, ... }: { + services.minio = { + enable = true; + inherit rootCredentialsFile; + }; + environment.systemPackages = [ pkgs.minio-client ]; - # Minio requires at least 1GiB of free disk space to run. - virtualisation.diskSize = 4 * 1024; + # Minio requires at least 1GiB of free disk space to run. + virtualisation.diskSize = 4 * 1024; + }; }; - }; - testScript = '' - import time + testScript = '' + import time - start_all() - # simulate manually editing root credentials file - machine.wait_for_unit("multi-user.target") - machine.copy_from_host("${credsPartial}", "${rootCredentialsFile}") - time.sleep(3) - machine.copy_from_host("${credsFull}", "${rootCredentialsFile}") + start_all() + # simulate manually editing root credentials file + machine.wait_for_unit("multi-user.target") + machine.copy_from_host("${credsPartial}", "${rootCredentialsFile}") + time.sleep(3) + machine.copy_from_host("${credsFull}", "${rootCredentialsFile}") - machine.wait_for_unit("minio.service") - machine.wait_for_open_port(9000) + 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} --api 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() - ''; -}) + # Create a test bucket on the server + machine.succeed( + "mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api 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() + ''; + }) |