def setUpClass():
    runner = citest.base.TestRunner.global_runner()
    scenario = runner.get_shared_data(GoogleServerGroupTestScenario)
    managed_region = runner.bindings['TEST_GCE_REGION']
    title = 'Check Quota for {0}'.format(scenario.__class__.__name__)

    verify_results = gcp.verify_quota(
        title,
        scenario.gcp_observer,
        project_quota=GoogleServerGroupTestScenario.MINIMUM_PROJECT_QUOTA,
        regions=[(managed_region,
                  GoogleServerGroupTestScenario.MINIMUM_REGION_QUOTA)])
    if not verify_results:
      raise RuntimeError('Insufficient Quota: {0}'.format(verify_results))
  def setUpClass():
    runner = citest.base.TestRunner.global_runner()
    scenario = runner.get_shared_data(GoogleServerGroupTestScenario)
    managed_region = scenario.bindings['TEST_GCE_REGION']
    title = 'Check Quota for {0}'.format(scenario.__class__.__name__)

    verify_results = gcp.verify_quota(
        title,
        scenario.gcp_observer,
        project_quota=GoogleServerGroupTestScenario.MINIMUM_PROJECT_QUOTA,
        regions=[(managed_region,
                  GoogleServerGroupTestScenario.MINIMUM_REGION_QUOTA)])
    if not verify_results:
      raise RuntimeError('Insufficient Quota: {0}'.format(verify_results))
    def setUpClass():
        runner = citest.base.TestRunner.global_runner()
        scenario = runner.get_shared_data(BakeAndDeployTestScenario)
        if not scenario.test_google:
            return

        managed_region = scenario.bindings["TEST_GCE_REGION"]
        title = "Check Quota for {0}".format(scenario.__class__.__name__)

        verify_results = gcp.verify_quota(
            title,
            scenario.gcp_observer,
            project_quota=BakeAndDeployTestScenario.MINIMUM_PROJECT_QUOTA,
            regions=[(managed_region,
                      BakeAndDeployTestScenario.MINIMUM_REGION_QUOTA)],
        )
        if not verify_results:
            raise RuntimeError(
                "Insufficient Quota: {0}".format(verify_results))
    def setUpClass(cls):
        runner = citest.base.TestRunner.global_runner()
        scenario = runner.get_shared_data(GoogleHttpLoadBalancerTestScenario)
        bindings = scenario.bindings
        cls.FIRST_CERT = "first-cert-%s" % (bindings["TEST_APP"])
        cls.SECOND_CERT = "second-cert-%s" % (bindings["TEST_APP"])
        cls.UPDATED_HC = "updated-%s" % (bindings["TEST_APP"])
        managed_region = bindings["TEST_GCE_REGION"]
        title = "Check Quota for {0}".format(scenario.__class__.__name__)

        verify_results = gcp.verify_quota(
            title,
            scenario.gcp_observer,
            project_quota=GoogleHttpLoadBalancerTestScenario.
            MINIMUM_PROJECT_QUOTA,
            regions=[(
                managed_region,
                GoogleHttpLoadBalancerTestScenario.MINIMUM_REGION_QUOTA,
            )],
        )
        if not verify_results:
            raise RuntimeError(
                "Insufficient Quota: {0}".format(verify_results))

        # No predicates against this agent, context is empty.
        context = ExecutionContext()
        compute_agent = gcp.GcpComputeAgent.make_agent(
            scopes=SCOPES, credentials_path=bindings["GCE_CREDENTIALS_PATH"])
        compute_agent.invoke_resource(
            context,
            "insert",
            resource_type="sslCertificates",
            project=bindings["GOOGLE_PRIMARY_MANAGED_PROJECT_ID"],
            body=cls.make_ssl_cert(cls.FIRST_CERT),
        )
        compute_agent.invoke_resource(
            context,
            "insert",
            resource_type="sslCertificates",
            project=bindings["GOOGLE_PRIMARY_MANAGED_PROJECT_ID"],
            body=cls.make_ssl_cert(cls.SECOND_CERT),
        )
