nixos/gitea: convert test to python
This commit is contained in:
parent
8eead58520
commit
9b33b5d38c
@ -3,7 +3,7 @@
|
|||||||
pkgs ? import ../.. { inherit system config; }
|
pkgs ? import ../.. { inherit system config; }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with import ../lib/testing.nix { inherit system pkgs; };
|
with import ../lib/testing-python.nix { inherit system pkgs; };
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -18,11 +18,11 @@ with pkgs.lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
startAll;
|
start_all()
|
||||||
|
|
||||||
$machine->waitForUnit('gitea.service');
|
machine.wait_for_unit("gitea.service")
|
||||||
$machine->waitForOpenPort('3000');
|
machine.wait_for_open_port(3000)
|
||||||
$machine->succeed("curl --fail http://localhost:3000/");
|
machine.succeed("curl --fail http://localhost:3000/")
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -37,11 +37,11 @@ with pkgs.lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
startAll;
|
start_all()
|
||||||
|
|
||||||
$machine->waitForUnit('gitea.service');
|
machine.wait_for_unit("gitea.service")
|
||||||
$machine->waitForOpenPort('3000');
|
machine.wait_for_open_port(3000)
|
||||||
$machine->succeed("curl --fail http://localhost:3000/");
|
machine.succeed("curl --fail http://localhost:3000/")
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,12 +56,14 @@ with pkgs.lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
startAll;
|
start_all()
|
||||||
|
|
||||||
$machine->waitForUnit('gitea.service');
|
machine.wait_for_unit("gitea.service")
|
||||||
$machine->waitForOpenPort('3000');
|
machine.wait_for_open_port(3000)
|
||||||
$machine->succeed("curl --fail http://localhost:3000/");
|
machine.succeed("curl --fail http://localhost:3000/")
|
||||||
$machine->succeed("curl --fail http://localhost:3000/user/sign_up | grep 'Registration is disabled. Please contact your site administrator.'");
|
machine.succeed(
|
||||||
|
"curl --fail http://localhost:3000/user/sign_up | grep 'Registration is disabled. Please contact your site administrator.'"
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user