2019-08-29 04:48:46 +03:00
|
|
|
# Tests all known filesystems with files.
|
|
|
|
# This test helps ensure the basic interface stays stable, and works.
|
|
|
|
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
|
|
|
|
let
|
|
|
|
imageBuilder = pkgs.callPackage <image-builder> {};
|
|
|
|
inherit (pkgs.lib.attrsets) mapAttrsToList;
|
|
|
|
inherit (pkgs.lib.strings) concatStringsSep removePrefix;
|
2019-08-30 01:12:51 +03:00
|
|
|
IDs = {
|
|
|
|
FAT32 = "0123456789ABCDEF";
|
|
|
|
ESP = "0123456789ABCDEF";
|
2019-08-30 01:16:39 +03:00
|
|
|
Ext4 = "44444444-4444-4444-1324-123456789098";
|
2019-08-30 01:12:51 +03:00
|
|
|
};
|
2019-08-29 04:48:46 +03:00
|
|
|
in
|
|
|
|
|
|
|
|
with imageBuilder;
|
|
|
|
|
|
|
|
let
|
|
|
|
cmds =
|
2019-08-30 01:12:51 +03:00
|
|
|
mapAttrsToList (fn_name: fn:
|
2019-08-29 04:48:46 +03:00
|
|
|
let
|
2019-08-30 01:12:51 +03:00
|
|
|
fs = fn rec {
|
|
|
|
name = removePrefix "make" fn_name;
|
|
|
|
partitionID = IDs."${name}";
|
2019-08-29 04:48:46 +03:00
|
|
|
populateCommands = ''
|
|
|
|
echo "I am ${name}." > file
|
|
|
|
ls -lA
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
''
|
2019-08-30 01:07:09 +03:00
|
|
|
ln -s ${fs}/${fs.filename} $out/
|
2019-08-29 04:48:46 +03:00
|
|
|
'') fileSystem;
|
|
|
|
in
|
|
|
|
pkgs.runCommandNoCC "filesystems-test" {} ''
|
|
|
|
mkdir -p $out/
|
|
|
|
${concatStringsSep "\n" cmds}
|
|
|
|
''
|
|
|
|
|