From 686bf5b8914fec002c88beb1241dc26bc68fe5c1 Mon Sep 17 00:00:00 2001 From: George Vlahavas Date: Fri, 21 May 2021 12:17:30 +0300 Subject: [PATCH] Add tests KEA_F001 to KEA_F008 --- kea_testing.groovy | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/kea_testing.groovy b/kea_testing.groovy index e752366..c777916 100644 --- a/kea_testing.groovy +++ b/kea_testing.groovy @@ -90,12 +90,54 @@ pipeline { /* Here do your tests */ sleep 50 try { - String testName = "1. Check that app is running - 200 response code" + String testName = "KEA_F001" String url = "$APP_URL" String responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) if (responseCode != '200') { error("$testName: Returned status code = $responseCode when calling $url") } + testName = "KEA_F002" + url = "$APP_URL:9091" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + testName = "KEA_F003" + url = "$APP_URL:5000" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + testName = "KEA_F004" + url = "$APP_URL:1883" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + testName = "KEA_F005" + url = "$APP_URL:5432" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + testName = "KEA_F006" + url = "$APP_URL:3001" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + testName = "KEA_F007" + url = "$APP_URL:5611" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + testName = "KEA_F008" + url = "$APP_URL:9091" + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $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