diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-07 00:09:37 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-07 00:09:37 +0200 |
commit | a85dcf4a00c1ac354eda3b84209b8fa6b2133259 (patch) | |
tree | 16bbf46e3cd5d7ea259783ee8b1ea8d5c7048e0d /nixos/tests | |
parent | 4b2ce84872a0903b9800d3ed23915f48ecedc565 (diff) | |
parent | 46a9e805efeee40d360605fa5987866ca45fed23 (diff) | |
download | nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.tar nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.tar.gz nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.tar.bz2 nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.tar.lz nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.tar.xz nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.tar.zst nixpkgs-a85dcf4a00c1ac354eda3b84209b8fa6b2133259.zip |
Merge remote-tracking branch 'origin/master' into staging
Conflicts: pkgs/development/libraries/libav/default.nix pkgs/shells/bash/bash-4.2-patches.nix pkgs/stdenv/generic/default.nix
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/installer.nix | 7 | ||||
-rw-r--r-- | nixos/tests/jenkins.nix | 2 | ||||
-rw-r--r-- | nixos/tests/kde4.nix | 2 | ||||
-rw-r--r-- | nixos/tests/munin.nix | 2 | ||||
-rw-r--r-- | nixos/tests/nat.nix | 130 |
5 files changed, 74 insertions, 69 deletions
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 3e29bc2a45b..138a81ad807 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -6,13 +6,13 @@ with pkgs.lib; let - # Build the ISO. This is the regular installation CD but with test - # instrumentation. + # Build the ISO. This is the regular minimal installation CD but + # with test instrumentation. iso = (import ../lib/eval-config.nix { inherit system; modules = - [ ../modules/installer/cd-dvd/installation-cd-graphical.nix + [ ../modules/installer/cd-dvd/installation-cd-minimal.nix ../modules/testing/test-instrumentation.nix { key = "serial"; boot.loader.grub.timeout = mkOverride 0 0; @@ -43,6 +43,7 @@ let { imports = [ ./hardware-configuration.nix <nixpkgs/nixos/modules/testing/test-instrumentation.nix> + <nixpkgs/nixos/modules/profiles/minimal.nix> ]; ${if useEFI then '' diff --git a/nixos/tests/jenkins.nix b/nixos/tests/jenkins.nix index f0d3139d902..3f4a197ebcc 100644 --- a/nixos/tests/jenkins.nix +++ b/nixos/tests/jenkins.nix @@ -17,7 +17,7 @@ import ./make-test.nix { users.extraUsers.jenkins.extraGroups = [ "users" ]; - systemd.services.jenkins.unitConfig.TimeoutSec = 240; + systemd.services.jenkins.serviceConfig.TimeoutStartSec = "3min"; }; slave = diff --git a/nixos/tests/kde4.nix b/nixos/tests/kde4.nix index 90c37397821..fcc5101feb3 100644 --- a/nixos/tests/kde4.nix +++ b/nixos/tests/kde4.nix @@ -32,7 +32,7 @@ import ./make-test.nix ({ pkgs, ... }: { pkgs.kde4.kdegraphics pkgs.kde4.kdeutils pkgs.kde4.kdegames - pkgs.kde4.kdeedu + #pkgs.kde4.kdeedu pkgs.kde4.kdeaccessibility pkgs.kde4.kdeadmin pkgs.kde4.kdenetwork diff --git a/nixos/tests/munin.nix b/nixos/tests/munin.nix index d18abd68ee0..1e51453df83 100644 --- a/nixos/tests/munin.nix +++ b/nixos/tests/munin.nix @@ -18,7 +18,7 @@ import ./make-test.nix { ''; }; }; - systemd.services.munin-node.unitConfig.TimeoutSec = 240; + systemd.services.munin-node.serviceConfig.TimeoutStartSec = "3min"; }; }; diff --git a/nixos/tests/nat.nix b/nixos/tests/nat.nix index 87ed974edad..c4d2614f785 100644 --- a/nixos/tests/nat.nix +++ b/nixos/tests/nat.nix @@ -3,77 +3,81 @@ # client on the inside network, a server on the outside network, and a # router connected to both that performs Network Address Translation # for the client. +import ./make-test.nix ({ withFirewall, ... }: + let + unit = if withFirewall then "firewall" else "nat"; + in + { + name = "nat${if withFirewall then "WithFirewall" else "Standalone"}"; -import ./make-test.nix { - name = "nat"; + nodes = + { client = + { config, pkgs, nodes, ... }: + { virtualisation.vlans = [ 1 ]; + networking.firewall.allowPing = true; + networking.defaultGateway = + (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ip4).address; + }; - nodes = - { client = - { config, pkgs, nodes, ... }: - { virtualisation.vlans = [ 1 ]; - networking.firewall.allowPing = true; - networking.defaultGateway = - (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ip4).address; - }; + router = + { config, pkgs, ... }: + { virtualisation.vlans = [ 2 1 ]; + networking.firewall.enable = withFirewall; + networking.firewall.allowPing = true; + networking.nat.enable = true; + networking.nat.internalIPs = [ "192.168.1.0/24" ]; + networking.nat.externalInterface = "eth1"; + }; - router = - { config, pkgs, ... }: - { virtualisation.vlans = [ 2 1 ]; - networking.firewall.allowPing = true; - networking.nat.enable = true; - networking.nat.internalIPs = [ "192.168.1.0/24" ]; - networking.nat.externalInterface = "eth1"; - }; + server = + { config, pkgs, ... }: + { virtualisation.vlans = [ 2 ]; + networking.firewall.enable = false; + services.httpd.enable = true; + services.httpd.adminAddr = "foo@example.org"; + services.vsftpd.enable = true; + services.vsftpd.anonymousUser = true; + }; + }; - server = - { config, pkgs, ... }: - { virtualisation.vlans = [ 2 ]; - networking.firewall.enable = false; - services.httpd.enable = true; - services.httpd.adminAddr = "foo@example.org"; - services.vsftpd.enable = true; - services.vsftpd.anonymousUser = true; - }; - }; + testScript = + { nodes, ... }: + '' + startAll; - testScript = - { nodes, ... }: - '' - startAll; + # The router should have access to the server. + $server->waitForUnit("network.target"); + $server->waitForUnit("httpd"); + $router->waitForUnit("network.target"); + $router->succeed("curl --fail http://server/ >&2"); - # The router should have access to the server. - $server->waitForUnit("network.target"); - $server->waitForUnit("httpd"); - $router->waitForUnit("network.target"); - $router->succeed("curl --fail http://server/ >&2"); + # The client should be also able to connect via the NAT router. + $router->waitForUnit("${unit}"); + $client->waitForUnit("network.target"); + $client->succeed("curl --fail http://server/ >&2"); + $client->succeed("ping -c 1 server >&2"); - # The client should be also able to connect via the NAT router. - $router->waitForUnit("nat"); - $client->waitForUnit("network.target"); - $client->succeed("curl --fail http://server/ >&2"); - $client->succeed("ping -c 1 server >&2"); + # Test whether passive FTP works. + $server->waitForUnit("vsftpd"); + $server->succeed("echo Hello World > /home/ftp/foo.txt"); + $client->succeed("curl -v ftp://server/foo.txt >&2"); - # Test whether passive FTP works. - $server->waitForUnit("vsftpd"); - $server->succeed("echo Hello World > /home/ftp/foo.txt"); - $client->succeed("curl -v ftp://server/foo.txt >&2"); + # Test whether active FTP works. + $client->succeed("curl -v -P - ftp://server/foo.txt >&2"); - # Test whether active FTP works. - $client->succeed("curl -v -P - ftp://server/foo.txt >&2"); + # Test ICMP. + $client->succeed("ping -c 1 router >&2"); + $router->succeed("ping -c 1 client >&2"); - # Test ICMP. - $client->succeed("ping -c 1 router >&2"); - $router->succeed("ping -c 1 client >&2"); + # If we turn off NAT, the client shouldn't be able to reach the server. + $router->succeed("iptables -t nat -D PREROUTING -j nixos-nat-pre"); + $router->succeed("iptables -t nat -D POSTROUTING -j nixos-nat-post"); + $client->fail("curl --fail --connect-timeout 5 http://server/ >&2"); + $client->fail("ping -c 1 server >&2"); - # If we turn off NAT, the client shouldn't be able to reach the server. - $router->stopJob("nat"); - $client->fail("curl --fail --connect-timeout 5 http://server/ >&2"); - $client->fail("ping -c 1 server >&2"); - - # And make sure that restarting the NAT job works. - $router->succeed("systemctl start nat"); - $client->succeed("curl --fail http://server/ >&2"); - $client->succeed("ping -c 1 server >&2"); - ''; - -} + # And make sure that reloading the NAT job works. + $router->succeed("systemctl restart ${unit}"); + $client->succeed("curl --fail http://server/ >&2"); + $client->succeed("ping -c 1 server >&2"); + ''; + }) |