mirror of
https://github.com/0xbbjubjub/miniguest.git
synced 2025-01-07 12:30:53 +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;
|
inherit name;
|
||||||
machine = {
|
machine = {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
|
git
|
||||||
# wrapper clears PATH to check for implicit dependencies
|
# 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;
|
environment.etc."pinned-nixpkgs".source = pinned-nixpkgs;
|
||||||
system.extraDependencies = [ (import pinned-nixpkgs { inherit system; }).stdenvNoCC ];
|
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 {
|
install_rename = mkTest {
|
||||||
name = "miniguest-install-rename";
|
name = "miniguest-install-rename";
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user