aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/lib/openstack_utils.py
AgeCommit message (Collapse)AuthorFilesLines
2019-03-22Add new methods to openstack_utilsVenkata Harshavardhan Reddy Allu1-0/+17
When we use OSM as MANO_COMPONENT, we don't have methods to retrieve the object instances of ports and VMs. So, we need these methods to gather details of a : - VM using the 'id' get_instance(id) - port using their 'ip_address' get_port_by_ip(ip_address) Change-Id: Ica45bf49dddb38a3811b049d67c363ac606fde7a Signed-off-by: Venkata Harshavardhan Reddy Allu <venkataharshavardhan_ven@srmuniv.edu.in>
2019-03-21Flake8 fixesVenkata Harshavardhan Reddy Allu1-2/+4
Change-Id: Ia0012ebb6af1faa8028b45545cd1f93ea5ed22f0 Signed-off-by: Venkata Harshavardhan Reddy Allu <venkataharshavardhan_ven@srmuniv.edu.in>
2019-01-25Fix Two Chains Test and Enabled all Testcasesgvrangan1-0/+57
- Method added to support Port Chain update - Used the new method to modify the test as follows - Create two Port Chains (one VNF per chain) - Block ssh in one vnf and http in the other - Test communication - Swap the flow classifiers in the chains so that ssh packets are sent to vnf where http is blocked and vice versa - Fix extracting odl username/password from ml2_conf - Checking flow classifiers are implemented - Fixed odl cleanup Change-Id: I1f0f3a3b829d6c73d1bb1a774ebf3484912b84b7 Signed-off-by: gvrangan <venkatrangang@hcl.com>
2019-01-21Simplify deletion test and fix unittestManuel Buil1-2/+1
Removing the port groups when deleting the first chain simplifies things because we don't need port_groups to be a variable of the SfcCommonTestCase class There were also some missing unittest Change-Id: I6ae780bdc72116907a9e6037571c29f28a6ba334 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-11-26Migrate SNAPS to Openstack-SDKNikos Mimigiannis1-136/+184
JIRA: SFC-137 This patch replaces SNAPS library with openstack_SDK library for TCs with mano component: no-mano Change-Id: I99b9a5f54a273f61ecff05a11616440d5e85e55b Signed-off-by: Nikos Mimigiannis <nmimi@intracom-telecom.com>
2018-11-06Avoid race conditionsManuel Buil1-0/+17
Sometimes the port pair group gets created before port pair was committed in openstack. Before creating the port pair group, we check that the port pair is already listed by openstack Change-Id: Icfd23521859fc5d4e6bb6745be80f79bf9e31a0c Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-10-26Add a bit more data to the logging messageManuel Buil1-2/+2
In case of failures, it is hard to understand for what vnf the port pair was being created when things went wrong Change-Id: I1cfa2553318d910535d45910b2a46d75b2f7926a Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-09-11Use block=True to avoid race conditionsManuel Buil1-1/+1
If we do things asynchronously, the instance might not be ready and the information we get is not complete (e.g. port missing). Using block=True fixes the problem Change-Id: I9f90f52656553b8da8697477250ed631be884196 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-09-03Remove port security from vnfs when no-manoManuel Buil1-9/+16
If the ports have security enabled, the traffic is dropped due to the anti-spoofing Change-Id: I6fbc63a3d959d9d55dfd1d64e12e1d0e7ec48bcb Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-08-31Decouple tacker from testsManuel Buil1-6/+128
Support n-sfc too and abstract a bit the MANO layer so that other MANO components can be inserted into the test Change-Id: I3fb59fbf40b4207bf1721092cd8ff0559e1d9d90 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-07-19Added parentheses in 'openstack_utils.py' line#476Venkata Harshavardhan Reddy Allu1-1/+1
Parentheses were added around the arguments in line#476 for proper formatting the Exception message in line#475 Change-Id: I3b2233aea10ff5afd23da00a837b976456274a51 Signed-off-by: Venkata Harshavardhan Reddy Allu <venkataharshavardhan_ven@srmuniv.edu.in>
2018-06-04Provide support for local imagesManuel Buil1-2/+13
There might be cases where we want to test local images and the image location in config.yml is locally Change-Id: I29f115de5c80db187ecc2b260c386b377fafd6d2 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-06-01Fix the logging to be compatible with functestPanagiotis Karalis1-2/+3
In order to collect logs from SFC test scenarios running through functest framework (mainly for troubleshooting purposes), the logging mechanism has been updated accordingly. JIRA: SFC-125 Change-Id: Ide7c32519afa6ece299d0ac1dcb168609a2e3945 Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
2018-05-21Improve logging and unify how to read from yamlManuel Buil1-4/+6
vnffgd and vnfd are being parsed in different ways, we should parse them in the same way. We could do it directly with safe_load, however, the returned object is not easy to read. If we use read() instead, the resturned object is easy to read/log. Therefore, this patch combines both options Change-Id: I3416933801569a6f57962cd9906726229923136d Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-05-09Add more logs to the codeManuel Buil1-1/+11
It is hard to understand what is going on in the SFC executions Change-Id: I5c9688e68b03c59d6d39290faee8683513a60440 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-05-03Bug fix: Use opnfv.logger objectManuel Buil1-11/+3
JIRA: SFC-125 If we don't use the opnfv.logger from functest, logs are not printed when exeucting tests through the functest framework Change-Id: I6d58ff3977fd94221720eea978e0efde07a576a2 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-04-18Track the indirectly created security groupsManuel Buil1-1/+10
networking-odl creates a security group when creating a router. This security group is not tracked by SNAPs and thus it never gets removed when running the clean up. We need this workaround until the following bug is fixed: https://bugs.launchpad.net/networking-odl/+bug/1763705 Change-Id: I15b939609e815f24ef0c1dcc0aeb9f4471f351f0 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-04-04Update symmetric chain test caseJaime Caamaño Ruiz1-34/+91
Update the symmetric chain test case aligning it with updates available from ODL Oxygen: - ODL networking-sfc implementation now supports symmetric paths. It is no longer needed to configure the ACL or chain directly through the ODL rest api. It can now be fully relied on tacker for this. - ODL networking-sfc implementation now supports different ingress and egress ports for port pairs. The test case exercises this by setting up a VNF with two distinct ports. Note that this requires an updated VNF image that supports two nics and bundles a vxlan_tool capable of using them. Change-Id: Ie711abb93109943dcbf699ece7b2b570500a3711 Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
2018-04-03Fix flake8 problemsManuel Buil1-1/+1
There was a bug in releng and pylint was not ran, some issues got merged in master because of that Change-Id: Icf3fa882f4f2b0593fa0b85edce46e49dcc303c9 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-03-22Fix tacker resource collection requestJaime Caamaño Ruiz1-6/+6
Looks like using tacker_client.get to request a resource collection causes connection drops and subsequent requests to fail, probably because of incomplete pagination handling. Use tacker_client.list instead. Change-Id: I79ba39759b61f57774e65b5e49686edb6bf05c13 Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
2018-03-11Remove SNAPs deprecated methodManuel Buil1-4/+3
SNAPs is not supporting get_vm_info() anymore, we should remove it from our lib https://gerrit.opnfv.org/gerrit/#/c/53263/4 Change-Id: Idad1bb60b86c45256bb0a95b6c554e83e6bfae35 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-03-05Update SNAPs usage of libraryManuel Buil1-2/+7
JIRA:SFC-120 Snaps updated two methods which now require more parameters: https://github.com/opnfv/snaps/blob/master/snaps/openstack/utils/heat_utils.py#L260 https://github.com/opnfv/snaps/blob/master/snaps/openstack/create_instance.py#L781 Change-Id: I164c51298afd7b80ee88312f3a09abe7f09282a0 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-03-02Remove glance_utils as we don't use it anymoreManuel Buil1-2/+1
Change-Id: I44d0dd4fdabd38f09e6113c28668f11a40c6ba86 Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-02-28Bug fix: Problem with SNAPs integrationManuel Buil1-4/+10
SNAPs changed the API: https://github.com/opnfv/snaps/commit/c711acf8ae3e4ad6f746500747857bcc9fd6f7be#diff-0b922a3e087121238d5a8b08ef5b894aR480 Now we require to pass keystone client to get the neutron port Change-Id: I93fa4b127255c1a078aa3644773b7c8b886cea6d Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-02-22Switch from CONST to CONFCédric Ollivier1-3/+3
CONST is not the right Functest object to get config data. It also updates the way to get constants as proposed by Functest [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/52389/ Depends-On: Ie23c0ef90efc839d60f0f3a9754c58746b1f3a00 Change-Id: I6cfa832466dcefd737314633d807512e46267a69 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-21Switch to os.environ for getting OpenStack env varsCédric Ollivier1-4/+4
CONST shouldn't be selected to get env vars. Now it may raise KeyErrors if env is not well configured. Change-Id: I5e3f525640809778c5349fdc1c3796227894d0cd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-21Take into account last Functest config updatesCédric Ollivier1-2/+2
It follows the next changes (Functest) which renamed the related config entry [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/51283/5/functest/ci/config_functest.yaml Change-Id: Ieae5baff13bb70aa35b01c2358ab4865cdb9dfb0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-29Fix problem to fetch the compute name of client VMManuel Buil1-2/+9
When migrating to SNAPs a bug was introduced and could be seen in logs as: Error when waiting for classification rules: 'module' object has no attribute 'get_compute_client' The cause is that get_compute_client is not a global function anymore but a method inside a class. Besides, due to SNAPs, we need to fetch the compute name in another way Change-Id: I32007c83894281ba9514a121b7939b5bfe52f4bc Signed-off-by: Manuel Buil <mbuil@suse.com>
2018-01-26Fix cleanup functionManuel Buil1-0/+1
A floating ip remains when executing the clean up function. That floating ip belongs to the Tacker VNF and thus we should add that creator to the list Change-Id: Ic15574bf93f30a26f81a4944d742307dda4bfe6d Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-12-21Migrate to SNAPs openstack libraryManuel Buil1-176/+187
Functest is deprecating its openstack library which we were using extensively We need then to move to an alternative and the best appears to be SNAPs Change-Id: Icaa0b9f1ec580545b9d0faa88be2080a310deaf7 Signed-off-by: Manuel Buil<mbuil@suse.com>
2017-12-12Clean up our utils.pyManuel Buil1-0/+616
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>