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

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
This diff is collapsed.
This diff is collapsed.
......@@ -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)
def _execute_verify(self, verify_step_id):
"""
If IUT cannot perform verify validations then just override method with `pass` command
:param verify_step_id:
:return:
"""
raise NotImplementedError("Subclasses should implement this!")
def _execute_stimuli(self, stimuli_step_id, addr):
"""
When executing IUT stimuli, the call MUST NOT block thread forever
:param stimuli_step_id:
:param addr:
:return:
"""
raise NotImplementedError("Subclasses should implement this!")
# TODO fix me! no node should be passed, mabe pass config ID (test description defines one)
def _execute_configuration(self, testcase_id, node):
"""
If IUT doesnt need to configure anything then just override method with `pass` command
:param testcase_id:
:param node:
:return:
"""
raise NotImplementedError("Subclasses should implement this!")
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
def run(self):
logger.info("Starting thread listening on the event bus")
self.channel.start_consuming()
......@@ -109,6 +157,11 @@ class AutomatedIUT(threading.Thread):
logger.info('Event received: %s' % repr(event))
if isinstance(event, MsgTestCaseReady):
if self.implemented_testcases_list == []:
logger.info('IUT didnt declare testcases capabilities, we asume that any can be run')
return
if event.testcase_id not in self.implemented_testcases_list:
time.sleep(0.1)
logger.info('IUT %s pushing test case skip message for %s' % (self.component_id, event.testcase_id))
......@@ -118,17 +171,14 @@ class AutomatedIUT(threading.Thread):
elif isinstance(event, MsgStepStimuliExecute):
logger.info('event.node %s,%s' % (event.node, self.node))
if event.node == self.node and event.step_id in self.stimuli_cmd_dict:
# TODO Fix me: No need to go fetch CMD to child object, just call as _execute_simuli(step_id,target_address)
cmd = self.stimuli_cmd_dict[event.step_id]
if event.node == self.node and event.step_id in self.implemented_stimuli_list:
step = event.step_id
addr = event.target_address
if cmd:
self._execute_stimuli(step, cmd,
addr) # this should be a blocking call until stimuli has been executed
addr = event.target_address # may be None
self._execute_stimuli(step, addr) # blocking till stimuli execution
publish_message(self.connection, MsgStepStimuliExecuted(node=self.node))
else:
logger.info('Event received and ignored: %s (node: %s - step: %s)' %
logger.info('Event received and ignored: \n\tEVENT:%s \n\tNODE:%s \n\tSTEP: %s' %
(
type(event),
event.node,
......@@ -145,12 +195,22 @@ class AutomatedIUT(threading.Thread):
))
else:
logger.info('Event received and ignored: %s (node: %s - step: %s)' %
(type(event),
event.node,
event.step_id,))
(
type(event),
event.node,
event.step_id,
))
elif isinstance(event, MsgTestSuiteReport):
logger.info('Got final test suite report: %s' % event.to_json())
if self.process_log_file:
contents = open(self.process_log_file).read()
logger.info('*' * 72)
logger.info('AUTOMATED_IUT LOGS %s' % self.process_log_file)
logger.info('*' * 72)
logger.info(contents)
logger.info('*' * 72)
logger.info('*' * 72)
elif isinstance(event, MsgTestingToolTerminate):
logger.info('Test terminate signal received. Quitting..')
......@@ -162,31 +222,13 @@ class AutomatedIUT(threading.Thread):
logger.info('Configure test case %s', event.testcase_id)
# TODO fix me _execute_config should pass an arbitrary dict, which will be used later for building the fields of the ret message
ipaddr = self._execute_configuration(event.testcase_id,
event.node) # this should be a blocking call until configuration has been done
event.node) # blocking till complete config execution
if ipaddr != '':
m = MsgConfigurationExecuted(testcase_id=event.testcase_id, node=event.node, ipv6_address=ipaddr)
publish_message(self.connection, m)
else:
logger.info('Event received and ignored: %s' % type(event))
def _exit(self):
m = MsgTestingToolComponentShutdown(component=self.component_id)
publish_message(self.connection, m)
time.sleep(2)
self.connection.close()
sys.exit(0)
def _execute_verify(self, verify_step_id):
raise NotImplementedError("Subclasses should implement this!")
# TODO fix me! no cmd should be passed, this is child class related stuff
def _execute_stimuli(self, stimuli_step_id, cmd, addr):
raise NotImplementedError("Subclasses should implement this!")
# TODO fix me! no node should be passed, mabe pass config ID (test description defines one)
def _execute_configuration(self, testcase_id, node):
raise NotImplementedError("Subclasses should implement this!")
class UserMock(threading.Thread):
"""
......@@ -315,9 +357,16 @@ class UserMock(threading.Thread):
def stop(self):
self.shutdown = True
if not self.connection.is_open:
self.connection = pika.BlockingConnection(pika.URLParameters(AMQP_URL))
publish_message(self.connection,
MsgTestingToolComponentShutdown(component=COMPONENT_ID))
self.channel.stop_consuming()
if self.channel.is_open:
self.channel.stop_consuming()
self.connection.close()
def exit(self):
......
......@@ -24,8 +24,12 @@ WORKDIR /ioppytest
#py2 requirements
RUN python -m pip install -r ioppytest/agent/requirements.txt
#py3 requierements
RUN python3 -m pip install pika
# requirements on autoamted-iut python code
RUN python3 -m pip install -r automated_IUTs/requirements.txt
# temp PATCH for avoiding https://github.com/celery/py-amqp/issues/191
RUN python3 -m pip install -Iv amqp==2.2.2
RUN python -m pip install -Iv amqp==2.2.2
#RUN cp automated_IUTs/coap_client_californium/supervisor.conf /etc/supervisor/supervisor.conf
......
......@@ -8,99 +8,87 @@ from automated_IUTs.automation import *
logger = logging.getLogger()
logger.setLevel(LOG_LEVEL)
server_base_url = 'coap://[%s]:%s' % (COAP_SERVER_HOST, COAP_SERVER_PORT)
default_coap_server_base_url = 'coap://[%s]:%s' % (COAP_SERVER_HOST, COAP_SERVER_PORT)
coap_host_address = COAP_CLIENT_HOST
class CaliforniumCoapClient(AutomatedIUT):
"""
californium client CLI expects:
java -jar (..)/coap_plugtest_client-1.1.0-SNAPSHOT.jar -s -u coap://[<IPv6>]:port -t TD_COAP_CORE_01
"""
component_id = 'automated_iut-coap_client-californium'
node = 'coap_client'
iut_cmd = [
'java -jar automated_IUTs/coap_client_californium/target/coap_plugtest_client-1.1.0-SNAPSHOT.jar -s -u ' +
server_base_url + ' -t'
]
# mapping message's stimuli id -> CoAPthon (coap client) commands
stimuli_cmd_dict = {
'TD_COAP_CORE_01_step_01': iut_cmd + ['TD_COAP_CORE_01'],
'TD_COAP_CORE_02_step_01': iut_cmd + ['TD_COAP_CORE_02'],
'TD_COAP_CORE_03_step_01': iut_cmd + ['TD_COAP_CORE_03'],
'TD_COAP_CORE_04_step_01': iut_cmd + ['TD_COAP_CORE_04'],
'TD_COAP_CORE_05_step_01': iut_cmd + ['TD_COAP_CORE_05'],
'TD_COAP_CORE_06_step_01': iut_cmd + ['TD_COAP_CORE_06'],
'TD_COAP_CORE_07_step_01': iut_cmd + ['TD_COAP_CORE_07'],
'TD_COAP_CORE_08_step_01': iut_cmd + ['TD_COAP_CORE_08'],
'TD_COAP_CORE_09_step_01': iut_cmd + ['TD_COAP_CORE_09'],
'TD_COAP_CORE_10_step_01': iut_cmd + ['TD_COAP_CORE_10'],
'TD_COAP_CORE_11_step_01': iut_cmd + ['TD_COAP_CORE_11'],
'TD_COAP_CORE_12_step_01': iut_cmd + ['TD_COAP_CORE_12'],
'TD_COAP_CORE_13_step_01': iut_cmd + ['TD_COAP_CORE_13'],
'TD_COAP_CORE_14_step_01': iut_cmd + ['TD_COAP_CORE_14'],
'TD_COAP_CORE_17_step_01': iut_cmd + ['TD_COAP_CORE_17'],
'TD_COAP_CORE_18_step_01': iut_cmd + ['TD_COAP_CORE_18'],
'TD_COAP_CORE_19_step_01': iut_cmd + ['TD_COAP_CORE_19'],
'TD_COAP_CORE_20_step_01': iut_cmd + ['TD_COAP_CORE_20'],
'TD_COAP_CORE_20_step_05': None,
'TD_COAP_CORE_21_step_01': iut_cmd + ['TD_COAP_CORE_21'],
'TD_COAP_CORE_21_step_05': None,
'TD_COAP_CORE_21_step_09': None,
'TD_COAP_CORE_21_step_10': None,
'TD_COAP_CORE_22_step_01': iut_cmd + ['TD_COAP_CORE_22'],
'TD_COAP_CORE_22_step_04': None,
'TD_COAP_CORE_22_step_08': None,
'TD_COAP_CORE_22_step_12': None,
'TD_COAP_CORE_22_step_13': None,
'TD_COAP_CORE_23_step_01': iut_cmd + ['TD_COAP_CORE_23'],
'TD_COAP_CORE_23_step_05': None,
iut_base_cmd = 'java -jar automated_IUTs/coap_client_californium/target/coap_plugtest_client-1.1.0-SNAPSHOT.jar -s'
# mapping message's stimuli id -> testcase id
stimuli_to_testcase_map = {
'TD_COAP_CORE_01_step_01': 'TD_COAP_CORE_01',
'TD_COAP_CORE_02_step_01': 'TD_COAP_CORE_02',
'TD_COAP_CORE_03_step_01': 'TD_COAP_CORE_03',
'TD_COAP_CORE_04_step_01': 'TD_COAP_CORE_04',
'TD_COAP_CORE_05_step_01': 'TD_COAP_CORE_05',
'TD_COAP_CORE_06_step_01': 'TD_COAP_CORE_06',
'TD_COAP_CORE_07_step_01': 'TD_COAP_CORE_07',
'TD_COAP_CORE_08_step_01': 'TD_COAP_CORE_08',
'TD_COAP_CORE_09_step_01': 'TD_COAP_CORE_09',
'TD_COAP_CORE_10_step_01': 'TD_COAP_CORE_10',
'TD_COAP_CORE_11_step_01': 'TD_COAP_CORE_11',
'TD_COAP_CORE_12_step_01': 'TD_COAP_CORE_12',
'TD_COAP_CORE_13_step_01': 'TD_COAP_CORE_13',
'TD_COAP_CORE_14_step_01': 'TD_COAP_CORE_14',
'TD_COAP_CORE_17_step_01': 'TD_COAP_CORE_17',
'TD_COAP_CORE_18_step_01': 'TD_COAP_CORE_18',
'TD_COAP_CORE_19_step_01': 'TD_COAP_CORE_19',
'TD_COAP_CORE_20_step_01': 'TD_COAP_CORE_20',
'TD_COAP_CORE_21_step_01': 'TD_COAP_CORE_21',
'TD_COAP_CORE_22_step_01': 'TD_COAP_CORE_22',
'TD_COAP_CORE_23_step_01': 'TD_COAP_CORE_23',
}
implemented_testcases_list = [
'TD_COAP_CORE_01',
'TD_COAP_CORE_02',
'TD_COAP_CORE_03',
'TD_COAP_CORE_04',
'TD_COAP_CORE_05',
'TD_COAP_CORE_06',
'TD_COAP_CORE_07',
'TD_COAP_CORE_08',
'TD_COAP_CORE_09',
'TD_COAP_CORE_10',
'TD_COAP_CORE_11',
'TD_COAP_CORE_12',
'TD_COAP_CORE_13',
'TD_COAP_CORE_14',
'TD_COAP_CORE_17',
'TD_COAP_CORE_18',
'TD_COAP_CORE_19',
'TD_COAP_CORE_20',
'TD_COAP_CORE_21',
'TD_COAP_CORE_22',
'TD_COAP_CORE_23',
]
implemented_stimuli_list = list(stimuli_to_testcase_map.keys())
implemented_testcases_list = list(stimuli_to_testcase_map.values())
def __init__(self):
super().__init__(self.node)
logger.info('starting %s [ %s ]' % (self.node, self.component_id))
def _execute_verify(self, verify_step_id, ):
def _execute_verify(self, verify_step_id):
logger.warning('Ignoring: %s. No auto-iut mechanism for verify step implemented.' % verify_step_id)
def _execute_stimuli(self, stimuli_step_id, cmd, addr):
def _execute_stimuli(self, stimuli_step_id, addr):
logger.info('got stimuli execute request: \n\tSTIMULI_ID=%s,\n\tTARGET_ADDRESS=%s' % (stimuli_step_id, addr))
if addr and addr is not "":
target_base_url = 'coap://[%s]:%s' % (addr, COAP_SERVER_PORT)
else:
target_base_url = default_coap_server_base_url
try:
logger.info('spawning process with : %s' % cmd)
cmd = " ".join(cmd)
# Generate IUT CMD for stimuli
cmd = self.iut_base_cmd
cmd += ' {option} {value}'.format(option='-u', value=target_base_url)
cmd += ' {option} {value}'.format(option='-t', value=self.stimuli_to_testcase_map[stimuli_step_id])
# Execute IUT CMD for stimuli
logger.info('Spawning process with : %s' % cmd)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
proc.wait(timeout=STIMULI_HANDLER_TOUT)
# GET stdout IUT CMD for stimuli
output = ''
while proc.poll() is None:
output += str(proc.stdout.readline())
output += str(proc.stdout.read())
logger.info('%s executed' % stimuli_step_id)
logger.info('process stdout: %s' % output)
logger.info('EXECUTED: %s' % stimuli_step_id)
logger.info('Process STDOUT: %s' % output)
except subprocess.TimeoutExpired as tout:
logger.warning('Process timeout. info: %s' % str(tout))
logger.warning('Process TIMEOUT. info: %s' % str(tout))
except Exception as e:
logging.error('Error found on automated-iut while tryning to execute stimuli %s' % stimuli_step_id)
......@@ -112,6 +100,10 @@ class CaliforniumCoapClient(AutomatedIUT):
if __name__ == '__main__':
iut = CaliforniumCoapClient()
iut.start()
iut.join()
try:
iut = CaliforniumCoapClient()
iut.start()
iut.join()
except Exception as e:
logger.error(e)
Subproject commit ed0c8025c05204f0f3e2b661f4d9ef54ff20bd58
Subproject commit 87d4e53445d35bb78313a411256a5a7cf607b169
......@@ -22,10 +22,16 @@ RUN python -m pip install -r ioppytest/agent/requirements.txt
#py3 requirements
RUN python3 -m pip install -r automated_IUTs/coap_client_coapthon/CoAPthon/requirements.txt
RUN python3 -m pip install -r automated_IUTs/coap_client_coapthon/requirements.txt
# requirements on autoamted-iut python code
RUN python3 -m pip install -r automated_IUTs/requirements.txt
#RUN cp automated_IUTs/coap_client_coapthon/supervisor.conf supervisor.conf
# temp PATCH for avoiding https://github.com/celery/py-amqp/issues/191
RUN python3 -m pip install -Iv amqp==2.2.2
RUN python -m pip install -Iv amqp==2.2.2
EXPOSE 5671 5672
# launch processes
......
......@@ -2,74 +2,87 @@
# !/usr/bin/env python3
import subprocess
import logging
from urllib.parse import urlparse
from automated_IUTs import COAP_SERVER_HOST, COAP_SERVER_PORT, COAP_CLIENT_HOST, LOG_LEVEL
from automated_IUTs.automation import *
from automated_IUTs.automation import STIMULI_HANDLER_TOUT, AutomatedIUT
logger = logging.getLogger()
logger.setLevel(LOG_LEVEL)
server_base_url = 'coap://[%s]:%s' % (COAP_SERVER_HOST, COAP_SERVER_PORT)
default_coap_server_base_url = 'coap://[%s]:%s' % (COAP_SERVER_HOST, COAP_SERVER_PORT)
coap_host_address = COAP_CLIENT_HOST
class CoapthonCoapClient(AutomatedIUT):
"""
CoAPthon CLI expects:
python finterop_interop_tests.py --ip bbbb::2 --port 5683 --testcase test_td_coap_core_01
(python2.7)
"""
component_id = 'automated_iut-coap_client-coapthon'
node = 'coap_client'
iut_cmd = [
'python',
'automated_IUTs/coap_client_coapthon/CoAPthon/finterop_interop_tests.py',
'-t',
]
iut_base_cmd = 'python automated_IUTs/coap_client_coapthon/CoAPthon/finterop_interop_tests.py'
def __init__(self):
super().__init__(self.node)
logger.info('starting %s [ %s ]' % (self.node, self.component_id))
# mapping message's stimuli id -> CoAPthon (coap client) commands
stimuli_cmd_dict = {
'TD_COAP_CORE_01_step_01': iut_cmd + ['test_td_coap_core_01'],
'TD_COAP_CORE_02_step_01': iut_cmd + ['test_td_coap_core_02'],
'TD_COAP_CORE_03_step_01': iut_cmd + ['test_td_coap_core_03'],
'TD_COAP_CORE_04_step_01': iut_cmd + ['test_td_coap_core_04'],
'TD_COAP_CORE_05_step_01': iut_cmd + ['test_td_coap_core_05'],
'TD_COAP_CORE_06_step_01': iut_cmd + ['test_td_coap_core_06'],
'TD_COAP_CORE_07_step_01': iut_cmd + ['test_td_coap_core_07'],
'TD_COAP_CORE_08_step_01': iut_cmd + ['test_td_coap_core_08'],
'TD_COAP_CORE_09_step_01': iut_cmd + ['test_td_coap_core_09'],
'TD_COAP_CORE_10_step_01': iut_cmd + ['test_td_coap_core_10'],
stimuli_to_testcase_map = {
'TD_COAP_CORE_01_step_01': 'test_td_coap_core_01',
'TD_COAP_CORE_02_step_01': 'test_td_coap_core_02',
'TD_COAP_CORE_03_step_01': 'test_td_coap_core_03',
'TD_COAP_CORE_04_step_01': 'test_td_coap_core_04',
'TD_COAP_CORE_05_step_01': 'test_td_coap_core_05',
'TD_COAP_CORE_06_step_01': 'test_td_coap_core_06',
'TD_COAP_CORE_07_step_01': 'test_td_coap_core_07',
'TD_COAP_CORE_08_step_01': 'test_td_coap_core_08',
'TD_COAP_CORE_09_step_01': 'test_td_coap_core_09',
'TD_COAP_CORE_10_step_01': 'test_td_coap_core_10',
}
implemented_testcases_list = [
'TD_COAP_CORE_01',
'TD_COAP_CORE_02',
'TD_COAP_CORE_03',
'TD_COAP_CORE_04',
'TD_COAP_CORE_05',
'TD_COAP_CORE_06',
'TD_COAP_CORE_07',
'TD_COAP_CORE_08',
'TD_COAP_CORE_09',
'TD_COAP_CORE_10',
]
def _execute_verify(self, verify_step_id, ):
implemented_stimuli_list = list(stimuli_to_testcase_map.keys())
implemented_testcases_list = ['TD_COAP_CORE_%02d' % tc for tc in range(1, 11)]
def _execute_verify(self, verify_step_id):
logger.warning('Ignoring: %s. No auto-iut mechanism for verify step implemented.' % verify_step_id)
def _execute_stimuli(self, stimuli_step_id, cmd, addr):
def _execute_stimuli(self, stimuli_step_id, addr):
logger.info('got stimuli execute request: \n\tSTIMULI_ID=%s,\n\tTARGET_ADDRESS=%s' % (stimuli_step_id, addr))
if addr and addr is not "":
target_base_url = 'coap://[%s]:%s' % (addr, COAP_SERVER_PORT)
else:
target_base_url = default_coap_server_base_url
try:
logger.info('spawning process with : %s' % cmd)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
# Parse url
o = urlparse(target_base_url)
# Generate IUT CMD for stimuli
cmd = self.iut_base_cmd
cmd += ' {option} {value}'.format(option='--ip', value=o.hostname)
cmd += ' {option} {value}'.format(option='--port', value=o.port)
cmd += ' {option} {value}'.format(option='--testcase', value=self.stimuli_to_testcase_map[stimuli_step_id])
# Execute IUT CMD for stimuli
logger.info('Spawning process with : %s' % cmd)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
proc.wait(timeout=STIMULI_HANDLER_TOUT)
# GET stdout IUT CMD for stimuli
output = ''
while proc.poll() is None:
output += str(proc.stdout.readline())
output += str(proc.stdout.read())
logger.info('%s executed' % stimuli_step_id)
logger.info('process stdout: %s' % output)
logger.info('EXECUTED: %s' % stimuli_step_id)
logger.info('Process STDOUT: %s' % output)
except subprocess.TimeoutExpired as tout:
logger.warning('Process timeout. info: %s' % str(tout))
logger.warning('Process TIMEOUT. info: %s' % str(tout))
except Exception as e:
logging.error('Error found on automated-iut while tryning to execute stimuli %s' % stimuli_step_id)
......@@ -81,6 +94,10 @@ class CoapthonCoapClient(AutomatedIUT):
if __name__ == '__main__':
iut = CoapthonCoapClient()
iut.start()
iut.join()
try:
iut = CoapthonCoapClient()
iut.start()
iut.join()
except Exception as e:
logger.error(e)
......@@ -24,11 +24,15 @@ WORKDIR /ioppytest
#py2 requirements
RUN python -m pip install -r ioppytest/agent/requirements.txt
#py3 requierements
RUN python3 -m pip install pika
# requirements on autoamted-iut python code
RUN python3 -m pip install -r automated_IUTs/requirements.txt
#RUN cp automated_IUTs/coap_server_californium/supervisor.conf supervisor.conf
# temp PATCH for avoiding https://github.com/celery/py-amqp/issues/191
RUN python3 -m pip install -Iv amqp==2.2.2
RUN python -m pip install -Iv amqp==2.2.2
EXPOSE 5671 5672
# launch processes
......
......@@ -21,16 +21,13 @@ class CaliforniumCoapServer(AutomatedIUT):
component_id = 'automated_iut-coap_server-californium'
node = 'coap_server'
process_log_file = os.path.join(TMPDIR, component_id + '.log')
implemented_testcases_list = ['TD_COAP_CORE_%02d' % tc for tc in range(1, 31)]
stimuli_cmd_dict = NotImplementedField
iut_cmd = [
'java',
'-jar',
'automated_IUTs/coap_server_californium/target/coap_plugtest_server-1.0-SNAPSHOT.jar',
' ::1 ',
COAP_SERVER_HOST,
COAP_SERVER_PORT,
]
......@@ -38,27 +35,30 @@ class CaliforniumCoapServer(AutomatedIUT):
super().__init__(self.node)
logging.info('starting %s [ %s ]' % (self.node, self.component_id))
logging.info('spawning process %s' % str(self.iut_cmd))
th = threading.Thread(target=self._launch_automated_iut)
th.daemon = True
th.start()
self._launch_automated_iut_process()
def _execute_verify(self, verify_step_id, ):
def _execute_verify(self, verify_step_id):
logging.warning('Ignoring: %s. No auto-iut mechanism for verify step implemented.' % verify_step_id)