-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Makefile to run unit tests locally
Use a container to isolate from other ovsdb instances Signed-off-by: Adrian Moreno <[email protected]>
- Loading branch information
Showing
2 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from golang:1.12 | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
bc \ | ||
gcc-multilib \ | ||
libssl-dev \ | ||
llvm-dev \ | ||
libjemalloc-dev \ | ||
libnuma-dev \ | ||
python-sphinx \ | ||
libelf-dev \ | ||
selinux-policy-dev \ | ||
libunbound-dev \ | ||
autoconf \ | ||
automake \ | ||
libtool | ||
|
||
ADD .travis /src/travis | ||
WORKDIR /src/travis | ||
|
||
ENV OVN_SRCDIR=/src/ | ||
RUN sh ./test_prepare.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
.PHONY: clean build-image | ||
.PHONY: clean check_prep check | ||
|
||
# clean: clean up all build artifacts. | ||
# build-image: build docker image for selected projects. | ||
DOCKER ?= $(shell which docker) | ||
IMAGE_NAME="goovn:test" | ||
|
||
# Remove all build artifacts. | ||
# | ||
# Example: | ||
# make clean | ||
.PHONY=check | ||
check: check_prep | ||
$(DOCKER) run -e "OVN_SRCDIR=/src/" -v $$PWD:/root/workspace -w /root/workspace -it $(IMAGE_NAME) .travis/test_run.sh | ||
|
||
.PHONY=check_prep | ||
check_prep: | ||
@$(DOCKER) inspect $(IMAGE_NAME) 2>&1 >/dev/null || \ | ||
$(DOCKER) build -t $(IMAGE_NAME) . ; | ||
|
||
.PHONY=clean | ||
clean: | ||
build/clean.sh | ||
@docker rmi -f $(IMAGE_NAME) | ||
|