mirror of
https://github.com/0xbbjubjub/miniguest.git
synced 2025-01-06 03:45:49 +03:00
parent
df1bd92229
commit
d58d012d4c
@ -61,6 +61,21 @@ lib.optionalAttrs stdenv.isLinux {
|
||||
'';
|
||||
};
|
||||
|
||||
install_rename = mkTest {
|
||||
name = "miniguest-install-rename";
|
||||
testScript = ''
|
||||
machine.succeed("""
|
||||
miniguest install --name=renamed_dummy /tmp/flake1#dummy
|
||||
""")
|
||||
assert "foo" in machine.succeed("""
|
||||
cat /etc/miniguests/renamed_dummy/boot/init
|
||||
""")
|
||||
assert "/nix/var/nix/profiles/miniguest-profiles/renamed_dummy\n" == machine.succeed("""
|
||||
readlink /etc/miniguests/renamed_dummy
|
||||
""")
|
||||
'';
|
||||
};
|
||||
|
||||
install_nonexistent = mkTest {
|
||||
name = "miniguest-install-nonexistent";
|
||||
testScript = ''
|
||||
|
@ -18,11 +18,12 @@
|
||||
source install_arg.bash
|
||||
|
||||
parse_flake_reference "$_arg_flake_reference"
|
||||
profile_name="${_arg_name:-$guest_name}"
|
||||
|
||||
mkdir -p "$guests_dir" || die "" $?
|
||||
mkdir -p "$profiles_dir" || die "" $?
|
||||
|
||||
reset_profile "$guest_name" # FIXME: need an atomic reset-and-install
|
||||
install_profile "$guest_name" "$flake#nixosConfigurations.$guest_name.config.system.build.miniguest"
|
||||
reset_profile "$profile_name" # FIXME: need an atomic reset-and-install
|
||||
install_profile "$profile_name" "$flake#nixosConfigurations.$guest_name.config.system.build.miniguest"
|
||||
|
||||
have_control_of_symlink "$guest_name" && ln -sf "$profiles_dir/$guest_name" "$guests_dir"
|
||||
have_control_of_symlink "$profile_name" && ln -sf "$profiles_dir/$profile_name" "$guests_dir"
|
||||
|
@ -15,5 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Miniguest. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# ARG_HELP(build the guest and install it into a nix profile)
|
||||
# ARG_POSITIONAL_SINGLE(flake-reference, guest to build)
|
||||
# ARG_OPTIONAL_SINGLE(name, n, name of the profile)
|
||||
# ARGBASH_GO
|
||||
|
Loading…
Reference in New Issue
Block a user