Commit 88b814847c41dd4253b52272fcb9d47ea8c435d9
1 parent
3e893a46f2
Exists in
master
and in
2 other branches
Add MLTD tests
Showing 1 changed file with 21 additions and 0 deletions
kea_testing.groovy
View file @
88b8148
... | ... | @@ -116,6 +116,27 @@ |
116 | 116 | if (responseCode != '200') { |
117 | 117 | error("$testName: Returned status code = $responseCode when calling $url") |
118 | 118 | } |
119 | + | |
120 | + testName = "KEA_F010" | |
121 | + url = "$APP_URL/api/v1/mltd/start" | |
122 | + responseCode = sh(label: testName, script: "curl -m 10 -sL -w '%{http_code}' -H 'Authorization: Bearer $token' -H 'Accept: application/json, text/plain, */*' $url", returnStdout: true) | |
123 | + echo responseCode | |
124 | + if (!responseCode.endsWith('200')) { | |
125 | + error("$testName: Returned status code = $responseCode when calling $url") | |
126 | + } | |
127 | + String processId = responseCode.split(",")[1].split(":")[1].split('"')[1]; | |
128 | + url = "$APP_URL/api/v1/mltd/status" | |
129 | + 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) | |
130 | + echo responseCode | |
131 | + if (responseCode != '200') { | |
132 | + error("$testName: Returned status code = $responseCode when calling $url") | |
133 | + } | |
134 | + url = "$APP_URL/api/v1/mltd/stop/$processId" | |
135 | + 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) | |
136 | + echo responseCode | |
137 | + if (responseCode != '200') { | |
138 | + error("$testName: Returned status code = $responseCode when calling $url") | |
139 | + } | |
119 | 140 | |
120 | 141 | } catch (ignored) { |
121 | 142 | currentBuild.result = 'FAILURE' |