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"