Merge pull request #75795 from kampka/port-tests-4

Port NixOS tests to python
This commit is contained in:
Niklas Hambüchen 2019-12-18 02:14:43 +00:00 committed by GitHub
commit f7b6824e5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 31 deletions

View File

@ -1,4 +1,4 @@
import ../make-test.nix ({...}: { import ../make-test-python.nix ({...}: {
nodes = { nodes = {
namenode = {pkgs, ...}: { namenode = {pkgs, ...}: {
services.hadoop = { services.hadoop = {
@ -35,20 +35,20 @@ import ../make-test.nix ({...}: {
}; };
testScript = '' testScript = ''
startAll start_all()
$namenode->waitForUnit("hdfs-namenode"); namenode.wait_for_unit("hdfs-namenode")
$namenode->waitForUnit("network.target"); namenode.wait_for_unit("network.target")
$namenode->waitForOpenPort(8020); namenode.wait_for_open_port(8020)
$namenode->waitForOpenPort(9870); namenode.wait_for_open_port(9870)
$datanode->waitForUnit("hdfs-datanode"); datanode.wait_for_unit("hdfs-datanode")
$datanode->waitForUnit("network.target"); datanode.wait_for_unit("network.target")
$datanode->waitForOpenPort(9864); datanode.wait_for_open_port(9864)
$datanode->waitForOpenPort(9866); datanode.wait_for_open_port(9866)
$datanode->waitForOpenPort(9867); datanode.wait_for_open_port(9867)
$namenode->succeed("curl http://namenode:9870"); namenode.succeed("curl http://namenode:9870")
$datanode->succeed("curl http://datanode:9864"); datanode.succeed("curl http://datanode:9864")
''; '';
}) })

View File

@ -1,4 +1,4 @@
import ../make-test.nix ({...}: { import ../make-test-python.nix ({...}: {
nodes = { nodes = {
resourcemanager = {pkgs, ...}: { resourcemanager = {pkgs, ...}: {
services.hadoop.package = pkgs.hadoop_3_1; services.hadoop.package = pkgs.hadoop_3_1;
@ -28,19 +28,19 @@ import ../make-test.nix ({...}: {
}; };
testScript = '' testScript = ''
startAll; start_all()
$resourcemanager->waitForUnit("yarn-resourcemanager"); resourcemanager.wait_for_unit("yarn-resourcemanager")
$resourcemanager->waitForUnit("network.target"); resourcemanager.wait_for_unit("network.target")
$resourcemanager->waitForOpenPort(8031); resourcemanager.wait_for_open_port(8031)
$resourcemanager->waitForOpenPort(8088); resourcemanager.wait_for_open_port(8088)
$nodemanager->waitForUnit("yarn-nodemanager"); nodemanager.wait_for_unit("yarn-nodemanager")
$nodemanager->waitForUnit("network.target"); nodemanager.wait_for_unit("network.target")
$nodemanager->waitForOpenPort(8042); nodemanager.wait_for_open_port(8042)
$nodemanager->waitForOpenPort(8041); nodemanager.wait_for_open_port(8041)
$resourcemanager->succeed("curl http://localhost:8088"); resourcemanager.succeed("curl http://localhost:8088")
$nodemanager->succeed("curl http://localhost:8042"); nodemanager.succeed("curl http://localhost:8042")
''; '';
}) })

View File

@ -1,4 +1,4 @@
import ../make-test.nix ({ pkgs, ... }: import ../make-test-python.nix ({ pkgs, ... }:
{ {
name = "hitch"; name = "hitch";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
@ -23,11 +23,11 @@ import ../make-test.nix ({ pkgs, ... }:
testScript = testScript =
'' ''
startAll; start_all()
$machine->waitForUnit('multi-user.target'); machine.wait_for_unit("multi-user.target")
$machine->waitForUnit('hitch.service'); machine.wait_for_unit("hitch.service")
$machine->waitForOpenPort(443); machine.wait_for_open_port(443)
$machine->succeed('curl -k https://localhost:443/index.txt | grep "We are all good!"'); assert "We are all good!" in machine.succeed("curl -k https://localhost:443/index.txt")
''; '';
}) })