diff options
author | John Soo <john.soo@arista.com> | 2023-03-13 18:00:43 -0700 |
---|---|---|
committer | John Soo <john.soo@arista.com> | 2023-03-13 18:00:43 -0700 |
commit | 4400f7d72ff5ce35d3be07cb7fd6906f5bcb4c9c (patch) | |
tree | 991d043ac78278594fc92c14818266c41d5e02b4 /nixos/tests/minio.nix | |
parent | e30469a37bfdd898b0f359c758c18bc00167cbaf (diff) |
nixosTests/minio: make sure editing root credentials restarts minio
Diffstat (limited to 'nixos/tests/minio.nix')
-rw-r--r-- | nixos/tests/minio.nix | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/nixos/tests/minio.nix b/nixos/tests/minio.nix index ad51f738d4901..bbea6f523f34a 100644 --- a/nixos/tests/minio.nix +++ b/nixos/tests/minio.nix @@ -18,6 +18,14 @@ let sio.seek(0) 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" '' + MINIO_ROOT_USER=${accessKey} + ''; + credsFull = pkgs.writeText "minio-credentials-full" '' + MINIO_ROOT_USER=${accessKey} + MINIO_ROOT_PASSWORD=${secretKey} + ''; in { name = "minio"; meta = with pkgs.lib.maintainers; { @@ -28,10 +36,7 @@ in { machine = { pkgs, ... }: { services.minio = { enable = true; - rootCredentialsFile = pkgs.writeText "minio-credentials" '' - MINIO_ROOT_USER=${accessKey} - MINIO_ROOT_PASSWORD=${secretKey} - ''; + inherit rootCredentialsFile; }; environment.systemPackages = [ pkgs.minio-client ]; @@ -41,7 +46,15 @@ in { }; 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}") + machine.wait_for_unit("minio.service") machine.wait_for_open_port(9000) |