forked from telefonicaid/fiware-orion
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from FIWARE/doc/functest-installation-guide-f…
…or-ubuntu-20.04 Doc/functest installation guide for ubuntu 20.04
- Loading branch information
Showing
3 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
doc/manuals-ld/installation-guide-functional-tests-ubuntu20.04.1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Installation Guide for the Orion-LD Functional Test Suite on Ubuntu 20.04 | ||
|
||
The functional test suite for Orion-LD, found in the Orion-LD repository, under `test/functionalTests`, needs some installation in order to work. | ||
|
||
First of all, there is a python script (`scripts/accumulator-server.py`) that is used as the receptor of the notifications during the functional tests. | ||
|
||
This python script (that needs python 2.7) needs a few packages to be installed: | ||
|
||
1. Install **python 2.7** (and make a softlink /usr/bin/python to point to it) | ||
```bash | ||
sudo aptitude install python2 | ||
sudo ln -s /usr/bin/python2 /usr/bin/python | ||
``` | ||
|
||
2. Install **OpenSSL** for Python: | ||
```bash | ||
sudo aptitude install python-openssl | ||
``` | ||
|
||
3. Install **Flask**: | ||
```bash | ||
pip2.7 install Flask | ||
``` | ||
|
||
That should be all for the accumulator python script. | ||
|
||
The test script (`test/functionalTest/testHarness.sh`) needs to *find* the accumulator, to be able to start it: | ||
```bash | ||
cd <orion-ld repository base directory> | ||
export PATH=$PATH:$PWD/scripts | ||
which accumulator-server.py | ||
``` | ||
|
||
The output of the `which` command should be: | ||
|
||
```text | ||
~/git/context.Orion-LD/scripts/accumulator-server.py | ||
``` | ||
|
||
Also, the test script uses `nc` to verify that the broker has started, and `bc` for simple calculations. | ||
Install both of them: | ||
```bash | ||
sudo aptitude install netcat | ||
sudo aptitude install bc | ||
``` | ||
|
||
Test it by launching: | ||
```bash | ||
test/functionalTest/testHarness.sh | ||
``` | ||
|
||
There are over 1250 test cases (each with a number of steps), so, it will take a while. | ||
Orion-LD has inherited the functional test suite from `orion` and added some 250 test cases only for NGSI-LD. | ||
If you want to run only the NGSi-LD test cases, run the suite with the `-ld` option: | ||
|
||
```bash | ||
test/functionalTest/testHarness.sh -ld | ||
``` | ||
|
||
There are lots of command line options for the test suite; use the `-u` option to see all of them. | ||
|
||
In case some functional test case fails, normally due to installation error, and you're not really interested in that case (might be for IPv6 and you aren't interested in IPv6), you can disable test cases. | ||
|
||
Functional test cases can be disabled by exporting an environment variable called `CB_SKIP_FUNC_TESTS`. | ||
For example, to disable the test case 'direct_https_notifications.test' (you don't want https notification, so ...), do this: | ||
|
||
```bash | ||
export CB_SKIP_FUNC_TESTS=0706_direct_https_notifications/direct_https_notifications.test | ||
``` | ||
Note that not only the name of the test case file, but also the directoy where it resides is part of the "identifier". | ||
This is so because different functional test case directories can have test case files with the same name. | ||
|
||
FYI: after following myself the instructions in the installation guides, the following functional tests failed for me: | ||
|
||
* 0706_direct_https_notifications/direct_https_notifications.test | ||
* 0706_direct_https_notifications/direct_https_notifications_no_accept_selfsigned.test | ||
|
||
Hmmm, something about https seems to be missing in the instructions ... | ||
|
||
Looking closer at the errors, it seems clear that it is the accumulator script that is having problems (the accumulator log-file says: **AttributeError: 'Context' object has no attribute 'wrap_socket'**). | ||
I will have to look into this, but for now, I simply do this: | ||
|
||
```bash | ||
export CB_SKIP_FUNC_TESTS="0706_direct_https_notifications/direct_https_notifications.test 0706_direct_https_notifications/direct_https_notifications_no_accept_selfsigned.test" | ||
``` | ||
|
||
Remember to put this environment variable in your startup files (e.g. `~/.bash_profile`), so that you don't lose it. | ||
Also, the directory added to PATH should be saved in your startup files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters