From f5aef234c925bce5e965b73762383bd5a7c09d17 Mon Sep 17 00:00:00 2001 From: George Vlahavas Date: Fri, 10 Dec 2021 14:42:46 +0200 Subject: [PATCH] Add sleep between api calls --- kea_integration.groovy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kea_integration.groovy b/kea_integration.groovy index b852ce7..70f8155 100644 --- a/kea_integration.groovy +++ b/kea_integration.groovy @@ -42,9 +42,15 @@ pipeline { error("$testName: Returned status code = $responseCode when calling $url") } String processId = responseCode.split(",")[1].split(":")[1]; + + sleep 5; + url = "$APP_URL/api/v1/xlsiem" responseCode = sh(label: testName, script: "curl -m 10 -sL -w '%{http_code}' -H 'Authorization: Bearer $token' -H 'Accept: application/json' -H 'Content-Type: application/json' --data-raw \"`cat pcap-data/mltd1-unix.json`\" $url -o /dev/null", returnStdout: true) echo responseCode + + sleep 5; + if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -53,6 +59,9 @@ pipeline { if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } + + sleep 5; + url = "$APP_URL/api/v1/mltd/stop/$processId" responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' -H 'Authorization: Bearer $token' -H 'Accept: application/json, text/plain, */*' $url -o /dev/null", returnStdout: true) echo responseCode -- 2.2.2