Advertisement
Guest User

Untitled

a guest
Oct 28th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. import ./make-test.nix ({ pkgs, lib, ... }:
  2.  
  3. {
  4. name = "fstab";
  5. meta.maintainers = [ lib.maintainers.aanderse ];
  6.  
  7. nodes = {
  8. machine =
  9. { ... }:
  10. { boot.supportedFilesystems = [ "zfs" ];
  11. networking.hostId = "deadbeef";
  12. };
  13.  
  14. newMachine =
  15. { ... }:
  16. { boot.supportedFilesystems = [ "zfs" ];
  17. networking.hostId = "deadbeef";
  18.  
  19. fileSystems."/foo bar" =
  20. { device = "tank/foo bar";
  21. fsType = "zfs";
  22. };
  23.  
  24. fileSystems."/blah" =
  25. { device = "tank/blah";
  26. fsType = "zfs";
  27. };
  28. };
  29. };
  30.  
  31. testScript = { nodes, ... }: let
  32. inherit (nodes.newMachine.config.system.build) toplevel;
  33. in ''
  34. $machine->start;
  35. $machine->waitForUnit('multi-user.target');
  36. $machine->succeed('modprobe zfs');
  37. $machine->succeed('zpool status');
  38.  
  39. $machine->succeed('truncate -s 100M /test.img');
  40. $machine->succeed('zpool create -f tank /test.img');
  41.  
  42. $machine->succeed('zfs create -o mountpoint=legacy tank/foo\\ bar');
  43. $machine->succeed('zfs create -o mountpoint=legacy tank/blah');
  44.  
  45. $machine->succeed('${toplevel}/bin/switch-to-configuration test');
  46. print $machine->execute('zpool status');
  47. print $machine->execute('zfs list');
  48. print $machine->execute('ls -ltr /');
  49. print $machine->execute('cat /etc/fstab');
  50. '';
  51. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement