Skip to content
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

Add basic ZFS tests #31618

Merged
merged 1 commit into from Nov 16, 2017
Merged

Add basic ZFS tests #31618

merged 1 commit into from Nov 16, 2017

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Nov 13, 2017

Motivation for this change

Add some basic testing for zfs to be able to discover regressions in newer kernels more easily.

These are all currently failing because of linuxPackages_4_14 being both lts and latest (but did succeed when testing with linuxPackages_4_13).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Nov 13, 2017

We also have a test in nixos/tests/installer.nix

@@ -0,0 +1,7 @@
{
lts_stable = import ./lts_stable.nix { };
lts_unstable = import ./lts_unstable.nix { };
Copy link
Member

@Mic92 Mic92 Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTS might be redundant. We will most likely see the bug first in latest.

Copy link
Member

@copumpkin copumpkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps factor out the common stuff for both? The duplication sounds like it'll be quite annoying to maintain if we make the tests more sophisticated. It seems like they could live in the same file. See how something like the installer test works, for example

@adisbladis
Copy link
Member Author

@copumpkin Good feedback. It's done 👍

Also implemented tests for zfs encryption.

@jcumming
Copy link
Contributor

jcumming commented Nov 14, 2017

It would be nice to have a test that ran ztest, too:

    # we don't directly create a zfs filesystem here we create a ext3 
    # filesystem and the the zfs unit tests use it.. 
    $machine->succeed("mkfs.ext3 -L ztest /dev/vdb"); 
    $machine->succeed("mkdir /ztest"); 
    $machine->succeed("mount LABEL=ztest /ztest"); 
    $machine->succeed("modprobe zfs");  
    $machine->succeed("echo Running ZFS unit tests, this may take a while..."); 
    $machine->succeed("ztest -f /ztest -T 120 -t1 -VVV");  # single threaded 
    $machine->succeed("ztest -f /ztest -T 120 -VVV");  # multi threaded 

@orivej orivej merged commit f79e3e2 into NixOS:master Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants