Skip to content

Commit 548f540

Browse files
author
Rob Tjalma
authored
Merge pull request #67 from com-pas/update-docker-image-14apr
Update Docker Image (14-apr-2022) + Validation Tests for Websockets/REST API
2 parents 171ea69 + b434567 commit 548f540

File tree

5 files changed

+92
-12
lines changed

5 files changed

+92
-12
lines changed

compas/docker-compose-basex.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ services:
4040
labels:
4141
compas: true
4242
image: "lfenergy/compas-scl-data-service:0.9.4-basex"
43+
ports:
44+
- "9090:8080"
4345
environment:
4446
- BASEX_HOST=basex
4547
- BASEX_PORT=1984
@@ -68,6 +70,8 @@ services:
6870
labels:
6971
compas: true
7072
image: "lfenergy/compas-cim-mapping:0.8.4"
73+
ports:
74+
- "9091:8080"
7175
environment:
7276
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
7377
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
@@ -90,6 +94,8 @@ services:
9094
labels:
9195
compas: true
9296
image: "lfenergy/compas-scl-auto-alignment:0.2.2"
97+
ports:
98+
- "9092:8080"
9399
environment:
94100
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
95101
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
@@ -111,7 +117,7 @@ services:
111117
scl-validator:
112118
labels:
113119
compas: true
114-
image: "lfenergy/compas-scl-validator:0.1.2"
120+
image: "lfenergy/compas-scl-validator:0.1.3"
115121
ports:
116122
- "9093:8080"
117123
environment:
@@ -138,7 +144,7 @@ services:
138144
open-scd:
139145
labels:
140146
compas: true
141-
image: "lfenergy/compas-open-scd:v0.13.0.0"
147+
image: "lfenergy/compas-open-scd:v0.13.0.2"
142148
healthcheck:
143149
test: ["CMD", "curl", "-f", "http://localhost/"]
144150
interval: 30s

compas/docker-compose-postgresql.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ services:
4747
labels:
4848
compas: true
4949
image: "lfenergy/compas-scl-data-service:0.9.4-postgresql"
50+
ports:
51+
- "9090:8080"
5052
environment:
5153
- POSTGRESQL_HOST=postgresql
5254
- POSTGRESQL_DB=compas
@@ -75,6 +77,8 @@ services:
7577
labels:
7678
compas: true
7779
image: "lfenergy/compas-cim-mapping:0.8.4"
80+
ports:
81+
- "9091:8080"
7882
environment:
7983
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
8084
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
@@ -97,6 +101,8 @@ services:
97101
labels:
98102
compas: true
99103
image: "lfenergy/compas-scl-auto-alignment:0.2.2"
104+
ports:
105+
- "9092:8080"
100106
environment:
101107
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
102108
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
@@ -118,7 +124,7 @@ services:
118124
scl-validator:
119125
labels:
120126
compas: true
121-
image: "lfenergy/compas-scl-validator:0.1.2"
127+
image: "lfenergy/compas-scl-validator:0.1.3"
122128
ports:
123129
- "9093:8080"
124130
environment:
@@ -145,7 +151,7 @@ services:
145151
open-scd:
146152
labels:
147153
compas: true
148-
image: "lfenergy/compas-open-scd:v0.13.0.0"
154+
image: "lfenergy/compas-open-scd:v0.13.0.2"
149155
healthcheck:
150156
test: ["CMD", "curl", "-f", "http://localhost/"]
151157
interval: 30s

compas/reverse-proxy/nginx.conf

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,33 @@ http {
126126
proxy_redirect off;
127127
}
128128

