mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
nixos/modules/jenkins: Test the CLI
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
This commit is contained in:
parent
4265efef54
commit
4f093b8fdb
30
nixos/tests/jenkins-cli.nix
Normal file
30
nixos/tests/jenkins-cli.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
import ./make-test-python.nix ({ pkgs, ...} : rec {
|
||||
name = "jenkins-cli";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ pamplemousse ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ ... }:
|
||||
{
|
||||
services.jenkins = {
|
||||
enable = true;
|
||||
withCLI = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
machine.wait_for_unit("jenkins")
|
||||
|
||||
assert "JENKINS_URL" in machine.succeed("env")
|
||||
assert "http://0.0.0.0:8080" in machine.succeed("echo $JENKINS_URL")
|
||||
|
||||
machine.succeed(
|
||||
"jenkins-cli -auth admin:$(cat /var/lib/jenkins/secrets/initialAdminPassword)"
|
||||
)
|
||||
'';
|
||||
})
|
Loading…
Reference in a new issue