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;
|
|
|
|
in
|
|
|
|
|
|
|
|
with imageBuilder;
|
|
|
|
|
|
|
|
let
|
|
|
|
cmds =
|
|
|
|
mapAttrsToList (name: fn:
|
|
|
|
let
|
|
|
|
fs = fn {
|
|
|
|
name = removePrefix "make" name;
|
|
|
|
# FIXME : this is wrong. Not all partition IDs have the same format.
|
|
|
|
partitionID = "0123456789ABCDEF";
|
|
|
|
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}
|
|
|
|
''
|
|
|
|
|