-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (41 loc) · 1.82 KB
/
Makefile
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
# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
.PHONY: all test clean
all: test
test: # @HELP run the acceptance tests
test: deps opa-test
opa-test: #@HELP run the rego rule tests
opa-test:
@cd aether-roc-umbrella/files/opa-rbac && for test_file in test/*; do \
trimmed=`basename $$test_file .json`;\
case "$$trimmed" in \
*2.0.0*) docker run --platform linux/amd64 -v $$(pwd):/opa-rbac openpolicyagent/opa:0.40.0 eval -f pretty -b /opa-rbac \
--input opa-rbac/test/$$trimmed.json data.aether_2_0_x.allowed > /tmp/$$trimmed.out;;\
*2.1.0*) docker run --platform linux/amd64 -v $$(pwd):/opa-rbac openpolicyagent/opa:0.40.0 eval -f pretty -b /opa-rbac \
--input opa-rbac/test/$$trimmed.json data.aether_2_1_x.allowed > /tmp/$$trimmed.out;;\
*) continue;;esac;\
cmp -b /tmp/$$trimmed.out test/out/$$trimmed.out \
&& echo "[TEST] $$trimmed.json : PASS"|| echo "[TEST] $$trimmed.json : FAIL";\
done;
roc-test: # @HELP run the integration tests
roc-test: deps # @HELP run the integration tests
./build/bin/run-roc-test
clean: # @HELP clean up temporary files for ROC umbrella.
rm -rf aether-roc-umbrella/charts aether-roc-umbrella/Chart.lock chronos-umbrella/charts chronos-umbrella/Chart.lock fabric-umbrella/charts fabric-umbrella/Chart.lock
deps: # @HELP build dependencies for ROC Umbrella local charts.
deps: clean
helm dep build aether-roc-umbrella
deps-chronos: # @HELP build dependencies for Chronos Umbrella local charts.
deps-chronos: clean
rm -rf chronos-umbrella/Chart.lock chronos-umbrella/charts
helm dep build chronos-umbrella
help:
@grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
| sort \
| awk ' \
BEGIN {FS = ": *# *@HELP"}; \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \
'
reuse-lint:
reuse --root . lint