Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 1 | #Copyright 2018-present Open Networking Foundation |
| 2 | # |
| 3 | #Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | #you may not use this file except in compliance with the License. |
| 5 | #You may obtain a copy of the License at |
| 6 | # |
| 7 | #http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | #Unless required by applicable law or agreed to in writing, software |
| 10 | #distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | #See the License for the specific language governing permissions and |
| 13 | #limitations under the License. |
| 14 | |
| 15 | ######################################################################## |
| 16 | |
| 17 | # This Makefile provides hook for Jenkins to invoke the test target for |
| 18 | # CI integration. |
| 19 | # The main Makefile for product compilation is available at |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 20 | # agent/Makefile. Please see ./README.md and ./agent/test/README.md for more |
| 21 | # details. |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 22 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 23 | # set default shell options |
| 24 | SHELL = bash -e -o pipefail |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 25 | |
Jason Huang | 5d9ab1a | 2020-04-15 16:53:49 +0800 | [diff] [blame] | 26 | export OPENOLT_ROOT_DIR=$(shell pwd) |
| 27 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 28 | ## Variables |
| 29 | OPENOLTDEVICE ?= asfvolt16 |
Burak Gurdag | a052359 | 2021-02-24 15:17:47 +0000 | [diff] [blame^] | 30 | OPENOLT_PROTO_VER ?= v4.0.14 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 31 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 32 | DOCKER ?= docker |
| 33 | DOCKER_REGISTRY ?= |
| 34 | DOCKER_REPOSITORY ?= voltha/ |
| 35 | DOCKER_EXTRA_ARGS ?= |
Burak Gurdag | 74e3ab8 | 2020-12-17 13:35:06 +0000 | [diff] [blame] | 36 | DOCKER_TAG ?= 2.1.1 |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 37 | IMAGENAME = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}openolt-test:${DOCKER_TAG} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 38 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 39 | DOCKER_BUILD_ARGS ?= \ |
| 40 | ${DOCKER_EXTRA_ARGS} \ |
| 41 | --build-arg OPENOLTDEVICE=${OPENOLTDEVICE} \ |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 42 | --build-arg OPENOLT_PROTO_VER=${OPENOLT_PROTO_VER} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 43 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 44 | test: |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 45 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test test |
| 46 | |
| 47 | clean: |
| 48 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 49 | |
| 50 | cleanall: |
| 51 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 52 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C protos distclean |