blob: 78931146c04bc7dfbbdf1499c32ab5aad7370773 [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
kesavand88fdddd2020-09-04 12:06:34 +053030OPENOLT_PROTO_VER ?= v3.4.5
Girish Gowdra489425a2020-02-22 13:07:42 +053031GTEST_VER ?= release-1.8.0
32CMOCK_VER ?= 0207b30
33GMOCK_GLOBAL_VER ?= 1.0.2
34GRPC_VER ?= v1.27.1
Girish Gowdraddf9a162020-01-27 12:56:27 +053035
Girish Gowdra489425a2020-02-22 13:07:42 +053036DOCKER ?= docker
37DOCKER_REGISTRY ?=
38DOCKER_REPOSITORY ?= voltha/
39DOCKER_EXTRA_ARGS ?=
40DOCKER_TAG ?= 1.0.0
41IMAGENAME = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}openolt-test:${DOCKER_TAG}
Girish Gowdraddf9a162020-01-27 12:56:27 +053042
Girish Gowdra489425a2020-02-22 13:07:42 +053043DOCKER_BUILD_ARGS ?= \
44 ${DOCKER_EXTRA_ARGS} \
45 --build-arg OPENOLTDEVICE=${OPENOLTDEVICE} \
46 --build-arg OPENOLT_PROTO_VER=${OPENOLT_PROTO_VER} \
47 --build-arg GTEST_VER=${GTEST_VER} \
48 --build-arg CMOCK_VER=${CMOCK_VER} \
49 --build-arg GMOCK_GLOBAL_VER=${GMOCK_GLOBAL_VER} \
50 --build-arg GRPC_VER=${GRPC_VER}
Girish Gowdraddf9a162020-01-27 12:56:27 +053051
Girish Gowdraddf9a162020-01-27 12:56:27 +053052test:
Girish Gowdra489425a2020-02-22 13:07:42 +053053 ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test test
54
55clean:
56 ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean
57
58cleanall:
59 ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean
60 ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C protos distclean