Пример #1
0
 def __init__(self, *args, **kwargs):
     super(VPNaasEventHandlerTestCase, self).__init__(*args, **kwargs)
     self.test_dict = vpn_test_data.VPNTestData()
     self.sc = self.test_dict.sc
     self.conf = self.test_dict.conf
     self.handler = vpn.VPNaasEventHandler(self.test_dict.sc,
                                           self.test_dict.drivers)
     self.ev = vpn_test_data.FakeEvent()
     self.rpc_sender = vpn.VpnaasRpcSender(self.sc)
     self.driver = mock.Mock()
Пример #2
0
 def __init__(self, *args, **kwargs):
     super(VpnaasIpsecDriverTestCase, self).__init__(*args, **kwargs)
     self.conf = 'conf'
     self.test_dict = vpn_test_data.VPNTestData()
     self.context = self.test_dict.make_service_context()
     self.plugin_rpc = vpn.VpnaasRpcSender(self.test_dict.sc)
     self.driver = vyos_vpn_driver.VpnaasIpsecDriver(self.conf)
     self.svc_validate = (vyos_vpn_driver.VPNServiceValidator(
         self.plugin_rpc))
     self.resp = mock.Mock()
     self.fake_resp_dict = {'status': True}
Пример #3
0
 def __init__(self, *args, **kwargs):
     super(VpnGenericConfigDriverTestCase, self).__init__(*args, **kwargs)
     self.conf = 'conf'
     self.test_dict = vpn_test_data.VPNTestData()
     self.context = self.test_dict.make_service_context()
     self.plugin_rpc = vpn.VpnaasRpcSender(self.test_dict.sc)
     self.rest_apt = vyos_vpn_driver.RestApi(self.test_dict.vm_mgmt_ip)
     self.driver = vyos_vpn_driver.VpnGenericConfigDriver()
     self.resp = mock.Mock()
     self.fake_resp_dict = {'status': True}
     self.kwargs = self.test_dict.fake_resource_data()
 def __init__(self, *args, **kwargs):
     super(VPNSvcValidatorTestCase, self).__init__(*args, **kwargs)
     self.test_dict = vpn_test_data.VPNTestData()
     self.plugin_rpc = vpn.VpnaasRpcSender(self.test_dict.sc)
     self.valid_obj = vyos_vpn_driver.VPNServiceValidator(self.plugin_rpc)
import mock
from neutron.tests import base
from oslo_serialization import jsonutils
import requests
import six

from gbpservice.contrib.nfp.configurator.agents import vpn
from gbpservice.contrib.nfp.configurator.drivers.base import base_driver
from gbpservice.contrib.nfp.configurator.drivers.vpn.vyos import (
    vyos_vpn_driver)
from gbpservice.contrib.tests.unit.nfp.configurator.test_data import (
    vpn_test_data)

bdobj = base_driver.BaseDriver('conf')
bdobj.register_agent_object_with_driver(
    'agent', vpn.VpnaasRpcSender(vpn_test_data.VPNTestData().sc))


class VpnaasIpsecDriverTestCase(base.BaseTestCase):
    """
    Implements test cases for driver methods
    of vpn.

    """
    def __init__(self, *args, **kwargs):
        super(VpnaasIpsecDriverTestCase, self).__init__(*args, **kwargs)
        self.conf = 'conf'
        self.test_dict = vpn_test_data.VPNTestData()
        self.context = self.test_dict.make_service_context()
        self.headers = self.test_dict.get_header()
        self.plugin_rpc = vpn.VpnaasRpcSender(self.test_dict.sc)