move test definitions
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -0,0 +1 @@
|
||||
tests/*.json
|
108
group-test.json
108
group-test.json
@@ -1,108 +0,0 @@
|
||||
{
|
||||
"name": "CBS group testing",
|
||||
"testCases": {
|
||||
"test1": {
|
||||
"path": "/api/login",
|
||||
"method": "POST",
|
||||
"description": "Perform login",
|
||||
"body": {
|
||||
"username": "Administrator",
|
||||
"password": "Password123"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["access_token"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"test2": {
|
||||
"path": "/api/admin/groups",
|
||||
"method": "GET",
|
||||
"description": "get group listing",
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["groupName"],
|
||||
"contains": {
|
||||
"message": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test3": {
|
||||
"path": "/api/admin/group/add",
|
||||
"disabled": true,
|
||||
"method": "POST",
|
||||
"description": "add new local group",
|
||||
"body": {
|
||||
"groupName": "test local group",
|
||||
"ldapGroup": false
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test4": {
|
||||
"path": "/api/admin/groups",
|
||||
"method": "GET",
|
||||
"description": "get group listing again",
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["groupName"],
|
||||
"contains": {
|
||||
"message": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test5": {
|
||||
"path": "/api/admin/group/delete",
|
||||
"method": "POST",
|
||||
"description": "remove new local group",
|
||||
"body": {
|
||||
"groupName": "test local group",
|
||||
"ldapGroup": false
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": "https://10.63.39.130:8443",
|
||||
"insecure": true,
|
||||
"header": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"capture": {
|
||||
"test1": {
|
||||
"body": {
|
||||
"access_token": "%ACCESS_TOKEN%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"name": "CBS permissions testing",
|
||||
"testCases": {
|
||||
"test1": {
|
||||
"path": "/api/login",
|
||||
"method": "POST",
|
||||
"description": "Perform login",
|
||||
"body": {
|
||||
"username": "Administrator",
|
||||
"password": "Password123"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["access_token"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"test2": {
|
||||
"path": "/api/admin/permissions",
|
||||
"method": "GET",
|
||||
"description": "get list of permissions",
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["permissionId"],
|
||||
"contains": {
|
||||
"message": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test3": {
|
||||
"path": "/api/admin/permission/add",
|
||||
"method": "POST",
|
||||
"description": "create new permission",
|
||||
"body": {
|
||||
"Description": "Readonly access to default safe",
|
||||
"safeId": 1,
|
||||
"userId": 2,
|
||||
"readOnly": true
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": "https://10.63.39.130:8443",
|
||||
"insecure": true,
|
||||
"header": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"capture": {
|
||||
"test1": {
|
||||
"body": {
|
||||
"access_token": "%ACCESS_TOKEN%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
120
safes-test.json
120
safes-test.json
@@ -1,120 +0,0 @@
|
||||
{
|
||||
"name": "CBS safes testing",
|
||||
"testCases": {
|
||||
"test1": {
|
||||
"path": "/api/login",
|
||||
"method": "POST",
|
||||
"description": "Perform login",
|
||||
"body": {
|
||||
"username": "Administrator",
|
||||
"password": "Password123"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["access_token"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"test2": {
|
||||
"path": "/api/safe/list",
|
||||
"method": "GET",
|
||||
"description": "get user allowed safe listing",
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["safeName"],
|
||||
"contains": {
|
||||
"message": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test3": {
|
||||
"path": "/api/admin/safe/add",
|
||||
"method": "POST",
|
||||
"description": "create new safe",
|
||||
"body": {
|
||||
"safeName": "API test created safe"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test4": {
|
||||
"path": "/api/admin/safe/add",
|
||||
"method": "POST",
|
||||
"description": "create new safe",
|
||||
"body": {
|
||||
"safeName": "API test created second safe"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test5": {
|
||||
"path": "/api/admin/safe/listall",
|
||||
"method": "GET",
|
||||
"description": "get all defined safe listing",
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["safeName"],
|
||||
"contains": {
|
||||
"message": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test6": {
|
||||
"path": "/api/admin/safe/delete",
|
||||
"method": "POST",
|
||||
"description": "get all defined safe listing",
|
||||
"body": {
|
||||
"safeName": "API test created safe"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": "https://10.63.39.130:8443",
|
||||
"insecure": true,
|
||||
"header": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"capture": {
|
||||
"test1": {
|
||||
"body": {
|
||||
"access_token": "%ACCESS_TOKEN%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,67 +0,0 @@
|
||||
{
|
||||
"name": "CBS test cases",
|
||||
"testCases": {
|
||||
"test1": {
|
||||
"path": "/api/login",
|
||||
"method": "POST",
|
||||
"description": "Perform login",
|
||||
"body": {
|
||||
"username": "Administrator",
|
||||
"password": "Password123"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["access_token"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"test12": {
|
||||
"path": "/api/secret/store",
|
||||
"method": "POST",
|
||||
"description": "store first new secret",
|
||||
"body": {
|
||||
"safeId": 1,
|
||||
"deviceName": {
|
||||
"random": {
|
||||
"isString": true,
|
||||
"length": 12
|
||||
}
|
||||
},
|
||||
"deviceCategory": "appliance",
|
||||
"userName": "service@cdc.home",
|
||||
"secretValue": {
|
||||
"random": {
|
||||
"isString": true,
|
||||
"length": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": "https://10.63.39.130:8443",
|
||||
"insecure": true,
|
||||
"header": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"capture": {
|
||||
"test1": {
|
||||
"body": {
|
||||
"access_token": "%ACCESS_TOKEN%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
296
tests.json
296
tests.json
@@ -1,296 +0,0 @@
|
||||
{
|
||||
"name": "CBS test cases",
|
||||
"testCases": {
|
||||
"test1": {
|
||||
"path": "/api/login",
|
||||
"method": "POST",
|
||||
"description": "Perform login",
|
||||
"body": {
|
||||
"username": "Administrator",
|
||||
"password": "Password123"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["access_token"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"test2": {
|
||||
"path": "/api/admin/user/add",
|
||||
"method": "POST",
|
||||
"description": "register user account",
|
||||
"header": {
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"body": {
|
||||
"username": "test",
|
||||
"password": "test"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"contains": {
|
||||
"message": "registration success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test3": {
|
||||
"path": "/api/admin/users",
|
||||
"method": "GET",
|
||||
"description": "get user account listing",
|
||||
"expect": {
|
||||
"body": {
|
||||
"contains": {
|
||||
"userName": "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test4": {
|
||||
"path": "/api/admin/user/delete",
|
||||
"method": "POST",
|
||||
"description": "delete user account",
|
||||
"body": {
|
||||
"userName": "test"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"contains": {
|
||||
"message": "user deletion success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test5": {
|
||||
"path": "/api/admin/user/delete",
|
||||
"method": "POST",
|
||||
"description": "try to delete non-existing user account",
|
||||
"body": {
|
||||
"userName": "test"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "400"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"contains": {
|
||||
"error": "attempt to delete non-existing username"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test10": {
|
||||
"path": "/api/admin/unlock",
|
||||
"disabled": false,
|
||||
"method": "POST",
|
||||
"description": "provide unlock key",
|
||||
"body": {
|
||||
"secretKey": "Example32ByteSecretKey0123456789"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test11": {
|
||||
"path": "/api/admin/unlock",
|
||||
"disabled": false,
|
||||
"method": "POST",
|
||||
"description": "repeat provide unlock key",
|
||||
"body": {
|
||||
"secretKey": "Example32ByteSecretKey0123456789"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "400"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test12": {
|
||||
"path": "/api/secret/store",
|
||||
"disabled": true,
|
||||
"method": "POST",
|
||||
"description": "store first new secret",
|
||||
"body": {
|
||||
"safeId": 1,
|
||||
"deviceName": {
|
||||
"random": {
|
||||
"isString": true,
|
||||
"length": 12
|
||||
}
|
||||
},
|
||||
"deviceCategory": "appliance",
|
||||
"userName": "service@cdc.home",
|
||||
"secretValue": "TheWiggles"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test20": {
|
||||
"path": "/api/secret/list",
|
||||
"disabled": false,
|
||||
"method": "GET",
|
||||
"description": "List secrets",
|
||||
"header": {
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test21": {
|
||||
"path": "/api/secret/retrieve",
|
||||
"method": "POST",
|
||||
"description": "get existing secret",
|
||||
"body": {
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"deviceCategory": "windows-server",
|
||||
"userName": "dummy@cdc.home"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test22": {
|
||||
"path": "/api/secret/update",
|
||||
"method": "POST",
|
||||
"description": "update existing secret",
|
||||
"body": {
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"deviceCategory": "windows-server",
|
||||
"userName": "dummy@cdc.home",
|
||||
"secretValue": "TheAlphabet29"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test23": {
|
||||
"path": "/api/secret/retrieve",
|
||||
"method": "POST",
|
||||
"description": "get updated secret",
|
||||
"body": {
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"deviceCategory": "windows-server",
|
||||
"userName": "dummy@cdc.home"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"contains": {
|
||||
"deviceName": "adcp01.cdc.home"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test24": {
|
||||
"path": "/api/secret/delete",
|
||||
"method": "POST",
|
||||
"description": "delete existing secret",
|
||||
"body": {
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"deviceCategory": "windows-server",
|
||||
"userName": "dummy@cdc.home"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test25": {
|
||||
"path": "/api/secret/store",
|
||||
"method": "POST",
|
||||
"description": "store new secret",
|
||||
"body": {
|
||||
"safeId": 1,
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"deviceCategory": "windows-server",
|
||||
"userName": "dummy@cdc.home",
|
||||
"secretValue": "TheAlphabet"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test26": {
|
||||
"path": "/api/secret/retrieve",
|
||||
"method": "POST",
|
||||
"description": "test retrieving the new secret",
|
||||
"body": {
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"userName": "dummy@cdc.home"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": "https://10.63.39.130:8443",
|
||||
"insecure": true,
|
||||
"header": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"capture": {
|
||||
"test1": {
|
||||
"body": {
|
||||
"access_token": "%ACCESS_TOKEN%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"name": "CBS normal user testing",
|
||||
"testCases": {
|
||||
"test1": {
|
||||
"path": "/api/login",
|
||||
"method": "POST",
|
||||
"description": "Perform login",
|
||||
"body": {
|
||||
"username": "nathtest",
|
||||
"password": "VMware1!"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"hasKeys": ["access_token"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"test20": {
|
||||
"path": "/api/secret/list",
|
||||
"disabled": false,
|
||||
"method": "GET",
|
||||
"description": "List secrets",
|
||||
"header": {
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"expect": {
|
||||
"header": {
|
||||
"contains": {
|
||||
"http_status": "200"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test22": {
|
||||
"path": "/api/secret/update",
|
||||
"method": "POST",
|
||||
"description": "try update existing secret",
|
||||
"body": {
|
||||
"deviceName": "adcp01.cdc.home",
|
||||
"deviceCategory": "windows-server",
|
||||
"userName": "dummy@cdc.home",
|
||||
"secretValue": "TheWiggles"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": "https://10.63.39.130:8443",
|
||||
"insecure": true,
|
||||
"header": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer %ACCESS_TOKEN%"
|
||||
},
|
||||
"capture": {
|
||||
"test1": {
|
||||
"body": {
|
||||
"access_token": "%ACCESS_TOKEN%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user