diff --git a/kea_testing.groovy b/kea_testing.groovy index 61e3be4..dced4ec 100644 --- a/kea_testing.groovy +++ b/kea_testing.groovy @@ -35,6 +35,7 @@ pipeline { String testName = "KEA_F001" String url = "$APP_URL" String 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -42,6 +43,7 @@ pipeline { testName = "KEA_F002" url = "$APP_URL/components/od" 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -49,6 +51,7 @@ pipeline { testName = "KEA_F003" url = "$APP_URL/components/mltd" 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -56,6 +59,7 @@ pipeline { testName = "KEA_F004" url = "$APP_URL/api/config" 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -63,6 +67,7 @@ pipeline { testName = "KEA_F005" url = "$APP_URL/api/capec" 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -70,6 +75,7 @@ pipeline { testName = "KEA_F006" url = "https://kea-grafana.vlahavas.com/api/dashboards/home" responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' -H 'Αuthorization: Bearer $token' -H 'Accept: application/json, text/plain, */*' $url -o /dev/null", returnStdout: true) + echo responseCode if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -77,6 +83,7 @@ pipeline { testName = "KEA_F007" url = "https://kea-kibana.vlahavas.com/app/kibana" 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -84,6 +91,7 @@ pipeline { testName = "KEA_F008" url = "$APP_URL/components/ceptd" 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 if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } @@ -98,11 +106,13 @@ pipeline { 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) + echo responseCode 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) + echo responseCode if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") }