aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils
AgeCommit message (Collapse)AuthorFilesLines
2019-10-23Allow blacklisting tests if public endpoint onlyCédric Ollivier1-1/+2
It allows reusing the blacklisting system if only public endpoints are reachable (ONAP Openlab testing). It contains a first list of tempest-based tests which force the use of admin endpoints. Change-Id: Ic1ab07dec3ae1f2a0ca50b80e08cd0ac396f2e56 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-10-08Count all hypervisors by defaultCédric Ollivier1-1/+2
If one hypervisor is down, few tempest test fails. User is free to set SKIP_DOWN_HYPERVISORS if it's down on purpose. Change-Id: I7b6a4d0d8f67755d8c1550fd1bc6fd707634f68b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-09-29Detect OpenStack TrainCédric Ollivier1-1/+4
It takes into account latest max nova microversions [1] [1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html Change-Id: Icb9838b09ad22f6e87e9d8fb3c47525bdc1e3307 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-09-28Fix falsy linksCédric Ollivier1-2/+2
It completes the previous commit "Allow getting service via any endpoint" [1]. [1] https://gerrit.opnfv.org/gerrit/c/functest/+/68542 Change-Id: Ib396ed75e2385f99bce51e09d37f7f05808b5b5e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-09-28Allow getting service via any endpointCédric Ollivier2-2/+48
It overrides the default implementation provided by Shade. Change-Id: I3ad2f8ba543be4483f108c4bd7765018dddc5b19 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-09-12Allow skipping list_servicesCédric Ollivier1-1/+2
Shade forces the use of admin endpoints when listing services [1]. A new env var is added to allow running Functest when only public endpoints are reachable (e.g. testing from a VM as proposed for ONAP integration). It seems the best approach as list_services provides key data and we do avoid blocking requests. It seems easier and more generic than listing all calls in testcases.yaml. [1] https://github.com/openstack/shade/blob/master/shade/openstackcloud.py#L9956 Change-Id: Idcbe5d364f4230ffe1da34e7da0e99e863f15c5e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-08-18Clean orphan security groupsCédric Ollivier1-1/+2
It removes all security groups which are not owned by a project. This approach seems suitable as it works even if dynamic accounts (tempest and rally). All other OpenStack resources are still removed by the underlying framework. It lists all orphan security groups in use as debug to avoid misunderstanding the testcase results (it could happen if cloud admin removes accounts without cleaning the virtual machines). Change-Id: I033d96e077b4277d59233a3de4ca6d41ed91f743 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-07-27Switch to Python 3.7 and Alpine 3.10Cédric Ollivier1-1/+1
It also allows building docs as doc8 is broken due to latest OpenStack's upper-constraints. pylint is updated to 2.3.1 (lastest py3.7 version) It disables perm as umask is currently false on lf-virtual1. Change-Id: If09d4796d48b7d0591e7926621d3bbf5ca1b6c24 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-06-14Update Xtesting to 0.70Cédric Ollivier1-3/+0
Change-Id: Ib2427112f1ec2e89aa349740c1bb82db1a3622f5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-05-25Set utf-8 in decode and encode callsCédric Ollivier1-2/+2
It eases backporting in iruya and hunter as a few logs can't be decoded as ascii [1]. [1] https://build.opnfv.org/ci/job/functest-opnfv-functest-vnf-iruya-juju_epc-run/56/console Change-Id: I52a6f9a25130cbf62e8ce3b9972064ab73177665 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-05-13Update to Python3Cédric Ollivier1-2/+2
Functest containers leverage on Python3 instead of python2. https://mail.python.org/pipermail/python-dev/2018-March/152348.html It also updates robotframework librairies to latest release and Vmtp to master ([1] is needed) It patches cloudify rest client to support python3. Vmtp is currently disabled because it currently supports python2 only. [1] https://github.com/openstack/vmtp/commit/a5d062881d91bf4f547d92c6e289bea30feb5d6e#diff-b4ef698db8ca845e5845c4618278f29a Change-Id: I39964a212ec2d4dbf53c9ea7c63f02e0b6a05b48 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-05-02Manage block_migration in RallyCédric Ollivier1-1/+2
It creates a new env var BLOCK_MIGRATION (True by default) to allow block migration for live migration in Rally. It updates scenarios and blacklisting to take that env vars into account. Change-Id: I41129432798ae9e40fe23bbe2c2162df4c0dff80 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-04-25Leverage on DEBUG env varCédric Ollivier1-0/+1
It allows muting debug logs. Change-Id: I291f3bb7e0a450724a34997c720bde01f72c8e50 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-04-20Add Stein in Nova API microversionsCédric Ollivier1-1/+3
Change-Id: I42e854122fde9495cb3472ccc78900eccb20670d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-10-26Move tempest logics in tempest_conf.yamlCédric Ollivier1-2/+1
It allows removing OPNFV logics out of Functest (releng) and then simplifies conf_utils. tempest.conf is filled by the current default values. functest-alpine.sh will be updated to allow modifying the default values without breaking the OPNFV installers. It deprecates the only tempest-related env var (STORAGE_PROTOCOL) Change-Id: I14bcb715826ef2d85af87e7af600261a3c08e72c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-10-15Ease configuring extra specs via env varsDelia Popescu2-1/+2
Ease configuring flavor extra specs, as well as image extra specs. Set environment variables for image_properties and flavor extra_specs for ovs|fdio scenario from the start. Image extra_properties and flavor extra_specs will continue to get updates from functest config file but so will from IMAGE_PROPERTIES and FLAVOR_EXTRA_SPECS env variables. Change-Id: Ie1c69e66d2e2e158915d214402fe44d9991c56d3 Signed-off-by: Delia Popescu <delia.popescu@enea.com>
2018-10-14Fix image properties parsingCédric Ollivier1-0/+32
It removes useless spaces and now conforms with oslo.conf dict. New helpers and unit tests are available. Change-Id: I20335c5e5c3840cc872e158c6072d97a3f2cb98c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-10-06Merge "Rename IMG_PROP to IMAGE_PROPERTIES"Cedric Ollivier1-1/+1
2018-10-06Rename IMG_PROP to IMAGE_PROPERTIESCédric Ollivier1-1/+1
Any other env vars are reduced. Change-Id: Ic2c37d6efd543603a2495f9d2621b66d61710a54 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-10-06Merge "Use environment variable for image properties"Cedric Ollivier1-0/+1
2018-10-05Use environment variable for image propertiesDelia Popescu1-0/+1
Use IMG_PROP environment variable to read extra image properties. Set image_extra_properties for scsi volume types without file patch, but using IMG_PROP env variable IMG_PROP is defined through releng. Image extra_properties will continue to get updates from functest config file With this change, remove unnecessary parameters from arm patch Related to:https://gerrit.opnfv.org/gerrit/#/c/63203/ JIRA:ARMBAND-402 Change-Id: I64139240751b1e109bbe24ba32f487ccd98b9a92 Signed-off-by: Delia Popescu <delia.popescu@enea.com>
2018-09-20Allow overriding default storage protocolCédric Ollivier1-1/+2
It adds a new env var STORAGE_PROTOCOL to override storage_protocol in tempest. The default value is unchanged [1]. [1] https://docs.openstack.org/tempest/latest/sampleconf.html Co-Authored-By: Viktor Tikkanen <viktor.tikkanen@nokia.com> Change-Id: I19e4e25212b6f6176e3b967e01eb634c15e4d474 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-09-14Update get_openstack_version()Cédric Ollivier1-2/+4
It takes Rocky maximum version into account. Change-Id: I55469de4a63f1f824222660130a20d7fd8fa42c3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-08-28Support pre-Provisioned credentialsCédric Ollivier1-1/+2
If USE_DYNAMIC_CREDENTIALS = False, Functest is expected for /home/opnfv/functest/data/accounts.yaml which contains the set of pre-existing credentials to use for testing [1]. It also sets admin_domain_scope and default_credentials_domain_name. [1] https://docs.openstack.org/tempest/latest/configuration.html Change-Id: Ie7b81f0c56049260ca99b8e3a6d58cb8a2660659 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-08-18Generate API doc rst filesCédric Ollivier1-4/+2
It also fixes few docstrings Change-Id: I10bae7b7fab40edd931dd55ab8859946e3b38a71 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-21Add helpers to detect OpenStack versionsCédric Ollivier1-1/+63
It leverages on Nova API Microversions [1]. [1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html Change-Id: I60abf9089036e56fcbcd6c2b734666ea20875ceb Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-20Allow overriding the default roleCédric Ollivier1-1/+2
It allows testing controllers which implements other RBAC policies. Defining NEW_USER_ROLE=admin will easily raise side effects for orchestrators such as Juju and Cloudify. Change-Id: Ia78a25381aeb8aa81fd1872661629e1c08432b8f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-15Define env vars for ODL inputsCédric Ollivier1-0/+4
It's linked to "Add default param for ODL password" [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/59811/ Change-Id: Ib88d9371a2b6febb5c1af69ffda9b3c5024999e9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-30Inherit rally from VmReady1Cédric Ollivier1-19/+0
It also fixes clean(). Change-Id: I42d1305d5cdb5a717cfa7fce26798ac7102310f7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-05Implement get_external_network via shadeCédric Ollivier1-0/+19
It fixes the current issues as EXTERNAL_NETWORK is mainly unset by all Installers [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-fuel-armband-baremetal-arm-daily-fraser/31/console Change-Id: I8ee62623701c15b9ff962d0a0e07a77934ff03ac Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-03-07Add a new env var for nameserverLinda Wang1-1/+2
We should still consider that the nameserver must be handled by all installers instead [1]: - by configuring one or more DNS resolvers in dhcp_agent.ini - by asking a local resolv It eases setting the nameserver in testcases and then allows gating them. 8.8.8.8 is still defined by default. [1] https://docs.openstack.org/neutron/pike/admin/config-dns-res.html Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Id58dd5ebee612a0fce2ebc40f089769e60899416 Signed-off-by: Linda Wang <wangwulin@huawei.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-03-07Define a new env var for volume device nameCédric Ollivier1-1/+2
It eases modifying the volume device name written in tempest config. Fuel jobs should be adapted to set the right value (vdc) which differs from default (vdb). Change-Id: I09212018f94daa800ede815bd3586cceed0d54e7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-03-02Leverage on XtestingCédric Ollivier3-67/+12
It removes all the files which have moved to Xtesting. Vnf inheritances and env management will be improved in other changes. It keeps the same tree thanks to a symlink to allow publishing artifacts. Change-Id: I551bbd3f344cdab0158a50b7b09e541576695631 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-26Remove obsolete Functest utilsCédric Ollivier1-98/+0
Only 3 functions are kept as part of our framework: - execute_command_raise() - execute_command() - get_parameter_from_yaml() Change-Id: I966a1d6122391dae85aa3c77813ad2f1698ceb45 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-26Remove openstack utilsCédric Ollivier1-1486/+0
They have been obsolete since we fully switched to snaps. The files are being moved to SDNVPN which is the last project using them [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/52631/ Change-Id: I277b92a04cf6bc7b30015eed76f03f17830fad2b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-24Set Energy default values to NoneCédric Ollivier1-2/+2
It conforms with the other default values. Change-Id: Id46110c5aedf244f94e83b5b0389b135f075ffc8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-24Print env vars and env_fileCédric Ollivier1-0/+11
It simply eases detecting wrong inputs [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/796/console Change-Id: I0784c29265c69a6ba4a049226196bcdd70b0a572 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-22Switch from CONST to CONFCédric Ollivier3-35/+2
It also removes constants.CONST and env.Environment which are now useless. Depends-On: I764a0a2a24447c941d1e726f3116593b29dd1c1e Depends-On: I6cfa832466dcefd737314633d807512e46267a69 Change-Id: Ife41c59d9f2e6ec4e49df38af962039f99554bc5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-22Use constants for Functest config fileCédric Ollivier2-4/+10
env_file can't be defined in a config file simply because it's an entry point (Jenkins jobs, end users) Change-Id: Ie23c0ef90efc839d60f0f3a9754c58746b1f3a00 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-19Remove last CONST.__getattribute__()Cédric Ollivier1-3/+2
Change-Id: I82f6aa1e723c88eebd4c7410da4b9741a482e9bc Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-16Get properly env vars or their default valuesCédric Ollivier5-42/+48
It defines env.get() as an unique way to get Functest env vars or their default values. It can be considered as a wrapper above os.environ. It enforces backward compatibility via CONST which mustn't be used for that purpose. It should be noted that it also stops using CONST for getting OpenStack env vars. Change-Id: I333dc1afbc0123166a7eaff8b551370098efa341 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-13Remove INSTALLER_IP from FunctestCédric Ollivier1-1/+0
It's mandatory for testcases which are out of Functest. Change-Id: Ia5f5134334ad9f69d44409d817616fa9033fae95 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-13Remove obsolote env var IS_CI_RUNCédric Ollivier1-7/+0
Change-Id: I284e0ec97792620db08005a617f584b81a1eae63 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-13Improve the way of setting values in CONSTLinda Wang2-3/+3
Use setattr instead of internal method (__setattr__). It must be completed by patches fixing [1] [2] and [3]. [1] https://jira.opnfv.org/browse/FUNCTEST-930 [2] https://jira.opnfv.org/browse/FUNCTEST-931 [3] https://jira.opnfv.org/browse/FUNCTEST-932 Change-Id: I9558f33f5ed4559b6031d75951d5637c0c0ef8cb Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-02-13Simplify functest/cli/commands/cli_env.pyCédric Ollivier1-1/+0
CONST shouldn't be used for getting/setting env vars. It adds complexity and may raise side effects. It also removes the obsolete env var CI_DEBUG. Change-Id: I8a8fde0fa781351d5eabd2698ca8aae9dee76fb8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-12Export env vars via os.environ in test_openstack_utils.pyCédric Ollivier1-1/+1
CONST shouldn't be used for getting/setting env vars. It adds complexity and may raise side effects. Change-Id: I8319748dd2f0abb95b82a2f65191cac8ccba7f5e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-09Move get_dict_by_test() into run_tests.pyCédric Ollivier1-23/+0
It also removes functest_utils.get_criteria_by_test() Change-Id: I3f265642acd053755e32f8e92f1086b93517c247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-08Move source_credentials() into run_tests.pyCédric Ollivier1-16/+0
It's also renamed source_envfile(). Change-Id: I0e7c38c2def125961f86dc2bc9a63cfb6ad87c03 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-31Merge "proper instance status handling"Juha Kosonen1-1/+4
2018-01-26Fix pylint errors in several utils modulesCédric Ollivier3-53/+45
All utils which are moving to xtesting are now fixed. It remains OpenStack and Functest utils (+ the related unit tests) which doesn't move to the new package. Change-Id: If13c627c8444c62d5c6bf9c8057d6413aa0e56c7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>