1import ./make-test.nix ({ pkgs, ...} : {
2 name = "minio";
3 meta = with pkgs.stdenv.lib.maintainers; {
4 maintainers = [ bachp ];
5 };
6
7 nodes = {
8 machine = { pkgs, ... }: {
9 services.minio = {
10 enable = true;
11 accessKey = "BKIKJAA5BMMU2RHO6IBB";
12 secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
13 };
14 environment.systemPackages = [ pkgs.minio-client ];
15
16 # Minio requires at least 1GiB of free disk space to run.
17 virtualisation.diskSize = 4 * 1024;
18 };
19 };
20
21 testScript =
22 ''
23 startAll;
24 $machine->waitForUnit("minio.service");
25 $machine->waitForOpenPort(9000);
26
27 # Create a test bucket on the server
28 $machine->succeed("mc config host add minio http://localhost:9000 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v4");
29 $machine->succeed("mc mb minio/test-bucket");
30 $machine->succeed("mc ls minio") =~ /test-bucket/ or die;
31 $machine->shutdown;
32
33 '';
34})