Commit 296ef6417b08e704d38400aefa696fe28d102d4e

Authored by George Vlahavas
1 parent 9396f6c4aa

Add OD test

Showing 1 changed file with 18 additions and 0 deletions

kea_testing.groovy View file @ 296ef64
... ... @@ -88,6 +88,24 @@
88 88 error("$testName: Returned status code = $responseCode when calling $url")
89 89 }
90 90  
  91 + testName = "KEA_F009"
  92 + url = "$APP_URL/api/v1/od/start"
  93 + 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)
  94 + if (!responseCode.endsWith('200')) {
  95 + error("$testName: Returned status code = $responseCode when calling $url")
  96 + }
  97 + String processId = responseCode.split(",")[1].split(":")[1].split('"')[1];
  98 + url = "$APP_URL/api/v1/od/status"
  99 + 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)
  100 + if (responseCode != '200') {
  101 + error("$testName: Returned status code = $responseCode when calling $url")
  102 + }
  103 + url = "$APP_URL/api/v1/od/stop/$processId"
  104 + 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)
  105 + if (responseCode != '200') {
  106 + error("$testName: Returned status code = $responseCode when calling $url")
  107 + }
  108 +
91 109 } catch (ignored) {
92 110 currentBuild.result = 'FAILURE'
93 111 echo "KEA Deployment Tests failed"