README.md 4.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
CoAP Testing Tool:
------------------

This repo conaints all necessary software (and their dependencies) for running a 
CoAP interoperability test session.

This can be run as standalone software and also integrated to f-interop 
architecture.

### TODO
Federico Sismondi's avatar
Federico Sismondi committed
11
- add coap client automated IUT
12
- add feat for handling step by step analysis
Federico Sismondi's avatar
Federico Sismondi committed
13
- add more unit testing of coordinator component
14 15 16 17
- document isntallation of requirements and dependencies

### CoAP Testing tools components

Federico Sismondi's avatar
Federico Sismondi committed
18 19 20
The CoAP testing tool handles the coordination, sniffing, dissection
and analysis of traces for the tests described in the test description.
The implemented test description is based on:
21 22 23 24
[ETSI CoAP test description](http://www.etsi.org/plugtests/CoAP/Document/CoAP_TestDescriptions_v015.pdf)

For description of components please visit: [f-interop doc](doc.f-interop.eu)

25 26 27

-----------------------------------------------------------------------------

Federico Sismondi's avatar
doc++  
Federico Sismondi committed
28 29
### Clonning the project
```
30
git clone --recursive https://gitlab.f-interop.eu/fsismondi/coap_testing_tool.git
31
cd coap_testing_tool
Federico Sismondi's avatar
doc++  
Federico Sismondi committed
32
```
33

34
### Running CoAP testing tool as standalone mode
35

36
(# TODO talk about the CLI, without it you cannot run a session)
37

38 39 40
First thing needed is to have the rabbit running. Whaat?
You need a server running RabbitMQ message broker for handling the
messaging between the components taking part in your test session.
41

42 43 44 45 46 47 48 49 50 51 52 53
The options for this are:

- install locally RabbitMQ message broker on local machine,
create RMQ vhost, user, pass on local machine

    (# TODO add instructions)

- Request a remote vhost and its user, pass credentials to F-Interop developers.

    for this contact federico.sismondi@inria.fr or remy.leone@inria.fr

then, export in the machine where the testing tool is running the following vars:
54 55

    ```
Federico Sismondi's avatar
Federico Sismondi committed
56
    export AMQP_URL='amqp://someUser:somePassword@server/amqp_vhost'
Federico Sismondi's avatar
Federico Sismondi committed
57
    export AMQP_EXCHANGE='default'
58 59
    ```

60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
---
#### Building & running the tool
Now, let's get the testing tool running. Several approaches can be used,
these are:

( tested with debian based OS & macos )

**1.** Build the testing tool using docker (see Dockerfile) &
run the testing tool inside a docker container (recommended)

**2.** Install dependencies with ansible in the local machine &
run the testing tool using supervisor.
(no agent can be run in the same machine after)

**3.** Install dependencies with ansible in remote machine &
run the testing tool using supervisor.

**4.** Install everything manually, why not right?

---

#### Opt 1 - Building & running CoAP testing tool with docker

First, let's install docker. For this just follow this instructions:

https://docs.docker.com/engine/installation/

Don't forget to start it!

Second, **build** the testing tool, from inside coap_testing_tool dir run:
```
docker build -t finterop-coap .
```

94 95 96 97 98 99
If build fails due to a "Failed to fetch http://archive.ubuntu ...."
then:
```
docker build -t finterop-coap . --no-cache
```

100 101 102 103 104
Finally, **run** it, from inside coap_testing_tool run:
```
docker run -it --env AMQP_EXCHANGE='default' --env AMQP_URL='amqp://someUser:somePassword@server/amqp_vhost' --privileged finterop-coap supervisord --nodaemon --configuration supervisor.conf
```

105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
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
root@bab3b2220510:/coap_testing_tool# supervisorctl -c supervisor.conf
agent                            RUNNING   pid 28, uptime 0:00:02
automated-iut                    STARTING
bootstrap-agent-TT               RUNNING   pid 19, uptime 0:00:02
packet-router                    RUNNING   pid 24, uptime 0:00:02
packet-sniffer                   RUNNING   pid 18, uptime 0:00:02
tat                              RUNNING   pid 17, uptime 0:00:02
test-coordinator                 RUNNING   pid 26, uptime 0:00:02
supervisor>
```

120 121
Run the CLI & Agent and you are ready to launch CoAP tests from your PC!

122

123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
#### Opt 2 & 3 - Build CoAP testing tool with ansible


First thing, install ansible:

http://docs.ansible.com/ansible/intro_installation.html


Install supervisor (needed for spawning and monitoring processes):
For this follow this instructions:

http://supervisord.org/installing.html

  
Now, let's install the testing tool requirements:

**for Opt 2 (local install)**:

- change in ansible/main.yml the variable unix_user from f-interop to your
unix user, then run ansible script:

    ```
    ansible-playbook -i ansible/hosts.local ansible/main.yml --ask-become-pass
    ```

148
- run CoAP testing tool and monitor processes
Federico Sismondi's avatar
Federico Sismondi committed
149
    
150
    ```
151 152
    sudo -E supervisord -c supervisor.conf
    sudo supervisorctl -c supervisor.conf
153
    ```
Federico Sismondi's avatar
Federico Sismondi committed
154 155
	note: use -E when launching supervisor process, it preserves the
	env vars
156

157
Run the CLI & Agent and you are ready to launch CoAP tests from your PC!
158

159
**for Opt 3 (remote install)**:
160

161
TDB