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 \ |
| 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 Milkey | 35a07f8 | 2021-10-26 15:05:43 -0700 | [diff] [blame] | 27 | |
| 28 | roc-test: # @HELP run the integration tests |
| 29 | roc-test: deps # @HELP run the integration tests |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 30 | ./build/bin/run-roc-test |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 31 | |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 32 | clean: # @HELP clean up temporary files for ROC umbrella. |
| 33 | rm -rf aether-roc-umbrella/charts aether-roc-umbrella/Chart.lock |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 34 | |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 35 | deps: # @HELP build dependencies for ROC Umbrella local charts. |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 36 | deps: clean |
Sean Condon | af0eb3c | 2021-09-19 20:14:29 +0100 | [diff] [blame] | 37 | helm dep build aether-roc-umbrella |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 38 | |
Sean Condon | b0769e6 | 2021-12-21 09:57:29 +0000 | [diff] [blame] | 39 | deps-chronos: # @HELP build dependencies for Chronos Umbrella local charts. |
| 40 | deps-chronos: clean |
| 41 | rm -rf chronos-umbrella/Chart.lock chronos-umbrella/charts |
| 42 | helm dep build chronos-umbrella |
| 43 | |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 44 | help: |
| 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 RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 51 | |
Sean Condon | dccb314 | 2022-01-10 14:36:16 +0000 | [diff] [blame] | 52 | reuse-lint: |
Sean Condon | 65dbad9 | 2022-02-04 13:36:47 +0000 | [diff] [blame] | 53 | reuse --root . lint |