From 90e3a9ef3287f8433d252c8c54aa50c09a7f0d98 Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 1 Oct 2024 00:49:47 +0200 Subject: [PATCH] Updating scripts to get environment ready --- tests/API-dhcp/Jenkinsfile | 13 ++- tests/API-dhcp/Vagrantfile | 1 + tests/API-dhcp/assets/kea-ctrl-agent.conf | 104 ++++++++++++++++++++++ 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 tests/API-dhcp/assets/kea-ctrl-agent.conf 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 = <