Commit 686bf5b8914fec002c88beb1241dc26bc68fe5c1

Authored by George Vlahavas
1 parent f690130cc5

Add tests KEA_F001 to KEA_F008

Showing 1 changed file with 43 additions and 1 deletions

kea_testing.groovy View file @ 686bf5b
... ... @@ -90,9 +90,51 @@
90 90 /* Here do your tests */
91 91 sleep 50
92 92 try {
93   - String testName = "1. Check that app is running - 200 response code"
  93 + String testName = "KEA_F001"
94 94 String url = "$APP_URL"
95 95 String responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  96 + if (responseCode != '200') {
  97 + error("$testName: Returned status code = $responseCode when calling $url")
  98 + }
  99 + testName = "KEA_F002"
  100 + url = "$APP_URL:9091"
  101 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  102 + if (responseCode != '200') {
  103 + error("$testName: Returned status code = $responseCode when calling $url")
  104 + }
  105 + testName = "KEA_F003"
  106 + url = "$APP_URL:5000"
  107 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  108 + if (responseCode != '200') {
  109 + error("$testName: Returned status code = $responseCode when calling $url")
  110 + }
  111 + testName = "KEA_F004"
  112 + url = "$APP_URL:1883"
  113 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  114 + if (responseCode != '200') {
  115 + error("$testName: Returned status code = $responseCode when calling $url")
  116 + }
  117 + testName = "KEA_F005"
  118 + url = "$APP_URL:5432"
  119 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  120 + if (responseCode != '200') {
  121 + error("$testName: Returned status code = $responseCode when calling $url")
  122 + }
  123 + testName = "KEA_F006"
  124 + url = "$APP_URL:3001"
  125 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  126 + if (responseCode != '200') {
  127 + error("$testName: Returned status code = $responseCode when calling $url")
  128 + }
  129 + testName = "KEA_F007"
  130 + url = "$APP_URL:5611"
  131 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
  132 + if (responseCode != '200') {
  133 + error("$testName: Returned status code = $responseCode when calling $url")
  134 + }
  135 + testName = "KEA_F008"
  136 + url = "$APP_URL:9091"
  137 + responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true)
96 138 if (responseCode != '200') {
97 139 error("$testName: Returned status code = $responseCode when calling $url")
98 140 }