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