From 798fee6e0d373c69982440e615983eb775be3dc0 Mon Sep 17 00:00:00 2001 From: Spencer Brower Date: Wed, 2 Nov 2022 20:25:46 -0400 Subject: [PATCH] test: Updated checks. --- flake.nix | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index bc3ba86..634805a 100644 --- a/flake.nix +++ b/flake.nix @@ -7,16 +7,30 @@ vagrant = { ... }: { imports = [ ./nixos/modules/virtualisation/vagrant.nix ]; }; }; - checks."x86_64-linux".vagrant = let pkgs = nixpkgs.legacyPackages."x86_64-linux"; in - pkgs.nixosTest { - name = "vagrant-box-test"; - nodes.machine = { pkgs, ... }: { imports = with self.nixosModules; [ vagrant ]; }; - testScript = '' - # 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 - ''; - }; + checks."x86_64-linux".vagrant = let + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + in pkgs.nixosTest { + name = "vagrant-box-test"; + 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 = '' + # run hello on machine and check for output + # test is a simple python script + machine.succeed('cd /vagrant && php artisan') + ''; + }; }; }