Exemplo n.º 1
0
 def setUp(self):
     super().setUp()
     self.envs = EnvironmentFactory.create_batch(2)
     self.services = ServiceFactory.create_batch(2)
     ServiceEnvironment.objects.create(service=self.services[0],
                                       environment=self.envs[0])
     self.team = TeamFactory()
     self.profit_center = ProfitCenterFactory()
Exemplo n.º 2
0
    def setUp(self):
        super().setUp()
        self.envs = EnvironmentFactory.create_batch(2)
        self.services = ServiceFactory.create_batch(2)
        self.service_env = []
        for i in range(0, 2):
            self.service_env.append(ServiceEnvironment.objects.create(
                service=self.services[i], environment=self.envs[i]
            ))
        self.service_env[0].service.business_owners = [self.user1]
        self.service_env[0].service.technical_owners = [self.user2]
        self.service_env[0].save()
        self.cloud_provider = CloudProviderFactory(name='openstack')
        self.cloud_flavor = CloudFlavorFactory()
        self.cloud_project = CloudProjectFactory(
            service_env=self.service_env[0]
        )
        self.cloud_host = CloudHostFactory(
            parent=self.cloud_project,
            cloudflavor=self.cloud_flavor
        )
        self.cloud_host2 = CloudHostFactory()

        self.test_cpu = ComponentModel.objects.create(
            name='vcpu1',
            cores=5,
            family='vCPU',
            type=ComponentType.processor,
        )
        self.test_mem = ComponentModel.objects.create(
            name='2000 MiB vMEM',
            size='2000',
            type=ComponentType.memory,
        )
        self.test_disk = ComponentModel.objects.create(
            name='4 GiB vDISK',
            size='4096',
            type=ComponentType.disk,
        )

        VirtualComponent.objects.create(
            base_object=self.cloud_flavor,
            model=self.test_cpu,
        )
        VirtualComponent.objects.create(
            base_object=self.cloud_flavor,
            model=self.test_mem,
        )
        VirtualComponent.objects.create(
            base_object=self.cloud_flavor,
            model=self.test_disk,
        )
Exemplo n.º 3
0
    def setUp(self):
        self.envs = EnvironmentFactory.create_batch(2)
        self.services = ServiceFactory.create_batch(2)
        self.service_env = []
        for i in range(0, 2):
            self.service_env.append(
                ServiceEnvironment.objects.create(service=self.services[i],
                                                  environment=self.envs[i]))

        self.cloud_provider = CloudProviderFactory(name='openstack')
        self.cloud_flavor = CloudFlavorFactory()
        self.cloud_project = CloudProjectFactory()
        self.cloud_host = CloudHostFactory(parent=self.cloud_project)

        self.test_cpu = ComponentModel.objects.create(
            name='vcpu1',
            cores=4,
            family='vCPU',
            type=ComponentType.processor,
        )
        self.test_mem = ComponentModel.objects.create(
            name='1024 MiB vMEM',
            size='1024',
            type=ComponentType.memory,
        )
        self.test_disk = ComponentModel.objects.create(
            name='4 GiB vDISK',
            size='4096',
            type=ComponentType.disk,
        )

        VirtualComponent.objects.create(
            base_object=self.cloud_flavor,
            model=self.test_cpu,
        )
        VirtualComponent.objects.create(
            base_object=self.cloud_flavor,
            model=self.test_mem,
        )
        VirtualComponent.objects.create(
            base_object=self.cloud_flavor,
            model=self.test_disk,
        )
Exemplo n.º 4
0
 def setUp(self):
     super().setUp()
     self.services = ServiceFactory.create_batch(2, active=True)
     self.inactive_services = ServiceFactory.create_batch(1, active=False)