create project and delete project tests
This commit is contained in:
parent
cf33b8c7c5
commit
438d20884a
@ -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'
|
||||
|
||||
59
devops-service/features/api_v2/10_create/20_project.feature
Normal file
59
devops-service/features/api_v2/10_create/20_project.feature
Normal file
@ -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'
|
||||
|
||||
53
devops-service/features/api_v2/90_delete/80_project.feature
Normal file
53
devops-service/features/api_v2/90_delete/80_project.feature
Normal file
@ -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'
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
@server
|
||||
Feature: Create server for existing environment
|
||||
Scenario: Get project 'test'
|
||||
When I send GET '/v2.0/project/test' query
|
||||
|
||||
Loading…
Reference in New Issue
Block a user