blob: 1261c5bf1e0b416fd57553b2d63b1cd805c62725 [file] [log] [blame]
Sean Condonaf0eb3c2021-09-19 20:14:29 +01001# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
Scott Baker69654392021-09-17 13:50:16 -07002#
Sean Condon160ec1d2022-02-08 12:58:25 +00003# SPDX-License-Identifier: Apache-2.0
Scott Baker69654392021-09-17 13:50:16 -07004
5.PHONY: all test clean
6
Scott Baker69654392021-09-17 13:50:16 -07007all: test
8
Ray Milkey35a07f82021-10-26 15:05:43 -07009test: # @HELP run the acceptance tests
Amit Wankhede751e7cd2022-03-23 17:08:30 +000010test: deps opa-test
11
12opa-test: #@HELP run the rego rule tests
13opa-test:
14 @cd aether-roc-umbrella/files/opa-rbac && for test_file in test/*; do \
15 trimmed=`basename $$test_file .json`;\
16 case "$$trimmed" in \
17 *2.0.0*) docker run -v $$(pwd):/opa-rbac openpolicyagent/opa:0.29.4 eval -f pretty -b /opa-rbac \
18 --input opa-rbac/test/$$trimmed.json data.aether_2_0_x.allowed > /tmp/$$trimmed.out;;\
19 *3.0.0*) docker run -v $$(pwd):/opa-rbac openpolicyagent/opa:0.29.4 eval -f pretty -b /opa-rbac \
20 --input opa-rbac/test/$$trimmed.json data.aether_3_0_0.allowed > /tmp/$$trimmed.out;;\
21 *4.0.0*) docker run -v $$(pwd):/opa-rbac openpolicyagent/opa:0.29.4 eval -f pretty -b /opa-rbac \
22 --input opa-rbac/test/$$trimmed.json data.aether_4_0_18.allowed > /tmp/$$trimmed.out;;\
23 *) continue;;esac;\
24 cmp -s /tmp/$$trimmed.out test/out/$$trimmed.out \
25 && echo "[TEST] $$trimmed.json : PASS"|| echo "[TEST] $$trimmed.json : FAIL";\
26 done;
Ray Milkey35a07f82021-10-26 15:05:43 -070027
28roc-test: # @HELP run the integration tests
29roc-test: deps # @HELP run the integration tests
Sean Condonaf0eb3c2021-09-19 20:14:29 +010030 ./build/bin/run-roc-test
Scott Baker69654392021-09-17 13:50:16 -070031
Sean Condonaf0eb3c2021-09-19 20:14:29 +010032clean: # @HELP clean up temporary files for ROC umbrella.
33 rm -rf aether-roc-umbrella/charts aether-roc-umbrella/Chart.lock
Scott Baker69654392021-09-17 13:50:16 -070034
Sean Condonaf0eb3c2021-09-19 20:14:29 +010035deps: # @HELP build dependencies for ROC Umbrella local charts.
Scott Baker69654392021-09-17 13:50:16 -070036deps: clean
Sean Condonaf0eb3c2021-09-19 20:14:29 +010037 helm dep build aether-roc-umbrella
Scott Baker69654392021-09-17 13:50:16 -070038
Sean Condonb0769e62021-12-21 09:57:29 +000039deps-chronos: # @HELP build dependencies for Chronos Umbrella local charts.
40deps-chronos: clean
41 rm -rf chronos-umbrella/Chart.lock chronos-umbrella/charts
42 helm dep build chronos-umbrella
43
Scott Baker69654392021-09-17 13:50:16 -070044help:
45 @grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
46 | sort \
47 | awk ' \
48 BEGIN {FS = ": *# *@HELP"}; \
49 {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \
50 '
PUSHP RAJba2e32f2021-11-02 10:39:24 +000051
Sean Condondccb3142022-01-10 14:36:16 +000052reuse-lint:
Sean Condon65dbad92022-02-04 13:36:47 +000053 reuse --root . lint