2017-06-25 17:43:10 +01:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
|
|
|
name = "minio";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ bachp ];
|
|
|
|
};
|
|
|
|
|
2017-07-07 23:11:44 +01:00
|
|
|
nodes = {
|
2018-07-20 21:56:59 +01:00
|
|
|
machine = { pkgs, ... }: {
|
2017-07-07 23:11:44 +01:00
|
|
|
services.minio = {
|
|
|
|
enable = true;
|
|
|
|
accessKey = "BKIKJAA5BMMU2RHO6IBB";
|
|
|
|
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
|
|
|
|
};
|
|
|
|
environment.systemPackages = [ pkgs.minio-client ];
|
2017-10-01 19:58:28 +01:00
|
|
|
|
|
|
|
# Minio requires at least 1GiB of free disk space to run.
|
|
|
|
virtualisation.diskSize = 4 * 1024;
|
2017-07-07 23:11:44 +01:00
|
|
|
};
|
2017-06-25 17:43:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
startAll;
|
|
|
|
$machine->waitForUnit("minio.service");
|
|
|
|
$machine->waitForOpenPort(9000);
|
2017-07-07 23:11:44 +01:00
|
|
|
|
|
|
|
# Create a test bucket on the server
|
|
|
|
$machine->succeed("mc config host add minio http://localhost:9000 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v4");
|
|
|
|
$machine->succeed("mc mb minio/test-bucket");
|
|
|
|
$machine->succeed("mc ls minio") =~ /test-bucket/ or die;
|
2017-06-25 17:43:10 +01:00
|
|
|
$machine->shutdown;
|
2017-07-07 23:11:44 +01:00
|
|
|
|
2017-06-25 17:43:10 +01:00
|
|
|
'';
|
|
|
|
})
|