Commit 7fef5c5b authored by Federico Sismondi's avatar Federico Sismondi
Browse files

Merge branch 'develop' into 'master'

merge after successful IoTweek 18 demos

See merge request !65
parents 1eb4e9a9 20d83927
Pipeline #2577 passed with stage
in 0 seconds
......@@ -97,7 +97,7 @@ if(env.JOB_NAME =~ 'ioppytest/'){
echo Do you smell the smoke in the room??
echo processes logs :
sudo -E supervisorctl -c $SUPERVISOR_CONFIG_FILE tail -10000 tat
sudo -E supervisorctl -c $SUPERVISOR_CONFIG_FILE tail -10000 test-coordinator
sudo -E supervisorctl -c $SUPERVISOR_CONFIG_FILE tail -100000 test-coordinator
sudo -E supervisorctl -c $SUPERVISOR_CONFIG_FILE tail -10000 agent
sudo -E supervisorctl -c $SUPERVISOR_CONFIG_FILE tail -10000 packet-router
sudo -E supervisorctl -c $SUPERVISOR_CONFIG_FILE tail -10000 packet-sniffer
......@@ -122,17 +122,25 @@ if(env.JOB_NAME =~ 'ioppytest/'){
if(env.JOB_NAME =~ 'CoAP testing tool/'){
node('docker'){
/* attention, here we use external RMQ server, else we would need to allow docker containers to access localhost's ports (docker host ports) */
/* attention, here we use external RMQ server*/
/* if integration tests take too long to execute we need to allow docker containers to access localhost's ports (docker host ports), and change AMQP_URL */
env.AMQP_URL="amqp://paul:iamthewalrus@f-interop.rennes.inria.fr/jenkins.full_coap_interop_session"
env.AMQP_EXCHANGE="amq.topic"
env.DOCKER_CLIENT_TIMEOUT=3000
env.COMPOSE_HTTP_TIMEOUT=3000
stage("Check if DOCKER is installed on node"){
sh '''
docker version
'''
}
stage("Clone repo and submodules"){
checkout scm
sh '''
git submodule update --init
tree .
# tree .
'''
}
......@@ -167,8 +175,9 @@ if(env.JOB_NAME =~ 'CoAP testing tool/'){
}
}
stage("RUN CoAP containers for mini-plugtests"){
gitlabCommitStatus("RUN CoAP containers for mini-plugtests") {
stage("RUN mini-plugtest: coapthon_clie VS californium_serv"){
gitlabCommitStatus("START resources for mini-plugtest: coapthon_clie VS californium_serv") {
gitlabCommitStatus("Docker run") {
long startTime = System.currentTimeMillis()
long timeoutInSeconds = 120
......@@ -177,9 +186,7 @@ if(env.JOB_NAME =~ 'CoAP testing tool/'){
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
sudo -E make run-coap-client
sudo -E make run-coap-server
sudo -E make run-coap-testing-tool
sudo -E make _run-coap-mini-interop-coapthon-cli-vs-californium-server
'''
}
......@@ -194,10 +201,115 @@ if(env.JOB_NAME =~ 'CoAP testing tool/'){
}
}
}
}
stage("EXECUTE CoAP mini-plugtests"){
gitlabCommitStatus("EXECUTE CoAP mini-plugtests") {
gitlabCommitStatus("EXECUTE mini-plugtest: coapthon_clie VS californium_serv") {
long timeoutInSeconds = 600
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
python3 -m pytest -s -p no:cacheprovider tests/test_full_coap_interop_session.py -v
'''
}
}
catch (e){
sh '''
echo Do you smell the smoke in the room??
echo docker container logs :
sudo make get-logs
'''
throw e
}
finally {
sh '''
sudo -E make stop-all
sudo -E docker ps
'''
}
}
}
stage("RUN mini-plugtest: californium_clie VS californium_serv"){
gitlabCommitStatus("START resources for mini-plugtest: californium_clie VS californium_serv") {
gitlabCommitStatus("Docker run") {
long startTime = System.currentTimeMillis()
long timeoutInSeconds = 120
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
sudo -E make _run-coap-mini-interop-californium-cli-vs-californium-server
'''
}
} catch (err) {
long timePassed = System.currentTimeMillis() - startTime
if (timePassed >= timeoutInSeconds * 1000) {
echo 'Docker container kept on running!'
currentBuild.result = 'SUCCESS'
} else {
currentBuild.result = 'FAILURE'
}
}
}
}
gitlabCommitStatus("EXECUTE mini-plugtest: californium_clie VS californium_serv") {
long timeoutInSeconds = 600
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
python3 -m pytest -s -p no:cacheprovider tests/test_full_coap_interop_session.py -v
'''
}
}
catch (e){
sh '''
echo Do you smell the smoke in the room??
echo docker container logs :
sudo make get-logs
'''
throw e
}
finally {
sh '''
sudo -E make stop-all
sudo -E docker ps
'''
}
}
}
stage("RUN mini-plugtest: californium_clie VS coapthon_serv"){
gitlabCommitStatus("START resources for mini-plugtest: californium_clie VS coapthon_serv") {
gitlabCommitStatus("Docker run") {
long startTime = System.currentTimeMillis()
long timeoutInSeconds = 120
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
sudo -E make _run-coap-mini-interop-californium-cli-vs-coapthon-server
'''
}
} catch (err) {
long timePassed = System.currentTimeMillis() - startTime
if (timePassed >= timeoutInSeconds * 1000) {
echo 'Docker container kept on running!'
currentBuild.result = 'SUCCESS'
} else {
currentBuild.result = 'FAILURE'
}
}
}
}
gitlabCommitStatus("EXECUTE mini-plugtest: californium_clie VS coapthon_serv") {
long timeoutInSeconds = 600
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
......@@ -217,15 +329,66 @@ if(env.JOB_NAME =~ 'CoAP testing tool/'){
}
finally {
sh '''
sudo -E make stop-coap-client
sudo -E make stop-coap-server
sudo -E make stop-coap-testing-tool
sudo -E make stop-all
sudo -E docker ps
'''
}
}
}
stage("RUN mini-plugtest: coapthon_clie VS coapthon_serv"){
gitlabCommitStatus("START resources for mini-plugtest: coapthon_clie VS coapthon_serv") {
gitlabCommitStatus("Docker run") {
long startTime = System.currentTimeMillis()
long timeoutInSeconds = 120
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
sudo -E make _run-coap-mini-interop-coapthon-cli-vs-coapthon-server
'''
}
} catch (err) {
long timePassed = System.currentTimeMillis() - startTime
if (timePassed >= timeoutInSeconds * 1000) {
echo 'Docker container kept on running!'
currentBuild.result = 'SUCCESS'
} else {
currentBuild.result = 'FAILURE'
}
}
}
}
gitlabCommitStatus("EXECUTE mini-plugtest: coapthon_clie VS coapthon_serv") {
long timeoutInSeconds = 600
try {
timeout(time: timeoutInSeconds, unit: 'SECONDS') {
sh '''
echo AMQP params: { url: $AMQP_URL , exchange: $AMQP_EXCHANGE}
python3 -m pytest -s -p no:cacheprovider tests/test_full_coap_interop_session.py -v
'''
}
}
catch (e){
sh '''
echo Do you smell the smoke in the room??
echo docker container logs :
sudo make get-logs
'''
throw e
}
finally {
sh '''
sudo -E make stop-all
sudo -E docker ps
'''
}
}
}
}
}
......@@ -244,7 +407,7 @@ if(env.JOB_NAME =~ 'ioppytest - build all tools/'){
checkout scm
sh '''
git submodule update --init
tree .
# tree .
'''
}
......
version = 1.0
info_message = """ \\n\
******************************************************************************************\n\
docker images naming must follow the following conventions: \n\
\n\
resource_type-sub_type-resource_name-version \n\
\n\
resource_type, sub_type and resource_name cannot contain any special character, nor '-' \n\
version format must comply to vx.x \n\
\n\
examples: \n\
\n\
automated_iut-coap_client-coapthon \n\
automated_iut-coap_server-californium \n\
automated_iut-coap_client-coapthon-v$(version) \n\
automated_iut-coap_server-californium-v$(version) \n\
\n\
testing_tool-performance-coap-v$(version) \n\
testing_tool-interoperability-coap-v$(version) \n\
testing_tool-interoperability-coap (alias to last version) \n\
testing_tool-conformance-coap-v$(version) \n\
testing_tool-conformance-coap (alias to last version) \n\
testing_tool-conformance-6tisch-v$(version) \n\
\n\
reference_iut-coap_client (alias) \n\
reference_iut-coap_server (alias) \n\
******************************************************************************************\n\\n\
"""
info:
@echo $(info_message)
version:
@echo ioppytest v$(version)
echo_amqp_env_params:
@echo URL: $(AMQP_URL)
@echo EXCHANGE: $(AMQP_EXCHANGE)
help: ## Help dialog.
@IFS=$$'\n' ; \
......@@ -18,6 +49,8 @@ help: ## Help dialog.
printf "%-30s %s\n" $$help_command $$help_info ; \
done
# # # # Testing Tool & other resources BUILD commands # # # #
build-tools: ## builds all testing tool docker images (only testing tool)
@echo $(info_message)
@echo "Starting to build docker images.. "
......@@ -25,6 +58,7 @@ build-tools: ## builds all testing tool docker images (only testing tool)
$(MAKE) _docker-build-coap
$(MAKE) _docker-build-6lowpan
$(MAKE) _docker-build-onem2m
$(MAKE) _docker-build-lwm2m
$(MAKE) _docker-build-comi
build-automated-iuts: ## Build all automated-iut docker images
......@@ -32,6 +66,7 @@ build-automated-iuts: ## Build all automated-iut docker images
$(MAKE) _docker-build-coap-additional-resources
$(MAKE) _docker-build-comi-additional-resources
$(MAKE) _docker-build-onem2m-additional-resources
$(MAKE) _docker-build-lwm2m-additional-resources
build-all: ## Build all testing tool in docker images, and other docker image resources too
@echo $(info_message)
......@@ -39,6 +74,9 @@ build-all: ## Build all testing tool in docker images, and other docker image re
$(MAKE) build-tools
$(MAKE) build-automated-iuts
# # # # Testing Tool & other resources RUN commands # # # #
sniff-bus: ## Listen and echo all messages in the event bus
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@python3 -m ioppytest.utils.interop_cli connect -ll
......@@ -55,6 +93,10 @@ run-coap-testing-tool: ## Run CoAP testing tool in docker container
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name testing_tool-interoperability-coap testing_tool-interoperability-coap
run-lwm2m-testing-tool: ## Run lwm2m testing tool in docker container
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name testing_tool-interoperability-lwm2m testing_tool-interoperability-lwm2m
run-onem2m-testing-tool: ## Run oneM2M testing tool in docker container
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name testing_tool-interoperability-onem2m testing_tool-interoperability-onem2m
......@@ -85,6 +127,9 @@ stop-comi-testing-tool:
stop-onem2m-testing-tool:
docker stop testing_tool-interoperability-onem2m
stop-lwm2m-testing-tool:
docker stop testing_tool-interoperability-lwm2m
stop-6lowpan-testing-tool:
docker stop testing_tool-interoperability-6lowpan
......@@ -97,6 +142,32 @@ stop-coap-server:
stop-coap-client:
docker stop reference_iut-coap_client
stop-coap-client-californium:
docker stop automated_iut-coap_client-californium
stop-coap-server-californium:
docker stop automated_iut-coap_server-californium
stop-coap-client-coapthon:
docker stop automated_iut-coap_client-coapthon
stop-coap-server-coapthon:
docker stop automated_iut-coap_server-coapthon
stop-all: ## Stop testing tools running as docker containers
@echo "running $@"
# (exit 0) -> so the script continues on errors
$(MAKE) stop-coap-testing-tool --keep-going ; exit 0
$(MAKE) stop-6lowpan-testing-tool --keep-going ; exit 0
$(MAKE) stop-coap-server --keep-going ; exit 0
$(MAKE) stop-coap-client --keep-going ; exit 0
$(MAKE) stop-coap-client-californium --keep-going ; exit 0
$(MAKE) stop-coap-server-californium --keep-going ; exit 0
$(MAKE) stop-coap-client-coapthon --keep-going ; exit 0
$(MAKE) stop-coap-server-coapthon --keep-going ; exit 0
# # # # UNITTEST commands # # # #
validate-test-description-syntax: ## validate (yaml) test description file syntax
@python3 -m pytest -p no:cacheprovider ioppytest/extended_test_descriptions/tests/tests.py -vvv
......@@ -121,13 +192,6 @@ _test_submodules:
$(MAKE) _test_utils
stop-all: ## Stop testing tools running as docker containers
# (exit 0) -> so the script continues on errors
$(MAKE) stop-coap-testing-tool --keep-going ; exit 0
$(MAKE) stop-6lowpan-testing-tool --keep-going ; exit 0
$(MAKE) stop-coap-server --keep-going ; exit 0
$(MAKE) stop-coap-client --keep-going ; exit 0
get-logs: ## Get logs from the running containers
@echo ">>>>> start logs testing_tool-interoperability-coap"
docker logs testing_tool-interoperability-coap ; exit 0
......@@ -141,6 +205,10 @@ get-logs: ## Get logs from the running containers
docker logs testing_tool-interoperability-onem2m ; exit 0
@echo "<<<<< end logs testing_tool-interoperability-onem2m \n"
@echo ">>>>> start logs testing_tool-interoperability-lwm2m"
docker logs testing_tool-interoperability-lwm2m ; exit 0
@echo "<<<<< end logs testing_tool-interoperability-lwm2m \n"
@echo ">>>>> start logs reference_iut-coap_server"
docker logs reference_iut-coap_server ; exit 0
@echo "<<<<< end logs reference_iut-coap_server \n"
......@@ -161,7 +229,7 @@ install-python-dependencies: ## installs all python pip dependencies
@python3 -m pip -qq install -r ioppytest/webserver/requirements.txt
@python3 -m pip -qq install -r ioppytest/utils/requirements.txt
# # # # other AUXILIARY commands # # # #
_check-sudo:
@runner=`whoami` ;\
if test $$runner != "root" ;\
......@@ -175,6 +243,15 @@ _docker-build-dummy-gui-adaptor:
# let's build the testing tool image (same for interop and conformance)
docker build --quiet -t dummy-gui-adaptor -f envs/dummy_testing_tool/Dockerfile .
_docker-build-lwm2m:
@echo "Starting to build the lwm2m testing tools.."
# let's build the testing tool image (same for interop and conformance)
docker build --quiet -t testing_tool-interoperability-lwm2m-v$(version) -f envs/lwm2m_testing_tool/Dockerfile .
# tag all last version images also with a version-less name
docker tag testing_tool-interoperability-lwm2m-v$(version):latest testing_tool-interoperability-lwm2m
_docker-build-onem2m:
@echo "Starting to build the oneM2M testing tools.."
......@@ -236,9 +313,14 @@ _docker-build-coap-additional-resources:
docker tag automated_iut-coap_client-californium-v$(version):latest automated_iut-coap_client-californium
docker tag automated_iut-coap_server-californium-v$(version):latest automated_iut-coap_server-californium
docker tag automated_iut-coap_client-coapthon-v$(version):latest reference_iut-coap_client
docker tag automated_iut-coap_client-californium-v$(version):latest reference_iut-coap_client
docker tag automated_iut-coap_server-californium-v$(version):latest reference_iut-coap_server
_docker-build-lwm2m-additional-resources:
@echo "Starting to build lwm2m-additional-resources.. "
docker build --quiet -t automated_iut-lwm2m_client-leshan-v$(version) -f automated_IUTs/lwm2m_client_leshan/Dockerfile .
docker tag automated_iut-lwm2m_client-leshan-v$(version):latest automated_iut-lwm2m_client-leshan
_docker-build-onem2m-additional-resources:
@echo "Starting to build onem2m-additional-resources.. "
@echo "TBD"
......@@ -255,28 +337,76 @@ _docker-build-6lowpan-additional-resources:
@echo "Starting to build 6lowpan-additional-resources.. "
@echo "TBD"
info_message = """ \\n\
******************************************************************************************\n\
docker images naming must follow the following conventions: \n\
\n\
resource_type-sub_type-resource_name-version \n\
\n\
resource_type, sub_type and resource_name cannot contain any special character, nor '-' \n\
version format must comply to vx.x \n\
\n\
examples: \n\
\n\
automated_iut-coap_client-coapthon-v$(version) \n\
automated_iut-coap_server-californium-v$(version) \n\
\n\
testing_tool-performance-coap-v$(version) \n\
testing_tool-interoperability-coap-v$(version) \n\
testing_tool-interoperability-coap (alias to last version) \n\
testing_tool-conformance-coap-v$(version) \n\
testing_tool-conformance-coap (alias to last version) \n\
testing_tool-conformance-6tisch-v$(version) \n\
\n\
reference_iut-coap_client (alias) \n\
reference_iut-coap_server (alias) \n\
******************************************************************************************\n\\n\
"""
_setup-coap-mini-interop-californium-cli-vs-californium-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_client-californium automated_iut-coap_client-californium
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_server-californium automated_iut-coap_server-californium
_run-coap-mini-interop-californium-cli-vs-californium-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
$(MAKE) run-coap-testing-tool
$(MAKE) _setup-coap-mini-interop-californium-cli-vs-californium-server
_setup-coap-mini-interop-californium-cli-vs-coapthon-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_client-californium automated_iut-coap_client-californium
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_server-coapthon automated_iut-coap_server-coapthon
_run-coap-mini-interop-californium-cli-vs-coapthon-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
$(MAKE) run-coap-testing-tool
$(MAKE) _setup-coap-mini-interop-californium-cli-vs-coapthon-server
_setup-coap-mini-interop-coapthon-cli-vs-coapthon-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_client-coapthon automated_iut-coap_client-coapthon
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_server-coapthon automated_iut-coap_server-coapthon
_run-coap-mini-interop-coapthon-cli-vs-coapthon-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
$(MAKE) run-coap-testing-tool
$(MAKE) _setup-coap-mini-interop-coapthon-cli-vs-coapthon-server
_setup-coap-mini-interop-coapthon-cli-vs-californium-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_client-coapthon automated_iut-coap_client-coapthon
docker run -d --rm --env AMQP_EXCHANGE=$(AMQP_EXCHANGE) --env AMQP_URL=$(AMQP_URL) --sysctl net.ipv6.conf.all.disable_ipv6=0 --privileged --name automated_iut-coap_server-californium automated_iut-coap_server-californium
_run-coap-mini-interop-coapthon-cli-vs-californium-server:
@echo "Using AMQP env vars: {url : $(AMQP_URL), exchange : $(AMQP_EXCHANGE)}"
@echo "running $@"
$(MAKE) run-coap-testing-tool
$(MAKE) _setup-coap-mini-interop-coapthon-cli-vs-californium-server
_stop-coap-mini-interop-coapthon-cli-vs-californium-server:
$(MAKE) stop-coap-client-coapthon
$(MAKE) stop-coap-server-californium
$(MAKE) stop-coap-testing-tool
_stop-coap-mini-interop-californium-cli-vs-californium-server:
$(MAKE) stop-coap-client-californium
$(MAKE) stop-coap-server-californium
$(MAKE) stop-coap-testing-tool
_stop-coap-mini-interop-californium-cli-vs-coapthon-server:
$(MAKE) stop-coap-client-californium
$(MAKE) stop-coap-server-coapthon
$(MAKE) stop-coap-testing-tool
_stop-coap-mini-interop-coapthon-cli-vs-coapthon-server:
$(MAKE) stop-coap-client-coapthon
$(MAKE) stop-coap-server-coapthon
$(MAKE) stop-coap-testing-tool
......@@ -49,6 +49,13 @@
pip:
requirements: "{{ testing_tool_dir }}/ioppytest/webserver/requirements.txt"
executable: pip3
- name: Install python requirements for utils
tags: coap_test_suite
become: True
pip:
requirements: "{{ testing_tool_dir }}/ioppytest/utils/requirements.txt"
executable: pip3
- name: Install python3 requirements for agent
tags: coap_test_suite
......
......@@ -30,10 +30,10 @@ processes regarding the IUT and the integration scripts
```sudo docker run -it --env AMQP_EXCHANGE=$AMQP_EXCHANGE --env AMQP_URL=$AMQP_URL --privileged automated_iut-coap_client-coapthon-v0.1```
- Modify the build_all_docker_images.sh at the root dir of the project
- Modify the Makefile at the root dir of the project
- Add ansible scripts for building the IUT
- Add ansible scripts for building the IUT (optional)
......
......@@ -13,6 +13,7 @@ import signal
import logging
import threading
from ioppytest.utils.rmq_handler import RabbitMQHandler, JsonFormatter
from ioppytest.utils.messages import *
from ioppytest.utils.amqp_synch_call import publish_message
from ioppytest import AMQP_URL, AMQP_EXCHANGE, INTERACTIVE_SESSION, RESULTS_DIR, LOG_LEVEL
......@@ -22,9 +23,16 @@ STIMULI_HANDLER_TOUT = 10
COMPONENT_ID = 'automation'
# init logging to stnd output and log files
logger = logging.getLogger(COMPONENT_ID)
logger.setLevel(LOG_LEVEL)
# AMQP log handler with f-interop's json formatter
rabbitmq_handler = RabbitMQHandler(AMQP_URL, COMPONENT_ID)
json_formatter = JsonFormatter()
rabbitmq_handler.setFormatter(json_formatter)
logger.addHandler(rabbitmq_handler)
@property
def NotImplementedField(self):
......@@ -40,19 +48,18 @@ def signal_int_handler(signal, frame):
)
logger.info('got SIGINT. Bye bye!')
sys.exit(0)
signal.signal(signal.SIGINT, signal_int_handler)
class AutomatedIUT(threading.Thread):
# attributes to be provided by subclass
implemented_testcases_list = NotImplementedField
stimuli_cmd_dict = NotImplementedField
implemented_stimuli_list = NotImplementedField
component_id = NotImplementedField
node = NotImplementedField
process_log_file = None # child may override, it will be logged at the end of the session
EVENTS = [
MsgTestCaseReady,
......@@ -86,6 +93,47 @@ class AutomatedIUT(threading.Thread):
self.channel.basic_qos(prefetch_count=1)
self.channel.basic_consume(self.on_request, queue=services_queue_name)
# # # # INTERFACE to be overridden by child class # # # # # # # # # # # # # # # # # #
def _exit(self):
m = MsgTestingToolComponentShutdown(component=self.component_id)
publish_message(self.connection, m)
time.sleep(2)
self.connection.close()
sys.exit(0)