aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/odl/test_odl.py
AgeCommit message (Collapse)AuthorFilesLines
2021-11-15Update linters and fix all new issuesCédric Ollivier1-25/+24
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-1/+1
It also fixes lots of new pylint warnings. Change-Id: I3376aee5649596c53bc2941ad4d8e0674a2967fe Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-09-02Update Xtesting to 0.60Cédric Ollivier1-1/+1
Xtesting leverages on stevedore [1] which will bring much more flexibility (discovery, module or class renaming, etc). OPNFV Features have to be updated as well: - https://gerrit.opnfv.org/gerrit/61713 - https://gerrit.opnfv.org/gerrit/61715 - https://gerrit.opnfv.org/gerrit/61717 - https://gerrit.opnfv.org/gerrit/61719 [1] https://docs.openstack.org/stevedore/latest/ Change-Id: I0ce45eb6c9af66546c2c020eb962fa457f6c7e1a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-08-25Remove INSTALLER_TYPE logics in odlCédric Ollivier1-34/+1
JIRA: APEX-621 JIRA: COMPASS-606 Change-Id: I76dde66aefc67f80b40496f705f2864ea9355dcf Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-08-07Update Xtesting to 0.55.0Cédric Ollivier1-3/+31
It allows calling one skipped test via run_tests (parallel testing). Change-Id: I04e5c69f2129e28f1451815938cd5d0f8bbe9e44 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-20Stop Fuel logics in odlCédric Ollivier1-12/+0
Fuel is setting the right env vars [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/59929/ Change-Id: Ieb0ae1887859e0b7d3f77dfb5100a633b6479a37 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-18Remove logics about Daisy in odlCédric Ollivier1-9/+2
Daisy is now setting the right env vars [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/59839/1 Change-Id: If23c0ac0b5ab2f4f4b9515e27d845cb9c4d07ded Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-07-12Protect vs former interface formatCédric Ollivier1-2/+11
Compass still set publicURL [1] [1] https://build.opnfv.org/ci/view/functest/job/functest-compass-baremetal-daily-fraser/lastFailedBuild/consoleFull Change-Id: I88c6ca336a7017f97f4c07719156e567d1afb9df Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-19Fix pylint errorsCédric Ollivier1-0/+2
They are highlighted by the last pylint version. Change-Id: I473212a413013492716993fb536903b13bff66ed Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-17Mock os.makedirs() in test_odl.pyCédric Ollivier1-0/+5
os.makedirs() is called before calling robot.run. Change-Id: Id651428343510683cd616d8101d22a73ccbf3dad Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-12Update ODL testcase to OpenStack ShadeCédric Ollivier1-23/+125
Change-Id: I7832b5ed274e181449f9db9fb03a2d27038520ae Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-04-11Leverage on SDN_CONTROLLER_IP if fuelCédric Ollivier1-1/+6
It conforms with [1]. [1] https://jira.opnfv.org/browse/FUEL-352 Change-Id: Idae142de8de09203509c73c35c2e7fea5a5d880b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-04-09[fuel] Unite OpenDaylight portsMichael Polenchuk1-1/+1
ODL Oxygen has only 1 connector by default, so unite web and rest ports together. Change-Id: Idd5bdd5da3dcc85fa25b82ab2d19107b2d005974 Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
2018-03-19Update xtesting to 0.31Cédric Ollivier1-0/+1
It mainly fixes regex when INSTALLER_TYPE is unset [1] [1] https://gerrit.opnfv.org/gerrit/#/c/54089/ Change-Id: I57430e87ec7b988337697417e319cf4f9b207e0d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-03-14Get odl ip from env on CompassLinda Wang1-1/+2
Change-Id: I9ed2cdeef461c27381ecdfd56e5347ded61b5cb8 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-03-02Leverage on XtestingCédric Ollivier1-1/+1
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-26Raise exceptions when SDN_CONTROLLER_IP is NoneCédric Ollivier1-4/+13
Change-Id: Ia0d00a6b3c4c4936dc10602e838f507beea0c592 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-26Stop raising keystoneauth1 exceptions in odl unit testsCédric Ollivier1-2/+1
It simply raises Exceptions to avoid depending on keystoneauth1. Snaps may also reraise another exception. Change-Id: Ib3041b2d8ff51ee098f2bf0b9918079b7945abf3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-15Stop reading SDN_CONTROLLER env var.Cédric Ollivier1-10/+0
Joid doesn't support ODL and this exception is no longer needed. It will be a simple switch from SDN_CONTROLLER to SDN_CONTROLLER_IP if Joid supports ODL again. Change-Id: I925965f9c1adf24914e4110ff3206443f4063ac8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-08Get neutron endpoint via snaps in odlCédric Ollivier1-82/+70
Change-Id: Iaf0e451e7f6bd7d22459f8d3509b39773527cfea Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-07Add variablefile as possible robot.run() argsCédric Ollivier1-6/+4
Change-Id: Ic80840957b4d9c3c4a1615696a2851f3f5bf7bf4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-11-30Skip modifying creds if Variables.robot is missingCédric Ollivier1-6/+17
Variable.robot is missing in functest-features [1]. As it's related to ODL csit suites, modifying it could be safely skipped as odl.py is designed for testing multiple ODL testcases. [1] https://gerrit.opnfv.org/gerrit/#/c/46225/ Change-Id: Id5f1947a073d251ef7480f418218a4c85fe078c1 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-11-29Remove one obsolete test in test_odl.pyCédric Ollivier1-3/+0
It completes "Create RobotFramework class" [1] which decreased coverage to 99% (test_odl.py) [1] https://gerrit.opnfv.org/gerrit/#/c/47841/ Change-Id: I2a2d448daeb6d1f50064588167cafd32e07aa502 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-11-27Create RobotFramework classCédric Ollivier1-113/+4
It moves the capability to run any robot script from ODL TestCase into a new class: RobotFramework. It updates ODL TestCase and the related unit tests to inherit from the new parent class. Change-Id: I73e59ee9652fb63d9d89d7c75c58cce9cf62b0d7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-28Switch to OS_PROJECT_NAMECédric Ollivier1-13/+15
It simply conforms with OpenStack keystone v3. JIRA: FUNCTEST-877 Change-Id: I989a6eb4d8564948927c184a899b62ca763ef824 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-22Support https when testing ODLCédric Ollivier1-54/+55
It conforms with the last change on ODL tests [1]. Neutron endpoint is passed via robot args instead of Neutron ip. Keystone url (based on OS_AUTH_URL) is passed too to replace Keystone ip. [1] https://git.opendaylight.org/gerrit/#/c/63293/ Change-Id: Ie44f55304a438b1b0289ec69ac2241664be70e80 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-08Update ODL testcase to Keystone v3Cédric Ollivier1-3/+26
As basic neutron tests have been updated [1], ODL testcase must manage user domain and project domain names. [1] https://git.opendaylight.org/gerrit/#/c/62846/ JIRA: FUNCTEST-862 Change-Id: I61ef622f840b8d825cf45a3557bd6da14a4d3cb7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-07[Fuel/MCP] Set opendaylight web/restconf portsMichael Polenchuk1-1/+2
Change-Id: I24518bdf54974debf49df6d775db1203e61922e5 Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
2017-07-13Correct odl port for compass installerYifei Xue1-1/+1
For the port 8181 has been used by OSA repo LXC in compass deployment. So we change the port here in functest to 8080. Change-Id: Ia262319f7513497db6e849521de6be6328ec97ba Signed-off-by: Yifei Xue <xueyifei@huawei.com>
2017-07-12Add odl configurations for odl testcase in daisy environmentAlex Yang1-0/+15
To support odl testcase in the environment deployed by daisy installer. Change-Id: I70bc668520cf28385fcff8489c773b880e7b4080 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
2017-06-30Define ODL console_scriptCédric Ollivier1-24/+24
main() is excluded from coverage as it usually parses argv. It also renames ODLTests main() to run_suites() not to exclude this method. Change-Id: I3109a65166b21d93e3e376912a32d364931a7ba5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Merge "Modify how to disable logging in unit test."Jose Lausuch1-2/+1
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier1-2/+1
Logs are only disabled when the unit tests are run from cmdline. It allows running them via pytest_suite_runner.py and printing their results to functest.log. You should notice that the unit test must disable the logger of the tested TestCase (e.g. testcase.TestCase.logger.disabled = 1). Otherwise false logs will be printed in console. Change-Id: Ic171e4575c8bab2e52db1897ae026b61a03b6247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-18Use StringIO in odl.pyCédric Ollivier1-40/+0
It avoids creating and removing the temporary file to dump robot output. Change-Id: Ia5ea66e76ffb8b8327f2da938f177e8ef4c61dd4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-17Add Python3 support to the ODL testcaseCédric Ollivier1-4/+4
It also adds this support to its dependencies. Change-Id: I0534f0c7b0e15a9ee89f522f314cf5200874454c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-17Update/Add requirements to run ODL robot CSITJamo Luhrsen1-6/+4
It conforms test_odl.py with the new RobotFramework API too. It also updates test-requirements.txt as required by the current implementation of run_unit_tests.sh. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Ibca0150a40d3b8a3f736be1e9dcbf9ce56af0299 Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-09Conform ODL with last framework updatesCédric Ollivier1-4/+25
Now ODL TestCase calculates the ratio between critical tests passed and failed and saves it in result. Non-critical test cases can fail as result doesn't take them into account [1]. It also updates default attribute values in TestCase and allows result to be float. [1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-criticality Change-Id: Id4a89271b5b1a90cd3c1e2b08591ff26ffaffee0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-05Check open args in test_odlCédric Ollivier1-3/+9
Change-Id: I4b0060502621c7491820b9aa42d8f2f63b06a9ae Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-30Remove missing statements in test_odlCédric Ollivier1-25/+19
It mainly removes _fake_url_for() which is useless since get_endpoint() is not called for identity. Coverage for functest/tests/unit/odl/test_odl.py : 100% Change-Id: I5809c5eac4021c44113e70379621ab311187c669 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-26Switch TestCase attribute criteria to resultCédric Ollivier1-1/+1
It mainly avoids mixing input and output. Criteria is now an input set in functest/ci/testcases.yaml and then must be passed as __init__() args (which will be proposed in an additional change). Then it also renames the related TestCase method to check_result(). Change-Id: Ifc3c8e3ea6cde7e3edf7174bed4bf2bf0894e8e3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-11Modify TestCase constructor attributesCédric Ollivier1-1/+1
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-03-28Fix pylint warnings in test_odlCédric Ollivier1-155/+216
It takes into account the following warnings: - wrong-import-order - bad-continuation - unused-argument - invalid-name - too-many-arguments missing-docstring is partially disabled as they are unit tests. It has been rated at 10.00/10. Change-Id: I35886ec75a9e66817cfd0fe18534f157d7500a2b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-27Rename testcase_base to testcaseCédric Ollivier1-35/+35
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-28/+28
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-03-09Introduce smoke tests for FDSTomas Cechvala1-9/+17
Added: - fds repository to docker file - fds test to smoke tier in testcases - config values for fds tests A new robot var OS_AUTH_URL is defined as expected by FDS robot files. Method args switch from Keystone IP to OS_AUTH_URL which is more precised. The argument parsing is changed too. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Ife27ab4a83f0110cbdcf7c9d47d9b3fb4c0ec705 Signed-off-by: Tomas Cechvala <tcechval@cisco.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-02-03Add netvirt to odl testsNikolas Hermanns1-0/+14
For the odl test the default odl port is 8080. In netvirt this is the same as apex. Change-Id: I949510e4f7fb57bcf8ec01f69f7941c5d55c98e7 Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
2017-02-02Allow multiple sets of suites in ODLCédric Ollivier1-0/+30
ODLTests can manage multiple sets of suites passing as run args. It avoids duplicating odl.py according to ODL features installed (e.g. netvirt). Change-Id: Ibb0697ef9441506c3f33627e13a0845cc482e23f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-01-19Leverage logging config and refactor the loggerhelenyao1-1/+0
JIRA: FUNCTEST-690 The detailed benefits are listed in the JIRA description. 1. Refactored the functest_logger to make use of configuration file 2. Avoided configuring the logging every time a logger is initialized 3. Applied separate logging configuration fo unit test by removing saving log to file Change-Id: I6e27eaba727ae6d704f0301f15359dc3ea7b2f97 Signed-off-by: helenyao <yaohelan@huawei.com>
2017-01-18Use 8081 for apex's restconfport robot variableJamo Luhrsen1-3/+5
Change-Id: Ie3579254b8f09eda3707fbc4b8d098a292f52a93 Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
2017-01-13Fixes ODL rest port for ApexTim Rozet1-1/+1
Apex has enabled tripleo firewall in deployments which block access to port 8181. Only port 8081 is exposed on the admin network now. Change-Id: I58e5eaf16cfc0738c248e1468b2d59cc9f542ddd Signed-off-by: Tim Rozet <trozet@redhat.com>