diff --git a/devops-service/features/api_v2/10_create/10_image.feature b/devops-service/features/api_v2/10_create/10_image.feature index ff0cf22..a83c4ab 100644 --- a/devops-service/features/api_v2/10_create/10_image.feature +++ b/devops-service/features/api_v2/10_create/10_image.feature @@ -23,6 +23,14 @@ Feature: Manage images When I send GET '/v2.0/images' query without headers 'Accept' Then response should be '406' + Scenario: Get list of all images without privileges + When I send GET '/v2.0/images' query with user without privileges + Then response should be '401' + + Scenario: Get list of all images - invalid path + When I send GET '/v2.0/images/foo' query + Then response should be '404' + @openstack Scenario: Get list of openstack images When I send GET '/v2.0/images?provider=openstack' query @@ -59,11 +67,6 @@ Feature: Manage images When I send GET '/v2.0/images/provider/openstack' query with user without privileges Then response should be '401' - @openstack - Scenario: Get openstack image without privileges - When I send GET '/v2.0/image/08093b30-8393-42c3-8fb3-c4df56deb967' query with user without privileges - Then response should be '401' - @ec2 Scenario: Get list of ec2 images When I send GET '/v2.0/images?provider=ec2' query @@ -100,11 +103,6 @@ Feature: Manage images When I send GET '/v2.0/images/provider/ec2' query with user without privileges Then response should be '401' - @ec2 - Scenario: Get ec2 image without privileges - When I send GET '/v2.0/image/ami-63071b0a' query with user without privileges - Then response should be '401' - Scenario: Get list of images of unknown provider When I send GET '/v2.0/images/provider/foo' query Then response should be '404' @@ -537,6 +535,11 @@ Feature: Manage images When I send GET '/v2.0/image/ami-63071b0a' query without headers 'Accept' Then response should be '406' + @ec2 + Scenario: Get ec2 image without privileges + When I send GET '/v2.0/image/ami-63071b0a' query with user without privileges + Then response should be '401' + @openstack Scenario: Get info for single openstack image When I send GET '/v2.0/image/08093b30-8393-42c3-8fb3-c4df56deb967' query @@ -559,6 +562,11 @@ Feature: Manage images When I send GET '/v2.0/image/08093b30-8393-42c3-8fb3-c4df56deb967' query without headers 'Accept' Then response should be '406' + @openstack + Scenario: Get openstack image without privileges + When I send GET '/v2.0/image/08093b30-8393-42c3-8fb3-c4df56deb967' query with user without privileges + Then response should be '401' + Scenario: Get info for single unknown image When I send GET '/v2.0/image/foo' query Then response should be '404' diff --git a/devops-service/features/api_v2/10_create/20_project.feature b/devops-service/features/api_v2/10_create/20_project.feature new file mode 100644 index 0000000..9185135 --- /dev/null +++ b/devops-service/features/api_v2/10_create/20_project.feature @@ -0,0 +1,59 @@ +@project +Feature: create project + + @openstack + Scenario: Create project test_openstack + When I send POST '/v2.0/project' query with JSON body + """ + { + "deploy_envs": [ + { + "identifier": "test", + "run_list": [], + "expires": null, + "provider": "openstack", + "users": [ + "test" + ], + "flavor": "as_long_as_image", + "image": "08093b30-8393-42c3-8fb3-c4df56deb967", + "subnets": [ + "private" + ], + "groups": [ + "default" + ] + } + ], + "name": "test_openstack" + } + """ + Then response should be '201' + + @ec2 + Scenario: Create project test_ec2 + When I send POST '/v2.0/project' query with JSON body + """ + { + "deploy_envs": [ + { + "identifier": "test", + "run_list": [], + "expires": null, + "provider": "ec2", + "users": [ + "test" + ], + "flavor": "m1.small", + "image": "ami-63071b0a", + "subnets": [], + "groups": [ + "default" + ] + } + ], + "name": "test_ec2" + } + """ + Then response should be '201' + diff --git a/devops-service/features/api_v2/90_delete/80_project.feature b/devops-service/features/api_v2/90_delete/80_project.feature new file mode 100644 index 0000000..f1f9ed6 --- /dev/null +++ b/devops-service/features/api_v2/90_delete/80_project.feature @@ -0,0 +1,53 @@ +@project +Feature: delete project + + @openstack + Scenario: Delete openstack project with user without privileges + When I send DELETE '/v2.0/project/test_openstack' query with user without privileges + Then response should be '401' + + @openstack + Scenario: Delete openstack project without header 'Accept' + When I send DELETE '/v2.0/project/test_openstack' query without header 'Accept' + Then response should be '406' + + @openstack + Scenario: Delete openstack project + When I send DELETE '/v2.0/project/test_openstack' query + Then response should be '200' + And the Content-Type header should include 'application/json' + And the JSON response should be an object + And response should be JSON object like: + """ + { + "message" : "Project 'test_openstack' is deleted" + } + """ + + @ec2 + Scenario: Delete ec2 project with user without privileges + When I send DELETE '/v2.0/project/test_ec2' query with user without privileges + Then response should be '401' + + @ec2 + Scenario: Delete ec2 project without header 'Accept' + When I send DELETE '/v2.0/project/test_ec2' query without header 'Accept' + Then response should be '406' + + @ec2 + Scenario: Delete ec2 project + When I send DELETE '/v2.0/project/test_ec2' query + Then response should be '200' + And the Content-Type header should include 'application/json' + And the JSON response should be an object + And response should be JSON object like: + """ + { + "message" : "Project 'test_ec2' is deleted" + } + """ + + Scenario: Delete unknown project + When I send DELETE '/v2.0/project/foo' query + Then response should be '404' + diff --git a/devops-service/features/api_v2/server.feature b/devops-service/features/api_v2/server.feature index 2e07521..75f1d69 100644 --- a/devops-service/features/api_v2/server.feature +++ b/devops-service/features/api_v2/server.feature @@ -1,3 +1,4 @@ +@server Feature: Create server for existing environment Scenario: Get project 'test' When I send GET '/v2.0/project/test' query