blob: d3ecd0854edcb3f24f711dd98b65db48ea51ae19 [file] [log] [blame]
Girish Gowdraddf9a162020-01-27 12:56:27 +05301#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 Gowdra489425a2020-02-22 13:07:42 +053020# agent/Makefile. Please see ./README.md and ./agent/test/README.md for more
21# details.
Girish Gowdraddf9a162020-01-27 12:56:27 +053022
Girish Gowdra489425a2020-02-22 13:07:42 +053023# set default shell options
24SHELL = bash -e -o pipefail
Girish Gowdraddf9a162020-01-27 12:56:27 +053025
Jason Huang5d9ab1a2020-04-15 16:53:49 +080026export OPENOLT_ROOT_DIR=$(shell pwd)
27
Girish Gowdra489425a2020-02-22 13:07:42 +053028## Variables
29OPENOLTDEVICE ?= asfvolt16
Girish Gowdrafc10f0d2020-11-30 13:06:35 -080030OPENOLT_PROTO_VER ?= v4.0.3
Girish Gowdraddf9a162020-01-27 12:56:27 +053031
Girish Gowdra489425a2020-02-22 13:07:42 +053032DOCKER ?= docker
33DOCKER_REGISTRY ?=
34DOCKER_REPOSITORY ?= voltha/
35DOCKER_EXTRA_ARGS ?=
Girish Gowdra1935e6a2020-10-31 21:48:22 -070036DOCKER_TAG ?= 2.1.0
Girish Gowdra489425a2020-02-22 13:07:42 +053037IMAGENAME = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}openolt-test:${DOCKER_TAG}
Girish Gowdraddf9a162020-01-27 12:56:27 +053038
Girish Gowdra489425a2020-02-22 13:07:42 +053039DOCKER_BUILD_ARGS ?= \
40 ${DOCKER_EXTRA_ARGS} \
41 --build-arg OPENOLTDEVICE=${OPENOLTDEVICE} \
Girish Gowdra252f4972020-09-07 21:24:01 -070042 --build-arg OPENOLT_PROTO_VER=${OPENOLT_PROTO_VER}
Girish Gowdraddf9a162020-01-27 12:56:27 +053043
Girish Gowdraddf9a162020-01-27 12:56:27 +053044test:
Girish Gowdra489425a2020-02-22 13:07:42 +053045 ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test test
46
47clean:
48 ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean
49
50cleanall:
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