Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org> |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 2 | # |
Sean Condon | 160ec1d | 2022-02-08 12:58:25 +0000 | [diff] [blame] | 3 | # SPDX-License-Identifier: Apache-2.0 |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 4 | |
| 5 | .PHONY: all test clean |
| 6 | |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 7 | all: test |
| 8 | |
Ray Milkey | 35a07f8 | 2021-10-26 15:05:43 -0700 | [diff] [blame] | 9 | test: # @HELP run the acceptance tests |
Amit Wankhede | 751e7cd | 2022-03-23 17:08:30 +0000 | [diff] [blame] | 10 | test: deps opa-test |
| 11 | |
| 12 | opa-test: #@HELP run the rego rule tests |
| 13 | opa-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 \ |
SeanCondon | 172097c | 2022-05-10 09:57:48 +0100 | [diff] [blame] | 17 | *2.0.0*) docker run --platform linux/amd64 -v $$(pwd):/opa-rbac openpolicyagent/opa:0.40.0 eval -f pretty -b /opa-rbac \ |
Amit Wankhede | 751e7cd | 2022-03-23 17:08:30 +0000 | [diff] [blame] | 18 | --input opa-rbac/test/$$trimmed.json data.aether_2_0_x.allowed > /tmp/$$trimmed.out;;\ |
SeanCondon | 172097c | 2022-05-10 09:57:48 +0100 | [diff] [blame] | 19 | *2.1.0*) docker run --platform linux/amd64 -v $$(pwd):/opa-rbac openpolicyagent/opa:0.40.0 eval -f pretty -b /opa-rbac \ |
| 20 | --input opa-rbac/test/$$trimmed.json data.aether_2_1_x.allowed > /tmp/$$trimmed.out;;\ |
Amit Wankhede | 751e7cd | 2022-03-23 17:08:30 +0000 | [diff] [blame] | 21 | *) continue;;esac;\ |
SeanCondon | 172097c | 2022-05-10 09:57:48 +0100 | [diff] [blame] | 22 | cmp -b /tmp/$$trimmed.out test/out/$$trimmed.out \ |
Amit Wankhede | 751e7cd | 2022-03-23 17:08:30 +0000 | [diff] [blame] | 23 | && echo "[TEST] $$trimmed.json : PASS"|| echo "[TEST] $$trimmed.json : FAIL";\ |
| 24 | done; |
Ray Milkey | 35a07f8 | 2021-10-26 15:05:43 -0700 | [diff] [blame] | 25 | |
| 26 | roc-test: # @HELP run the integration tests |
| 27 | roc-test: deps # @HELP run the integration tests |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 28 | ./build/bin/run-roc-test |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 29 | |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 30 | clean: # @HELP clean up temporary files for ROC umbrella. |
SeanCondon | 3c3d08f | 2022-05-27 11:39:58 +0100 | [diff] [blame] | 31 | 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 |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 32 | |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 33 | deps: # @HELP build dependencies for ROC Umbrella local charts. |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 34 | deps: clean |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 35 | helm dep build aether-roc-umbrella |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 36 | |
Sean Condon | b0769e6 | 2021-12-21 09:57:29 +0000 | [diff] [blame] | 37 | deps-chronos: # @HELP build dependencies for Chronos Umbrella local charts. |
| 38 | deps-chronos: clean |
| 39 | rm -rf chronos-umbrella/Chart.lock chronos-umbrella/charts |
| 40 | helm dep build chronos-umbrella |
| 41 | |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 42 | help: |
| 43 | @grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \ |
| 44 | | sort \ |
| 45 | | awk ' \ |
| 46 | BEGIN {FS = ": *# *@HELP"}; \ |
| 47 | {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \ |
| 48 | ' |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 49 | |
Sean Condon | dccb314 | 2022-01-10 14:36:16 +0000 | [diff] [blame] | 50 | reuse-lint: |
Sean Condon | 65dbad9 | 2022-02-04 13:36:47 +0000 | [diff] [blame] | 51 | reuse --root . lint |