Exemple #5
0
    def setUpClass(cls):
        runner = citest.base.TestRunner.global_runner()
        bindings = runner.bindings
        cls.FIRST_CERT = 'first-cert-%s' % (bindings['TEST_APP'])
        cls.SECOND_CERT = 'second-cert-%s' % (bindings['TEST_APP'])
        runner = citest.base.TestRunner.global_runner()
        bindings = runner.bindings
        scenario = runner.get_shared_data(GoogleHttpLoadBalancerTestScenario)
        managed_region = runner.bindings['TEST_GCE_REGION']
        title = 'Check Quota for {0}'.format(scenario.__class__.__name__)

        verify_results = gcp.verify_quota(
            title,
            scenario.gcp_observer,
            project_quota=GoogleHttpLoadBalancerTestScenario.
            MINIMUM_PROJECT_QUOTA,
            regions=[(managed_region,
                      GoogleHttpLoadBalancerTestScenario.MINIMUM_REGION_QUOTA)
                     ])
        if not verify_results:
            raise RuntimeError(
                'Insufficient Quota: {0}'.format(verify_results))

        # No predicates against this agent, context is empty.
        context = ExecutionContext()
        compute_agent = (gcp.GcpComputeAgent.make_agent(
            scopes=SCOPES, credentials_path=bindings['GCE_CREDENTIALS_PATH']))
        compute_agent.invoke_resource(
            context,
            'insert',
            resource_type='sslCertificates',
            project=bindings['GOOGLE_PRIMARY_MANAGED_PROJECT_ID'],
            body=cls.make_ssl_cert(cls.FIRST_CERT))
        compute_agent.invoke_resource(
            context,
            'insert',
            resource_type='sslCertificates',
            project=bindings['GOOGLE_PRIMARY_MANAGED_PROJECT_ID'],
            body=cls.make_ssl_cert(cls.SECOND_CERT))
  def setUpClass(cls):
    runner = citest.base.TestRunner.global_runner()
    bindings = runner.bindings
    cls.FIRST_CERT = 'first-cert-%s' % (bindings['TEST_APP'])
    cls.SECOND_CERT = 'second-cert-%s'  % (bindings['TEST_APP'])
    runner = citest.base.TestRunner.global_runner()
    bindings = runner.bindings
    scenario = runner.get_shared_data(GoogleHttpLoadBalancerTestScenario)
    managed_region = runner.bindings['TEST_GCE_REGION']
    title = 'Check Quota for {0}'.format(scenario.__class__.__name__)

    verify_results = gcp.verify_quota(
      title,
      scenario.gcp_observer,
      project_quota=GoogleHttpLoadBalancerTestScenario.MINIMUM_PROJECT_QUOTA,
      regions=[(managed_region,
                GoogleHttpLoadBalancerTestScenario.MINIMUM_REGION_QUOTA)]
    )
    if not verify_results:
      raise RuntimeError('Insufficient Quota: {0}'.format(verify_results))

    # No predicates against this agent, context is empty.
    context = ExecutionContext()
    compute_agent = (
      gcp.GcpComputeAgent
      .make_agent(scopes=SCOPES,
                  credentials_path=bindings['GCE_CREDENTIALS_PATH']))
    compute_agent.invoke_resource(context,
                                  'insert',
                                  resource_type='sslCertificates',
                                  project=bindings['GOOGLE_PRIMARY_MANAGED_PROJECT_ID'],
                                  body=cls.make_ssl_cert(cls.FIRST_CERT))
    compute_agent.invoke_resource(context,
                                  'insert',
                                  resource_type='sslCertificates',
                                  project=bindings['GOOGLE_PRIMARY_MANAGED_PROJECT_ID'],
                                  body=cls.make_ssl_cert(cls.SECOND_CERT))