Commit 64b860bf authored by Federico Sismondi's avatar Federico Sismondi

fix merge conflict

parents 7be60793 ed88d388
......@@ -98,11 +98,18 @@ docker build -t finterop-coap . --no-cache
Go to FAQ, for known errors.
Finally, **run** it, from inside coap_testing_tool run:
```
docker run -it --env AMQP_EXCHANGE='amq.topic' --env AMQP_URL='amqp://someUser:somePassword@server/amqp_vhost' --privileged finterop-coap supervisord --nodaemon --configuration supervisor.conf
docker run -it
--env AMQP_EXCHANGE='default'
--env AMQP_URL='amqp://someUser:somePassword@server/amqp_vhost'
--privileged finterop-coap supervisord
--nodaemon
--configuration supervisor.conf
```
alternatively, you can:
```
docker run -it --env AMQP_EXCHANGE=default --env AMQP_URL='amqp://someUser:somePassword@server/amqp_vhost' --privileged finterop-coap bash
root@bab3b2220510:/coap_testing_tool# supervisord -c supervisor.conf
......@@ -142,7 +149,8 @@ Now, let's install the testing tool requirements:
unix user, then run ansible script:
```
ansible-playbook -i ansible/hosts.local ansible/main.yml --ask-become-pass
ansible-playbook -i ansible/hosts.local ansible/main.yml
--ask-become-pass
```
- run CoAP testing tool and monitor processes
......
......@@ -26,13 +26,13 @@ def NotImplementedField(self):
raise NotImplementedError
def signal_int_handler(signal, frame):
def signal_int_component_handler(signal, frame, component_id):
connection = pika.BlockingConnection(pika.URLParameters(AMQP_URL))
channel = connection.channel()
publish_message(
channel,
MsgTestingToolComponentShutdown(component=COMPONENT_ID)
MsgTestingToolComponentShutdown(component=component_id)
)
logger.info('got SIGINT. Bye bye!')
......@@ -40,7 +40,7 @@ def signal_int_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_int_handler)
signal.signal(signal.SIGINT, signal_int_component_handler)
class AutomatedIUT(threading.Thread):
......@@ -162,104 +162,3 @@ class AutomatedIUT(threading.Thread):
raise NotImplementedError("Subclasses should implement this!")
class UserEmulator(threading.Thread):
"""
this class servers for moking user inputs into GUI
"""
component_id = 'user_emulation'
implemented_testcases_list = [
'TD_COAP_CORE_01_v01',
'TD_COAP_CORE_02_v01',
'TD_COAP_CORE_03_v01',
'TD_COAP_CORE_04_v01',
]
def __init__(self, iut_testcases, iut_node):
threading.Thread.__init__(self)
self.message_count = 0
# queues & default exchange declaration
self.iut_node = iut_node
self.iut_testcases = iut_testcases
# lets create connection
connection = pika.BlockingConnection(pika.URLParameters(AMQP_URL))
channel = connection.channel()
# in case exchange not not declared
connection.channel().exchange_declare(exchange=AMQP_EXCHANGE,
type='topic',
durable=True,
)
services_queue_name = 'services_queue@%s' % self.component_id
self.channel.queue_declare(queue=services_queue_name, auto_delete=True)
self.channel.queue_bind(exchange=AMQP_EXCHANGE,
queue=services_queue_name,
routing_key='control.testcoordination')
publish_message(self.channel, MsgTestingToolComponentReady(component=self.component_id))
self.channel.basic_qos(prefetch_count=1)
self.channel.basic_consume(self.on_request, queue=services_queue_name)
def stop(self):
self.channel.stop_consuming()
def on_request(self, ch, method, props, body):
ch.basic_ack(delivery_tag=method.delivery_tag)
props_dict = {
'content_type': props.content_type,
'delivery_mode': props.delivery_mode,
'correlation_id': props.correlation_id,
'reply_to': props.reply_to,
'message_id': props.message_id,
'timestamp': props.timestamp,
'user_id': props.user_id,
'app_id': props.app_id,
}
event = Message.from_json(body)
event.update_properties(**props_dict)
self.message_count += 1
if event is None:
return
elif isinstance(event, MsgTestCaseReady):
if event.testcase_id in self.implemented_testcases_list:
m = MsgTestCaseStart()
publish_message(self.channel, m)
logging.info('Event received %s' % event._type)
logging.info('Event pushed %s' % m)
else:
m = MsgTestCaseSkip(testcase_id=event.testcase_id)
publish_message(self.channel, m)
logging.info('Event received %s' % event._type)
logging.info('Event pushed %s' % m)
elif isinstance(event, MsgTestingToolReady):
m = MsgTestSuiteStart()
publish_message(self.channel, m)
logging.info('Event received %s' % event._type)
logging.info('Event pushed %s' % m)
elif isinstance(event, MsgTestSuiteReport):
logging.info('Test suite finished, final report: %s' % event.to_json())
self._exit
else:
logging.info('Event received and ignored: %s' % event._type)
def _exit(self):
time.sleep(2)
self.connection.close()
sys.exit(0)
def run(self):
print("Starting thread listening on the event bus")
self.channel.start_consuming()
print('Bye byes!')
......@@ -3,16 +3,12 @@
import subprocess
from automated_IUTs import COAP_SERVER_HOST, COAP_SERVER_PORT, COAP_CLIENT_HOST
from automated_IUTs.automation import *
from automated_IUTs.automated_IUTs_test import *
logger = logging.getLogger(__name__)
str_coap_server_port = str(COAP_SERVER_PORT)
# timeout in seconds
STIMULI_HANDLER_TOUT = 10
str_coap_server_port = str(COAP_SERVER_PORT)
signal.signal(signal.SIGINT, signal_int_handler)
class CaliforniumCoapClient(AutomatedIUT):
......
......@@ -2,14 +2,8 @@
# !/usr/bin/env python3
import subprocess
from automated_IUTs.automation import *
logger = logging.getLogger(__name__)
# timeout in seconds
STIMULI_HANDLER_TOUT = 10
signal.signal(signal.SIGINT, signal_int_handler)
from automated_IUTs import COAP_SERVER_HOST, COAP_SERVER_PORT, COAP_CLIENT_HOST
from automated_IUTs.automated_IUTs_test import *
class CoapthonCoapClient(AutomatedIUT):
......
......@@ -26,7 +26,7 @@ docker build -t automated_iut-coap_server-californium-v0.1 -f automated_IUTs/coa
docker build -t automated_iut-coap_client-californium-v0.1 -f automated_IUTs/coap_client_californium/Dockerfile .
docker build -t automated_iut-coap_server-coapthon-v0.1 -f automated_IUTs/coap_server_coapthon/Dockerfile .
docker build -t automated_iut-coap_client-coapthon-v0.1 -f automated_IUTs/coap_client_coapthon/Dockerfile .
docker build -t testing_tool-interoperability-coap-v-0.5 .
docker build -t testing_tool-interoperability-coap-v-0.5 -f coap_testing_tool/Dockerfile .
# tag "HEAD" for INTEROP TESTING TOOL
docker tag testing_tool-interoperability-coap-v-0.5:latest testing_tool-interoperability-coap
......
......@@ -31,4 +31,4 @@ RUN pip3 install -r coap_testing_tool/webserver/requirements.txt
EXPOSE 5671 5672
# launch processes
CMD supervisord --nodaemon --configuration supervisor.conf
CMD supervisord --nodaemon --configuration coap_testing_tool/supervisord.conf
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import json
from urllib.parse import urlparse
try: # py2 and py3 compat
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
__version__ = (0, 0, 6)
......@@ -56,7 +60,6 @@ try:
print('Env vars for AMQP connection succesfully imported')
except KeyError as e:
print('Cannot retrieve environment variables for AMQP connection. Loading defaults..')
# load default values
AMQP_SERVER = "localhost"
......@@ -80,7 +83,7 @@ print(json.dumps(
try:
# read config information from manifest file (interoperability_manifest.json)
with open('interoperability_manifest.json') as index_file:
with open('coap_testing_tool/interoperability_manifest.json') as index_file:
AGENT_NAMES = json.load(index_file)['agent_names']
except:
......
......@@ -1747,6 +1747,7 @@ message_types_dict = {
"testingtool.ready": MsgTestingToolReady, # GUI Testing Tool -> GUI
"testingtool.terminate": MsgTestingToolTerminate, # orchestrator -> TestingTool
"testcoordination.testsuite.start": MsgTestSuiteStart, # GUI -> TestingTool
"testcoordination.testsuite.ready": MsgTestingToolReady,
"testcoordination.testsuite.finish": MsgTestSuiteFinish, # GUI -> TestingTool
"testcoordination.testcase.ready": MsgTestCaseReady, # TestingTool -> GUI
"testcoordination.testcase.start": MsgTestCaseStart, # GUI -> TestingTool
......
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:test-coordinator]
command = /usr/bin/python3 -m coap_testing_tool.test_coordinator
autorestart=false
stopsignal=INT
stopasgroup=true
loglevel=debug
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;redirect_stderr=true
;stdout_logfile = /var/log/test_coordinator-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[program:agent]
directory= ./coap_testing_tool/agent/
command = sh -c "sleep 1;python -m agent connect --url %(ENV_AMQP_URL)s --name agent_TT"
user=root
stopsignal=INT
stopasgroup=true
autorestart=false
loglevel=debug
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;redirect_stderr=true
;stdout_logfile = /var/log/agent-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[program:tat]
directory= ./coap_testing_tool/test_analysis_tool
command = sh -c "sleep 2;/usr/bin/python3 -m ttproto.tat_coap -i amqp"
autorestart=false
stopsignal=INT
stopasgroup=true
loglevel=debug
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;redirect_stderr=true
;stdout_logfile = /var/log/tat-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[program:bootstrap-agent-TT]
; we auto bootstrap the agent
command = sh -c "sleep 4;/usr/bin/python3 -m coap_testing_tool.agent.utils.bootstrap_agent agent_TT bbbb :3 --no_forwarding"
autorestart=false
stopsignal=INT
stopasgroup=false
loglevel=debug
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;redirect_stderr=true
;stdout_logfile = /var/log/bootstrap_agent_TT-stdout.log
[program:packet-router]
command = sh -c "sleep 5;/usr/bin/python3 -m coap_testing_tool.packet_router.packet_router"
autorestart=false
stopsignal=INT
stopasgroup=true
loglevel=debug
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;redirect_stderr=true
;stdout_logfile = /var/log/packet_router-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[program:packet-sniffer]
command = sh -c "sleep 5;/usr/bin/python3 -m coap_testing_tool.sniffer.packet_sniffer"
user=root
stopsignal=INT
stopasgroup=true
autorestart=false
loglevel=info
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;stdout_logfile = /var/log/packet_sniffer-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
;redirect_stderr=true
;[program:webserver]
;command = sh -c "sleep 5;/usr/bin/python3 -m coap_testing_tool.webserver"
;stopsignal=INT
;stopasgroup=true
;;autorestart=false
;loglevel=debug
;redirect_stderr=true
;stdout_logfile = /var/log/files_server-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
;[program:emulated-user]
;command = sh -c "sleep 3;python3 -m automated_IUTs.user_emulation"
;stopsignal=INT
;stopasgroup=true
;;autorestart=false
;loglevel=debug
;redirect_stderr=true
;stdout_logfile = /var/log/emulated_user-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[group:plugtest3]
programs=automated_iut-coap_client-coapthon-v0.1, automated_iut-coap_server-coapthon-v0.1, testing_tool-interoperability-coap-v-0.5, automation
[program:automated_iut-coap_client-coapthon-v0.1]
stopsignal=TERM
killasgroup=true
autostart=false
stdout_logfile = %(here)s/../log/automated_iut-coap_client-coapthon-v0.1-stdout.log
stderr_logfile = %(here)s/../log/automated_iut-coap_client-coapthon-v0.1-stderr.log
command = docker run
--env AMQP_URL=amqp://paul:iamthewalrus@f-interop.rennes.inria.fr/plugtests_03
--env AMQP_EXCHANGE=default
--rm
--privileged=true
--sysctl net.ipv6.conf.all.disable_ipv6=0
--name="automated_iut-coap_client-coapthon-v0.1"
automated_iut-coap_client-coapthon-v0.1
supervisord --nodaemon --configuration supervisor.conf
[program:automated_iut-coap_server-coapthon-v0.1]
stopsignal=TERM
killasgroup=true
autostart=false
stdout_logfile = %(here)s/../log/automated_iut-coap_server-coapthon-v0.1-stdout.log
stderr_logfile = %(here)s/../log/automated_iut-coap_server-coapthon-v0.1-stderr.log
command = docker run
--env AMQP_URL=amqp://paul:iamthewalrus@f-interop.rennes.inria.fr/plugtests_03
--env AMQP_EXCHANGE=default
--rm
--privileged=true
--sysctl net.ipv6.conf.all.disable_ipv6=0
--name="automated_iut-coap_server-coapthon-v0.1"
automated_iut-coap_server-coapthon-v0.1
supervisord --nodaemon --configuration supervisor.conf
[program:testing_tool-interoperability-coap-v-0.5]
stopsignal=TERM
killasgroup=true
autostart=false
stdout_logfile = %(here)s/../log/testing_tool-interoperability-coap-v-0.5-stdout.log
stderr_logfile = %(here)s/../log/testing_tool-interoperability-coap-v-0.5-stderr.log
command = docker run
--env AMQP_URL=amqp://paul:iamthewalrus@f-interop.rennes.inria.fr/session05
--env AMQP_EXCHANGE=default
--rm
--privileged=true
--sysctl net.ipv6.conf.all.disable_ipv6=0
--name="testing_tool-interoperability-coap-v-0.5"
testing_tool-interoperability-coap-v-0.5
supervisord --nodaemon --configuration supervisor.conf
[program:automation]
directory= ./automated_IUTs/
command = python3 automation.py
user=root
stopsignal=INT
stopasgroup=true
autorestart=false
loglevel=debug
; for sending logs to docker
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
;redirect_stderr=true
;stdout_logfile = /var/log/agent-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
\ No newline at end of file
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[include]
files = ./conf.d/*.conf
\ No newline at end of file
import os
import argparse
import sys
import supervisor.xmlrpc
import xmlrpclib
import yaml
from jinja2 import Environment, FileSystemLoader
from coap_testing_tool import AMQP_URL
PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_ENVIRONMENT = Environment(
autoescape=False,
loader=FileSystemLoader(os.path.join(PATH, 'templates')),
trim_blocks=False)
def render_template(template_filename, context):
return TEMPLATE_ENVIRONMENT.get_template(template_filename).render(context)
def create_plugtest_supervisor_conf(group_name, amqp_exchange,
docker_client_name, docker_server_name, stdout_logfile_client,
stdout_logfile_server, stderr_logfile_client, stderr_logfile_server,
docker_testing_tool_name):
if (group_name == 'plugtest1'):
file_name = "conf.d/plugtest1.conf"
prog_in_group = docker_client_name+", "+docker_server_name+", "+docker_testing_tool_name+", user_mock"
program_variable = [
[docker_client_name, stdout_logfile_client, stderr_logfile_client],
[docker_server_name, stdout_logfile_server, stderr_logfile_server]]
elif (group_name == 'plugtest2'):
file_name = "conf.d/plugtest2.conf"
prog_in_group = docker_client_name + ", " + docker_server_name + ", " + docker_testing_tool_name + ", user_mock"
program_variable = [
[docker_client_name, stdout_logfile_client, stderr_logfile_client],
[docker_server_name, stdout_logfile_server, stderr_logfile_server]]
elif (group_name == 'plugtest3'):
file_name = "conf.d/plugtest3.conf"
prog_in_group = docker_client_name + ", " + docker_server_name + ", " + docker_testing_tool_name + ", user_mock"
program_variable = [
[docker_client_name, stdout_logfile_client, stderr_logfile_client],
[docker_server_name, stdout_logfile_server, stderr_logfile_server]]
elif (group_name == 'plugtest4'):
file_name = "conf.d/plugtest4.conf"
prog_in_group = docker_client_name + ", " + docker_server_name + ", " + docker_testing_tool_name + ", user_mock"
program_variable = [
[docker_client_name, stdout_logfile_client, stderr_logfile_client],
[docker_server_name, stdout_logfile_server, stderr_logfile_server]]
else:
program_variable = ''
context = {
'group_name': group_name,
'amqp_exchange': amqp_exchange,
'prog_in_group': prog_in_group,
'program_variable': program_variable,
'docker_testing_tool_name': docker_testing_tool_name,
'amqp_url': AMQP_URL,
}
with open(file_name, 'w') as new_file:
code = render_template('template_jinja.conf', context)
new_file.write(code)
return file_name
if __name__ == "__main__":
# take in argument the name of client and server we want to use
execute_plugtests = False
testing_tool = False
try:
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--plugtest",
help="Give the name of the plugtest you want to execute (plugtest1, plugtest2, plugtest3, plugtest4)")
parser.add_argument("--execute_plugtests", help="Execute all the four plugtest with supervisor",
action="store_true")
parser.add_argument("--testing_tool", help="Execute the testing_tool with supervisor", action="store_true")
args = parser.parse_args()
if args.plugtest:
group_name = args.plugtest
if group_name != 'plugtest1' and group_name != 'plugtest2' and group_name != 'plugtest3' and group_name != 'plugtest4':
raise Exception
elif args.execute_plugtests:
execute_plugtests = args.execute_plugtests
elif args.testing_tool:
testing_tool = args.testing_tool
else:
raise Exception
except:
print("Error, please see help (-h)")
sys.exit(1)
yamlfile = "test_automation/plugtests.conf.yaml"
td_list = []
with open(yamlfile, "r") as stream:
yaml_docs = yaml.load_all(stream)
for yaml_doc in yaml_docs:
td_list.append(yaml_doc)
if execute_plugtests == True:
i = 1
while i <= 4:
group_name = "plugtest" + str(i)
amqp_exchange = td_list[0].get(group_name)[0].get("amqp_exchange")
docker_client_name = td_list[0].get(group_name)[1].get("docker_client_name")
docker_server_name = td_list[0].get(group_name)[2].get("docker_server_name")
stdout_logfile_client = td_list[0].get(group_name)[3].get("stdout_logfile_client")
stdout_logfile_server = td_list[0].get(group_name)[4].get("stdout_logfile_server")
stderr_logfile_client = td_list[0].get(group_name)[5].get("stderr_logfile_client")
stderr_logfile_server = td_list[0].get(group_name)[6].get("stderr_logfile_server")
docker_testing_tool_name = td_list[0].get(group_name)[7].get("docker_testing_tool_name")
coap_client_ip = td_list[0].get(group_name)[8].get("coap_client_ip")
coap_server_ip = td_list[0].get(group_name)[9].get("coap_server_ip")
coap_server_port = td_list[0].get(group_name)[10].get("coap_server_port")
file_name = create_plugtest_supervisor_conf(group_name, amqp_exchange,
docker_client_name, docker_server_name, stdout_logfile_client,
stdout_logfile_server, stderr_logfile_client, stderr_logfile_server,
docker_testing_tool_name)
i = i + 1
elif testing_tool == True:
print("NOT implemented for the moment")
sys.exit(1)
else:
amqp_exchange = td_list[0].get(group_name)[0].get("amqp_exchange")
docker_client_name = td_list[0].get(group_name)[1].get("docker_client_name")
docker_server_name = td_list[0].get(group_name)[2].get("docker_server_name")
stdout_logfile_client = td_list[0].get(group_name)[3].get("stdout_logfile_client")
stdout_logfile_server = td_list[0].get(group_name)[4].get("stdout_logfile_server")
stderr_logfile_client = td_list[0].get(group_name)[5].get("stderr_logfile_client")
stderr_logfile_server = td_list[0].get(group_name)[6].get("stderr_logfile_server")
docker_testing_tool_name = td_list[0].get(group_name)[7].get("docker_testing_tool_name")
coap_client_ip = td_list[0].get(group_name)[8].get("coap_client_ip")
coap_server_ip = td_list[0].get(group_name)[9].get("coap_server_ip")
coap_server_port = td_list[0].get(group_name)[10].get("coap_server_port")
file_name = create_plugtest_supervisor_conf(group_name, amqp_exchange,
docker_client_name, docker_server_name, stdout_logfile_client,
stdout_logfile_server, stderr_logfile_client, stderr_logfile_server,
docker_testing_tool_name)
socketpath = "/tmp/supervisor.sock"
server = xmlrpclib.ServerProxy('http://127.0.0.1',
transport=supervisor.xmlrpc.SupervisorTransport(
None, None, serverurl='unix://' + socketpath))
# launch supervisor
print('doing this : sudo -E supervisord -c supervisor.conf')
print(AMQP_URL)
os.system('sudo -E supervisord -c supervisord.conf')
# os.system('sudo supervisorctl -c supervisord.conf')
# server.supervisor.startProcessGroup("plugtest1", True)
print(server.supervisor.getState())
plugtest1:
- amqp_exchange : 'default'
- docker_client_name : 'automated_iut-coap_client-californium-v0.1'
- docker_server_name : 'automated_iut-coap_server-californium-v0.1'
- stdout_logfile_client : 'automated_iut-coap_client-californium-v0.1-stdout.log'
- stdout_logfile_server : 'automated_iut-coap_server-californium-v0.1-stdout.log'
- stderr_logfile_client : 'automated_iut-coap_client-californium-v0.1-stderr.log'
- stderr_logfile_server : 'automated_iut-coap_server-californium-v0.1-stderr.log'
- docker_testing_tool_name : 'testing_tool-interoperability-coap-v-0.5'
- coap_client_ip : 'bbbb::1'
- coap_server_ip : 'bbbb::2'
- coap_server_port: '5683'
plugtest2:
- amqp_exchange : 'default'
- docker_client_name : 'automated_iut-coap_client-coapthon-v0.1'
- docker_server_name : 'automated_iut-coap_server-californium-v0.1'
- stdout_logfile_client : 'automated_iut-coap_client-coapthon-v0.1-stdout.log'
- stdout_logfile_server : 'automated_iut-coap_server-californium-v0.1-stdout.log'
- stderr_logfile_client : 'automated_iut-coap_client-coapthon-v0.1-stderr.log'
- stderr_logfile_server : 'automated_iut-coap_server-californium-v0.1-stderr.log'
- docker_testing_tool_name : 'testing_tool-interoperability-coap-v-0.5'
- coap_client_ip : 'bbbb::1'
- coap_server_ip : 'bbbb::2'
- coap_server_port: '5683'
plugtest3:
- amqp_exchange : 'default'
- docker_client_name : 'automated_iut-coap_client-coapthon-v0.1'
- docker_server_name : 'automated_iut-coap_server-coapthon-v0.1'
- stdout_logfile_client : 'automated_iut-coap_client-coapthon-v0.1-stdout.log'
- stdout_logfile_server : 'automated_iut-coap_server-coapthon-v0.1-stdout.log'
- stderr_logfile_client : 'automated_iut-coap_client-coapthon-v0.1-stderr.log'
- stderr_logfile_server : 'automated_iut-coap_server-coapthon-v0.1-stderr.log'
- docker_testing_tool_name : 'testing_tool-interoperability-coap-v-0.5'
- coap_client_ip : 'bbbb::1'
- coap_server_ip : 'bbbb::2'
- coap_server_port: '5683'
plugtest4:
- amqp_exchange : 'default'
- docker_client_name : 'automated_iut-coap_client-californium-v0.1'
- docker_server_name : 'automated_iut-coap_server-coapthon-v0.1'
- stdout_logfile_client : 'automated_iut-coap_client-californium-v0.1-stdout.log'
- stdout_logfile_server : 'automated_iut-coap_server-coapthon-v0.1-stdout.log'
- stderr_logfile_client : 'automated_iut-coap_client-californium-v0.1-stderr.log'
- stderr_logfile_server : 'automated_iut-coap_server-coapthon-v0.1-stderr.log'
- docker_testing_tool_name : 'testing_tool-interoperability-coap-v-0.5'
- coap_client_ip : 'bbbb::1'
- coap_server_ip : 'bbbb::2'
- coap_server_port: '5683'
\ No newline at end of file
import pika
import threading
import logging
import subprocess
import sys
import signal
from coap_testing_tool.utils.event_bus_messages import *
from coap_testing_tool.utils.amqp_synch_call import publish_message
from coap_testing_tool import AMQP_URL, AMQP_EXCHANGE, INTERACTIVE_SESSION
class UserEmulator(threading.Thread):
"""
this class servers for moking user inputs into GUI
"""
component_id = 'user_emulation'
implemented_testcases_list = [
'TD_COAP_CORE_01_v01',
'TD_COAP_CORE_02_v01',
'TD_COAP_CORE_03_v01',
'TD_COAP_CORE_04_v01',
]
def __init__(self, iut_testcases, iut_node):
threading.Thread.__init__(self)
self.message_count = 0