Commit 3e893a46f2f2532fed4148e2fecaaa1561e9a29c

Authored by George Vlahavas
1 parent 7ebc5964e2

Always echo the responseCode

Showing 1 changed file with 10 additions and 0 deletions

kea_testing.groovy View file @ 3e893a4
... ... @@ -35,6 +35,7 @@
35 35 String testName = "KEA_F001"
36 36 String url = "$APP_URL"
37 37 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)
  38 + echo responseCode
38 39 if (responseCode != '200') {
39 40 error("$testName: Returned status code = $responseCode when calling $url")
40 41 }
... ... @@ -42,6 +43,7 @@
42 43 testName = "KEA_F002"
43 44 url = "$APP_URL/components/od"
44 45 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)
  46 + echo responseCode
45 47 if (responseCode != '200') {
46 48 error("$testName: Returned status code = $responseCode when calling $url")
47 49 }
... ... @@ -49,6 +51,7 @@
49 51 testName = "KEA_F003"
50 52 url = "$APP_URL/components/mltd"
51 53 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)
  54 + echo responseCode
52 55 if (responseCode != '200') {
53 56 error("$testName: Returned status code = $responseCode when calling $url")
54 57 }
... ... @@ -56,6 +59,7 @@
56 59 testName = "KEA_F004"
57 60 url = "$APP_URL/api/config"
58 61 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)
  62 + echo responseCode
59 63 if (responseCode != '200') {
60 64 error("$testName: Returned status code = $responseCode when calling $url")
61 65 }
... ... @@ -63,6 +67,7 @@
63 67 testName = "KEA_F005"
64 68 url = "$APP_URL/api/capec"
65 69 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)
  70 + echo responseCode
66 71 if (responseCode != '200') {
67 72 error("$testName: Returned status code = $responseCode when calling $url")
68 73 }
... ... @@ -70,6 +75,7 @@
70 75 testName = "KEA_F006"
71 76 url = "https://kea-grafana.vlahavas.com/api/dashboards/home"
72 77 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)
  78 + echo responseCode
73 79 if (responseCode != '200') {
74 80 error("$testName: Returned status code = $responseCode when calling $url")
75 81 }
... ... @@ -77,6 +83,7 @@
77 83 testName = "KEA_F007"
78 84 url = "https://kea-kibana.vlahavas.com/app/kibana"
79 85 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)
  86 + echo responseCode
80 87 if (responseCode != '200') {
81 88 error("$testName: Returned status code = $responseCode when calling $url")
82 89 }
... ... @@ -84,6 +91,7 @@
84 91 testName = "KEA_F008"
85 92 url = "$APP_URL/components/ceptd"
86 93 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)
  94 + echo responseCode
87 95 if (responseCode != '200') {
88 96 error("$testName: Returned status code = $responseCode when calling $url")
89 97 }
90 98  
... ... @@ -98,11 +106,13 @@
98 106 String processId = responseCode.split(",")[1].split(":")[1].split('"')[1];
99 107 url = "$APP_URL/api/v1/od/status"
100 108 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)
  109 + echo responseCode
101 110 if (responseCode != '200') {
102 111 error("$testName: Returned status code = $responseCode when calling $url")
103 112 }
104 113 url = "$APP_URL/api/v1/od/stop/$processId"
105 114 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)
  115 + echo responseCode
106 116 if (responseCode != '200') {
107 117 error("$testName: Returned status code = $responseCode when calling $url")
108 118 }