Skip to content

Commit 5383b0f

Browse files
2 parents 618f2d2 + 7a36043 commit 5383b0f

File tree

150 files changed

+1706
-985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1706
-985
lines changed

.github/workflows/test-install.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
runs-on: ubuntu-latest
4444
steps:
4545
- uses: actions/checkout@v3
46+
4647
- name: do test install in case of merged pull request
4748
run: cd /home/runner/work/firewall-orchestrator/firewall-orchestrator && ansible-playbook -e force_install=true site.yml -K
4849

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"name": "py-generate-tenant-data",
146146
"type": "debugpy",
147147
"request": "launch",
148-
"program": "${workspaceFolder}/roles/test/files/tenant_networks/create_tenant_network_data.py",
148+
"program": "${workspaceFolder}/roles/tests-unit/files/tenant_networks/create_tenant_network_data.py",
149149
"console": "integratedTerminal",
150150
"env": {
151151
"PYTHONPATH": "${PYTHONPATH}:${workspaceRoot}"
@@ -352,7 +352,7 @@
352352
"args": [
353353
"test"
354354
],
355-
"cwd": "${workspaceFolder}/roles/test/files/FWO.Test",
355+
"cwd": "${workspaceFolder}/roles/tests-unit/files/FWO.Test",
356356
"stopAtEntry": false,
357357
"console": "integratedTerminal"
358358
},

documentation/developer-docs/csharp/wkhtmltopdf.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

documentation/installer/install-advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Note that the following domains must be reachable through the proxy:
7575
postgresql.org
7676
microsoft.com
7777
nuget.org
78-
storage.googleapis.com
7978
googlechromelabs.github.io
79+
storage.googleapis.com
8080

8181
Only for the initial setup of python venv
8282

documentation/installer/install-for-testing.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,27 @@ Set dotnet installation mode to "debug" as follows (default = Release)
3939
```console
4040
ansible-playbook/ site.yml -e "dotnet_mode=Debug" -K
4141
```
42-
## Running integration tests after installation/upgrade
4342

44-
To only run tests (for an existing installation) use tags as follows:
43+
## Running unit tests after installation/upgrade
44+
45+
To only run unit tests (for an existing installation only to be used in comination with installation_mode=upgrade) use tags as follows:
4546

4647
```console
47-
ansible-playbook site.yml --tags test -K
48+
ansible-playbook site.yml --tags unittests -K
4849
```
4950

50-
## Running unit tests only
51+
## Running integration tests after installation/upgrade
52+
53+
To only run integration tests (for an existing installation only to be used in comination with installation_mode=upgrade) use tags as follows:
54+
55+
```console
56+
ansible-playbook site.yml --tags integrationtests -K
57+
```
5158

52-
To only run tests (for an existing installation, can only be combined with installation_mode=upgrade) use tags as follows:
59+
## Running installation without any tests
5360

5461
```console
55-
ansible-playbook site.yml --tags unittest -e "installation_mode=upgrade" -K
62+
ansible-playbook site.yml -K --skip-tags unittests,integrationtests
5663
```
5764

5865
## Parameter "api_no_metadata" to prevent meta data import

inventory/group_vars/all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ wsgi_package_name: libapache2-mod-wsgi
138138

139139
############# wkhtmltopdf #########################
140140

141-
wkhtmltopdf_version: "0.12.6.1-3"
141+
# wkhtmltopdf_version: "0.12.6.1-3"
142142

143143

144144
################# testing #########################

