blob: 57c67b84a5dca0353683b6b39eb24b48d7bcb3d9 [file] [log] [blame]
Stanislav Chlebece035f622018-11-09 14:31:02 +01001*** Settings ***
2Documentation Tests the health of the VVP containers...
3Library Collections
4Library String
5Library RequestsLibrary
6Resource global_properties.robot
7
8*** Variables ***
9${VVP_PATH} /
10${VVP_CI_UWSGI_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_CI_UWSGI_IP_ADDR}:${GLOBAL_VVP_CI_UWSGI_PORT}
11${VVP_CMS_UWSGI_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_CMS_UWSGI_IP_ADDR}:${GLOBAL_VVP_CMS_UWSGI_PORT1}
12${VVP_EM_UWSGI_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_EM_UWSGI_IP_ADDR}:${GLOBAL_VVP_EM_UWSGI_PORT}
13${VVP_EXT_HAPROXY_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_EXT_HAPROXY_IP_ADDR}:${GLOBAL_VVP_EXT_HAPROXY_PORT1}
14${VVP_GITLAB_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_GITLAB_IP_ADDR}:${GLOBAL_VVP_GITLAB_PORT1}
15${VVP_IMAGESCANNER_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_IMAGESCANNER_IP_ADDR}:${GLOBAL_VVP_IMAGESCANNER_PORT}
16${VVP_INT_HAPROXY_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_INT_HAPROXY_IP_ADDR}:${GLOBAL_VVP_INT_HAPROXY_PORT1}
17${VVP_JENKINS_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_JENKINS_IP_ADDR}:${GLOBAL_VVP_JENKINS_PORT}
18${VVP_POSTGRES_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_POSTGRES_IP_ADDR}:${GLOBAL_VVP_POSTGRES_PORT}
19${VVP_REDIS_ENDPOINT} ${GLOBAL_VVP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VVP_REDIS_IP_ADDR}:${GLOBAL_VVP_REDIS_PORT}
20
21*** Keywords ***
22Run VVP ICE CI Container (Automat Testing) Health Check
23 [Documentation] Tests interface for container with purpose: end-to-end flow tests based on Seleniunm
24 ${resp}= Run ICE CI Container (Automat Testing) Get Request ${VVP_PATH}
25 Should Be Equal As Strings ${resp.status_code} 200
26
27Run ICE CI Container (Automat Testing) Get Request
28 [Documentation] Runs request in container with purpose: end-to-end flow tests based on Seleniunm
29 [Arguments] ${data_path}
30 Log Creating session ${VVP_CI_UWSGI_ENDPOINT}
31 ${session}= Create Session ice-ci ${VVP_CI_UWSGI_ENDPOINT}
32 ${resp}= Get Request ice-ci ${data_path}
33 Log Received response from ice-ci ${resp.text}
34 [Return] ${resp}
35
36Run VVP CMS Health Check
37 [Documentation] Tests interface for container with purpose: backend uwsgi server which hosts django application
38 ${resp}= Run VVP CMS Get Request ${VVP_PATH}
39 Should Be Equal As Strings ${resp.status_code} 200
40
41Run VVP CMS Get Request ${VVP_PATH}
42 [Documentation] Runs request in container with purpose: backend uwsgi server which hosts django application
43 [Arguments] ${data_path}
44 Log Creating session ${VVP_CMS_UWSGI_ENDPOINT}
45 ${session}= Create Session cms ${VVP_CMS_UWSGI_ENDPOINT}
46 ${resp}= Get Request cms ${data_path}
47 Log Received response from cms ${resp.text}
48 [Return] ${resp}
49
50Run VVP Engagement Manager Health Check
51 [Documentation] Tests interface for container with purpose: backend uwsgi server which hosts django application
52 ${resp}= Run VVP Engagement Manager Get Request ${VVP_PATH}
53 Should Be Equal As Strings ${resp.status_code} 200
54
55Run VVP Engagement Manager Get Request
56 [Documentation] Runs request in container with purpose: backend uwsgi server which hosts django application
57 [Arguments] ${data_path}
58 Log Creating session ${VVP_EM_UWSGI_ENDPOINT}
59 ${session}= Create Session engagement-manager ${VVP_EM_UWSGI_ENDPOINT}
60 ${resp}= Get Request engagement-manager ${data_path}
61 Log Received response from engagement-manager ${resp.text}
62 [Return] ${resp}
63
64Run VVP Ext HA Proxy Health Check
65 [Documentation] Tests interface for container with purpose: load balancer for external transport
66 ${resp}= Run VVP Ext HA Proxy Get Request ${VVP_PATH}
67 Should Be Equal As Strings ${resp.status_code} 200
68
69Run VVP Ext HA Proxy Get Request
70 [Documentation] Runs request in container with purpose: load balancer for external transport
71 [Arguments] ${data_path}
72 Log Creating session ${VVP_EXT_HAPROXY_ENDPOINT}
73 ${session}= Create Session ext-haproxy ${VVP_EXT_HAPROXY_ENDPOINT}
74 ${resp}= Get Request ext-haproxy ${data_path}
75 Log Received response from ext-haproxy ${resp.text}
76 [Return] ${resp}
77
78Run VVP Gitlab Health Check
79 [Documentation] Tests gitlab interface
80 ${resp}= Run VVP Gitlab Get Request ${VVP_PATH}
81 Should Be Equal As Strings ${resp.status_code} 200
82
83Run VVP Gitlab Get Request
84 [Documentation] Runs an gitlab request
85 [Arguments] ${data_path}
86 Log Creating session ${VVP_GITLAB_ENDPOINT}
87 ${session}= Create Session gitlab ${VVP_GITLAB_ENDPOINT}
88 ${resp}= Get Request gitlab ${data_path}
89 Log Received response from gitlab ${resp.text}
90 [Return] ${resp}
91
92Run VVP Image Scanner Health Check
93 [Documentation] Tests interface for container with purpose: scan for validity and viruses on users files
94 ${resp}= Run VVP Image Scanner Get Request ${VVP_PATH}
95 Should Be Equal As Strings ${resp.status_code} 200
96
97Run VVP Image Scanner Get Request
98 [Documentation] Runs request in container with purpose: scan for validity and viruses on users files
99 [Arguments] ${data_path}
100 Log Creating session ${VVP_IMAGESCANNER_ENDPOINT}
101 ${session}= Create Session image-scanner ${VVP_IMAGESCANNER_ENDPOINT}
102 ${resp}= Get Request image-scanner ${data_path}
103 Log Received response from image-scanner ${resp.text}
104 [Return] ${resp}
105
106Run VVP Int HA Proxy Health Check
107 [Documentation] Tests interface for container with purpose: load balancer for internal (container to container) transport
108 ${resp}= Run VVP Int HA Proxy Get Request ${VVP_PATH}
109 Should Be Equal As Strings ${resp.status_code} 200
110
111Run VVP Int HA Proxy Get Request
112 [Documentation] Runs request in container with purpose: load balancer for internal (container to container) transport
113 [Arguments] ${data_path}
114 Log Creating session ${VVP_INT_HAPROXY_ENDPOINT}
115 ${session}= Create Session int-haproxy ${VVP_INT_HAPROXY_ENDPOINT}
116 ${resp}= Get Request int-haproxy ${data_path}
117 Log Received response from int-haproxy ${resp.text}
118 [Return] ${resp}
119
120Run VVP Jenkins Health Check
121 [Documentation] Tests jenkins interface
122 ${resp}= Run VVP Jenkins Get Request ${VVP_PATH}
123 Should Be Equal As Strings ${resp.status_code} 200
124
125Run VVP Jenkins Get Request
126 [Documentation] Runs a jenkins request
127 [Arguments] ${data_path}
128 Log Creating session ${VVP_JENKINS_ENDPOINT}
129 ${session}= Create Session jenkins ${VVP_JENKINS_ENDPOINT}
130 ${resp}= Get Request jenkins ${data_path}
131 Log Received response from jenkins ${resp.text}
132 [Return] ${resp}
133
134Run VVP Postgresql Health Check
135 [Documentation] Tests postgresql interface
136 ${resp}= Run VVP Postgresql Get Request ${VVP_PATH}
137 Should Be Equal As Strings ${resp.status_code} 200
138
139Run VVP Postgresql Get Request
140 [Documentation] Runs a postgresql request
141 [Arguments] ${data_path}
142 Log Creating session ${VVP_POSTGRES_ENDPOINT}
143 ${session}= Create Session postgresql ${VVP_POSTGRES_ENDPOINT}
144 ${resp}= Get Request postgresql ${data_path}
145 Log Received response from postgresql ${resp.text}
146 [Return] ${resp}
147
148Run VVP Redis Health Check
149 [Documentation] Tests redis interface
150 ${resp}= Run VVP Redis Get Request ${VVP_PATH}
151 Should Be Equal As Strings ${resp.status_code} 200
152
153Run VVP Redis Get Request
154 [Documentation] Runs a redis request
155 [Arguments] ${data_path}
156 Log Creating session ${VVP_REDIS_ENDPOINT}
157 ${session}= Create Session redis ${VVP_REDIS_ENDPOINT}
158 ${resp}= Get Request redis ${data_path}
159 Log Received response from redis ${resp.text}
160 [Return] ${resp}
161