test: Updated checks.

This commit is contained in:
Spencer Brower
2022-11-02 20:25:46 -04:00
parent 6a5a44981e
commit 798fee6e0d

View File

@@ -7,15 +7,29 @@
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";
in pkgs.nixosTest {
name = "vagrant-box-test"; name = "vagrant-box-test";
nodes.machine = { pkgs, ... }: { imports = with self.nixosModules; [ vagrant ]; }; nodes.machine = { config, pkgs, ... }: {
imports = [ self.nixosModules.vagrant ];
config = {
assertions = [
{
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 = '' testScript = ''
# run hello on machine and check for output # run hello on machine and check for output
machine.succeed('hello | grep "Hello, world!"')
machine.succeed('goodbye | grep "Hello, world!"')
# test is a simple python script # test is a simple python script
machine.succeed('cd /vagrant && php artisan')
''; '';
}; };
}; };