Newer
Older
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
*** Setting ***
Resource environment/variables.txt
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
Library MockServerLibrary
Library Process
Library OperatingSystem
Library BuiltIn
Library Collections
Library String
*** Test Cases ***
Check Notification Endpoint
&{req}= Create Mock Request Matcher GET ${callback_endpoint}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Clear Requests ${callback_endpoint}
Post NSD Change Notification
${json}= Get File schemas/NsdChangeNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Change Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post NSD Deletion Notification
${json}= Get File schemas/NsdDeletionNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Deletion Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post NSD Onboard Failure Notification
${json}= Get File schemas/NsdOnboardingFailureNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Onboard Failure Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post NSD Onboard Notification
${json}= Get File schemas/NsdOnboardingNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Onboard Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post PNFD Deletion Notification
${json}= Get File schemas/PnfdDeletionNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle PNFD Deletion Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post PNFD Onboard Failure Notification
${json}= Get File schemas/PNFDOnboardingFailureNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle PNFD Onboard Failure Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post PNFD Onboard Notification
${json}= Get File schemas/OPNFDOnboardingNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Onboard Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post Notification Negative 404
${json}= Get File schemas/ProblemDetails.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle Notification to handle 404 error
&{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
PUT VNF Package Management Notification
Log PUT Method not implemented
&{req}= Create Mock Request Matcher PUT ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
PATCH VNF Package Management Notification
Log PATCH Method not implemented
&{req}= Create Mock Request Matcher PATCH ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
DELETE VNF Package Management Notification
Log PATCH Method not implemented
&{req}= Create Mock Request Matcher DELETE ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
*** Keywords ***
Create Sessions
Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${callback_uri}:${callback_port}