diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/test-driver/log2html.xsl | 135 | ||||
-rw-r--r-- | nixos/lib/test-driver/logfile.css | 129 | ||||
-rw-r--r-- | nixos/lib/test-driver/treebits.js | 30 | ||||
-rw-r--r-- | nixos/lib/testing-python.nix | 18 | ||||
-rw-r--r-- | nixos/lib/testing.nix | 16 | ||||
-rw-r--r-- | nixos/modules/installer/tools/nixos-install.sh | 5 | ||||
-rw-r--r-- | nixos/modules/services/mail/dovecot.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/network-filesystems/ipfs.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/web-apps/dokuwiki.nix | 4 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/dokuwiki.nix | 4 | ||||
-rw-r--r-- | nixos/tests/ipfs.nix | 58 | ||||
-rw-r--r-- | nixos/tests/prometheus.nix | 2 |
13 files changed, 30 insertions, 378 deletions
diff --git a/nixos/lib/test-driver/log2html.xsl b/nixos/lib/test-driver/log2html.xsl deleted file mode 100644 index 0485412b4c8..00000000000 --- a/nixos/lib/test-driver/log2html.xsl +++ /dev/null @@ -1,135 +0,0 @@ -<?xml version="1.0"?> - -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - - <xsl:output method='html' encoding="UTF-8" - doctype-public="-//W3C//DTD HTML 4.01//EN" - doctype-system="http://www.w3.org/TR/html4/strict.dtd" /> - - <xsl:template match="logfile"> - <html> - <head> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery-ui.min.js"></script> - <script type="text/javascript" src="treebits.js" /> - <link rel="stylesheet" href="logfile.css" type="text/css" /> - <title>Log File</title> - </head> - <body> - <h1>VM build log</h1> - <p> - <a href="javascript:" class="logTreeExpandAll">Expand all</a> | - <a href="javascript:" class="logTreeCollapseAll">Collapse all</a> - </p> - <ul class='toplevel'> - <xsl:for-each select='line|nest'> - <li> - <xsl:apply-templates select='.'/> - </li> - </xsl:for-each> - </ul> - - <xsl:if test=".//*[@image]"> - <h1>Screenshots</h1> - <ul class="vmScreenshots"> - <xsl:for-each select='.//*[@image]'> - <li><a href="{@image}"><xsl:value-of select="@image" /></a></li> - </xsl:for-each> - </ul> - </xsl:if> - - </body> - </html> - </xsl:template> - - - <xsl:template match="nest"> - - <!-- The tree should be collapsed by default if all children are - unimportant or if the header is unimportant. --> - <xsl:variable name="collapsed" select="not(./head[@expanded]) and count(.//*[@error]) = 0"/> - - <xsl:variable name="style"><xsl:if test="$collapsed">display: none;</xsl:if></xsl:variable> - - <xsl:if test="line|nest"> - <a href="javascript:" class="logTreeToggle"> - <xsl:choose> - <xsl:when test="$collapsed"><xsl:text>+</xsl:text></xsl:when> - <xsl:otherwise><xsl:text>-</xsl:text></xsl:otherwise> - </xsl:choose> - </a> - <xsl:text> </xsl:text> - </xsl:if> - - <xsl:apply-templates select='head'/> - - <!-- Be careful to only generate <ul>s if there are <li>s, otherwise it’s malformed. --> - <xsl:if test="line|nest"> - - <ul class='nesting' style="{$style}"> - <xsl:for-each select='line|nest'> - - <!-- Is this the last line? If so, mark it as such so that it - can be rendered differently. --> - <xsl:variable name="class"><xsl:choose><xsl:when test="position() != last()">line</xsl:when><xsl:otherwise>lastline</xsl:otherwise></xsl:choose></xsl:variable> - - <li class='{$class}'> - <span class='lineconn' /> - <span class='linebody'> - <xsl:apply-templates select='.'/> - </span> - </li> - </xsl:for-each> - </ul> - </xsl:if> - - </xsl:template> - - - <xsl:template match="head|line"> - <code> - <xsl:if test="@error"> - <xsl:attribute name="class">errorLine</xsl:attribute> - </xsl:if> - <xsl:if test="@warning"> - <xsl:attribute name="class">warningLine</xsl:attribute> - </xsl:if> - <xsl:if test="@priority = 3"> - <xsl:attribute name="class">prio3</xsl:attribute> - </xsl:if> - - <xsl:if test="@type = 'serial'"> - <xsl:attribute name="class">serial</xsl:attribute> - </xsl:if> - - <xsl:if test="@machine"> - <xsl:choose> - <xsl:when test="@type = 'serial'"> - <span class="machine"><xsl:value-of select="@machine"/># </span> - </xsl:when> - <xsl:otherwise> - <span class="machine"><xsl:value-of select="@machine"/>: </span> - </xsl:otherwise> - </xsl:choose> - </xsl:if> - - <xsl:choose> - <xsl:when test="@image"> - <a href="{@image}"><xsl:apply-templates/></a> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates/> - </xsl:otherwise> - </xsl:choose> - </code> - </xsl:template> - - - <xsl:template match="storeref"> - <em class='storeref'> - <span class='popup'><xsl:apply-templates/></span> - <span class='elided'>/...</span><xsl:apply-templates select='name'/><xsl:apply-templates select='path'/> - </em> - </xsl:template> - -</xsl:stylesheet> diff --git a/nixos/lib/test-driver/logfile.css b/nixos/lib/test-driver/logfile.css deleted file mode 100644 index a54d8504a86..00000000000 --- a/nixos/lib/test-driver/logfile.css +++ /dev/null @@ -1,129 +0,0 @@ -body { - font-family: sans-serif; - background: white; -} - -h1 -{ - color: #005aa0; - font-size: 180%; -} - -a { - text-decoration: none; -} - - -ul.nesting, ul.toplevel { - padding: 0; - margin: 0; -} - -ul.toplevel { - list-style-type: none; -} - -.line, .head { - padding-top: 0em; -} - -ul.nesting li.line, ul.nesting li.lastline { - position: relative; - list-style-type: none; -} - -ul.nesting li.line { - padding-left: 2.0em; -} - -ul.nesting li.lastline { - padding-left: 2.1em; /* for the 0.1em border-left in .lastline > .lineconn */ -} - -li.line { - border-left: 0.1em solid #6185a0; -} - -li.line > span.lineconn, li.lastline > span.lineconn { - position: absolute; - height: 0.65em; - left: 0em; - width: 1.5em; - border-bottom: 0.1em solid #6185a0; -} - -li.lastline > span.lineconn { - border-left: 0.1em solid #6185a0; -} - - -em.storeref { - color: #500000; - position: relative; - width: 100%; -} - -em.storeref:hover { - background-color: #eeeeee; -} - -*.popup { - display: none; -/* background: url('http://losser.st-lab.cs.uu.nl/~mbravenb/menuback.png') repeat; */ - background: #ffffcd; - border: solid #555555 1px; - position: absolute; - top: 0em; - left: 0em; - margin: 0; - padding: 0; - z-index: 100; -} - -em.storeref:hover span.popup { - display: inline; - width: 40em; -} - - -.logTreeToggle { - text-decoration: none; - font-family: monospace; - font-size: larger; -} - -.errorLine { - color: #ff0000; - font-weight: bold; -} - -.warningLine { - color: darkorange; - font-weight: bold; -} - -.prio3 { - font-style: italic; -} - -code { - white-space: pre-wrap; -} - -.serial { - color: #56115c; -} - -.machine { - color: #002399; - font-style: italic; -} - -ul.vmScreenshots { - padding-left: 1em; -} - -ul.vmScreenshots li { - font-family: monospace; - list-style: square; -} diff --git a/nixos/lib/test-driver/treebits.js b/nixos/lib/test-driver/treebits.js deleted file mode 100644 index 9754093dfd0..00000000000 --- a/nixos/lib/test-driver/treebits.js +++ /dev/null @@ -1,30 +0,0 @@ -$(document).ready(function() { - - /* When a toggle is clicked, show or hide the subtree. */ - $(".logTreeToggle").click(function() { - if ($(this).siblings("ul:hidden").length != 0) { - $(this).siblings("ul").show(); - $(this).text("-"); - } else { - $(this).siblings("ul").hide(); - $(this).text("+"); - } - }); - - /* Implementation of the expand all link. */ - $(".logTreeExpandAll").click(function() { - $(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() { - $(this).siblings("ul").show(); - $(this).text("-"); - }); - }); - - /* Implementation of the collapse all link. */ - $(".logTreeCollapseAll").click(function() { - $(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() { - $(this).siblings("ul").hide(); - $(this).text("+"); - }); - }); - -}); diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index 3891adc1043..88801f20517 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -62,25 +62,11 @@ in rec { requiredSystemFeatures = [ "kvm" "nixos-test" ]; - buildInputs = [ libxslt ]; - buildCommand = '' - mkdir -p $out/nix-support - - LOGFILE=$out/log.xml tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver - - # 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 - ln -s ${jquery}/js/jquery.min.js $out/ - ln -s ${jquery}/js/jquery.js $out/ - ln -s ${jquery-ui}/js/jquery-ui.min.js $out/ - ln -s ${jquery-ui}/js/jquery-ui.js $out/ + mkdir -p $out - touch $out/nix-support/hydra-build-products - echo "report testlog $out log.html" >> $out/nix-support/hydra-build-products + LOGFILE=/dev/null tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver for i in */xchg/coverage-data; do mkdir -p $out/coverage-data diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix index 7d6a5c0a290..cbb7faf039e 100644 --- a/nixos/lib/testing.nix +++ b/nixos/lib/testing.nix @@ -58,23 +58,11 @@ in rec { requiredSystemFeatures = [ "kvm" "nixos-test" ]; - buildInputs = [ libxslt ]; - buildCommand = '' - mkdir -p $out/nix-support - - LOGFILE=$out/log.xml tests='eval $ENV{testScript}; die $@ if $@;' ${driver}/bin/nixos-test-driver - - # 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 - ln -s ${jquery}/js/jquery.min.js $out/ - ln -s ${jquery-ui}/js/jquery-ui.min.js $out/ + mkdir -p $out - touch $out/nix-support/hydra-build-products - echo "report testlog $out log.html" >> $out/nix-support/hydra-build-products + LOGFILE=/dev/null tests='eval $ENV{testScript}; die $@ if $@;' ${driver}/bin/nixos-test-driver for i in */xchg/coverage-data; do mkdir -p $out/coverage-data diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 6e1d56af2ae..1bccbbfaf24 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -87,8 +87,11 @@ if [[ ! -e $NIXOS_CONFIG && -z $system ]]; then fi # A place to drop temporary stuff. +tmpdir="$(mktemp -d -p $mountPoint)" trap "rm -rf $tmpdir" EXIT -tmpdir="$(mktemp -d)" + +# store temporary files on target filesystem by default +export TMPDIR=${TMPDIR:-$tmpdir} sub="auto?trusted=1" diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix index 230a2ae3f82..9fbf0c19752 100644 --- a/nixos/modules/services/mail/dovecot.nix +++ b/nixos/modules/services/mail/dovecot.nix @@ -407,7 +407,7 @@ in after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - restartTriggers = [ cfg.configFile ]; + restartTriggers = [ cfg.configFile modulesDir ]; serviceConfig = { ExecStart = "${dovecotPkg}/sbin/dovecot -F"; diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index b6d881afd7b..880f70ae141 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -37,9 +37,7 @@ let baseService = recursiveUpdate commonEnv { wants = [ "ipfs-init.service" ]; # NB: migration must be performed prior to pre-start, else we get the failure message! - preStart = '' - ipfs repo fsck # workaround for BUG #4212 (https://github.com/ipfs/go-ipfs/issues/4214) - '' + optionalString cfg.autoMount '' + preStart = optionalString cfg.autoMount '' ipfs --local config Mounts.FuseAllowOther --json true ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir} ipfs --local config Mounts.IPNS ${cfg.ipnsMountDir} diff --git a/nixos/modules/services/web-apps/dokuwiki.nix b/nixos/modules/services/web-apps/dokuwiki.nix index 76e18266a27..33a828fa2cb 100644 --- a/nixos/modules/services/web-apps/dokuwiki.nix +++ b/nixos/modules/services/web-apps/dokuwiki.nix @@ -188,7 +188,7 @@ let name = "icalevents"; # Download the plugin from the dokuwiki site src = pkgs.fetchurl { - url = https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip; + url = "https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip"; sha256 = "e40ed7dd6bbe7fe3363bbbecb4de481d5e42385b5a0f62f6a6ce6bf3a1f9dfa8"; }; sourceRoot = "."; @@ -216,7 +216,7 @@ let name = "bootstrap3"; # Download the theme from the dokuwiki site src = pkgs.fetchurl { - url = https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip; + url = "https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip"; sha256 = "4de5ff31d54dd61bbccaf092c9e74c1af3a4c53e07aa59f60457a8f00cfb23a6"; }; # We need unzip to build this package diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ecdd30a6c50..d9aee709f1c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -143,6 +143,7 @@ in initrdNetwork = handleTest ./initrd-network.nix {}; installer = handleTest ./installer.nix {}; iodine = handleTest ./iodine.nix {}; + ipfs = handleTest ./ipfs.nix {}; ipv6 = handleTest ./ipv6.nix {}; jackett = handleTest ./jackett.nix {}; jellyfin = handleTest ./jellyfin.nix {}; diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index 2b907133ed5..05271919eff 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -5,7 +5,7 @@ let name = "bootstrap3"; # Download the theme from the dokuwiki site src = pkgs.fetchurl { - url = https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip; + url = "https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip"; sha256 = "4de5ff31d54dd61bbccaf092c9e74c1af3a4c53e07aa59f60457a8f00cfb23a6"; }; # We need unzip to build this package @@ -20,7 +20,7 @@ let name = "icalevents"; # Download the plugin from the dokuwiki site src = pkgs.fetchurl { - url = https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip; + url = "https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip"; sha256 = "e40ed7dd6bbe7fe3363bbbecb4de481d5e42385b5a0f62f6a6ce6bf3a1f9dfa8"; }; # We need unzip to build this package diff --git a/nixos/tests/ipfs.nix b/nixos/tests/ipfs.nix index 3cff7e99ff8..4d721aec0c7 100644 --- a/nixos/tests/ipfs.nix +++ b/nixos/tests/ipfs.nix @@ -1,55 +1,25 @@ - -import ./make-test.nix ({ pkgs, ...} : { +import ./make-test-python.nix ({ pkgs, ...} : { name = "ipfs"; meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ mguentner ]; }; - nodes = { - adder = - { ... }: - { - services.ipfs = { - enable = true; - defaultMode = "norouting"; - gatewayAddress = "/ip4/127.0.0.1/tcp/2323"; - apiAddress = "/ip4/127.0.0.1/tcp/2324"; - }; - networking.firewall.allowedTCPPorts = [ 4001 ]; - }; - getter = - { ... }: - { - services.ipfs = { - enable = true; - defaultMode = "norouting"; - autoMount = true; - }; - networking.firewall.allowedTCPPorts = [ 4001 ]; - }; + nodes.machine = { ... }: { + services.ipfs = { + enable = true; + apiAddress = "/ip4/127.0.0.1/tcp/2324"; + }; }; testScript = '' - startAll; - $adder->waitForUnit("ipfs-norouting"); - $getter->waitForUnit("ipfs-norouting"); - - # wait until api is available - $adder->waitUntilSucceeds("ipfs --api /ip4/127.0.0.1/tcp/2324 id"); - my $addrId = $adder->succeed("ipfs --api /ip4/127.0.0.1/tcp/2324 id -f=\"<id>\""); - my $addrIp = (split /[ \/]+/, $adder->succeed("ip -o -4 addr show dev eth1"))[3]; - - $adder->mustSucceed("[ -n \"\$(ipfs --api /ip4/127.0.0.1/tcp/2324 config Addresses.Gateway | grep /ip4/127.0.0.1/tcp/2323)\" ]"); - - # wait until api is available - $getter->waitUntilSucceeds("ipfs --api /ip4/127.0.0.1/tcp/5001 id"); - my $ipfsHash = $adder->mustSucceed("echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | cut -d' ' -f2"); - chomp($ipfsHash); + start_all() + machine.wait_for_unit("ipfs") - $adder->mustSucceed("[ -n \"\$(echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | grep added)\" ]"); + machine.wait_until_succeeds("ipfs --api /ip4/127.0.0.1/tcp/2324 id") + ipfs_hash = machine.succeed( + "echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | awk '{ print $2 }'" + ) - $getter->mustSucceed("ipfs --api /ip4/127.0.0.1/tcp/5001 swarm connect /ip4/$addrIp/tcp/4001/ipfs/$addrId"); - $getter->mustSucceed("[ -n \"\$(ipfs --api /ip4/127.0.0.1/tcp/5001 cat /ipfs/$ipfsHash | grep fnord)\" ]"); - $getter->mustSucceed("[ -n \"$(cat /ipfs/$ipfsHash | grep fnord)\" ]"); - ''; + machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord") + ''; }) diff --git a/nixos/tests/prometheus.nix b/nixos/tests/prometheus.nix index 8bfd0c131e6..bce489168f9 100644 --- a/nixos/tests/prometheus.nix +++ b/nixos/tests/prometheus.nix @@ -179,7 +179,7 @@ in import ./make-test-python.nix { s3.succeed( "mc config host add minio " + "http://localhost:${toString minioPort} " - + "${s3.accessKey} ${s3.secretKey} S3v4", + + "${s3.accessKey} ${s3.secretKey} --api s3v4", "mc mb minio/thanos-bucket", ) |