Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ./make-test.nix ({ pkgs, lib, ... }:
- {
- name = "fstab";
- meta.maintainers = [ lib.maintainers.aanderse ];
- nodes = {
- machine =
- { ... }:
- { boot.supportedFilesystems = [ "zfs" ];
- networking.hostId = "deadbeef";
- };
- newMachine =
- { ... }:
- { boot.supportedFilesystems = [ "zfs" ];
- networking.hostId = "deadbeef";
- fileSystems."/foo bar" =
- { device = "tank/foo bar";
- fsType = "zfs";
- };
- fileSystems."/blah" =
- { device = "tank/blah";
- fsType = "zfs";
- };
- };
- };
- testScript = { nodes, ... }: let
- inherit (nodes.newMachine.config.system.build) toplevel;
- in ''
- $machine->start;
- $machine->waitForUnit('multi-user.target');
- $machine->succeed('modprobe zfs');
- $machine->succeed('zpool status');
- $machine->succeed('truncate -s 100M /test.img');
- $machine->succeed('zpool create -f tank /test.img');
- $machine->succeed('zfs create -o mountpoint=legacy tank/foo\\ bar');
- $machine->succeed('zfs create -o mountpoint=legacy tank/blah');
- $machine->succeed('${toplevel}/bin/switch-to-configuration test');
- print $machine->execute('zpool status');
- print $machine->execute('zfs list');
- print $machine->execute('ls -ltr /');
- print $machine->execute('cat /etc/fstab');
- '';
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement