Skip to content

Commit

Permalink
ci: verify file location and migration p2p
Browse files Browse the repository at this point in the history
Motivation: Complete test case scenario for a specific file migration from upload, status check, and pool to pool migration.

Modification: Addition of more tests inside the poolEndpoint.http file

Result: Better testing suite.

Acked-by: Tigran Mkrtchyan
Target: master
Require-book: no
Require-notes: no
  • Loading branch information
khys95 committed Sep 2, 2024
1 parent d4c2c75 commit 09919b7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
32 changes: 30 additions & 2 deletions .ci/poolEndpoint.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Upload frontend file
### Upload readme file
PUT {{webdav-door}}/data/pool-a/ReadMeFile
Authorization: Basic {{user_name}} {{passwd}}
Content-Type: application/octet-stream
Expand All @@ -9,4 +9,32 @@ Content-Type: application/octet-stream
client.test("Successful response when uploading a file", function() {
client.assert(response.status === 201, "Response was not 201");
});
%}
%}


### Verify location of readme file
GET {{frontend-door}}{{endpoint}}{{namespace}}/%2Fdata%2Fpool-a%2FReadMeFile?children=false&locality=false&locations=true&qos=false&optional=false

> {%
client.test("Successful response when verifying location of file", function() {
client.assert(response.status === 200, "Response was not 200");
client.assert(response.body["locations"][0] == "pool-a", "Locations not found");
});
%}


### Migrate ReadMeFile from pool_a to pool_b
POST {{frontend-door}}{{endpoint}}{{migrations}}/copy
Content-Type: application/json
Authorization: Basic {{user_name}} {{passwd}}

{
"sourcePool": {{sourcePool}},
"targetPools": [{{targetPools}}]
}

> {%
client.test("ReadMe file migration successful", function() {
client.assert(response.status === 201, "Migration not successful");
});
%}
6 changes: 3 additions & 3 deletions http-client.private.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"passwd" : "dickerelch",
"incorrect_passwd" : "password",
"webdav-door" : "https://store-door-svc:8083",
"frontend-door" : "http://store-door-svc:3880",
"frontend-door" : "https://store-door-svc:3881",
"endpoint": "/api/v1",
"qos-management": "/qos-management/qos",
"migrations": "/migrations",
"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

0 comments on commit 09919b7

Please sign in to comment.