From 4f093b8fdb3e6b7102ad99089712beca2ae49abb Mon Sep 17 00:00:00 2001 From: Pamplemousse Date: Sun, 4 Jul 2021 14:49:39 -0700 Subject: [PATCH] nixos/modules/jenkins: Test the CLI Signed-off-by: Pamplemousse --- nixos/tests/jenkins-cli.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 nixos/tests/jenkins-cli.nix diff --git a/nixos/tests/jenkins-cli.nix b/nixos/tests/jenkins-cli.nix new file mode 100644 index 000000000000..f25e1604da33 --- /dev/null +++ b/nixos/tests/jenkins-cli.nix @@ -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)" + ) + ''; +})