aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/vping/vping_ssh.py
AgeCommit message (Collapse)AuthorFilesLines
2021-11-15Update linters and fix all new issuesCédric Ollivier1-5/+4
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-08-17Boot a VM to run jujuCédric Ollivier1-2/+2
It allows running juju_epc vs arm32 and arm64. It stops offering juju in functest-vnf and rather installs it in a VM. It also adds a couple of missing output decode() Change-Id: I2218742b2824c8328823051bde32422e56784e90 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2020-03-27Check the login prompt in console in SingleVm1Cédric Ollivier1-0/+2
It also checks the second vm2 console log in case of vping_ssh. Change-Id: I13a5edfb3e19449a38d2f0478d549bd8fcc5cfa7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-31Add fallback mechanism if vlanCédric Ollivier1-1/+3
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-31Print stderr in logs when calling cmd over sshCédric Ollivier1-2/+3
Change-Id: I152ac898661a0e99a6232df86689c70c468ceaa5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-11Clean all possible resourcesCédric Ollivier1-3/+4
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-07Cover vping_sshCédric Ollivier1-2/+0
Change-Id: I37c52057a45d76e081a1a0145baee96041ca25a5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-24Improve scenarios to reduce duplicate codesCédric Ollivier1-92/+17
Change-Id: I71f79b9ac8314ac979d4b1009f662baa7c93a4fd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-30Fix _do_execute() return code in vping_sshCédric Ollivier1-1/+1
Change-Id: I781e51bb56f6cdac8b347e7fd85e70c07eb69e23 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-28Print vping output instead of Paramiko objectCédric Ollivier1-1/+1
Change-Id: Iddc1abdf443e482e8748434a4ba7d85709d8cd0e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-07Improve ssh timeout in vping_sshCédric Ollivier1-6/+18
It seems that 10s is not enough for Fuel. Change-Id: I46d3d2c9091946befb0e056a8c8cc56c59087471 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-07Simplify vping_sshCédric Ollivier1-80/+12
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-120/+74
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-2/+5
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-2/+0
Change-Id: Ic43b100348e77fd96aab9abc5a9ec4a0b47a2f87 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-03-02Leverage on XtestingCédric Ollivier1-11/+11
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-22Switch from CONST to CONFCédric Ollivier1-6/+6
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-19Remove last CONST.__getattribute__()Cédric Ollivier1-5/+5
Change-Id: I82f6aa1e723c88eebd4c7410da4b9741a482e9bc Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-28Fix warnings in all snaps-related modulesCédric Ollivier1-6/+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-1/+1
Change-Id: I272f0eb6fb0f2a274484a3dcfacd8ed65e4a5b23 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-11-21Removal of deprecated SNAPS-OO classes.spisarski1-26/+24
JIRA: SNAPS-202 Change-Id: I115b4927b287a5525f4c1b95128d91f5229c7856 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-10-03Create a router in both vping scenariiCédric Ollivier1-19/+1
It fixes vping_userdata as it allows getting metadata due to the gateway defined for the subnet. It could be noted that DHCP can add the route needed if no gateway is defined and if force_metadata is set in dhcp_agent.ini. Change-Id: Ia62e0f00e3d2caee6262dd9cd9966d1f21fe40d5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-30Fix userdata issue for vping and orchestraLinda Wang1-1/+1
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-11Add decorators in testcases for energy recording.Benoit HERARD1-29/+49
Test cases are: - rally (sanity and full) - refstack - cloudify_ims - vping_ssh It also fix a bug on "energy_recording" decorator of energy module. Change-Id: I625c214552ad1b89eaf7e196e706d7c69b37da33 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-06-30Define console_scriptsCédric Ollivier1-1/+1
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-27Added unit tests for vping.spisarski1-21/+15
Also removed some instance variables and unnecessary methods. JIRA: FUNCTEST-813 Change-Id: I13895674a9fd3de16c6a19410661440c5380c2f8 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-20Remove all references to /home/opnfv/repos/functestCédric Ollivier1-3/+3
It also removes relative (and incomplete) references which could be defined in modules instead of this global configuration. Change-Id: Ie20dc3547e49b6224aa8100cd380d37b87ece5a9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.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-104/+174
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>
2017-03-27Rename testcase_base to testcaseCédric Ollivier1-4/+4
It simply removes the useless suffix. Change-Id: Ib9a682b57d8f33518359d817a593bb3786577390 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-27Switch TestcaseBase to TestCaseCédric Ollivier1-3/+3
It partially reverts "Rename TestCasesBase into TestcaseBase" [1] and removes the useless suffix too. [1] https://gerrit.opnfv.org/gerrit/#/c/25391/ Change-Id: Iddf2ec8d6c1dafe6e4c6713c2e69969613317471 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-02-23WIP: Cirros TestVM: Allow config of username/passwordAlexandru Avadanii1-4/+2
With the recent changes in Cirros image default password, we need to support configuring these credentials. JIRA: ARMBAND-218 Change-Id: I5962ec2aeee4ffecefdd8b7e70bdb7ed88457553 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2016-12-20Remove backslash to meet PEP8 requirementhelenyao1-3/+3
JIRA: FUNCTEST-630 Change-Id: Ia02760fd98aaab59a6cf0a90a2020b76e0c92df6 Signed-off-by: helenyao <yaohelan@huawei.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-12-02Rename TestCasesBase into TestcaseBasehelenyao1-4/+4
JIRA: FUNCTEST-628 1. rename the TestCasesBase into TestcaseBase 2. updated the module name to testcase_base.py Change-Id: Ic6b5d8209098c136613a2419c3790668fdbd493e Signed-off-by: helenyao <yaohelan@huawei.com>
2016-11-29bug fix: bad ping.sh path after refactoringMorgan Richomme1-2/+2
JIRA: FUNCTEST-626 Change-Id: Iaab7de65ae197939f1ef715826ba5a2b2423c205 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2016-11-25Bugfix: fix the wrong path for vping_sshhelenyao1-1/+1
JIRA: FUNCTEST-624 Change-Id: Idbd04eb4c09a3bae29f12e43b019ad095ce2cf7b Signed-off-by: helenyao <yaohelan@huawei.com>
2016-11-25file/dir renaming for consistencyMorgan Richomme1-0/+175
JIRA: FUNCTEST-579 Change-Id: Iaa545db70bfb76770df0a3d17871e29ce518ff2d Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>