1) Keep only 1 sanity test as part of the jenkins build test, 2) exclude the test_frameio.py test from direct run, 3) set the frameio test to be run within a docker when the itest is invoked
Change-Id: I2388f0465b891b3aba781ce728000dc92d134727
diff --git a/BUILD.md b/BUILD.md
index a9b6cc3..bbf1be1 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -89,7 +89,7 @@
With the IP address in hand, you can now start Voltha manually as:
```
-docker run -ti --rm --net=compose_default cord/voltha /voltha/main.py --consul=$CONSUL_IP:8500
+docker run -ti --rm --net=compose_default cord/voltha /voltha/voltha/main.py --consul=$CONSUL_IP:8500
```
This time it should successfully connect to consul and actually register itself.
diff --git a/Makefile b/Makefile
index 6b58405..fb736f5 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@
include setup.mk
VENVDIR := venv-$(shell uname -s | tr '[:upper:]' '[:lower:]')
+DOCKER_CMD := docker pull consul
.PHONY: $(DIRS) $(DIRS_CLEAN) $(DIRS_FLAKE8) flake8
@@ -71,6 +72,7 @@
@echo "rebuild-venv : Rebuild local Python virtualenv from scratch"
@echo "venv : Build local Python virtualenv if did not exist yet"
@echo "utest : Run all unit tests"
+ @echo "itest : Run all integration tests"
@echo
build: protos docker-base
@@ -128,10 +130,22 @@
. ${VENVDIR}/bin/activate && \
nosetests tests --exclude-dir=./tests/itests/
-itest: venv
+itest: venv frameio
+ @ echo "Executing sanity integration tests"
+ . ${VENVDIR}/bin/activate && \
+ nosetests -s \
+ tests/itests/docutests/build_md_test.py:BuildMdTests.test_07_start_all_containers \
+ --exclude-dir=./tests/itests/frameio_tests/run_as_root/
+
+itest-all: venv frameio
@ echo "Executing all integration tests"
. ${VENVDIR}/bin/activate && \
- nosetests tests/itests -s
+ nosetests -s \
+ tests/itests/docutests/build_md_test.py \
+ --exclude-dir=./tests/itests/frameio_tests/run_as_root/
+
+frameio:
+ docker run -ti --rm -v /voltha:/voltha --privileged cord/voltha-base env PYTHONPATH=/voltha python /voltha/tests/itests/frameio_tests/run_as_root/test_frameio.py
flake8: $(DIRS_FLAKE8)
diff --git a/tests/itests/docutests/build_md_test.py b/tests/itests/docutests/build_md_test.py
index b75da23..cdaeb3f 100644
--- a/tests/itests/docutests/build_md_test.py
+++ b/tests/itests/docutests/build_md_test.py
@@ -55,7 +55,7 @@
docker_start_voltha="docker run -ti --rm cord/voltha",
docker_start_voltha_with_consul_ip="docker run -ti --rm --net="
"compose_default cord/voltha "
- "/voltha/main.py --consul=",
+ "/voltha/voltha/main.py --consul=",
docker_get_consul_ip="docker inspect "
"compose_consul_1 | jq -r "
"'.[0].NetworkSettings.Networks."
@@ -201,8 +201,8 @@
expected_output_subset = [
'main.print_banner {event: (to stop: press Ctrl-C), '
'instance_id:',
- 'coordinator.__init__ {event: initialized-coordinator,',
- 'grpc_server.run {event: starting-grpc-server,',
+ 'coordinator.__init__ {event: initializing-coordinator,',
+ 'grpc_server.start {event: started',
'main.<lambda> {event: twisted-reactor-started',
'main.startup_components {event: started-internal-services,',
'kafka_proxy.send_message {event: Sending message Heartbeat '
@@ -490,7 +490,7 @@
'coordinator._renew_session', 'main.heartbeat']
cmd = command_defs['docker_voltha_logs']
docker_voltha_logs = run_long_running_command_with_timeout(cmd,
- 0.5, 2)
+ 0.5, 3)
intersected_logs = [l for l in expected_output if
l in docker_voltha_logs]
self.assertEqual(len(intersected_logs), len(expected_output))
diff --git a/tests/itests/frameio_tests/__init__.py b/tests/itests/frameio_tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/itests/frameio_tests/__init__.py
diff --git a/tests/itests/frameio_tests/run_as_root/__init__.py b/tests/itests/frameio_tests/run_as_root/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/itests/frameio_tests/run_as_root/__init__.py
diff --git a/tests/itests/test_frameio.py b/tests/itests/frameio_tests/run_as_root/test_frameio.py
similarity index 97%
rename from tests/itests/test_frameio.py
rename to tests/itests/frameio_tests/run_as_root/test_frameio.py
index c367a9d..b3863d9 100644
--- a/tests/itests/test_frameio.py
+++ b/tests/itests/frameio_tests/run_as_root/test_frameio.py
@@ -19,7 +19,8 @@
Run this test inside a docker container using the following syntax:
docker run -ti --rm -v $(pwd):/voltha --privileged cord/voltha-base \
- env PYTHONPATH=/voltha python /voltha/tests/itests/test_frameio.py
+ env PYTHONPATH=/voltha python \
+ /voltha/tests/itests/frameio_tests/run_as_root/test_frameio.py
"""