Commit a5470d94 authored by Federico Sismondi's avatar Federico Sismondi

Modifications and enhacements on GUI adaptor: new message factory for WoT...

Modifications and enhacements on GUI adaptor: new message factory for WoT which enables a non structured test suite meant to be used a simple VPN playground
parent fdd9aa10
FROM node:10
# Create app directory
WORKDIR /usr/src/app
# Bundle app source
# COPY . .
# ioppytest standard docker build procedure:
RUN apt-get -y -qq update
RUN apt-get -y -qq install apt-utils
RUN apt-get -y -qq install python3-dev
RUN apt-get -y -qq install build-essential
RUN apt-get -y -qq install python3-setuptools
RUN apt-get -y -qq install python3-pip
RUN apt-get -y -qq install python-pip
RUN apt-get -y -qq install supervisor
RUN apt-get -y -qq install net-tools
RUN apt-get -y install iputils-ping
RUN apt-get -y -qq install make
# upgrade pip
RUN python -m pip install --upgrade pip
RUN python3 -m pip install --upgrade pip
# install aux ioppytest packages
RUN python -m pip install ioppytest-agent
RUN python3 -m pip install ioppytest-utils
# node-wot install procedure :
RUN git clone https://github.com/draggett/arena-webhub
WORKDIR arena-webhub
RUN npm install
EXPOSE 8888
# copy supervisor processes configs
ADD automation/wot_arenahub/supervisor.conf.ini supervisor.conf.ini
# launch processes
CMD ["/usr/bin/supervisord", "--nodaemon", "--configuration", "supervisor.conf.ini"]
[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)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
[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:agent]
command = ioppytest-agent connect
--url %(ENV_AMQP_URL)s
--exchange %(ENV_AMQP_EXCHANGE)s
--name wot_arenahub
--force-bootstrap
--ipv6-prefix bbbb
--ipv6-host 102
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-thing-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[program:thing]
command = sh -c "sleep 6;cd examples/Getting\ Started/; npm install; node light.js"
user=root
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/thing-stdout.log
......@@ -6,6 +6,29 @@ WORKDIR /usr/src/app
# Bundle app source
# COPY . .
# ioppytest standard docker build procedure:
RUN apt-get -y -qq update
RUN apt-get -y -qq install apt-utils
RUN apt-get -y -qq install python3-dev
RUN apt-get -y -qq install build-essential
RUN apt-get -y -qq install python3-setuptools
RUN apt-get -y -qq install python3-pip
RUN apt-get -y -qq install python-pip
RUN apt-get -y -qq install supervisor
RUN apt-get -y -qq install net-tools
RUN apt-get -y install iputils-ping
RUN apt-get -y -qq install make
# upgrade pip
RUN python -m pip install --upgrade pip
RUN python3 -m pip install --upgrade pip
# install aux ioppytest packages
RUN python -m pip install ioppytest-agent
RUN python3 -m pip install ioppytest-utils
# node-wot install procedure :
RUN git clone https://github.com/eclipse/thingweb.node-wot
WORKDIR thingweb.node-wot
RUN npm install
......@@ -18,5 +41,10 @@ RUN npm install
RUN npm run build
EXPOSE 8080
#CMD [ "npm", "packages/cli/dist/cli.js", "examples/scripts/counter.js"]
ENTRYPOINT [ "node", "packages/cli/dist/cli.js", "examples/scripts/counter.js"]
\ No newline at end of file
#CMD [ "node", "packages/cli/dist/cli.js", "examples/scripts/counter.js"]
# copy supervisor processes configs
ADD automation/wot_thingweb/supervisor.conf.ini supervisor.conf.ini
# launch processes
CMD ["/usr/bin/supervisord", "--nodaemon", "--configuration", "supervisor.conf.ini"]
[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)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
[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:agent]
command = ioppytest-agent connect
--url %(ENV_AMQP_URL)s
--exchange %(ENV_AMQP_EXCHANGE)s
--name wot_thingweb
--force-bootstrap
--ipv6-prefix bbbb
--ipv6-host 101
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-thing-stdout.log
;stdout_logfile_maxbytes = 10MB
;stdout_logfile_backups = 5
[program:thing]
command = sh -c "sleep 6; node packages/cli/dist/cli.js examples/scripts/counter.js"
user=root
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/thing-stdout.log
......@@ -68,7 +68,7 @@ TD_DIR = os.path.join(project_dir, 'ioppytest', 'test_descriptions')
# fixme: refact the code so TD_XXX is a list of yaml files containing test cases from several groups
TD_DUMMY_CFG = os.path.join(TD_DIR, "TD_DUMMY_CFG.yaml")
TD_WOT_CFG = os.path.join(TD_DIR, "TD_WOT_CFG.yaml")
TD_COAP_CORE = os.path.join(TD_DIR, "TD_COAP_CORE.yaml")
TD_COAP_CFG = os.path.join(TD_DIR, "TD_COAP_CFG.yaml")
TD_COAP = [
......@@ -135,6 +135,7 @@ TEST_DESCRIPTIONS_CONFIGS_DICT = {
'onem2m': [TD_ONEM2M_CFG],
'comi': [TD_COMI_CFG],
'lwm2m': [TD_LWM2M_CFG],
'wot': [TD_WOT_CFG],
}
AUTO_DISSECTION_FILE = os.path.join(project_dir, '/data/auto_dissection.json')
......
# -*- coding: utf-8 -*-
--- !configuration
configuration_id: WOT_CFG_01
uri: http://doc.f-interop.eu/tests/WOT_CFG_01
nodes:
- thing1
- thing2
- thing3
topology:
- link_id : link_01
capture_filter: udp
nodes:
- thing1
- thing2
- thing3
- thing4
- thing5
- thing6
- thing7
- thing8
- thing9
- thing10
- wot_arenahub
- wot_thingweb
addressing:
- node: thing1
ipv6_prefix : bbbb
ipv6_host: 1
- node: thing2
ipv6_prefix : bbbb
ipv6_host: 2
- node: thing3
ipv6_prefix : bbbb
ipv6_host: 3
- node: thing4
ipv6_prefix : bbbb
ipv6_host: 4
- node: thing5
ipv6_prefix : bbbb
ipv6_host: 5
- node: thing6
ipv6_prefix : bbbb
ipv6_host: 6
- node: thing7
ipv6_prefix : bbbb
ipv6_host: 7
- node: thing8
ipv6_prefix : bbbb
ipv6_host: 8
- node: thing9
ipv6_prefix : bbbb
ipv6_host: 9
- node: thing10
ipv6_prefix : bbbb
ipv6_host: 10
- node: wot_arenahub
ipv6_prefix : bbbb
ipv6_host: 100
- node: wot_thingweb
ipv6_prefix : bbbb
ipv6_host: 101
description:
- node: thing1
message:
- No special configuration needed, configuration used for testing TUN setup
configuration_diagram: null
\ No newline at end of file
......@@ -1295,10 +1295,3 @@ def import_test_description_from_yaml(yamlfile):
else:
logging.error('Couldnt processes import: %s from %s' % (str(yaml_doc), yamlfile))
return td_list
if __name__ == '__main__':
COMPONENT_ID = '%s' % ('testsuite_tests')
# init logging to stnd output and log files
logger = logging.getLogger(COMPONENT_ID)
logger.setLevel(logging.DEBUG)
......@@ -27,11 +27,15 @@ MESSAGES_NOT_TO_BE_ECHOED = [
WAITING_TIME_FOR_SECOND_USER = 900 # in seconds
# GUI api says that <tags> are dicts
UI_TAG_SETUP = {"session_setup": ""}
UI_TAG_AGENT_REQUIREMENTS = {"agents_requirements": ""}
UI_TAG_AGENT_INSTALL = {"agents_install": ""}
UI_TAG_AGENT_CONNECT = {"agents_connect": ""}
UI_TAG_AGENT_INFO = {"agents_info": ""}
UI_TAG_AGENT_TEST = {"agents_test": ""}
UI_TAG_REPORT = {"testsuite_report": ""}
UI_TAG_VPN_STATUS = {"vpn_status": ""}
TESTING_TOOL_TOPIC_SUBSCRIPTIONS = [
......
This diff is collapsed.
This diff is collapsed.
......@@ -313,13 +313,13 @@ def get_user_ids_and_roles_from_ui(message_translator, amqp_publisher, session_c
}
)
# add also a 'BOTH' roles option
# add also a 'ALL' roles option
fields.append(
{
"name": 'iut_role',
"type": "radio",
"label": 'both',
"value": 'both',
"label": 'all',
"value": 'all',
}
)
......@@ -334,9 +334,9 @@ def get_user_ids_and_roles_from_ui(message_translator, amqp_publisher, session_c
timeout=120
)
if resp and resp.ok:
try:
user_lead_iut_role = resp.fields.pop()['iut_role']
else:
except:
raise UiResponseError('received from the UI: %s' % repr(resp))
# echo response back to *ALL* users
......
......@@ -2,16 +2,6 @@ from ioppytest import AMQP_URL, AMQP_EXCHANGE
env_vars_export = """
### Agent requirements
The agent component, which is needed for running interop tests works for both MacOs (tested with MacOs 10.12.x)
and also debian-based distributions.
(!) Windows is for the time being not supported by the agent. If your implementation can run into a virtual machine
or docker container please setup that environment so yo can run the agent from within.
------------------------------------------------------------------------------
### Prepare environment
Please open a Terminal where to execute the agent component
......@@ -22,47 +12,63 @@ and export environment variables:
------------------------------------------------------------------------------
""".format(url=AMQP_URL)
agent_requirements = """
agent_install_help = """
### Agent requirements
### Please install the agent using PyPi (python script):
\n
- [OS requirement] agent component runs on MacOs (tested with MacOs 10.12.x) and debian-based distributions
- [OS requirement] for MacOs, `tuntap` driver is needed: `brew install Caskroom/cask/tuntap`
- [python version] python 2.7 needed (virtualenv use is recommended)
\n
---------------------------------------------------------------------------------
(!) Windows is for the time being not supported by the agent. \n
If your implementation can run into a virtual machine or docker container please\n
setup that environment so yo can run the agent from within.\n
----------------------------------------------------------------------------------
\n\n
"""
using virtual env (recommended):
agent_install_help = """
\n
### Please install the agent using PyPi (python script):
\n\n
---
OPTION 1: using virtual env (recommended):
\n
```
# install venv
> pip install virtualenv
>>> pip install virtualenv
# create a python 2.7 env
> virtualenv -p /usr/bin/python2.7 my_venv
>>> virtualenv -p /usr/bin/python2.7 my_venv
# activate env
> source my_venv/bin/activate
>>> source my_venv/bin/activate
# install package
> pip install ioppytest-agent
>>> pip install ioppytest-agent
```
\n\n
or else (without virtualenv):
\n
---
OPTION 2: (without virtualenv):
```
> python2.7 -m pip install ioppytest-agent
# install package
>>> python2.7 -m pip install ioppytest-agent
```
\n\n
\n
------------------------------------------------------------------------------
\n\n
\n
You can execute directly from source code, for this use, and check out README.md:
......@@ -70,21 +76,11 @@ You can execute directly from source code, for this use, and check out README.md
```
> git clone --recursive https://gitlab.f-interop.eu/f-interop-contributors/agent
>>> git clone --recursive https://gitlab.f-interop.eu/f-interop-contributors/agent
```
\n\n
------------------------------------------------------------------------------
\n\n
Installation didn't work? Check the agent dependencies:
\n
- python 2.7 needed (virtualenv use recommended if no py2.7 version installed in OS )
- for MacOs users, tuntap driver is needed: `brew install Caskroom/cask/tuntap`
\n\n
"""
......@@ -121,6 +117,9 @@ WSN network) please check out the agent help section describing these setups
"""
help_agent_run_for_raw_ip_single_entry = "sudo -E python2.7 -m agent connect --url $AMQP_URL --name {agent_name} " \
"--force-bootstrap --ipv6-host {ipv6_host} --ipv6-prefix {ipv6_prefix}"
vpn_setup = """
### How does my implementation will reach other implementations?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment