aboutsummaryrefslogtreecommitdiffstats
path: root/tests/optf-cmso/cmso/resources/change_management_ete.robot
blob: 2b1ff5408c1fbe6da1c294096c9957151f2db03d (plain)
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
*** Settings ***
Documentation   Creates VID VNF Instance

#Library   StringTemplater
#Library   UUID
Library   ../attlibs/UID.py
Library   ../attlibs/StringTemplater.py
Library   Collections
Library   SSHLibrary

Resource  scheduler_common.robot
Resource  json_templater.robot
Resource  create_schedule.robot
Resource  approval_requests.robot

*** Variables ****
${TEMPLATES}  /assets/templates

*** Keywords ***
Change Management Template
   [Arguments]    ${request_file}   ${workflow}   ${minutesFromNow}=1
   ${template_folder}=    Catenate   ${TEMPLATES}/changemanagement
   ${uuid}=   Generate UUID 
   ${resp}=   Create Schedule   ${uuid}   ${request_file}   ${template_folder}   workflow=${workflow}   minutesFromNow=${minutesFromNow}   
   Should Be Equal as Strings    ${resp.status_code}    202
   Validate Acknowledgment Response Headers    ${resp} 
   Wait Until Keyword Succeeds    600s    30s    Wait For Pending Approval   ${uuid}
   Send Tier2 Approval   ${uuid}   jf9860    Accepted      
   ${resp}=   Get Change Management   auth   schedules/${uuid}
   Wait Until Keyword Succeeds    120s    30s    Wait For All VNFs Reach Status   Completed   ${uuid}
   Wait Until Keyword Succeeds    120s    30s    Wait for Schedule to Complete   Completed   ${uuid}
   ${reps}=   Delete Change Management   auth   schedules/${uuid}

Change Management Immediate Template
   [Arguments]    ${request_file}    ${workflow}  
   ${template_folder}=    Catenate   ${TEMPLATES}/changemanagement
   ${uuid}=   Generate UUID 
   ${resp}=   Create Schedule   ${uuid}   ${request_file}   ${template_folder}   workflow=${workflow}
   Should Be Equal as Strings    ${resp.status_code}   202
   Validate Acknowledgment Response Headers    ${resp}
   Wait Until Keyword Succeeds    120s    30s    Wait For All VNFs Reach Status   Completed   ${uuid}
   Wait Until Keyword Succeeds    120s    30s    Wait for Schedule to Complete   Completed   ${uuid}
   ${reps}=   Delete Change Management   auth   schedules/${uuid}
    
Wait For All VNFs Reach Status
    [Arguments]   ${status}   ${uuid}
    ${resp}=   Get Change Management   auth   schedules/scheduleDetails?request.scheduleId=${uuid}
    : for   ${vnf}   in  @{resp.json()}
    \   Dictionary Should Contain Item   ${vnf}   status   Completed 
      
Wait for Schedule to Complete
    [Arguments]   ${status}   ${uuid}
    ${resp}=   Get Change Management   auth   schedules/${uuid}
    Dictionary Should Contain Item   ${resp.json()}   status   Completed 

Create and Approve
   [Arguments]    ${request_file}   ${workflow}   ${minutesFromNow}=5  
   ${template_folder}=    Catenate   ${TEMPLATES}/changemanagement
   ${uuid}=   Generate UUID 
   ${resp}=   Create Schedule   ${uuid}   ${request_file}   ${template_folder}   workflow=${workflow}   minutesFromNow=${minutesFromNow}   
   Should Be Equal as Strings    ${resp.status_code}    202 
   Validate Acknowledgment Response Headers    ${resp}
   Wait Until Keyword Succeeds    300s    5s    Wait For Pending Approval   ${uuid}
   Send Tier2 Approval   ${uuid}   jf9860    Accepted      

Change Management Cancel Template
   [Arguments]    ${request_file}   ${workflow}   ${minutesFromNow}=5
   ${template_folder}=    Catenate   ${TEMPLATES}/changemanagement
   ${uuid}=   Generate UUID 
   ${resp}=   Create Schedule   ${uuid}   ${request_file}   ${template_folder}   workflow=${workflow}   minutesFromNow=${minutesFromNow}   
   Should Be Equal as Strings    ${resp.status_code}    202 
   Validate Acknowledgment Response Headers    ${resp}
   Wait Until Keyword Succeeds    600s    5s    Wait For Pending Approval   ${uuid}
   Send Tier2 Approval   ${uuid}   jf9860    Accepted      
   ${resp}=   Delete Change Management   auth   schedules/${uuid}
   Should Be Equal as Strings    ${resp.status_code}    204 
   Log    ${resp.headers}    
   
Validate Acknowledgment Response Headers 
    [Arguments]    ${Response} 
    Log     ${Response.headers} 
    ${act_headers_keys} =    Get Dictionary Keys    ${Response.headers} 
    Dictionary Should Contain Key    ${Response.headers}    X-LatestVersion 
    Dictionary Should Contain Key    ${Response.headers}    X-MinorVersion 
    Dictionary Should Contain Key    ${Response.headers}    X-PatchVersion
    
    
    
Change Management Immediate Template Query Data    
   [Arguments]    ${request_file}    ${workflow}  
   ${template_folder}=    Catenate   ${TEMPLATES}/SearchSchedulerDetails
   ${uuid}=   Generate UUID 
   ${resp}=   Create Schedule   ${uuid}   ${request_file}   ${template_folder}   workflow=${workflow}
   Should Be Equal as Strings    ${resp.status_code}   202
   Validate Acknowledgment Response Headers    ${resp}
   Wait Until Keyword Succeeds    120s    30s    Wait For All VNFs Reach Status   Completed   ${uuid}
   Wait Until Keyword Succeeds    120s    30s    Wait for Schedule to Complete   Completed   ${uuid}
   [Return]    ${uuid}