Esempio n. 1
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(
            os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
            globals(),
            [("simpleexampleservice", "simpleexampleservice.xproto"),
             ("kubernetes-service", "kubernetes.xproto")])

        self.MockObjectList = self.unittest_setup["MockObjectList"]
        self.model_accessor = self.unittest_setup["model_accessor"]

        sys.path.append(
            os.path.join(
                os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                "../model_policies"))

        from model_policy_simpleexampleserviceinstance import SimpleExampleServiceInstancePolicy
        self.policy_class = SimpleExampleServiceInstancePolicy

        self.service = SimpleExampleService(service_message="hello",
                                            service_secret="p@ssw0rd")
        self.k8s_service = KubernetesService(id=1111)
        self.k8s_service.get_service_instance_class = MagicMock(
            return_value=KubernetesServiceInstance)
        self.trust_domain = TrustDomain(owner=self.k8s_service,
                                        name="test-trust")
        self.image = Image(name="test-image", tag="1.2", kind="container")
        self.slice = Slice(trust_domain=self.trust_domain,
                           service=self.service,
                           default_image=self.image)
        self.service.slices = self.MockObjectList([self.slice])
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                                                   globals(),
                                                   [("openstack", "openstack.xproto")] )

        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))

        self.model_accessor = self.unittest_setup["model_accessor"]

        from sync_trustdomain import SyncTrustDomain
        self.step_class = SyncTrustDomain

        self.service = OpenStackService()
Esempio n. 3
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(
            os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
            globals(), [("openstack", "openstack.xproto")])

        sys.path.append(
            os.path.join(
                os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                "../steps"))

        from sync_trustdomain import SyncTrustDomain
        self.step_class = SyncTrustDomain

        self.service = OpenStackService()
Esempio n. 4
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                                                   globals(),
                                                   [("openstack", "openstack.xproto")] )

        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))

        self.model_accessor = self.unittest_setup["model_accessor"]

        from sync_slice import SyncSlice
        self.step_class = SyncSlice

        self.service = OpenStackService()
        self.site = Site(name="test-site")
        self.trust_domain = TrustDomain(owner=self.service, name="test-trust")
Esempio n. 5
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(
            os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
            globals(), [("openstack", "openstack.xproto")])

        sys.path.append(
            os.path.join(
                os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                "../steps"))

        from sync_principal import SyncPrincipal
        self.step_class = SyncPrincipal

        self.service = OpenStackService()
        self.trust_domain = TrustDomain(owner=self.service, name="test-trust")
Esempio n. 6
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                                                   globals(),
                                                   [("openstack", "openstack.xproto")] )

        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../pull_steps"))

        from pull_ports import OpenStackPortPullStep
        self.step_class = OpenStackPortPullStep

        self.service = OpenStackService()
        self.site = Site(name="test-site")
        self.trust_domain = TrustDomain(owner=self.service, name="test-trust")
        self.flavor = Flavor(name="test-flavor", backend_handle=1114)
        self.node = Node(name="test-node", backend_handle=1113)
        self.slice = Slice(name="test-slice", trust_domain=self.trust_domain, backend_handle=1112)
        self.image = Image(name="test-image", backend_handle=1111)
        self.net_management = Network(name="management", backend_handle=1115)
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                                                   globals(),
                                                   [("openstack", "openstack.xproto")] )

        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))

        self.model_accessor = self.unittest_setup["model_accessor"]

        from sync_openstackserviceinstance import SyncOpenStackServiceInstance
        self.step_class = SyncOpenStackServiceInstance

        self.service = OpenStackService()
        self.site = Site(name="test-site")
        self.trust_domain = TrustDomain(owner=self.service, name="test-trust")
        self.flavor = Flavor(name="test-flavor", backend_handle=1114)
        self.node = Node(name="test-node", backend_handle=1113)
        self.slice = Slice(name="test-slice", trust_domain=self.trust_domain, backend_handle=1112)
        self.image = Image(name="test-image", backend_handle=1111)
Esempio n. 8
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(
            os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
            globals(), [("openstack", "openstack.xproto")])

        sys.path.append(
            os.path.join(
                os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                "../steps"))

        from sync_openstackserviceinstance import SyncOpenStackServiceInstance
        self.step_class = SyncOpenStackServiceInstance

        self.service = OpenStackService()
        self.site = Site(name="test-site")
        self.trust_domain = TrustDomain(owner=self.service, name="test-trust")
        self.flavor = Flavor(name="test-flavor", backend_handle=1114)
        self.node = Node(name="test-node", backend_handle=1113)
        self.slice = Slice(name="test-slice",
                           trust_domain=self.trust_domain,
                           backend_handle=1112)
        self.image = Image(name="test-image", backend_handle=1111)
Esempio n. 9
0
    def setUp(self):
        self.unittest_setup = setup_sync_unit_test(
            os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
            globals(), [("openstack", "openstack.xproto")])

        sys.path.append(
            os.path.join(
                os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
                "../pull_steps"))

        from pull_ports import OpenStackPortPullStep
        self.step_class = OpenStackPortPullStep

        self.service = OpenStackService()
        self.site = Site(name="test-site")
        self.trust_domain = TrustDomain(owner=self.service, name="test-trust")
        self.flavor = Flavor(name="test-flavor", backend_handle=1114)
        self.node = Node(name="test-node", backend_handle=1113)
        self.slice = Slice(name="test-slice",
                           trust_domain=self.trust_domain,
                           backend_handle=1112)
        self.image = Image(name="test-image", backend_handle=1111)
        self.net_management = Network(name="management", backend_handle=1115)