Ejemplo n.º 1
0
    def __init__(self,
                 gbp_resources_info,
                 update_tc_info,
                 common_lib_obj=None):
        """
        Arguments:
            1. gbp_resources_info: (output dict returned by the
                create_gbp_resources of gbp_resource_create.)
            2. update_tc_info: (dictionary)
                {
                    "update_resource_type: rule/prs/node/spec/...,
                    "operation": "add/delete/add_delete/update",
                    "resource": fw/lb/vpn/vpn+lb/prs_allow_rule/
                }
            3. common_lib_obj: Common library object. (optional.)
        """
        self.gbp_resources_info = gbp_resources_info.copy()
        # update action add /delete/ add_delete
        self.operation = update_tc_info.get("operation")
        # gbp resource to be updated
        self.update_resource_type = update_tc_info.get("update_resource_type")
        self.resource = update_tc_info.get("resource")
        # common library object.
        self.common_lib_obj = common_lib_obj
        if not self.common_lib_obj:
            self.common_lib_obj = commonLibrary()

        self.traffic_type = "E-W"
        self.vpn_in_chain = False
        if self.gbp_resources_info.get('remote_resource_info'):
            self.traffic_type = "N-S"
            if self.gbp_resources_info['remote_resource_info'].get('vpn_type'):
                self.vpn_in_chain = True
Ejemplo n.º 2
0
    def __init__(self, lib_obj):
        """Constructor

        Arguments:-
            lib_obj: OpenstackLibrary class object.
        """
        self.os_pub_ip = lib_obj.host_ip
        self.gbp_cleanup_driver = GbpResourceCleanup(self.os_pub_ip)
        self.neutron_cleanup = NeutronCleanup(lib_obj)
        self.lib_obj = lib_obj
        self.common_obj = commonLibrary()
        self.error_msg = ""
Ejemplo n.º 3
0
 def __init__(self, os_pub_ip):
     """
     Argu: os_pub_ip (Openstack Controller public ip.)
     """
     # os public ip
     self.os_pub_ip = os_pub_ip
     # logging object
     self.logger = log.get_atf_logger()
     # commonLibrary object.
     self.common_obj = commonLibrary()
     # creating object of gbp_construct class
     # passing empty token while creating object.
     self.gbp_driver = gbp_construct("", self.os_pub_ip)
Ejemplo n.º 4
0
    def __init__(self):
        """This is the constructor for StressTests class.

        Instance Variables:

        * __e2e_scenario_tcs_range:  Stress test cases number list,
             for End to end scenario test.

        * __services_ha_tcs_range: Stress test cases number list,
             services HA tests.

        * __multichains_tcs_range: Stress test cases number list,
             for multiple chains tests.

        * __gbp_cruds_tcs_range: Stress test cases number list,
             for gbp  rest api validation tests.

        * __common_obj: commonLibrary class object.
        """
        StressTestHelper.__init__(self)

        def xmap_add(num, xlist):
            """Add number to every element of list"""
            return [x + num for x in xlist]

        self.__e2e_scenario_tcs_range =\
            range(1, gbp_config.MAX_INSERTION_TC_NO + 1)
        self.__services_ha_tcs_range = xmap_add(
            self.__e2e_scenario_tcs_range[-1],
            range(1, gbp_config.MAX_SERVICES_HA_TC_NO + 1))
        self.__multichains_tcs_range = xmap_add(
            self.__services_ha_tcs_range[-1],
            range(1,
                  len(gbp_config.multiple_chain_tcs.keys()) + 1))
        self.__gbp_cuds_tcs_range = xmap_add(
            self.__multichains_tcs_range[-1],
            range(1,
                  len(gbp_config.gbp_crud_test_no_to_id_mapping.keys()) + 1))
        self.__total_stress_tcs_range = self.__e2e_scenario_tcs_range +\
            self.__services_ha_tcs_range + self.__multichains_tcs_range +\
            self.__gbp_cuds_tcs_range
        self.__common_obj = commonLibrary()
Ejemplo n.º 5
0
 def __init__(self):
     self.os_host_ip = setup_config.setupInfo['os-controller-node'
                                              ]['pubip']
     self.insertion_tests = InsertionTests()
     self.lib_os_obj = self.insertion_tests.lib_os_obj
     self.common_lib = commonLibrary()
Ejemplo n.º 6
0
 def __init__(self):
     self.os_host_ip = setup_config.setupInfo['os-controller-node']['pubip']
     self.lib_os_obj = OpenStackLibrary(self.os_host_ip)
     self.common_lib = commonLibrary()
Ejemplo n.º 7
0
 def __init__(self):
     self.common_lib = commonLibrary()
     self.func_test = InsertionTests()
     self.lib_os_obj = self.func_test.lib_os_obj
Ejemplo n.º 8
0
# This is to generate diff file
"""
Library to generate and validate the traffic
"""
import sys
import traceback
import time
sys.path.append("../../")
from atf.lib.lib_common import commonLibrary
import atf.config.gbp_config as gbp_config
import atf.config.common_config as common_config
import atf.config.setup_config as setup_config
from atf.lib.trafficgen import Traffic
import atf.lib.nvp_atf_logging as logObj

commonLib = commonLibrary()


#class traffic_generation_validation():
class TrafficGenerationValidation():
    """class having methods to generate and validate traffic"""
    def __init__(self):
        self.log_obj = logObj.get_atf_logger()
        self.traffic_obj = Traffic()
        self.obj_computes = {}
        self.obj_consumers = {}
        self.dump_file_list = []
        # active_standby_status is dictionary provides info about
        # service vms (fw/lb) are active/standby.
        self.active_standby_status = {"FW": {"active": False,
                                             "standby": False},
Ejemplo n.º 9
0
 def __init__(self):
     self.log = logObj.get_atf_logger()
     self.comlib = commonLibrary()
     self.com_config = com_config