Example #1
0
    def setUpClass(cls):

        cls.api_client = super(
                               TestAffinityRules,
                               cls
                               ).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(
                                cls.api_client,
                                cls.services
                            )
        cls.zone = get_zone(
                            cls.api_client,
                            cls.services
                            )
        cls.template = get_template(
                                    cls.api_client,
                                    cls.zone.id,
                                    cls.services["ostype"]
                            )

        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id

        cls.service_offering = ServiceOffering.create(
                                            cls.api_client,
                                            cls.services["service_offering"],
                                            offerha=True
                                            )

        cls.account = Account.create(
                                     cls.api_client,
                                     cls.services["account"],
                                     domainid=cls.domain.id
                                     )
        cls._cleanup = [cls.account]
        return
Example #2
0
    def setUpClass(cls):

        cls.api_client = super(
                               TestVMPlacement,
                               cls
                               ).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(
                                cls.api_client,
                                cls.services
                            )
        cls.zone = get_zone(
                            cls.api_client,
                            cls.services
                            )
        cls.pod = get_pod(
                          cls.api_client,
                          zoneid=cls.zone.id,
                          services=cls.services
                          )
        cls.template = get_template(
                                    cls.api_client,
                                    cls.zone.id,
                                    cls.services["ostype"]
                            )
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id

        cls.service_offering = ServiceOffering.create(
                                            cls.api_client,
                                            cls.services["service_offering"],
                                            offerha=True
                                            )
        cls._cleanup = [
                        cls.service_offering,
                        ]
        return