mirror of
https://github.com/0xbbjubjub/miniguest.git
synced 2025-01-06 03:45:49 +03:00
checks: add a check for imperative upgrade
This commit is contained in:
parent
d58d012d4c
commit
60c93c3177
@ -29,8 +29,9 @@ let
|
||||
inherit name;
|
||||
machine = {
|
||||
environment.systemPackages = [
|
||||
git
|
||||
# wrapper clears PATH to check for implicit dependencies
|
||||
(writeShellScriptBin "miniguest" ''PATH= exec ${miniguest}/bin/miniguest "$@"'')
|
||||
(writeShellScriptBin "miniguest" ''PATH=${git}/bin exec ${miniguest}/bin/miniguest "$@"'')
|
||||
];
|
||||
environment.etc."pinned-nixpkgs".source = pinned-nixpkgs;
|
||||
system.extraDependencies = [ (import pinned-nixpkgs { inherit system; }).stdenvNoCC ];
|
||||
@ -61,6 +62,33 @@ lib.optionalAttrs stdenv.isLinux {
|
||||
'';
|
||||
};
|
||||
|
||||
upgrade_dummy = mkTest {
|
||||
name = "miniguest-upgrade-dummy";
|
||||
testScript = ''
|
||||
machine.succeed("""
|
||||
cd /tmp/flake1
|
||||
git init
|
||||
git config user.name Miniguest
|
||||
git config user.email miniguest@example.org
|
||||
git add .
|
||||
git commit -m init
|
||||
""")
|
||||
machine.succeed("""
|
||||
miniguest install /tmp/flake1#dummy
|
||||
""")
|
||||
machine.succeed("""
|
||||
sed -i s/foo/bar/ /tmp/flake1/flake.nix
|
||||
git -C /tmp/flake1 commit -am upgrade
|
||||
""")
|
||||
machine.succeed("""
|
||||
miniguest upgrade dummy
|
||||
""")
|
||||
assert "bar" in machine.succeed("""
|
||||
cat /etc/miniguests/dummy/boot/init
|
||||
""")
|
||||
'';
|
||||
};
|
||||
|
||||
install_rename = mkTest {
|
||||
name = "miniguest-install-rename";
|
||||
testScript = ''
|
||||
|
Loading…
Reference in New Issue
Block a user