nixos/make-disk-image: fix contents dir paths#226214
Merged
RaitoBezarius merged 2 commits intoNixOS:masterfrom Apr 16, 2023
Merged
nixos/make-disk-image: fix contents dir paths#226214RaitoBezarius merged 2 commits intoNixOS:masterfrom
RaitoBezarius merged 2 commits intoNixOS:masterfrom
Conversation
nixos/tests/common/ec2.nix
Outdated
Member
There was a problem hiding this comment.
Modification of this file should go in a separate commit to keep clean history
Author
There was a problem hiding this comment.
I moved these changes to another commit in the same PR. Should I move them to another PR?
Member
There was a problem hiding this comment.
No, but the commit should be formatted using a path name: nixos/tests/ec2 is better
Author
There was a problem hiding this comment.
Okay, thanks, I wasn't sure quite how to format it.
RaitoBezarius
requested changes
Apr 15, 2023
Member
RaitoBezarius
left a comment
There was a problem hiding this comment.
Minor changes are necessary, but LGTM other than that, thank you!
6dde3e6 to
972e102
Compare
RaitoBezarius
approved these changes
Apr 16, 2023
Member
RaitoBezarius
left a comment
There was a problem hiding this comment.
Minor change on the commit formatting for EC2 and we are good to go!
This change fixes two problems with the qemu testing code: 1. Previously, the qemu-img command was missing a disk image format argument. 2. Previously, if a test assertion failed, the test hung because the VM was not torn down.
`make-disk-image` is a tool for creating VM images. It takes an argument `contents` that allows one to specify files and directories that should be copied into the VM image. However, directories end up not at the specified target, but instead at a subdirectory of the target, with a nix-store-like path, e.g. `/target/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-source`. See issue NixOS#226203 . This change adds a test for make-disk-image's contents directory handling and adds a fix (appending `/` to rsync input directory names). This closes issue NixOS#226203 .
972e102 to
15c760d
Compare
RaitoBezarius
approved these changes
Apr 16, 2023
13 tasks
Author
|
Thanks! |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
make-disk-imageis a tool for creating VM images. It takes an argumentcontentsthat allows one to specify files and directories that should be copied into the VM image. However, directories do not end up at the specified target, but instead at a subdirectory of the target, with a nix-store-like path, e.g./target/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-source. See issue #226203 .This change adds a test for make-disk-image's contents directory handling and adds a fix (appending
/to rsync input directory names).This closes issue #226203 .
Things done
I added some checks in
nixosTests.image-contentsand ran it on an x86_64 machine. I also rannixosTests.qemu-vm-restrictnetwork.I did not run these relevant-looking tests, however, because they had issues on master:
nixosTests.ec2-config(not run because it logged about something broken on master)nixosTests.ec2-nixops(not run because it failed on master)nixosTests.sourcehut(not tested because it did not complete in 10 minutes on master)nixosTests.systemd-repart(not tested because it failed on master)sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)