From 296ef6417b08e704d38400aefa696fe28d102d4e Mon Sep 17 00:00:00 2001 From: George Vlahavas Date: Thu, 9 Sep 2021 00:13:21 +0300 Subject: [PATCH] Add OD test --- kea_testing.groovy | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kea_testing.groovy b/kea_testing.groovy index 0b4cc87..4327fa6 100644 --- a/kea_testing.groovy +++ b/kea_testing.groovy @@ -88,6 +88,24 @@ pipeline { error("$testName: Returned status code = $responseCode when calling $url") } + testName = "KEA_F009" + url = "$APP_URL/api/v1/od/start" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' -H 'Authorization: Bearer $token' -H 'Accept: application/json, text/plain, */*' $url", returnStdout: true) + if (!responseCode.endsWith('200')) { + error("$testName: Returned status code = $responseCode when calling $url") + } + String processId = responseCode.split(",")[1].split(":")[1].split('"')[1]; + url = "$APP_URL/api/v1/od/status" + 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) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + url = "$APP_URL/api/v1/od/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) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + } catch (ignored) { currentBuild.result = 'FAILURE' echo "KEA Deployment Tests failed" -- 2.2.2