diff --git a/tests/API-dhcp/Jenkinsfile b/tests/API-dhcp/Jenkinsfile index 15498d2..ce5b250 100644 --- a/tests/API-dhcp/Jenkinsfile +++ b/tests/API-dhcp/Jenkinsfile @@ -21,7 +21,18 @@ pipeline { } stage('Check Installation') { steps { - echo 'Testing..' + dir ('tests/API-dhcp') { + 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 tee -a /etc/hosts > /dev/null + echo "IP: $new_ip" + curl -L -X 'GET' -H 'accept: application/json' "http://api-test/opengnsys3/rest/dhcp/subnets/" + ''' + } + + } } stage ('Run API tests') { diff --git a/tests/API-dhcp/Vagrantfile b/tests/API-dhcp/Vagrantfile index cf23524..4462479 100644 --- a/tests/API-dhcp/Vagrantfile +++ b/tests/API-dhcp/Vagrantfile @@ -6,6 +6,7 @@ $script = <