aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/lib/utils.py
AgeCommit message (Collapse)AuthorFilesLines
2017-12-12Clean up our utils.pyManuel Buil1-748/+0
Utils.py was getting messy. This patch divides it into three different files: * test_utils.py * odl_utils.py * openstack_utils.py The tacker library is integrated into openstack_utils.py Change-Id: I310949d1cee49b6aa1c9b3396bf6d6ca458cbaac Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-10-17Produce more logs if things failManuel Buil1-0/+29
Apex deployment shows a problem when creating the SFC config in ODL and it is impossible to know what might be going on Change-Id: If8d33d1c60daaf9cd9773a5cb9c7e47f64e1caa9 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-10-06If the VM starts quickly, this check might failManuel Buil1-1/+1
Sometimes VM starts very quickly and then it takes longer for this service to come up Change-Id: Ibc4ea47eb0b4b6655e338d1b85e6ed14e61d0064 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-09-25Bug fix: Do not start testing before checkingManuel Buil1-5/+30
JIRA:SFC-113 We used to check that the ACL and RSP flows were implemented because it took a lot of time. However, the new ODL Nitrogen reduced this time a lot and thus we must check that the vxlan_tool is up and the HTTP port is up in the server before doing any test Change-Id: I70219071c7965781b17e80631bf3e2efbfcfe4cd Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-09-20Bug fix: Add iteration to check RSP config in ODLManuel Buil1-1/+8
JIRA: SFC-110 Sometimes the test is quicker than ODL and when it checks the configured RSP, that configuration has not yet been submitted in ODL, thus ODL replies with an empty list. We add an iteration to try again for a couple of times Change-Id: I21e4ac3fc3a919791daa7e41cb2953f7565c4ebb Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-09-19Create vnffg providing the neutron_portManuel Buil1-0/+38
JIRA: SFC-107 We are submitting the vnffgd with a variable for the neutron_port. Before creating the vnffg, we must provide a file with the neutron_port value Change-Id: I9994e2baa53f323df17434448d372598c0d94c72 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-09-15Update the wait_for_classification_rules functionManuel Buil1-60/+54
Two things must be done: 1 - Be compatible with the new way of doing SFC in ODL Nitrogen 2 - Be installer independent Change-Id: Ibbb3057db30a7c00e92f788bb03e770749e2b255 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-09-11Merge "Adapt functionality to the new Tacker API"Manuel Buil1-15/+29
2017-09-07Adapt functionality to the new Tacker APIDimitrios Markou1-15/+29
Change-Id: I078e9f26d3040cf04120abd425f03cb4f2e8daef Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
2017-09-01Remove setup_compute_node and configure_iptablesManuel Buil1-27/+0
We are going to use ODL Nitrogen which does not require the NSH hack as packets reaching the VNF will use ETH+NSH encapsulation Change-Id: I5a55fde84e8f17860783ec9de8b99242fc38b9a9 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-08-31Adapt the testcases to multiple installersDimitrios Markou1-12/+27
Right now the testcases are dependent to only one installer. So when we are trying to run the testcases to multiple installers the tests are failing. This patch make the testcases independent to the installer that they run. The testcases are running until the point which they hit the tacker client commands.They are failing in the tacker client commands because we need the new library for the upstream tacker API. The testaces have already tested to two installers (Fuel,Apex-ha). Also this patch contains the changes which are required for the adaptation to the new functest. For more information see the Jira tickets [0],[1],[2]. [0]: https://jira.opnfv.org/browse/SFC-100 [1]: https://jira.opnfv.org/browse/SFC-101 [2]: https://jira.opnfv.org/browse/SFC-102 Change-Id: Id1e5d5c94a65ab8bdea9584fa833bfa0cdec6632 Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
2017-06-30Use the recommended exception syntaxManuel Buil1-1/+1
Today I learnt that the use of except Exception, variable is not recommended anymore and it is not supported after python3. When using >=2.6, the syntax should be except Exception as variable. https://www.python.org/dev/peps/pep-3110/ Change-Id: I213c220fc6e92878ffa4737efa16adb76ace1271 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-05-26functest_logger changes fixvijayendra Radhakrishna1-2/+2
- Recently there is removal of functest logger utils. - This uses the default python logging mechanism Change-Id: I3aba38041bbed8b1e5a3de93bc9f639253f262d8 Signed-off-by: Vijayendra Radhakrishna <vradhakrishna@mvista.com>
2017-04-05Remove get_floating_ips()Juan Vidal1-28/+0
get_floating_ips() is non-reusable function, with too much logic into it. By using smaller functions, we can compose the same functionality and build all tests upon a common set of utilities. Using the new functions in functest to retrieve the nova ID for a VNF instance, it is possible to use a generic solution at the problem of getting floating ips deterministcally to the instances Change-Id: Ic7dba908fa6bb343c177fe1a68322d3803ed1707 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-04-05Harmonize vxlan-tool callsJuan Vidal1-15/+26
Renamed vxlan_firewall and vxlan_tool_stop to start_vxlan_tool and stop_vxlan_tool respectively. Added some comments to explain their behavior. Cleaned both functions to use ".format()" string formatting, which improves readability. Modified behavior of start_vxlan_tool: now it does NOT block traffic by default Change-Id: I6754b020a474be1e9adf2d83e7c9f5053930b702 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-03-31Fix hardcoded domain in wait_for_clf_rulesGeorge Paraskevopoulos1-2/+19
In the CI the availability zones are using a different domain. For example instead of "node-1.domain.tld", we have "node-1.opnfvericsson.com" This patch takes the av zones dynamically from nova hypervisor-list. Change-Id: Ifa26dbbb6b8d415ee30bb1216fc1150f65096a16 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-27Rewrite classification rules wait loopGeorge Paraskevopoulos1-91/+168
This is a candidate replacement for the wait_for_classification_rules function. The functionality is as follows: - Query ODL operational datastore for the RSPs for which we should expect to see flows in the computes (RSPs for which ACL rules exist) and associate them with a list of vnfs. Also get the tp_dst from the ACL match rules. - Use the known topology to associate the RSPs to a set of compute nodes (at this point we know that ODL promised us that we should see classification rules for a particular rsp in the nodes C1, C2 ...) - Gather the installed flows in table=11 in each compute - Verify that the RSPs are installed as promised by ODL for the correct tp_dst Change-Id: I79747ad1df3eb0c67f783167601b5ea99fb43f16 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-24Revert "Change from functest logger to python logging"George Paraskevopoulos1-3/+2
This reverts commit cb311aad19c732fa006b50795ab66687e01b95a6. Change-Id: I123c30acd765df692483eb5f91fecd1478219201 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-23Delete ACL when deleting a classifierGeorge Paraskevopoulos1-0/+8
Change-Id: I8e54892450e903aa51f888229940e6371a0710f7 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-22Added more logs to classification checkManuel Buil1-2/+18
The classification check is not working in CI and we don't understand why. I added a lot more logs to check Change-Id: I81bcc8874c5e5e843e0c301e1d66d5d11de092f3 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-03-21Bug fix: Eth header build with wrong dest. macManuel Buil1-1/+2
JIRA: SFC-89 The second test fetches the destination mac of the previous test because an entry with that IP is in the arp table. However, that table is outdated. We must flush the arp table before starting the new test. Change-Id: Ie00345bba13793dc68e8442421861a2555e5ba7d Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-03-20Cleanup IETF-ACL in OpenDaylightGeorge Paraskevopoulos1-0/+28
Change-Id: I6914a5fbe7eb30b2d76b89d8f38b7d3d16e7b44a Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-19Give time to start the firewall processManuel Buil1-0/+1
Sometimes test sfc_one is failing because the firewall is not started when the test begins. Waiting some seconds after starting the process corrects the problem Change-Id: Iebef292fa66338c3e27a325333cc5f1993facac5 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-03-18Change from functest logger to python loggingGeorge Paraskevopoulos1-2/+3
Change-Id: Ie7b2a63c301819a79768d1b286ee00693cd1129b Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-17Add checks for cleanup utilitiesGeorge Paraskevopoulos1-0/+2
Change-Id: I1facd54b11ef6a090e39dd5977eb5cf7183147af Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-17Add ODL cleanup utilitiesGeorge Paraskevopoulos1-0/+46
ODL does not clean all resources properly after tacker deletions, so we add this as a post processing step Change-Id: Ic485ee32b195f72235922ebe613af6c010cb57db Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-17Remove SFF_filter“Manuel Buil”1-15/+0
After further investigation we found out that the classifier is deployed in all computes. When deploying several tests, ODL starts to function very slowly and sometimes the classifier takes a long time to be deployed in one compute. That tricked us and made us think that it was not deployed everywhere Change-Id: I474a05f77a6342be741d14ffbdb674ef7f970908 Signed-off-by: “Manuel Buil” <mbuil@suse.com>
2017-03-16Bug fix: rsps and first_RSPs must be restarted“Manuel Buil”1-1/+5
JIRA: SFC-88 Not a blocking bug but when the classifier is implemented in several computes, we loop all computes. By the time the second compute is inspected, more than 10 seconds passed and thus, the classification rules are already there. first_RSP should not be evaluated and rsps must be restarted Change-Id: I70858d6b423eebd8088a79aebebb4950f031878d Signed-off-by: “Manuel Buil” <mbuil@suse.com>
2017-03-15Merge "Remove security group exists error logs"Manuel Buil1-8/+56
2017-03-15Remove security group exists error logsGeorge Paraskevopoulos1-8/+56
We copied the create_secgroup_rule function from functest.openstack_utils and removed the logger.exception("Security group exists") line. This is very ugly and we should investigate an upstream fix after D release. Change-Id: I1674a77ebc3b3e3132b2b9e1f16a84106b2350eb Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-03-15Bug fix: Classification check failing“Manuel Buil”1-2/+17
If both SFs are in one host, the classification rules are not implemented in all the hosts Change-Id: Ifea131a86f49d33fdc6110a13d5fdc6c2796f7fa Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-03-14Bug fix: classif. check not working for one chainManuel Buil1-11/+24
In the test case with only one chain the wait_classification function was not working Change-Id: I4cff1e61130b6fc68d736108a0da048909dad750 Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-03-01Remove get_floating_ip_2 from sfc_symmetric_chainJuan Vidal1-32/+24
Using the new functions in functest to retrieve the nova ID for a VNF instance, it is possible to use a generic solution at the problem of getting floating ips deterministcally to the instances Change-Id: Ie77820b0f466dcbf8ac771f12b5aee55ef74ead5 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-23Reduce logging level of run_cmdJuan Vidal1-9/+11
run_cmd does not have enough information to determine if something should be logged with ERROR level. For example, you might want to repeat a command until it succeeds, and you would expect it to fail the first times, so it would not be an error in that context. Let's keep the debug logging only, which should be informative for troubleshooting. Change-Id: I72bc40e58d19188b83ad289fe7fa2b4453d5ad56 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-23Merge "Improve readability of ping function"Brady Johnson1-23/+6
2017-02-22Improve readability of ping functionJuan Vidal1-23/+6
The function now uses return codes instead of parsing the output of the command. Unused options have been removed as well. Added a default retry_timeout for the command to avoid ping hangs. Change-Id: I8c1f0f03d8b1e3092743c8745399a08fa7df8e40 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-21Merge "Get vnfd parameter file location from config.yaml"Manuel Buil1-4/+4
2017-02-21Wait for flows to appear in all compute nodesGeorge Paraskevopoulos1-16/+18
Right now we check the classification rules only on the first compute node. This leads to race conditions when running the testcases on multiple computes (ie the test fails when a rule is installed in the first compute but not the other[s]) Change-Id: I13cf26201aae185a0a5d1220b38e061d8bd3c766 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-02-20Get vnfd parameter file location from config.yamlGeorge Paraskevopoulos1-4/+4
Change-Id: Ide425e860ad219ec24765905666994390858cfdb Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-02-20Use __name__ on Logger instantiation instead of custom stringsJuan Vidal1-1/+1
Change-Id: Ic68256410b29cf3ba39a10a92d243979ea475220 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-17Introduce new test case: symmetric service chainJuan Vidal1-0/+32
JIRA: SFC-53 The goal is to verify that the traffic traverses the service chain, not only in the uplink (client --> server) direction, but also in the downlink (client <-- server) direction, which is the part that is not currently being covered by other test cases. Change-Id: I198a53e5afe3da1b397cee95627834856498b674 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-17Run sfc_two_chains in multiple topologiesGeorge Paraskevopoulos1-1/+1
JIRA: SFC-63 The test will run in a number of configurations as described in SFC-63. We expect to get decent coverage with these 5 topologies: 1. CLIENT_VNF_SAME_HOST 2. CLIENT_SERVER_SAME_HOST 3. SERVER_VNF_SAME_HOST 4. CLIENT_SERVER_SAME_HOST_SPLIT_VNF 5. CLIENT_SERVER_DIFFERENT_HOST_SPLIT_VNF Change-Id: Iaca75bf180c33e3d22759e4da1ca4897072f68a6 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-02-17Fix topology bugsGeorge Paraskevopoulos1-4/+14
- Fix getting the length of available topologies - Format a correct vnf parameter file Change-Id: I6c3534a67b44be6fcfb09d99856e5c27bcbd2ed1 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2017-02-17Fix check_ssh to allow any number of SFs to be checkedJuan Vidal1-1/+1
Change-Id: Ida31e1e7f1b638f1ba5e851cbdfd0379c0f546d4 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-16Add source port option for netcat utilityJuan Vidal1-10/+22
Change-Id: I3dedc06f0b288684a907df14874f277449c33146 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-16Merge "Bug fix in sfc utils lib"Manuel Buil1-1/+1
2017-02-16Bug fix in sfc utils lib“Manuel Buil”1-1/+1
The command to add route to the VM was wrong Change-Id: If45425a5bdc8ba9d2ecb37dd9914628b6963ed28 Signed-off-by: “Manuel Buil” <mbuil@suse.com>
2017-02-16Merge "Pass availability zone as param on vnf create"Manuel Buil1-0/+18
2017-02-16Fix is_ssh_blocked and is_http_blockedJuan Vidal1-21/+17
This patch fixes JIRA SFC-79 Previously, those functions used regex matching against the command output. Now, the return code from netcat is used. It should be easier and more relieable. Change-Id: I639c64b3fe0a0e3c0b59f73e5615b8737e676849 Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-15Pass availability zone as param on vnf createGeorge Paraskevopoulos1-0/+18
JIRA: SFC-63 JIRA: SFC-73 Instead of changing the vnfd-template file in runtime we can pass the availability zone as a parameter when the vnf is created This enables also the use of topology_shuffler for SFC-63 Change-Id: Ie650e3347e40aee030005b6a2272cae64968d303 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>