Skip to content

Commit

Permalink
Merge branch 'release-5.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Lopez committed Jul 6, 2016
2 parents 970cd0c + add651e commit f1a5094
Show file tree
Hide file tree
Showing 100 changed files with 1,302 additions and 2,003 deletions.
9 changes: 6 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.2.0
current_version = 1.3.0
commit = True
tag = False

Expand All @@ -8,6 +8,9 @@ search = unreleased_version_label = "v{current_version}"
replace = unreleased_version_label = "v{new_version}"

[bumpversion:file:sonar-project.properties]
search = sonar.projectVersion={current_version}
replace = sonar.projectVersion={new_version}
search = sonar.projectVersion = {current_version}
replace = sonar.projectVersion = {new_version}

[bumpversion:file:setup.cfg]
search = version = {current_version}
replace = version = {new_version}
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ omit =
tests/*
conf/*
*/__init__.py


*/lib/*
2 changes: 1 addition & 1 deletion .gitchangelog.rc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ tag_filter_regexp = r'^v[0-9]+\.[0-9]+(\.[0-9]+)?$'
##
## This label will be used as the changelog Title of the last set of changes
## between last valid tag and HEAD if any.
unreleased_version_label = "v1.2.0"
unreleased_version_label = "v1.3.0"


## ``output_engine`` is a callable
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ install:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pip install coveralls
- pip install pep8

before_script:
- sudo touch /var/log/fiware-skuld
- sudo chown travis /var/log/fiware-skuld

# command to run tests
script:
nosetests --with-coverage --cover-package=./ --exe
- pep8 --max-line-length=120 .
- nosetests --with-coverage --cover-package=./ --exe

after_success:
coveralls
44 changes: 44 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
Changelog
=========

v1.3.0 (2016-07-06)
-------------------
New
~~~
- Add docker files.
- Create docker files to deploy a testing environment of Skuld.
- Add new tests for deployment of two testbeds.
- Add Unit Tests associated to check users and rotated files.
- Separate the management of Skuld Testing Deployment to fiware-testeb-deploy component (https://github.com/telefonicaid/fiware-testbed-deploy/tree/develop).
- Update documentation and README file.

Fix
~~~

- Coding style configuration in Travis CI tool.
- Run test from main folder.
- Fix imports and requirements.
- Generalize Region name in testing environment.
- Obtain public IP from endpoints in the testing environment.

Bug
~~~

- Resolve not service entrypoint for missing FIWARE services.


v1.2.0 (2016-03-07)
-------------------

New
~~~

- Script to install a testbed used by the tests.
- Create script to recover all the user from one region.
- Improve osclients.py

Fix
~~~

- Add docstings to python file.
- Support domain with v3 API and fix Default name.
- Issue/change readme.
- Adding library to the requirements file.

v1.1.0 (2016-02-03)
-------------------

Expand Down
152 changes: 76 additions & 76 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FIWARE Trial Users Management
=============================

| |Build Status| |Coveralls| |StackOverflow|
| |License Badge| |StackOverflow| |Build Status| |Coveralls|
.. contents:: :local:

Expand Down Expand Up @@ -417,12 +417,45 @@ Testing
Unit tests
----------

To run unit test, invoke *nosetest test_expired_users.py* inside *tests* folder
To run the unit tests, you need to create a virtualenv using the requirements
both contained in requirements.txt and test-requirements.txt. You only need to
execute the nosetests program in the root directory of the fiware-skuld
code. Keep in mind that it requires python2.7 to execute the unit tests.

.. code::
virtualenv -p <root to python v2.7> venv
source ./venv/bin/activate
pip install -r requirements.txt
pip install -r test-requirements.txt
nosetests --with-coverage --cover-package=./ --exe
Unit tests with Docker execution
********************************
Skuld unit tests can be executed by docker. To do that, firstly it is required the creation of
the docker image, with the following command:

.. code::
docker build -t fiware-skuld-build -f docker/Dockerfile_build docker
Once the fiware-skuld-build image is created, we can run it by:

.. code::
docker run --name fiware-skuld-build fiware-skuld-build
Finally, it is possible to obtain tests results and coverage information by:

.. code::
docker cp fiware-skuld-build:/opt/fiware-skuld/test_results .
docker cp fiware-skuld-build:/opt/fiware-skuld/coverage .
Acceptance tests
----------------

The acceptante tests are inside the folder *tests/acceptance_tests*
The acceptance tests are inside the folder *tests/acceptance_tests*

Prerequisites
*************
Expand All @@ -441,82 +474,14 @@ Environment preparation
(pip install -r requirements.txt --allow-all-external).
- Configure file in tests/acceptance_tests/commons/configuration.py adding the
keystone url, and a valid, user, password and tenant ID.
- It is possible to deploy a valid Openstack testbed by using the fiware-testbed-deploy component: https://github.com/telefonicaid/fiware-testbed-deploy/

Tests execution
***************

1) Change to the tests/acceptance folder of the project if not already on it
2) Assign the PYTHONPATH environment variable executing "export PYTHONPATH=../.."
3) Run lettuce_tools with appropriate params (see available ones with the -h option)

Skuld Testbed
-------------

A set of scripts to create a secure environment for testing is provided. The
environment is created in a virtual machine using the FIWARE Lab infrastructure.
The environment variables OS_AUTH_URL, OS_REGION_NAME, OS_USERNAME, OS_PASSWORD
and OS_TENANT_NAME must be filled with the data of a valid FIWARE Lab account.

The installation of the testbed is fully automatized and consists on an OpenStack
instance where the original keystone server was replaced with the KeyRock server.
This is work in progress; the current version only installs Glance, Nova and Neutron,
but skuld also purges Swift, Cinder and Blueprint resources.

To install, it is only necessary to configure the same virtualenv than for
running skuld, set PYTHONPATH with the path of the project, and invoke
the script *./tests/install_testbed/launch_vm.py*.

The script uses a floating IP and creates both a keypair (it saves the SSH private key as
~/.ssh/testbedskuld_key) and a security group. The security group opens
the port 22 (SSH) and allows the ICMP traffic. It is also possible to connect
to any port from a VM using the same security group.

The names of the keypair, the security group and other parameters as the preferable
floating IP are configurable in the *settings.py* file, but most of the users may
ignore this file securely. However, to use the script in a different platform
than FIWARE Lab, probably is necessary to change the parameter about the
public shared network name.

Using the testbed
*****************

The *launch_vm.py* ends in a few seconds, showing the floating IP. Although it is
already possible to connect to the ubuntu account of the server (using the
SSH key at *~/.ssh/testbedskuld_key*), the installation is still running
inside the VM and needs a few minutes to complete. Usually the installation
process lasts between 10 and 20 minutes. The job is finished after the file
*config_vars* is copied into the */home/ubuntu* folder inside the virtual machine.

When the installation is finished, the credential may be loaded with *. ~/config_vars*.
The command *nova list* shows a testing VM that has been created during the installation
inside the testbed (that is, it is a virtual machine running inside the testbed
virtual machine). The floating IP 192.168.58.201 is associated to this
VM (that is the second IP of the pool, the first was assigned to the router). It is
possible to connect to the server following this steps:

.. code::
eval $(ssh-agent -s)
ssh-add ~/.ssh/testkey
ip a add dev br-ex 192.168.58.1/24
ssh cirros@192.168.58.201
Of course, if a new server is instantiated using the same network, there will
be network visibility between both servers, according the rules of the
security groups.

.. code::
. ~/config_vars
NETID =
nova boot testvm2 --poll --flavor micro2 --image cirros --nic net-id=$NETID\
--key-name testkey --security-groups ssh
ssh -A cirros@192.168.58.201
$ ssh cirros@192.168.58.3
The micro flavor provides 64MB of RAM, 1 VCPU and 1GB of disk. The micro2 flavor is the
same, but with 0GB of disk (i.e. a minimal disk to boot the image is created
but with barely free space)
3) Run behave features/ --tags ~@skip --junit --junit-directory testreport.

Tools
-----
Expand All @@ -537,6 +502,39 @@ advantage is that the script support OS_TRUST_ID, while other tools as nova does

Top_

Acceptance tests with Docker execution
**************************************
Skuld acceptance tests can be executed by Docker. To do that, firstly it is required the creation of
the docker image.
To do that:

.. code::
docker build -t fiware-skuld -f docker/Dockerfile docker
Once the fiware-skuld image is created, we can run it by using docker-compose (exporting the right
environment variables).

.. code::
export OS_AUTH_URL = {the auth uri of the testbed agains the tests are going to be execute}
export OS_USERNAME = {the user name}
export OS_TENANT_NAME = {the tenant name}
export OS_PASSWORD = {the password}
export OS_REGION_NAME = {the region}
export OS_PROJECT_DOMAIN_NAME = {the project domain name}
export OS_USER_DOMAIN_NAME = {the user domain name}
docker-compose -f docker/docker-compose.yml up
When docker has finished, you can obtain the tests results by
.. code::
docker cp docker_fiwareskuld_1:/opt/fiware-skuld/tests/acceptance/testreport .
All the scripts and docker files for the deployment of Openstack testsbed have been moved to
to fiware-testbed-deploy component: https://github.com/telefonicaid/fiware-testbed-deploy/

