EscalatePerceivedSeverityTask.robot 5.65 KB
Newer Older
1
*** Settings ***
2
Resource    environment/variables.txt 
Giacomo Bernini's avatar
Giacomo Bernini committed
3
4
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
Library    JSONSchemaLibrary
5
Suite Setup    Check resource existence
6
7
8

*** Test Cases ***
Escalate the perceived severity 
9
    [Documentation]    Test ID: 6.3.4.3.1
10
11
12
    ...    Test title: Escalate the perceived severity
    ...    Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource.
    ...    Pre-conditions: The resource representing the individual alarm has been created
13
    ...    Reference: clause 7.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v2.4.1
14
15
16
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
17
18
19
    Post escalate severity
    Check HTTP Response Status Code Is    204
    
20
GET Escalate the perceived severity - Method not implemented
21
22
    [Documentation]    Test ID: 6.3.4.3.2
    ...    Test title: GET Escalate the perceived severity - Method not implemented
23
    ...    Test objective: to test that the method is not implemented
24
    ...    Pre-conditions: 
25
    ...    Reference: clause 7.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v2.4.1
26
27
28
29
30
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Get escalate severity
    Check HTTP Response Status Code Is    405
31
32

PUT Escalate the perceived severity - Method not implemented
33
34
    [Documentation]    Test ID: 6.3.4.3.3
    ...    Test title: PUT Escalate the perceived severity - Method not implemented
35
    ...    Test objective: to test that the method is not implemented
36
    ...    Pre-conditions: 
37
    ...    Reference: clause 7.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v2.4.1
38
39
40
41
42
43
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Put escalate severity
    Check HTTP Response Status Code Is    405
    
44
PATCH Escalate the perceived severity - Method not implemented
45
46
    [Documentation]    Test ID: 6.3.4.3.4
    ...    Test title: PATCH Escalate the perceived severity - Method not implemented
47
    ...    Test objective: to test that the method is not implemented
48
    ...    Pre-conditions: 
49
    ...    Reference: clause 7.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v2.4.1
50
51
52
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
Giacomo Bernini's avatar
Giacomo Bernini committed
53
    PATCH escalate severity
54
55
    Check HTTP Response Status Code Is    405
    
56
57
    
DELETE Escalate the perceived severity - Method not implemented
58
    [Documentation]    Test ID: 6.3.4.3.5
59
60
    ...    Test title: DELETE Escalate the perceived severity - Method not implemented
    ...    Test objective: to test that the method is not implemented
61
    ...    Pre-conditions: 
62
    ...    Reference: clause 7.4.4.3.5 - ETSI GS NFV-SOL 002 [2] v2.4.1
63
64
65
66
67
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:   
    Delete escalate severity
    Check HTTP Response Status Code Is    405
68

Elian Kraja's avatar
Elian Kraja committed
69
*** Keywords ***
70
Check resource existence
71
72
73
74
75
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Integer    response status    200
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
POST escalate severity
    Log    escalate the perceived severity of an alarm with the VNFM
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate    ${PerceivedSeverity}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
GET escalate severity
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate 
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse} 
PUT escalate severity	
	log    Trying to perform a PUT. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate    
     ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse} 
PATCH escalate severity
    log    Trying to perform a PATCH. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate  
     ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse} 
DELETE escalate severity        
    log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}/escalate  
     ${outputResponse}=    Output    response
Giacomo Bernini's avatar
Giacomo Bernini committed
107
108
109
110
111
112
113
114
115
116
117
118
119
	Set Global Variable    @{response}    ${outputResponse} 
	
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal    ${response.status_code}    ${expected_status}
    Log    Status code validated 
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    SEPARATOR=    ${input}	.schema.json
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK