Ejemplo n.º 1
0
    def setUp(self):
        try:
            super(ClusterTest, self).setUp()
            (self.creds, self.keypair) = self.get_credentials_with_keypair(
                type_of_creds='default')
            (self.cluster_template_client,
             self.keypairs_client) = self.get_clients_with_existing_creds(
                 creds=self.creds,
                 type_of_creds='default',
                 request_type='cluster_template')
            (self.cluster_client,
             _) = self.get_clients_with_existing_creds(creds=self.creds,
                                                       type_of_creds='default',
                                                       request_type='cluster')
            (self.cert_client,
             _) = self.get_clients_with_existing_creds(creds=self.creds,
                                                       type_of_creds='default',
                                                       request_type='cert')
            model = datagen.valid_swarm_cluster_template()
            _, self.cluster_template = self._create_cluster_template(model)

            # NOTE (dimtruck) by default tempest sets timeout to 20 mins.
            # We need more time.
            test_timeout = 1800
            self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
        except Exception:
            self.tearDown()
            raise
Ejemplo n.º 2
0
    def setUp(self):
        try:
            super(ClusterTest, self).setUp()
            (self.creds, self.keypair) = self.get_credentials_with_keypair(
                type_of_creds='default')
            (self.cluster_template_client,
                self.keypairs_client) = self.get_clients_with_existing_creds(
                    creds=self.creds,
                    type_of_creds='default',
                    request_type='cluster_template')
            (self.cluster_client, _) = self.get_clients_with_existing_creds(
                creds=self.creds,
                type_of_creds='default',
                request_type='cluster')
            (self.cert_client, _) = self.get_clients_with_existing_creds(
                creds=self.creds,
                type_of_creds='default',
                request_type='cert')
            model = datagen.valid_swarm_cluster_template()
            _, self.cluster_template = self._create_cluster_template(model)

            # NOTE (dimtruck) by default tempest sets timeout to 20 mins.
            # We need more time.
            test_timeout = 1800
            self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
        except Exception:
            self.tearDown()
            raise
Ejemplo n.º 3
0
    def test_create_get_public_cluster_template(self):
        gen_model = datagen.valid_swarm_cluster_template(is_public=True)
        resp, model = self._create_cluster_template(gen_model)

        resp, model = \
            self.cluster_template_client.get_cluster_template(model.uuid)
        self.assertEqual(200, resp.status)
        self.assertTrue(model.public)
Ejemplo n.º 4
0
    def test_create_get_public_cluster_template(self):
        gen_model = datagen.valid_swarm_cluster_template(is_public=True)
        resp, model = self._create_cluster_template(gen_model)

        resp, model = \
            self.cluster_template_client.get_cluster_template(model.uuid)
        self.assertEqual(200, resp.status)
        self.assertTrue(model.public)
Ejemplo n.º 5
0
 def test_create_get_public_cluster_template(self):
     gen_model = datagen.valid_swarm_cluster_template(is_public=True)
     self.assertRaises(exceptions.Forbidden,
                       self.cluster_template_client.post_cluster_template,
                       gen_model)