-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_project.yml
119 lines (108 loc) · 3.37 KB
/
test_project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Test project
description: |
Integration test for project creation.
cleanup:
- path: /project/my_custom_application_policy_set_uuid
- path: /project/794dfa10-9bed-11e9-a497-ffb71b17054e
test_data:
project: &project
uuid: 794dfa10-9bed-11e9-a497-ffb71b17054e
name: 794dfa10-9bed-11e9-a497-ffb71b17054e
parent_type: domain
parent_uuid: beefbeef-beef-beef-beef-beefbeef0002
quota: {}
user_made_application_policy_set: &user_made_application_policy_set_project
uuid: my_custom_application_policy_set_uuid
fq_name:
- default-domain
- 794dfa10-9bed-11e9-a497-ffb71b17054e
- my-custom-aps
parent_type: project
clients:
default:
id: alice
password: alice_password
insecure: true
scope:
project:
name: admin
workflow:
- name: create project
request:
path: /projects
method: POST
expected: [200]
data:
project: *project
expect:
project: *project
watchers:
/contrail/project/794dfa10-9bed-11e9-a497-ffb71b17054e:
- data:
<<: *project # requested project was created with default-application-policy-set
- name: check if default-application-policy-set was created
request:
path: /application-policy-sets?parent_id=794dfa10-9bed-11e9-a497-ffb71b17054e
method: GET
expected: [200]
expect:
application-policy-sets:
- all_applications: true
name: default-application-policy-set # name is default
display_name: default-application-policy-set # display_name matches default name
fq_name:
- default-domain
- 794dfa10-9bed-11e9-a497-ffb71b17054e
- default-application-policy-set # fqname extends project's fqname
parent_type: project
parent_uuid: 794dfa10-9bed-11e9-a497-ffb71b17054e # parent_uuid points to project
- name: check if the ref from the project to the set was created
request:
path: /project/794dfa10-9bed-11e9-a497-ffb71b17054e
method: GET
expected: [200]
expect:
project:
application_policy_set_refs:
- {}
application_policy_sets:
- fq_name: [default-domain, 794dfa10-9bed-11e9-a497-ffb71b17054e, default-application-policy-set]
- name: create user made application-policy-set
request:
path: /application-policy-sets
method: POST
expected: [200]
data:
application-policy-set: *user_made_application_policy_set_project
expect:
application-policy-set: *user_made_application_policy_set_project
- name: try to delete project with user made application-policy-set
request:
path: /project/794dfa10-9bed-11e9-a497-ffb71b17054e
method: DELETE
expected: [409]
expect: null
- name: delete user made application policy set
request:
path: /application-policy-set/my_custom_application_policy_set_uuid
method: DELETE
expected: [200]
expect: null
- name: delete project
request:
path: /project/794dfa10-9bed-11e9-a497-ffb71b17054e
method: DELETE
expected: [200]
expect: null
- name: ensure default application policy set is deleted too
request:
path: /application-policy-sets?parent_id=794dfa10-9bed-11e9-a497-ffb71b17054e
method: GET
expected: [200]
expect:
application-policy-sets: []
watchers:
/contrail/application_policy_set/my_custom_application_policy_set_uuid:
- data:
name: my-custom-aps
- data: {uuid: $null} # empty event is emitted in case of deletion