-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider checking in a static fs hierarchy for tests #66
Comments
I think this is an excellent idea, @jpo-joyent. I'll try to modify our test setup accordingly and make use of the |
Adds in symlinks to block device directories (excluding loopbacks) for static snapshot of sysfs. Issue #66
Issue #66 Read a block device's /sys/block/$DEVICE directory link target and populate the ghw snapshot filesystem with the pseudofiles in the block device directory.
Adds a test script (hack/run-against-snapshot.sh) that builds the ghwc binary into a Docker image, extracts a snapshot created by ghwc-snapshot into a tmpdir, and runs the ghwc Docker image after bind-mounting the snapshot tmpdir as /host. This allows us to test ghw against a snapshot static filesystem from a user's machine (Linux only for now) Issue #66
Adds partition directories into the Linux snapshot, allowing ghwc to retrieve partition information when executing in a readonly test snapshot image. Issue #66
Hi there! I'd love to contribute because I'm interested in testing the syfs reading portion of
|
Hi @fromanirh! Check out the https://github.com/jaypipes/ghw/blob/master/cmd/ghw-snapshot/main.go You can run it like so:
After running that, you will see a You can investigate this snapshot of tmpfs using the https://github.com/jaypipes/ghw/blob/master/hack/run-against-snapshot.sh Of course, I'm very happy to accept any and all contributions that improve the test coverage in |
Thanks for the information @jaypipes ! Far from discouraging, this is a great building block! Do you think a flow like this could be a good direction?
I can contribute (and I'd love to) code & snapshots if we decide to go this direction. |
@fromanirh sounds like a great direction to me! :) |
@jaypipes great! I'll file PRs to implement this direction ASAP, referencing this issue. Thanks! |
Rock on :) Thank you so much! |
Currently,
go test
runs against your local machine, and some tests fail depending on what hardware that machine actually has.It might be a good idea to check in a single fs hierarchy to run tests against (using GHW_CHROOT), and could also serve as a handy reference of file formats for contributors without access to various hardware.
The text was updated successfully, but these errors were encountered: