aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/functest.rst127
-rw-r--r--testcases/config_functest.py23
-rw-r--r--testcases/functest_utils.py2
3 files changed, 94 insertions, 58 deletions
diff --git a/docs/functest.rst b/docs/functest.rst
index 4276594e6..3db860f51 100644
--- a/docs/functest.rst
+++ b/docs/functest.rst
@@ -76,6 +76,22 @@ For release 1, the tools are automatically installed, but the tests are not full
.. _pharos: https://wiki.opnfv.org/pharos
It is recommended to install the different tools on the jump host server as defined in the pharos_ project.
+
+For functest, the following libraries are needed. You can install them either with yum install or apt-get install, depending on your operating system:
+ * python-pip
+ * python-dev
+ * libffi-dev
+ * libxml2-dev
+ * libxslt1-dev
+
+You will also need some Python modules:
+ * sudo pip install GitPython
+ * sudo pip install python-novaclient
+ * sudo pip install python-neutronclient
+ * sudo pip install python-glanceclient
+ * sudo pip install python-keystoneclient
+
+
The high level architecture can be described as follow::
CIMC/Lights+out management Admin Private Public Storage
@@ -292,7 +308,7 @@ This script will:
When integrated in CI, the only prerequisite consists in retrieving the OpenStack credentials (rc file).
-This file shall be saved on the jumphost. It must be sourced by the user (who shall have sudo rights) executing the tests.
+This file shall be saved on the jumphost. It must be sourced by the user (who shall have sudo rights) executing the tests.
For the Continuous Integration we store this file under $HOME/functest/opnfv-openrc.sh on the jumphost server so CI can automatically execute the suite of tests
@@ -314,59 +330,60 @@ Retrieve OpenStack source file (configure your `OpenRC`_ file to let Rally acces
At the end of the git clone, the tree of <functest_repo_directory> will have the following structure::
- ├── docs
- │ ├── functest.rst
- │ └── images
- │ └── Ims_overview.png
- ├── INFO
- ├── LICENSE
- └── testcases
- ├── config_functest.py
- ├── config_functest.yaml
- ├── Controllers
- │ └── ODL
- │ ├── CI
- │ │ ├── create_venv.sh
- │ │ ├── custom_tests
- │ │ │ └── neutron
- │ │ ├── integration
- │ │ │ ├── distributions
- │ │ │ ├── features
- │ │ │ ├── feature-selector
- │ │ │ ├── packaging
- │ │ │ ├── pom.xml
- │ │ │ ├── test
- │ │ │ └── vm
- │ │ ├── logs
- │ │ ├── requirements.pip
- │ │ ├── start_tests.sh
- │ │ └── test_list.txt
- │ └── ODL.md
- ├── functest_utils.py
- ├── VIM
- │ └── OpenStack
- │ ├── CI
- │ │ ├── libraries
- │ │ │ └── run_rally.py
- │ │ └── suites
- │ │ ├── opnfv-authenticate.json
- │ │ ├── opnfv-cinder.json
- │ │ ├── opnfv-glance.json
- │ │ ├── opnfv-heat.json
- │ │ ├── opnfv-keystone.json
- │ │ ├── opnfv-neutron.json
- │ │ ├── opnfv-nova.json
- │ │ ├── opnfv-quotas.json
- │ │ ├── opnfv-requests.json
- │ │ ├── opnfv-smoke-green.json
- │ │ ├── opnfv-smoke.json
- │ │ ├── opnfv-tempest.json
- │ │ └── opnfv-vm.json
- │ └── OpenStack.md
- └── vPing
- └── CI
- └── libraries
- └── vPing.py
+ |-- docs/
+ | |-- functest.rst
+ | |-- images
+ | |-- Ims_overview.png
+ |-- INFO
+ |-- LICENSE
+ |-- testcases/
+ |-- config_functest.py
+ |-- config_functest.yaml
+ |-- functest_utils.py
+ |-- Controllers/
+ | |-- ODL/
+ | |-- CI/
+ | | |-- create_venv.sh
+ | | |-- custom_tests/
+ | | | |-- neutron
+ | | |-- integration/
+ | | | |-- distributions
+ | | | |-- features
+ | | | |-- feature-selector
+ | | | |-- packaging
+ | | | |-- pom.xml
+ | | | |-- test
+ | | | |-- vm
+ | | |-- logs
+ | | |-- requirements.pip
+ | | |-- start_tests.sh
+ | | |-- test_list.txt
+ | |-- ODL.md
+ |-- functest_utils.py
+ |-- VIM/
+ | |-- OpenStack/
+ | |-- CI/
+ | | |-- libraries/
+ | | | |-- run_rally.py
+ | | |-- suites/
+ | | |-- opnfv-authenticate.json
+ | | |-- opnfv-cinder.json
+ | | |-- opnfv-glance.json
+ | | |-- opnfv-heat.json
+ | | |-- opnfv-keystone.json
+ | | |-- opnfv-neutron.json
+ | | |-- opnfv-nova.json
+ | | |-- opnfv-quotas.json
+ | | |-- opnfv-requests.json
+ | | |-- opnfv-smoke-green.json
+ | | |-- opnfv-smoke.json
+ | | |-- opnfv-tempest.json
+ | | |-- opnfv-vm.json
+ | |-- OpenStack.md
+ |-- vPing/
+ |-- CI/
+ |-- libraries/
+ |-- vPing.py
NOTE: the Rally environment will be installed under ~/.rally/ the default Tempest configuration (automatically generated by Rally based on OpenStack credentials) can be found under .rally/tempest/for-deployment-<deployment_id>/tempest.conf
@@ -537,7 +554,7 @@ OpenDaylight
.. _`functest wiki (ODL section)`: https://wiki.opnfv.org/r1_odl_suite
-The results of ODL tests can be seen in the console::
+The results of ODL tests can be seen in the console::
==============================================================================
Basic
diff --git a/testcases/config_functest.py b/testcases/config_functest.py
index a106f07bc..3c608344a 100644
--- a/testcases/config_functest.py
+++ b/testcases/config_functest.py
@@ -8,9 +8,11 @@
# http://www.apache.org/licenses/LICENSE-2.0
#
-import re, json, os, urllib2, argparse, logging, shutil, subprocess, yaml, sys
+import re, json, os, urllib2, argparse, logging, shutil, subprocess, yaml, sys, getpass
import functest_utils
from git import Repo
+from os import stat
+from pwd import getpwuid
actions = ['start', 'check', 'clean']
parser = argparse.ArgumentParser()
@@ -71,6 +73,10 @@ def action_start():
"""
Start the functest environment installation
"""
+ if not check_permissions():
+ logger.error("Bad Python cache directory ownership.")
+ exit(-1)
+
if not functest_utils.check_internet_connectivity():
logger.error("There is no Internet connectivity. Please check the network configuration.")
exit(-1)
@@ -219,6 +225,18 @@ def action_clean():
+def check_permissions():
+ current_user = getpass.getuser()
+ cache_dir = HOME+".cache/pip"
+ logger.info("Checking permissions of '%s'..." %cache_dir)
+ logger.debug("Current user is '%s'" %current_user)
+ cache_user = getpwuid(stat(cache_dir).st_uid).pw_name
+ logger.debug("Cache directory owner is '%s'" %cache_user)
+ if cache_user != current_user:
+ logger.info("The owner of '%s' is '%s'. Please run 'sudo chown -R %s %s'." %(cache_dir, cache_user, current_user, cache_dir))
+ return False
+
+ return True
def install_rally():
@@ -231,7 +249,8 @@ def install_rally():
logger.debug("Executing %s./install_rally.sh..." %RALLY_REPO_DIR)
install_script = RALLY_REPO_DIR + "install_rally.sh"
- functest_utils.execute_command(install_script,logger)
+ cmd = 'sudo ' + install_script
+ functest_utils.execute_command(cmd,logger)
logger.debug("Creating Rally environment...")
cmd = "rally deployment create --fromenv --name=opnfv-arno-rally"
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index 838b09c4b..e146db1cd 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -203,7 +203,7 @@ def check_internet_connectivity(url='http://www.opnfv.org/'):
try:
urllib2.urlopen(url, timeout=5)
return True
- except urllib.request.URLError:
+ except urllib.URLError:
return False