mirror of
https://github.com/sbrow/nix.git
synced 2026-02-27 21:31:45 -05:00
test: Updated checks.
This commit is contained in:
36
flake.nix
36
flake.nix
@@ -7,16 +7,30 @@
|
|||||||
vagrant = { ... }: { imports = [ ./nixos/modules/virtualisation/vagrant.nix ]; };
|
vagrant = { ... }: { imports = [ ./nixos/modules/virtualisation/vagrant.nix ]; };
|
||||||
};
|
};
|
||||||
|
|
||||||
checks."x86_64-linux".vagrant = let pkgs = nixpkgs.legacyPackages."x86_64-linux"; in
|
checks."x86_64-linux".vagrant = let
|
||||||
pkgs.nixosTest {
|
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||||
name = "vagrant-box-test";
|
in pkgs.nixosTest {
|
||||||
nodes.machine = { pkgs, ... }: { imports = with self.nixosModules; [ vagrant ]; };
|
name = "vagrant-box-test";
|
||||||
testScript = ''
|
nodes.machine = { config, pkgs, ... }: {
|
||||||
# run hello on machine and check for output
|
imports = [ self.nixosModules.vagrant ];
|
||||||
machine.succeed('hello | grep "Hello, world!"')
|
config = {
|
||||||
machine.succeed('goodbye | grep "Hello, world!"')
|
assertions = [
|
||||||
# test is a simple python script
|
{
|
||||||
'';
|
assertion = config.services.laravel.enable == false;
|
||||||
};
|
message = "Laravel should be disabled";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = config.services.laravel.bashAliases.enable == config.services.laravel.enable;
|
||||||
|
message = "Bash aliases should be enabled";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
testScript = ''
|
||||||
|
# run hello on machine and check for output
|
||||||
|
# test is a simple python script
|
||||||
|
machine.succeed('cd /vagrant && php artisan')
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user