129-
# Forwarding to the SCL Auto Alignment Service container.
129+
# Forwarding to the SCL Validator Service container (websockets).
130+
location /compas-scl-validator/validate-ws/ {
131+
include /etc/nginx/include/authenticate.include;
132+
133+
proxy_http_version 1.1;
134+
proxy_set_header Upgrade $http_upgrade;
135+
proxy_set_header Connection "Upgrade";
136+
proxy_set_header Host $host;
137+
138+
proxy_set_header X-Real-IP $remote_addr;
139+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
140+
proxy_set_header X-Forwarded-Proto $scheme;
141+
proxy_set_header X-Forwarded-Port $server_port;
142+
proxy_set_header Authorization "Bearer ${access_token}";
143+
144+
# Added Header back to browser to get JWT Content for Debugging, should not do this in production.
145+
add_header X-Debug-Bearer "Bearer ${access_token}" always;
146+
147+
proxy_pass http://scl-validator:8080/compas-scl-validator/validate-ws/;
148+
}
149+
150+
# Forwarding to the SCL Validator Service container (http).
130151
location /compas-scl-validator/ {
131152
include /etc/nginx/include/authenticate.include;
132153

154+
proxy_set_header Host $http_host;
155+
133156
proxy_set_header X-Real-IP $remote_addr;
134157
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
135158
proxy_set_header X-Forwarded-Proto $scheme;
@@ -141,7 +164,6 @@ http {
141164

142165
proxy_pass http://scl-validator:8080/compas-scl-validator/;
143166

144-
proxy_set_header Host $http_host;
145167
proxy_cache_bypass $http_upgrade;
146168
proxy_redirect off;
147169
}

integration-testing/TestSuite005-validator.robot

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ Execute SCL Validator
1717

1818
*** Test Cases ***
1919
TestCase005-01
20-
[Documentation] Execute the SCL Validator for a Simple Configuration.
20+
[Documentation] Execute the SCL Validator (Websockets) with OCL Validation Errros.
2121
Set Test Variable ${sclname} SingleSubstation
2222
Set Test Variable ${scltype} SCD
2323

24-
Open Menu Open project
25-
Open local file ${sclname} ${scltype}
24+
Change Websockets setting True
25+
Open Menu Open project
26+
Open local file ${sclname} ${scltype}
2627

2728
Execute SCL Validator
2829

@@ -32,12 +33,45 @@ TestCase005-01
3233
Get Element Count mwc-dialog#diagnostic > filtered-list > abbr == 332
3334

3435
TestCase005-02
35-
[Documentation] Execute the SCL Validator for XSD Errors.
36+
[Documentation] Execute the SCL Validator (REST API) with OCL Validation Errros.
37+
Set Test Variable ${sclname} SingleSubstation
38+
Set Test Variable ${scltype} SCD
39+
40+
Change Websockets setting False
41+
Open Menu Open project
42+
Open local file ${sclname} ${scltype}
43+
44+
Execute SCL Validator
45+
46+
Open Menu View diagnostics
47+
Get Text mwc-dialog#diagnostic > filtered-list > mwc-list-item:nth-child(4) == Validate using OCL
48+
Get Attribute mwc-dialog#diagnostic > filtered-list > abbr:nth-child(6) title *= [SCD File] DataTypeTemplates section is mandatory (line 1)
49+
Get Element Count mwc-dialog#diagnostic > filtered-list > abbr == 332
50+
51+
TestCase005-03
52+
[Documentation] Execute the SCL Validator (Websockets) with XSD Validation Errors.
53+
Set Test Variable ${sclname} XsdValidationErrors
54+
Set Test Variable ${scltype} SCD
55+
56+
Change Websockets setting True
57+
Open Menu Open project
58+
Open local file ${sclname} ${scltype}
59+
60+
Execute SCL Validator
61+
62+
Open Menu View diagnostics
63+
Get Text mwc-dialog#diagnostic > filtered-list > mwc-list-item:nth-child(12) == Validate using OCL
64+
Get Attribute mwc-dialog#diagnostic > filtered-list > abbr:nth-child(14) title *= [XSD validation] (line: 32, column: 47): cvc-complex-type.4: Attribute 'type' must appear on element 'DO'.
65+
Get Element Count mwc-dialog#diagnostic > filtered-list > abbr == 11
66+
67+
TestCase005-04
68+
[Documentation] Execute the SCL Validator (REST API) with XSD Validation Errors.
3669
Set Test Variable ${sclname} XsdValidationErrors
3770
Set Test Variable ${scltype} SCD
3871

39-
Open Menu Open project
40-
Open local file ${sclname} ${scltype}
72+
Change Websockets setting False
73+
Open Menu Open project
74+
Open local file ${sclname} ${scltype}
4175

4276
Execute SCL Validator
4377

integration-testing/include/general-compas.robot

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,15 @@ Update in CoMPAS
4141
# check if the title (filename) changed to the new expected one. This way we know we can close the menu.
4242
Check Title Filename ${sclname}-${current-date}-${expectedVersion} ${scltype}
4343
Close Menu
44+
45+
Change Websockets setting
46+
[Arguments] ${checked}
47+
Open Menu CoMPAS Settings
48+
IF ${checked} == True
49+
Check Checkbox ${dialog-selector} compas-settings mwc-switch#useWebsockets #basic-switch
50+
ELSE
51+
Uncheck Checkbox ${dialog-selector} compas-settings mwc-switch#useWebsockets #basic-switch
52+
END
53+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
54+
Wait for dialog is closed
55+
Close Menu

0 commit comments

Comments
 (0)