roles/FWO.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{CE55F125-0CD
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Middleware.Client", "lib\files\FWO.Middleware.Client\FWO.Middleware.Client.csproj", "{ECB165CE-BE81-4C5C-B27A-D73177D73E28}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Test", "test\files\FWO.Test\FWO.Test.csproj", "{9C66B86B-FFB2-44A9-A944-54B33D31D413}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Test", "tests-unit\files\FWO.Test\FWO.Test.csproj", "{9C66B86B-FFB2-44A9-A944-54B33D31D413}"
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Report", "lib\files\FWO.Report\FWO.Report.csproj", "{84CA4892-7C35-4F1F-AF25-2A379112DFCA}"
1313
EndProject

roles/api/files/replace_metadata.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10581,6 +10581,28 @@
1058110581
}
1058210582
]
1058310583
},
10584+
{
10585+
"table": {
10586+
"name": "refresh_log",
10587+
"schema": "public"
10588+
},
10589+
"select_permissions": [
10590+
{
10591+
"role": "middleware-server",
10592+
"permission": {
10593+
"columns": [
10594+
"id",
10595+
"status",
10596+
"view_name",
10597+
"refreshed_at"
10598+
],
10599+
"filter": {},
10600+
"allow_aggregations": true
10601+
},
10602+
"comment": ""
10603+
}
10604+
]
10605+
},
1058410606
{
1058510607
"table": {
1058610608
"name": "report",
@@ -25259,6 +25281,16 @@
2525925281
"name": "recert_get_one_owner_one_mgm",
2526025282
"schema": "public"
2526125283
}
25284+
},
25285+
{
25286+
"function": {
25287+
"name": "refresh_view_rule_with_owner",
25288+
"schema": "public"
25289+
},
25290+
"configuration": {
25291+
"custom_root_fields": {},
25292+
"exposed_as": "query"
25293+
}
2526225294
}
2526325295
],
2526425296
"configuration": {

roles/database/files/sql/creation/fworch-create-triggers.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ $$ LANGUAGE plpgsql;
234234
-- FOR EACH ROW
235235
-- EXECUTE PROCEDURE owner_network_change_triggered ();
236236

237-
-- -- LargeOwnerChange: uncomment to disable triggers (e.g. for large installations without recert needs)
238-
-- -- ALTER TABLE owner DISABLE TRIGGER owner_change;
239-
-- -- ALTER TABLE owner_network DISABLE TRIGGER owner_network_change;
237+
-- LargeOwnerChange: uncomment to disable triggers (e.g. for large installations without recert needs)
238+
-- ALTER TABLE owner DISABLE TRIGGER owner_change;
239+
-- ALTER TABLE owner_network DISABLE TRIGGER owner_network_change;
240240

roles/database/files/sql/creation/fworch-views-materialized.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,39 @@ CREATE MATERIALIZED VIEW view_rule_with_owner AS
188188
-- execute procedure refresh_view_rule_with_owner();
189189

190190
GRANT SELECT ON TABLE view_rule_with_owner TO GROUP secuadmins, reporters, configimporters;
191+
192+
193+
CREATE TABLE IF NOT EXISTS refresh_log (
194+
id SERIAL PRIMARY KEY,
195+
view_name TEXT NOT NULL,
196+
refreshed_at TIMESTAMPTZ DEFAULT now(),
197+
status TEXT
198+
);
199+
200+
CREATE OR REPLACE FUNCTION refresh_view_rule_with_owner()
201+
RETURNS SETOF refresh_log AS $$
202+
DECLARE
203+
status_message TEXT;
204+
BEGIN
205+
-- Attempt to refresh the materialized view
206+
BEGIN
207+
REFRESH MATERIALIZED VIEW view_rule_with_owner;
208+
status_message := 'Materialized view refreshed successfully';
209+
EXCEPTION
210+
WHEN OTHERS THEN
211+
status_message := format('Failed to refresh view: %s', SQLERRM);
212+
END;
213+
214+
-- Log the operation
215+
INSERT INTO refresh_log (view_name, status)
216+
VALUES ('view_rule_with_owner', status_message);
217+
218+
-- Return the log entry
219+
RETURN QUERY SELECT * FROM refresh_log WHERE view_name = 'view_rule_with_owner' ORDER BY refreshed_at DESC LIMIT 1;
220+
END;
221+
$$ LANGUAGE plpgsql VOLATILE;
222+
223+
224+
-- Create indexes on the materialized view
225+
CREATE INDEX IF NOT EXISTS idx_view_rule_with_owner_rule_id ON view_rule_with_owner (rule_id);
226+
CREATE INDEX IF NOT EXISTS idx_view_rule_with_owner_owner_id ON view_rule_with_owner (owner_id);

0 commit comments

Comments
 (0)