summary refs log blame commit diff
path: root/nixos/tests/minio.nix
blob: a349265b2f579a5569a2ee75252f83b18213d490 (plain) (tree)
1
2
3
4
5
6





                                            








                                                               







                                                                              




                                                                                                                                             
                         
 

       
import ./make-test.nix ({ pkgs, ...} : {
  name = "minio";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ bachp ];
  };

  nodes = {
    machine = { config, pkgs, ... }: {
      services.minio = {
        enable = true;
        accessKey = "BKIKJAA5BMMU2RHO6IBB";
        secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
      };
      environment.systemPackages = [ pkgs.minio-client ];
    };
  };

  testScript =
    ''
      startAll;
      $machine->waitForUnit("minio.service");
      $machine->waitForOpenPort(9000);
      $machine->succeed("curl --fail http://localhost:9000/minio/index.html");

      # 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;
      $machine->shutdown;

    '';
})