strip trailing whitespace; no functional change
svn path=/nixos/trunk/; revision=29285
This commit is contained in:
@@ -9,7 +9,7 @@ rec {
|
||||
|
||||
inherit pkgs;
|
||||
|
||||
|
||||
|
||||
# Build a virtual network from an attribute set `{ machine1 =
|
||||
# config1; ... machineN = configN; }', where `machineX' is the
|
||||
# hostname and `configX' is a NixOS system configuration. Each
|
||||
@@ -38,7 +38,7 @@ rec {
|
||||
assignIPAddresses = nodes:
|
||||
|
||||
let
|
||||
|
||||
|
||||
machines = lib.attrNames nodes;
|
||||
|
||||
machinesNumbered = lib.zipTwoLists machines (lib.range 1 254);
|
||||
@@ -47,7 +47,7 @@ rec {
|
||||
[ ( { config, pkgs, nodes, ... }:
|
||||
let
|
||||
interfacesNumbered = lib.zipTwoLists config.virtualisation.vlans (lib.range 1 255);
|
||||
interfaces =
|
||||
interfaces =
|
||||
lib.flip map interfacesNumbered ({ first, second }:
|
||||
{ name = "eth${toString second}";
|
||||
ipAddress = "192.168.${toString first}.${toString m.second}";
|
||||
@@ -58,12 +58,12 @@ rec {
|
||||
{ key = "ip-address";
|
||||
config =
|
||||
{ networking.hostName = m.first;
|
||||
|
||||
|
||||
networking.interfaces = interfaces;
|
||||
|
||||
|
||||
networking.primaryIPAddress =
|
||||
lib.optionalString (interfaces != []) (lib.head interfaces).ipAddress;
|
||||
|
||||
|
||||
# Put the IP addresses of all VMs in this machine's
|
||||
# /etc/hosts file. If a machine has multiple
|
||||
# interfaces, use the IP address corresponding to
|
||||
@@ -74,7 +74,7 @@ rec {
|
||||
lib.optionalString (config.networking.primaryIPAddress != "")
|
||||
("${config.networking.primaryIPAddress} " +
|
||||
"${config.networking.hostName}\n"));
|
||||
|
||||
|
||||
virtualisation.qemu.options =
|
||||
lib.flip map interfacesNumbered
|
||||
({ first, second }: qemuNICFlags second first m.second);
|
||||
|
||||
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
|
||||
name = "iso9660-image";
|
||||
builder = ./make-iso9660-image.sh;
|
||||
buildInputs = [perl cdrkit];
|
||||
|
||||
|
||||
inherit isoName bootable bootImage compressImage volumeID pathsFromGraph;
|
||||
|
||||
# !!! should use XML.
|
||||
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
|
||||
# !!! should use XML.
|
||||
objects = map (x: x.object) storeContents;
|
||||
symlinks = map (x: x.symlink) storeContents;
|
||||
|
||||
|
||||
# For obtaining the closure of `storeContents'.
|
||||
exportReferencesGraph =
|
||||
map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "squashfs.img";
|
||||
|
||||
|
||||
buildInputs = [perl squashfsTools];
|
||||
|
||||
|
||||
# For obtaining the closure of `storeContents'.
|
||||
exportReferencesGraph =
|
||||
map (x: [("closure-" + baseNameOf x) x]) storeContents;
|
||||
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
|
||||
''
|
||||
# Add the closures of the top-level store objects.
|
||||
storePaths=$(perl ${pathsFromGraph} closure-*)
|
||||
|
||||
|
||||
# Also include a manifest of the closures in a format suitable
|
||||
# for nix-store --load-db.
|
||||
printRegistration=1 perl ${pathsFromGraph} closure-* > nix-path-registration
|
||||
|
||||
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
|
||||
name = "tarball";
|
||||
builder = ./make-system-tarball.sh;
|
||||
buildInputs = [perl xz];
|
||||
|
||||
|
||||
inherit fileName pathsFromGraph;
|
||||
|
||||
# !!! should use XML.
|
||||
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
|
||||
# !!! should use XML.
|
||||
objects = map (x: x.object) storeContents;
|
||||
symlinks = map (x: x.symlink) storeContents;
|
||||
|
||||
|
||||
# For obtaining the closure of `storeContents'.
|
||||
exportReferencesGraph =
|
||||
map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
|
||||
|
||||
@@ -14,13 +14,13 @@ rec {
|
||||
buildInputs = [ makeWrapper perl ];
|
||||
|
||||
unpackPhase = "true";
|
||||
|
||||
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
cp ${./test-driver/test-driver.pl} $out/bin/nixos-test-driver
|
||||
chmod u+x $out/bin/nixos-test-driver
|
||||
|
||||
|
||||
libDir=$out/lib/perl5/site_perl
|
||||
mkdir -p $libDir
|
||||
cp ${./test-driver/Machine.pm} $libDir/Machine.pm
|
||||
@@ -38,9 +38,9 @@ rec {
|
||||
runTests = driver:
|
||||
stdenv.mkDerivation {
|
||||
name = "vm-test-run";
|
||||
|
||||
|
||||
requiredSystemFeatures = [ "kvm" ];
|
||||
|
||||
|
||||
buildInputs = [ pkgs.libxslt ];
|
||||
|
||||
buildCommand =
|
||||
@@ -49,7 +49,7 @@ rec {
|
||||
|
||||
LOGFILE=$out/log.xml tests='eval $ENV{testScript}; die $@ if $@;' ${driver}/bin/nixos-test-driver || failed=1
|
||||
|
||||
# Generate a pretty-printed log.
|
||||
# Generate a pretty-printed log.
|
||||
xsltproc --output $out/log.html ${./test-driver/log2html.xsl} $out/log.xml
|
||||
ln -s ${./test-driver/logfile.css} $out/logfile.css
|
||||
ln -s ${./test-driver/treebits.js} $out/treebits.js
|
||||
@@ -96,12 +96,12 @@ rec {
|
||||
done
|
||||
|
||||
find $TMPDIR/gcov -name "*.gcda" -exec chmod 644 {} \;
|
||||
|
||||
|
||||
echo "producing info..."
|
||||
${pkgs.lcov}/bin/geninfo --ignore-errors source,gcov $TMPDIR/gcov --output-file $TMPDIR/app.info
|
||||
cat $TMPDIR/app.info >> $TMPDIR/full.info
|
||||
done
|
||||
|
||||
|
||||
echo "making report..."
|
||||
mkdir -p $out/coverage
|
||||
${pkgs.lcov}/bin/genhtml --show-details $TMPDIR/full.info -o $out/coverage
|
||||
@@ -131,11 +131,11 @@ rec {
|
||||
if builtins.isFunction t.testScript
|
||||
then t.testScript { inherit nodes; }
|
||||
else t.testScript;
|
||||
|
||||
|
||||
vlans = map (m: m.config.virtualisation.vlans) (lib.attrValues nodes);
|
||||
|
||||
vms = map (m: m.config.system.build.vm) (lib.attrValues nodes);
|
||||
|
||||
|
||||
# Generate onvenience wrappers for running the test driver
|
||||
# interactively with the specified network, and for starting the
|
||||
# VMs from the command line.
|
||||
@@ -161,11 +161,11 @@ rec {
|
||||
''; # "
|
||||
|
||||
test = runTests driver;
|
||||
|
||||
|
||||
report = makeReport test;
|
||||
};
|
||||
|
||||
|
||||
|
||||
runInMachine =
|
||||
{ drv
|
||||
, machine
|
||||
@@ -181,12 +181,12 @@ rec {
|
||||
|
||||
buildrunner = writeText "vm-build" ''
|
||||
source $1
|
||||
|
||||
|
||||
${coreutils}/bin/mkdir -p $TMPDIR
|
||||
cd $TMPDIR
|
||||
|
||||
|
||||
$origBuilder $origArgs
|
||||
|
||||
|
||||
exit $?
|
||||
'';
|
||||
|
||||
@@ -211,10 +211,10 @@ rec {
|
||||
builder = "${bash}/bin/sh";
|
||||
args = ["-e" vmRunCommand];
|
||||
origArgs = attrs.args;
|
||||
origBuilder = attrs.builder;
|
||||
origBuilder = attrs.builder;
|
||||
});
|
||||
|
||||
|
||||
|
||||
runInMachineWithX = { require ? [], ... } @ args:
|
||||
let
|
||||
client =
|
||||
@@ -238,7 +238,7 @@ rec {
|
||||
'';
|
||||
} // args);
|
||||
|
||||
|
||||
|
||||
simpleTest = as: (makeTest ({ ... }: as)).test;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user