From 8e2f093da1951aaa81677e8203b890c9f7cb84cb Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 1 Oct 2024 08:51:22 +0200 Subject: [PATCH] Replace echo command and get the ip --- tests/API-dhcp/Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/API-dhcp/Jenkinsfile b/tests/API-dhcp/Jenkinsfile index 24c6b4f..8038f19 100644 --- a/tests/API-dhcp/Jenkinsfile +++ b/tests/API-dhcp/Jenkinsfile @@ -26,14 +26,12 @@ pipeline { echo "Get IP of API server for DHCP with Vagrant" sh ''' set -e - new_ip=$(vagrant ssh -c "ip a | grep inet | grep eth0 | awk \'{print $2}\' | cut -d/ -f1") - echo "$new_ip test-api" | sudo -S tee -a /etc/hosts <<<$QINDEL_PASS + new_ip=$(vagrant ssh -c "hostname -I" | tr -d '\r') + echo "$QINDEL_PASS" | sudo -S bash -c "echo '$new_ip api-test' >> /etc/hosts" echo "IP: $new_ip" curl -L -X 'GET' -H 'accept: application/json' "http://api-test/opengnsys3/rest/dhcp/subnets/" ''' } - - } } stage ('Run API tests') {