Skip to content

Commit

Permalink
pool: add more pool test and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
khys95 committed Aug 15, 2024
1 parent 23c5214 commit fc227f1
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
41 changes: 41 additions & 0 deletions .ci/poolEndpoint.http
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,47 @@ Authorization: Basic {{user_name}} {{passwd}}
});
%}

### Get the list of pools inside the disk-qos
GET {{frontend-door}}{{endpoint}}{{poolmanager}}{{qosDiskGroup}}{{pools}}
Authorization: Basic {{user_name}} {{passwd}}

> {%
client.test("Successful response when calling /pool", function() {
client.assert(response.status === 200, "Response was not 200");
client.assert(response.body[0] === "pool_res1", "index 0 is not pool_res1");
client.assert(response.body[1] === "pool_res2", "index 1 is not pool_res2");
client.assert(response.body[2] === "pool_res3", "index 2 is not pool_res3");
client.assert(response.contentType !="application/json", "Content type is json");
});
%}

### Get information about resgroup
GET {{frontend-door}}{{endpoint}}{{poolmanager}}{{resGroup}}
Content-Type: application/json
Authorization: Basic {{user_name}} {{passwd}}

> {%
client.test("Successful response and information when calling /resGroup", function() {
client.assert(response.status === 200, "Response was not 200");
client.assert(response.body["name"] === "resgroup", "incorrect group name");
client.assert(response.body["links"][0] === "resilient-link", "incorrect link");
client.assert(response.body["pools"][0] === "pool_res1", "index 0 is not pool_res1");
client.assert(response.body["pools"][1] === "pool_res2", "index 1 is not pool_res2");
client.assert(response.body["pools"][2] === "pool_res3", "index 2 is not pool_res3");
});
%}

### Get information about non existent group
GET {{frontend-door}}{{endpoint}}{{poolmanager}}{{nonExistentGroup}}{{pools}}
Content-Type: application/json
Authorization: Basic {{user_name}} {{passwd}}

> {%
client.test("Successful response when calling /pool", function() {
client.assert(response.status === 500, "Response was not 500");
});
%}

### Upload frontend file
PUT {{webdav-door}}/frontendReadMeFile
Authorization: Basic {{user_name}} {{passwd}}
Expand Down
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ Frontend test suite:
- kubectl -n $K8S_NAMESPACE cp .ci/qosEndpoint.http http-tester:/qosEndpoint.http
- kubectl -n $K8S_NAMESPACE cp .ci/qos-policyEndpoint.http http-tester:/qos-policyEndpoint.http
- kubectl -n $K8S_NAMESPACE cp README.md http-tester:/README.md
- kubectl -n $K8S_NAMESPACE cp BUILDING.md http-tester:/BUILDING.md
- kubectl -n $K8S_NAMESPACE cp .ci/migrationEndpoint.http http-tester:/migrationEndpoint.http
- kubectl -n $K8S_NAMESPACE cp http-client.private.env.json http-tester:/http-client.private.env.json
- kubectl -n $K8S_NAMESPACE exec http-tester -- java --add-opens=java.base/java.util=ALL-UNNAMED $IJHTTP_JAVA_OPTS -cp /intellij-http-client/\* com.intellij.httpClient.cli.HttpClientMain -e Test -D /poolEndpoint.http -p /http-client.private.env.json --insecure --report=/httpTests
Expand Down
8 changes: 6 additions & 2 deletions http-client.private.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
"endpoint": "/api/v1",
"qos-management": "/qos-management/qos",
"migrations": "/migrations",
"poolmanager": "/poolgroups",
"resGroup": "/resgroup",
"qosDiskGroup": "/qos-disk",
"nonExistentGroup": "/nonExistentGroup",
"pools": "/pools",
"qos-policy": "/qos-policy",
"namespace": "/namespace",
"labels": "/labels",
"sourcePool" : "\"pool_write\"",
"sourcePool" : "\"pool_a\"",
"target": "hsm",
"targetPools": "\"pool_res1\"",
"targetPools": "\"pool_b\"",
"osm_targetPools": "\"osm\"",
"wrong_src_pool_name" : "wrong_src_pool_name",
"wrong_target_pool_name" : "wrong_target_pool_name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ public PoolGroup getPoolGroup(@ApiParam("The poolgroup to be described.")

@GET
@Path("/{group}/pools")
@ApiOperation("Get a list of pools that are a member of a poolgroup. If no "
+ "poolgroup is specified then all pools are listed. "
@ApiOperation("Get a list of pools that are a member of a pool group. If no "
+ "pool group is specified then all pools are listed. "
+ "Results sorted lexicographically by pool name.")
@Produces(MediaType.APPLICATION_JSON)
public String[] getPoolsOfGroup(@ApiParam("The poolgroup to be described.")
//todo: add logic when no pool group is specified
public String[] getPoolsOfGroup(@ApiParam("The pool group to be described.")
@PathParam("group") String group) {
if (group == null) {
return service.listPools();
Expand Down

0 comments on commit fc227f1

Please sign in to comment.