Top_

Deletion of Unaccepted Terms & Conditions users
===============================================
Expand Down Expand Up @@ -565,16 +563,18 @@ License
.. |Build Status| image:: https://travis-ci.org/telefonicaid/fiware-skuld.svg?branch=develop
:target: https://travis-ci.org/telefonicaid/fiware-skuld
:alt: Build status
.. |StackOverflow| image:: http://b.repl.ca/v1/help-stackoverflow-orange.png
.. |StackOverflow| image:: https://img.shields.io/badge/support-sof-yellowgreen.svg
:target: https://stackoverflow.com/questions/tagged/fiware-skuld
:alt: Help? Ask questions
.. |Coveralls| image:: https://coveralls.io/repos/telefonicaid/fiware-skuld/badge.svg?branch=develop&service=github
:target: https://coveralls.io/github/telefonicaid/fiware-skuld?branch=develop
:alt: Unit tests coverage

.. |License Badge| image:: https://img.shields.io/badge/license-Apache_2.0-blue.svg
:target: LICENSE
:alt: Apache 2.0

.. REFERENCES
.. _FIWARE: http://www.fiware.org/
.. _stackoverflow: http://stackoverflow.com/questions/ask
.. _`FIWARE Q&A`: https://ask.fiware.org
.. _`FIWARE Q&A`: https://ask.fiware.org
10 changes: 4 additions & 6 deletions conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
NOTIFY_BEFORE_EXPIRED = 7 # days
STOP_BEFORE_DELETE = 0 # days
TRUSTID_VALIDITY = 36000 # seconds
DONT_DELETE_DOMAINS = set((
'create-net.org', 'telefonica.com', 'man.poznan.pl', 'wigner.mta.hu',
'gatv.ssr.upm.es', 'thalesgroup.com', 'atos.net', 'uth.gr', 'bth.se',
'iminds.be', 'intec.ugent.be', 'neuropublic.gr', 'zhaw.ch', 'tid.es',
'it-innovation.soton.ac.uk', 'cesnet.cz', 'rt.cesnet.cz', 'rt3.cesnet.cz',
'fokus.fraunhofer.de'))
DONT_DELETE_DOMAINS = ([
'create-net.org', 'telefonica.com', 'man.poznan.pl', 'wigner.mta.hu', 'gatv.ssr.upm.es', 'thalesgroup.com',
'atos.net', 'uth.gr', 'bth.se', 'iminds.be', 'intec.ugent.be', 'neuropublic.gr', 'zhaw.ch', 'tid.es',
'it-innovation.soton.ac.uk', 'cesnet.cz', 'rt.cesnet.cz', 'rt3.cesnet.cz', 'fokus.fraunhofer.de'])
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fiware-skuld:
image: fiware-skuld
environment:
- OS_AUTH_URL
- OS_USERNAME
- OS_TENANT_NAME
- OS_PASSWORD
- OS_REGION_NAME
- OS_PROJECT_DOMAIN_NAME
- OS_USER_DOMAIN_NAME

17 changes: 17 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu
RUN apt-get update && apt-get -y install python-pip python-dev \
libmysqlclient-dev libpq-dev \
libxml2-dev libxslt1-dev git \
libffi-dev zip python-mysqldb
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server
RUN pip install --upgrade pip
RUN pip install git+https://github.com/telefonicaid/fiware-skuld@develop
RUN git clone https://github.com/telefonicaid/fiware-skuld/ /opt/fiware-skuld/
WORKDIR /opt/fiware-skuld/
COPY settings.py conf/settings.py
WORKDIR /opt/fiware-skuld/tests/acceptance/
RUN pip install -r requirements.txt
RUN mkdir testreport
COPY configuration.py commons/configuration.py
COPY start.sh .
CMD ./start.sh
14 changes: 14 additions & 0 deletions docker/Dockerfile_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu
RUN apt-get update && apt-get -y install python-pip python-dev \
libmysqlclient-dev libpq-dev \
libxml2-dev libxslt1-dev git \
libffi-dev zip python-mysqldb
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server
RUN git clone https://github.com/telefonicaid/fiware-skuld/ /opt/fiware-skuld/
WORKDIR /opt/fiware-skuld/
RUN pip install -r requirements.txt
RUN pip install -r test-requirements.txt
RUN python setup.py install
RUN mkdir coverage
RUN mkdir test_results
CMD nosetests --with-coverage --cover-package=./ --cover-xml --cover-xml-file=coverage/coverage.xml --with-xunit --xunit-file=test_results/TEST-nosetests.xml --exe

0 comments on commit f1a5094

Please sign in to comment.