aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/vping/vping_userdata.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-21Stop bashing functest scriptsguillaume.lambert1-1/+1
Though bash is a good interactive user shell and apart portability concerns, many UN*X systems and GNU+Linux distributions now prefers Almquist or Kornshell variants for scripting in order to improve the system performance and maintenability. https://wiki.ubuntu.com/DashAsBinSh https://mywiki.wooledge.org/Bashism https://en.wikipedia.org/wiki/Almquist_shell Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com> Change-Id: I32c5490f9eab54e6cac594f3eac1e392edf8b272
2021-11-15Update linters and fix all new issuesCédric Ollivier1-5/+5
It mostly add encoding in open calls and leverage f-strings. Change-Id: Ifead18fc724a452c1067dcf91dc577032edc9c59 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2021-08-18Update to Alpine 3.14Cédric Ollivier1-3/+3
It also fixes lots of new pylint warnings. Change-Id: I3376aee5649596c53bc2941ad4d8e0674a2967fe Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2020-01-24Update Alpine to 3.11Cédric Ollivier1-3/+3
It also updates Python to 3.8 (default version). It selects arm32v6 et arm64v8 repos and switches multiarch binfmt. https://alpinelinux.org/posts/Alpine-3.11.0-released.html Change-Id: Ib41cf0ab805ce2137658f3ff656b0a88c7b4ebf5 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>
2018-08-03Fix timeout (switch to synchronous calls)Cédric Ollivier1-1/+0
It completes "Switch create_server timeout to default value" [1] which forbids waiting more that 180s (create_server was asynchronous). [1] https://gerrit.opnfv.org/gerrit/#/c/60423/2 Change-Id: Icbf9ee48024fe9e10571c2bb7ca895d5828fb561 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-31Add fallback mechanism if vlanCédric Ollivier1-4/+9
private_v4 and public_v4 are incorrectly set when vlan is used as overlay. JIRA: FUNCTEST-996 Change-Id: I120a247e92e0fd295769b2a0eeb15ce82a0eabc8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-11Clean all possible resourcesCédric Ollivier1-6/+8
It checks all openstack resources before cleaning. It allows removing images even if the test fail quickly. Change-Id: I1763b8a70fa7ffeb03c435e8e775c7afd1a7adac Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-11Check the status of inherited stepsCédric Ollivier1-1/+2
Change-Id: If63c228f2844194279b560515f4ab24a4ee88be0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-24Improve scenarios to reduce duplicate codesCédric Ollivier1-17/+16
Change-Id: I71f79b9ac8314ac979d4b1009f662baa7c93a4fd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-13Abort vping_userdata test if IP address is missingJuha Kosonen1-0/+4
Do not start checking the result of ping test if the first instance has no IP address. JIRA: FUNCTEST-976 Change-Id: I2da3154e63a6a97f86efe8274be84abc437aa133 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-05-07Simplify vping_sshCédric Ollivier1-0/+2
It directly calls ping from the ssh socket. It fixes a possible missing security rule. It stops blocking if vpings are in failure. Change-Id: I64092a155bb134fa8b7d31d0d13f695e019540d1 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-04-29Rewrite vping_ssh and vping_userdataCédric Ollivier1-72/+56
They now leverage on shade to allow gating OpenStack master as asked by TSC. Switching to OpenStack master (openstacksdk) requires to change only one line. It deletes the related unit tests as they have to be fully rewritten. They will be added in another change. Change-Id: I0c60681d6e1c0944960770429ef972947dd85321 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-04-23Switch from deploy utils to the right objectsCédric Ollivier1-0/+2
It also prints the full exceptions and removes useless casts. Change-Id: I19ff1ae90670833f998c0d17592da82207235229 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-04-02Control vping cleanup step via --nocleanLinda Wang1-43/+39
Change-Id: Ic43b100348e77fd96aab9abc5a9ec4a0b47a2f87 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-03-02Leverage on XtestingCédric Ollivier1-3/+3
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-01-28Fix warnings in all snaps-related modulesCédric Ollivier1-2/+2
It also adds vping/__init__.py to stop skipping vping unit tests. It removes the useless import os which is not required for mock (here the mock patch was simply false). It should be noted that the code is partially duplicated between snaps_test_runner.py and vping_base_base.py. A small part of code has been rewritten to fix that without multi inheritance. Change-Id: I2e3e181ad7dab8aa41afb1e63d0b6795ff0d1610 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-05Fix pylint errors of vpingLinda Wang1-5/+7
Change-Id: I272f0eb6fb0f2a274484a3dcfacd8ed65e4a5b23 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-11-21Removal of deprecated SNAPS-OO classes.spisarski1-6/+6
JIRA: SNAPS-202 Change-Id: I115b4927b287a5525f4c1b95128d91f5229c7856 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-09-30Fix userdata issue for vping and orchestraLinda Wang1-3/+3
1. When creating VM, the type of the param userdata should be str, to conform with that in snaps [1]. 2. Remove the infinite loop for vping in userdata 3. Fix the criteria for vping_userdata and vping_ssh [1]: https://git.opnfv.org/snaps/tree/snaps/openstack/utils/nova_utils.py#n92 Change-Id: I262a7ebb93ec90bb6f8f3acb5d564f210abcfc4b Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-07-14Change calls to SNAPS library exposing OpenStack instance objects.spisarski1-1/+1
Openstack object structures can change when new API versions are released and SNAPS no longer is exposing OpenStack object implementations as this makes the library brittle. The only two SNAPS method calls affected are when functest needs to query for external networks and when vPing Userdata needs to obtain the console logs. JIRA: SNAPS-125 Change-Id: If6000e50eaa274713d9a6c964eabd1f73ded684e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-30Define console_scriptsCédric Ollivier1-15/+2
Only prepare_env.py and run_tests.py remain executable to avoid breaking the gate. As soon as the jenkins jobs are updated to run them from $PATH, tox will be updated to protect against chmod a+x py files. Dockerfile will be simplified as well. Change-Id: Iac1a7ceb6b344e800177226ea39919826f6d3735 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-26Fixed problem to vping userdata introducted by SNAPS-OO patch.spisarski1-1/+1
Changed get_vm_inst() to return a domain object forgot to change the call in vping_userdata.py. JIRA: SNAPS-92 Change-Id: I7585dcde483c39fa850e5184686f42bbf2e8f3c5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-28Switch shebangs to /usr/bin/env pythonCédric Ollivier1-1/+1
It modified the shebang to /usr/bin/env which is considered as more flexible. Change-Id: I9c8cdb4243d41a83d524499cc91060d3700e008b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-16Converted vPing to leverage the object-oriented SNAPS library.spisarski1-32/+102
JIRA: FUNCTEST-577 1. Replaced procedural openstack_utils with the object-oriented SNAPS library 2. Tests now clean themselves up. 3. Improved code documentation. 4. Removed dependency on file-based Cirros image and now leveraging the download URL. 5. Removed hardcoded location to the testcases.yaml file to leverage the value in config_functest.yaml 6. Included optional flavor metadata based on the scenario being tested 7. Included support for multi-part images. 8. Added enhanced support for configurable images. see SNAPS-76 Fixed line length verification problem with the previous submission Fixed retrieval of external network name to be dynamic. Changed external network name retrieval to leverage the newly merged snap_util.get_ext_net_name() function Added the creation and deletion of flavors. SNAPS now has the ability to add/remove security groups from running instances. Changed VMInstance constructor by moving userdata to configuration object. Change-Id: I0ef5e268eb153d696bb4d9a7533f780e5c603d26 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-04Delete functest.utils.functest_loggerCédric Ollivier1-2/+3
It deletes functest.utils.functest_logger and the related unit tests. Then it modifies all functest modules to get all loggers via logging.getLogger(). __name__ is mainly used as getLogger arg as proposed by logging [1]. All loggers and handlers are now defined via functest/ci/logging.ini instead of a dict loaded by an external json file. Now only warn messages and info messages from ci and core packages are printed in console. [1] https://docs.python.org/2/library/logging.html Change-Id: Ic192855e0f9bf94825d8f7ec73549a0f3b8d44c5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-11Modify TestCase constructor attributesCédric Ollivier1-2/+4
Every feature/testcase now allows receiving the data defined in testcases.yaml as args (name is renamed to case_name). From the time being, only project and case names are handled. Next pending patches will add criteria, cmd and repo to this list. It keeps the default values for case names except for features which will be aggregated into Feature. Change-Id: Id742d100b8183d7f10894c24ae6879d1b2b60ac9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-04Add case_name as constructor argCédric Ollivier1-3/+2
It allows managing multiple TestCase names with only one TestCase module. It is mainly required by odl which implements: - odl, - odl_netvirt, - fds. It also renames case to case_name in Features to conform with TestCases. JIRA: FUNCTEST-762 Change-Id: Ie254f754a0ea3077a8afda1c470528d38c79478f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2016-12-15Fix file permissionsCédric Ollivier1-0/+0
It has been fixed by calling [1] [1] find ${FUNCTEST_REPO_DIR} -name "*.py" \ -not -path "*tests/unit*" |xargs grep __main__ \ |cut -d\: -f 1 |xargs chmod -c 755 && find ${FUNCTEST_REPO_DIR} -name "*.sh" \ |xargs grep \#\! |cut -d\: -f 1 |xargs chmod -c 755 Change-Id: I654d9221179e60ea45d1db83157c4a9aa9497b69 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2016-11-25file/dir renaming for consistencyMorgan Richomme1-0/+82
JIRA: FUNCTEST-579 Change-Id: Iaa545db70bfb76770df0a3d17871e29ce518ff2d Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>