Exemple #1
0
    def test_deployment_update_several(self):
        # Create a deployment and update it
        deploy_one = db.deployment_create({})
        self.assertEqual(deploy_one['config'], {})
        update_deploy_one = db.deployment_update(
            deploy_one['uuid'],
            {'config': {
                'opt1': 'val1'
            }},
        )
        self.assertEqual(update_deploy_one['uuid'], deploy_one['uuid'])
        self.assertEqual(update_deploy_one['config'], {'opt1': 'val1'})
        get_deploy_one = db.deployment_get(deploy_one['uuid'])
        self.assertEqual(get_deploy_one['uuid'], deploy_one['uuid'])
        self.assertEqual(get_deploy_one['config'], {'opt1': 'val1'})

        # Create another deployment
        deploy_two = db.deployment_create({})
        update_deploy_two = db.deployment_update(
            deploy_two['uuid'],
            {'config': {
                'opt2': 'val2'
            }},
        )
        self.assertEqual(update_deploy_two['uuid'], deploy_two['uuid'])
        self.assertEqual(update_deploy_two['config'], {'opt2': 'val2'})
        get_deploy_one_again = db.deployment_get(deploy_one['uuid'])
        self.assertEqual(get_deploy_one_again['uuid'], deploy_one['uuid'])
        self.assertEqual(get_deploy_one_again['config'], {'opt1': 'val1'})
Exemple #2
0
 def test_deployment_delete(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({})
     db.deployment_delete(deploy_two['uuid'])
     deploys = db.deployment_list()
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]['uuid'], deploy_one['uuid'])
Exemple #3
0
    def test_deployment_update_several(self):
        # Create a deployment and update it
        deploy_one = db.deployment_create({})
        self.assertEqual(deploy_one['config'], {})
        update_deploy_one = db.deployment_update(
            deploy_one['uuid'],
            {'config': {'opt1': 'val1'}},
        )
        self.assertEqual(update_deploy_one['uuid'], deploy_one['uuid'])
        self.assertEqual(update_deploy_one['config'], {'opt1': 'val1'})
        get_deploy_one = db.deployment_get(deploy_one['uuid'])
        self.assertEqual(get_deploy_one['uuid'], deploy_one['uuid'])
        self.assertEqual(get_deploy_one['config'], {'opt1': 'val1'})

        # Create another deployment
        deploy_two = db.deployment_create({})
        update_deploy_two = db.deployment_update(
            deploy_two['uuid'],
            {'config': {'opt2': 'val2'}},
        )
        self.assertEqual(update_deploy_two['uuid'], deploy_two['uuid'])
        self.assertEqual(update_deploy_two['config'], {'opt2': 'val2'})
        get_deploy_one_again = db.deployment_get(deploy_one['uuid'])
        self.assertEqual(get_deploy_one_again['uuid'], deploy_one['uuid'])
        self.assertEqual(get_deploy_one_again['config'], {'opt1': 'val1'})
Exemple #4
0
 def test_deployment_delete(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({})
     db.deployment_delete(deploy_two['uuid'])
     deploys = db.deployment_list()
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]['uuid'], deploy_one['uuid'])
Exemple #5
0
    def test_deployment_update_several(self):
        # Create a deployment and update it
        deploy_one = db.deployment_create({})
        self.assertEqual(deploy_one["config"], {})
        update_deploy_one = db.deployment_update(deploy_one["uuid"],
                                                 {"config": {
                                                     "opt1": "val1"
                                                 }})
        self.assertEqual(update_deploy_one["uuid"], deploy_one["uuid"])
        self.assertEqual(update_deploy_one["config"], {"opt1": "val1"})
        get_deploy_one = db.deployment_get(deploy_one["uuid"])
        self.assertEqual(get_deploy_one["uuid"], deploy_one["uuid"])
        self.assertEqual(get_deploy_one["config"], {"opt1": "val1"})

        # Create another deployment
        deploy_two = db.deployment_create({})
        update_deploy_two = db.deployment_update(deploy_two["uuid"],
                                                 {"config": {
                                                     "opt2": "val2"
                                                 }})
        self.assertEqual(update_deploy_two["uuid"], deploy_two["uuid"])
        self.assertEqual(update_deploy_two["config"], {"opt2": "val2"})
        get_deploy_one_again = db.deployment_get(deploy_one["uuid"])
        self.assertEqual(get_deploy_one_again["uuid"], deploy_one["uuid"])
        self.assertEqual(get_deploy_one_again["config"], {"opt1": "val1"})
Exemple #6
0
 def test_deployment_get(self):
     deploy_one = db.deployment_create({"config": {"opt1": "val1"}})
     deploy_two = db.deployment_create({"config": {"opt2": "val2"}})
     get_deploy_one = db.deployment_get(deploy_one["uuid"])
     get_deploy_two = db.deployment_get(deploy_two["uuid"])
     self.assertNotEqual(get_deploy_one["uuid"], get_deploy_two["uuid"])
     self.assertEqual(get_deploy_one["config"], {"opt1": "val1"})
     self.assertEqual(get_deploy_two["config"], {"opt2": "val2"})
Exemple #7
0
 def test_deployment_list_parent(self):
     deploy = db.deployment_create({})
     subdeploy1 = db.deployment_create({'parent_uuid': deploy.uuid})
     subdeploy2 = db.deployment_create({'parent_uuid': deploy.uuid})
     self.assertEqual([deploy.uuid], [d.uuid for d in db.deployment_list()])
     subdeploys = db.deployment_list(parent_uuid=deploy.uuid)
     self.assertEqual(set([subdeploy1.uuid, subdeploy2.uuid]),
                      set([d.uuid for d in subdeploys]))
Exemple #8
0
 def test_deployment_get(self):
     deploy_one = db.deployment_create({'config': {'opt1': 'val1'}})
     deploy_two = db.deployment_create({'config': {'opt2': 'val2'}})
     get_deploy_one = db.deployment_get(deploy_one['uuid'])
     get_deploy_two = db.deployment_get(deploy_two['uuid'])
     self.assertNotEqual(get_deploy_one['uuid'], get_deploy_two['uuid'])
     self.assertEqual(get_deploy_one['config'], {'opt1': 'val1'})
     self.assertEqual(get_deploy_two['config'], {'opt2': 'val2'})
Exemple #9
0
 def test_deployment_get(self):
     deploy_one = db.deployment_create({'config': {'opt1': 'val1'}})
     deploy_two = db.deployment_create({'config': {'opt2': 'val2'}})
     get_deploy_one = db.deployment_get(deploy_one['uuid'])
     get_deploy_two = db.deployment_get(deploy_two['uuid'])
     self.assertNotEqual(get_deploy_one['uuid'], get_deploy_two['uuid'])
     self.assertEqual(get_deploy_one['config'], {'opt1': 'val1'})
     self.assertEqual(get_deploy_two['config'], {'opt2': 'val2'})
Exemple #10
0
 def test_deployment_list_parent(self):
     deploy = db.deployment_create({})
     subdeploy1 = db.deployment_create({'parent_uuid': deploy.uuid})
     subdeploy2 = db.deployment_create({'parent_uuid': deploy.uuid})
     self.assertEqual([deploy.uuid], [d.uuid for d in db.deployment_list()])
     subdeploys = db.deployment_list(parent_uuid=deploy.uuid)
     self.assertEqual(set([subdeploy1.uuid, subdeploy2.uuid]),
                      set([d.uuid for d in subdeploys]))
Exemple #11
0
 def test_deployment_get(self):
     deploy_one = db.deployment_create({"config": {"opt1": "val1"}})
     deploy_two = db.deployment_create({"config": {"opt2": "val2"}})
     get_deploy_one = db.deployment_get(deploy_one["uuid"])
     get_deploy_two = db.deployment_get(deploy_two["uuid"])
     self.assertNotEqual(get_deploy_one["uuid"], get_deploy_two["uuid"])
     self.assertEqual(get_deploy_one["config"], {"opt1": "val1"})
     self.assertEqual(get_deploy_two["config"], {"opt2": "val2"})
Exemple #12
0
 def test_get_all(self):
     deployment0 = db.deployment_create({})
     deployment1 = db.deployment_create({})
     res0 = db.resource_create({"deployment_uuid": deployment0["uuid"]})
     res1 = db.resource_create({"deployment_uuid": deployment1["uuid"]})
     res2 = db.resource_create({"deployment_uuid": deployment1["uuid"]})
     resources = db.resource_get_all(deployment1["uuid"])
     self.assertEqual(sorted([res1["id"], res2["id"]]),
                      sorted([r["id"] for r in resources]))
     resources = db.resource_get_all(deployment0["uuid"])
     self.assertEqual(len(resources), 1)
     self.assertEqual(res0["id"], resources[0]["id"])
Exemple #13
0
 def test_get_all(self):
     deployment0 = db.deployment_create({})
     deployment1 = db.deployment_create({})
     res0 = db.resource_create({'deployment_uuid': deployment0['uuid']})
     res1 = db.resource_create({'deployment_uuid': deployment1['uuid']})
     res2 = db.resource_create({'deployment_uuid': deployment1['uuid']})
     resources = db.resource_get_all(deployment1['uuid'])
     self.assertEqual(sorted([res1['id'], res2['id']]),
                      sorted([r['id'] for r in resources]))
     resources = db.resource_get_all(deployment0['uuid'])
     self.assertEqual(len(resources), 1)
     self.assertEqual(res0['id'], resources[0]['id'])
Exemple #14
0
 def test_get_all(self):
     deployment0 = db.deployment_create({})
     deployment1 = db.deployment_create({})
     res0 = db.resource_create({'deployment_uuid': deployment0['uuid']})
     res1 = db.resource_create({'deployment_uuid': deployment1['uuid']})
     res2 = db.resource_create({'deployment_uuid': deployment1['uuid']})
     resources = db.resource_get_all(deployment1['uuid'])
     self.assertEqual(sorted([res1['id'], res2['id']]),
                      sorted([r['id'] for r in resources]))
     resources = db.resource_get_all(deployment0['uuid'])
     self.assertEqual(len(resources), 1)
     self.assertEqual(res0['id'], resources[0]['id'])
Exemple #15
0
 def test_get_all(self):
     deployment0 = db.deployment_create({})
     deployment1 = db.deployment_create({})
     res0 = db.resource_create({"deployment_uuid": deployment0["uuid"]})
     res1 = db.resource_create({"deployment_uuid": deployment1["uuid"]})
     res2 = db.resource_create({"deployment_uuid": deployment1["uuid"]})
     resources = db.resource_get_all(deployment1["uuid"])
     self.assertEqual(sorted([res1["id"], res2["id"]]),
                      sorted([r["id"] for r in resources]))
     resources = db.resource_get_all(deployment0["uuid"])
     self.assertEqual(len(resources), 1)
     self.assertEqual(res0["id"], resources[0]["id"])
Exemple #16
0
 def test_deployment_list_with_status(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({
         'config': {},
         'status': consts.DeployStatus.DEPLOY_FAILED,
     })
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_INIT)
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]['uuid'], deploy_one['uuid'])
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_FAILED)
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]['uuid'], deploy_two['uuid'])
     deploys = db.deployment_list(
         status=consts.DeployStatus.DEPLOY_FINISHED)
     self.assertEqual(len(deploys), 0)
Exemple #17
0
 def test_deployment_create(self):
     deploy = db.deployment_create({'config': {'opt': 'val'}})
     deploys = db.deployment_list()
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploy['uuid'], deploys[0]['uuid'])
     self.assertEqual(deploy['status'], consts.DeployStatus.DEPLOY_INIT)
     self.assertEqual(deploy['config'], {'opt': 'val'})
Exemple #18
0
 def test_deployment_create(self):
     deploy = db.deployment_create({"config": {"opt": "val"}})
     deploys = db.deployment_list()
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploy["uuid"], deploys[0]["uuid"])
     self.assertEqual(deploy["status"], consts.DeployStatus.DEPLOY_INIT)
     self.assertEqual(deploy["config"], {"opt": "val"})
Exemple #19
0
 def test_deployment_create(self):
     deploy = db.deployment_create({'config': {'opt': 'val'}})
     deploys = db.deployment_list()
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploy['uuid'], deploys[0]['uuid'])
     self.assertEqual(deploy['status'], consts.DeployStatus.DEPLOY_INIT)
     self.assertEqual(deploy['config'], {'opt': 'val'})
Exemple #20
0
 def test_deployment_create(self):
     deploy = db.deployment_create({"config": {"opt": "val"}})
     deploys = db.deployment_list()
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploy["uuid"], deploys[0]["uuid"])
     self.assertEqual(deploy["status"], consts.DeployStatus.DEPLOY_INIT)
     self.assertEqual(deploy["config"], {"opt": "val"})
Exemple #21
0
 def test_deployment_update(self):
     deploy = db.deployment_create({})
     self.assertEqual(deploy['config'], {})
     update_deploy = db.deployment_update(deploy['uuid'],
                                          {'config': {'opt': 'val'}})
     self.assertEqual(update_deploy['uuid'], deploy['uuid'])
     self.assertEqual(update_deploy['config'], {'opt': 'val'})
     get_deploy = db.deployment_get(deploy['uuid'])
     self.assertEqual(get_deploy['uuid'], deploy['uuid'])
     self.assertEqual(get_deploy['config'], {'opt': 'val'})
Exemple #22
0
 def test_deployment_list_with_status_and_name(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({
         'config': {},
         'status': consts.DeployStatus.DEPLOY_FAILED,
     })
     deploy_three = db.deployment_create({'name': 'deployment_name'})
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_INIT)
     self.assertEqual(len(deploys), 2)
     self.assertEqual(deploys[0]['uuid'], deploy_one['uuid'])
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_FAILED)
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]['uuid'], deploy_two['uuid'])
     deploys = db.deployment_list(
         status=consts.DeployStatus.DEPLOY_FINISHED)
     self.assertEqual(len(deploys), 0)
     deploys = db.deployment_list(name='deployment_name')
     self.assertEqual(deploys[0]['uuid'], deploy_three['uuid'])
     self.assertEqual(len(deploys), 1)
Exemple #23
0
 def test_deployment_update(self):
     deploy = db.deployment_create({})
     self.assertEqual(deploy["config"], {})
     update_deploy = db.deployment_update(deploy["uuid"],
                                          {"config": {"opt": "val"}})
     self.assertEqual(update_deploy["uuid"], deploy["uuid"])
     self.assertEqual(update_deploy["config"], {"opt": "val"})
     get_deploy = db.deployment_get(deploy["uuid"])
     self.assertEqual(get_deploy["uuid"], deploy["uuid"])
     self.assertEqual(get_deploy["config"], {"opt": "val"})
Exemple #24
0
 def test_deployment_update(self):
     deploy = db.deployment_create({})
     self.assertEqual(deploy['config'], {})
     update_deploy = db.deployment_update(deploy['uuid'],
                                          {'config': {'opt': 'val'}})
     self.assertEqual(update_deploy['uuid'], deploy['uuid'])
     self.assertEqual(update_deploy['config'], {'opt': 'val'})
     get_deploy = db.deployment_get(deploy['uuid'])
     self.assertEqual(get_deploy['uuid'], deploy['uuid'])
     self.assertEqual(get_deploy['config'], {'opt': 'val'})
Exemple #25
0
    def test_deployment_create_several(self):
        # Create a deployment
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 0)
        deploy_one = db.deployment_create({"config": {"opt1": "val1"}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 1)
        self.assertEqual(deploy_one["uuid"], deploys[0]["uuid"])
        self.assertEqual(deploy_one["status"], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_one["config"], {"opt1": "val1"})

        # Create another deployment and sure that they are different
        deploy_two = db.deployment_create({"config": {"opt2": "val2"}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 2)
        self.assertEqual(set([deploy_one["uuid"], deploy_two["uuid"]]),
                         set([deploy["uuid"] for deploy in deploys]))
        self.assertNotEqual(deploy_one["uuid"], deploy_two["uuid"])
        self.assertEqual(deploy_two["status"], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_two["config"], {"opt2": "val2"})
Exemple #26
0
    def test_deployment_create_several(self):
        # Create a deployment
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 0)
        deploy_one = db.deployment_create({"config": {"opt1": "val1"}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 1)
        self.assertEqual(deploy_one["uuid"], deploys[0]["uuid"])
        self.assertEqual(deploy_one["status"], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_one["config"], {"opt1": "val1"})

        # Create another deployment and sure that they are different
        deploy_two = db.deployment_create({"config": {"opt2": "val2"}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 2)
        self.assertEqual(set([deploy_one["uuid"], deploy_two["uuid"]]),
                         set([deploy["uuid"] for deploy in deploys]))
        self.assertNotEqual(deploy_one["uuid"], deploy_two["uuid"])
        self.assertEqual(deploy_two["status"], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_two["config"], {"opt2": "val2"})
Exemple #27
0
    def test_deployment_create_several(self):
        # Create a deployment
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 0)
        deploy_one = db.deployment_create({'config': {'opt1': 'val1'}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 1)
        self.assertEqual(deploy_one['uuid'], deploys[0]['uuid'])
        self.assertEqual(deploy_one['status'], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_one['config'], {'opt1': 'val1'})

        # Create another deployment and sure that they are different
        deploy_two = db.deployment_create({'config': {'opt2': 'val2'}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 2)
        self.assertEqual([deploy_one['uuid'], deploy_two['uuid']],
                         [deploy['uuid'] for deploy in deploys])
        self.assertNotEqual(deploy_one['uuid'], deploy_two['uuid'])
        self.assertEqual(deploy_two['status'], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_two['config'], {'opt2': 'val2'})
Exemple #28
0
 def test_deployment_list_with_status_and_name(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({
         "config": {},
         "status": consts.DeployStatus.DEPLOY_FAILED,
     })
     deploy_three = db.deployment_create({"name": "deployment_name"})
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_INIT)
     deploys.sort(key=lambda x: x["id"])
     self.assertEqual(len(deploys), 2)
     self.assertEqual(deploys[0]["uuid"], deploy_one["uuid"])
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_FAILED)
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]["uuid"], deploy_two["uuid"])
     deploys = db.deployment_list(
         status=consts.DeployStatus.DEPLOY_FINISHED)
     self.assertEqual(len(deploys), 0)
     deploys = db.deployment_list(name="deployment_name")
     self.assertEqual(deploys[0]["uuid"], deploy_three["uuid"])
     self.assertEqual(len(deploys), 1)
Exemple #29
0
    def test_deployment_create_several(self):
        # Create a deployment
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 0)
        deploy_one = db.deployment_create({'config': {'opt1': 'val1'}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 1)
        self.assertEqual(deploy_one['uuid'], deploys[0]['uuid'])
        self.assertEqual(deploy_one['status'], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_one['config'], {'opt1': 'val1'})

        # Create another deployment and sure that they are different
        deploy_two = db.deployment_create({'config': {'opt2': 'val2'}})
        deploys = db.deployment_list()
        self.assertEqual(len(deploys), 2)
        self.assertEqual([deploy_one['uuid'], deploy_two['uuid']],
                         [deploy['uuid'] for deploy in deploys])
        self.assertNotEqual(deploy_one['uuid'], deploy_two['uuid'])
        self.assertEqual(deploy_two['status'], consts.DeployStatus.DEPLOY_INIT)
        self.assertEqual(deploy_two['config'], {'opt2': 'val2'})
Exemple #30
0
    def test_deployment_update_several(self):
        # Create a deployment and update it
        deploy_one = db.deployment_create({})
        self.assertEqual(deploy_one["config"], {})
        update_deploy_one = db.deployment_update(
            deploy_one["uuid"], {"config": {"opt1": "val1"}})
        self.assertEqual(update_deploy_one["uuid"], deploy_one["uuid"])
        self.assertEqual(update_deploy_one["config"], {"opt1": "val1"})
        get_deploy_one = db.deployment_get(deploy_one["uuid"])
        self.assertEqual(get_deploy_one["uuid"], deploy_one["uuid"])
        self.assertEqual(get_deploy_one["config"], {"opt1": "val1"})

        # Create another deployment
        deploy_two = db.deployment_create({})
        update_deploy_two = db.deployment_update(
            deploy_two["uuid"], {"config": {"opt2": "val2"}})
        self.assertEqual(update_deploy_two["uuid"], deploy_two["uuid"])
        self.assertEqual(update_deploy_two["config"], {"opt2": "val2"})
        get_deploy_one_again = db.deployment_get(deploy_one["uuid"])
        self.assertEqual(get_deploy_one_again["uuid"], deploy_one["uuid"])
        self.assertEqual(get_deploy_one_again["config"], {"opt1": "val1"})
Exemple #31
0
 def test_deployment_list_with_status_and_name(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({
         "config": {},
         "status":
         consts.DeployStatus.DEPLOY_FAILED,
     })
     deploy_three = db.deployment_create({"name": "deployment_name"})
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_INIT)
     deploys.sort(key=lambda x: x["id"])
     self.assertEqual(len(deploys), 2)
     self.assertEqual(deploys[0]["uuid"], deploy_one["uuid"])
     deploys = db.deployment_list(status=consts.DeployStatus.DEPLOY_FAILED)
     self.assertEqual(len(deploys), 1)
     self.assertEqual(deploys[0]["uuid"], deploy_two["uuid"])
     deploys = db.deployment_list(
         status=consts.DeployStatus.DEPLOY_FINISHED)
     self.assertEqual(len(deploys), 0)
     deploys = db.deployment_list(name="deployment_name")
     self.assertEqual(deploys[0]["uuid"], deploy_three["uuid"])
     self.assertEqual(len(deploys), 1)
Exemple #32
0
 def test_deployment_update(self):
     deploy = db.deployment_create({})
     self.assertEqual(deploy["config"], {})
     update_deploy = db.deployment_update(deploy["uuid"],
                                          {"config": {
                                              "opt": "val"
                                          }})
     self.assertEqual(update_deploy["uuid"], deploy["uuid"])
     self.assertEqual(update_deploy["config"], {"opt": "val"})
     get_deploy = db.deployment_get(deploy["uuid"])
     self.assertEqual(get_deploy["uuid"], deploy["uuid"])
     self.assertEqual(get_deploy["config"], {"opt": "val"})
Exemple #33
0
 def test_create(self):
     deployment = db.deployment_create({})
     resource = db.resource_create({
         'deployment_uuid': deployment['uuid'],
         'provider_name': 'fakeprovider',
         'type': 'faketype',
     })
     resources = db.resource_get_all(deployment['uuid'])
     self.assertTrue(resource['id'])
     self.assertEqual(len(resources), 1)
     self.assertTrue(resource['id'], resources[0]['id'])
     self.assertEqual(resource['deployment_uuid'], deployment['uuid'])
     self.assertEqual(resource['provider_name'], 'fakeprovider')
     self.assertEqual(resource['type'], 'faketype')
Exemple #34
0
 def test_create(self):
     deployment = db.deployment_create({})
     resource = db.resource_create({
         "deployment_uuid": deployment["uuid"],
         "provider_name": "fakeprovider",
         "type": "faketype",
     })
     resources = db.resource_get_all(deployment["uuid"])
     self.assertTrue(resource["id"])
     self.assertEqual(len(resources), 1)
     self.assertTrue(resource["id"], resources[0]["id"])
     self.assertEqual(resource["deployment_uuid"], deployment["uuid"])
     self.assertEqual(resource["provider_name"], "fakeprovider")
     self.assertEqual(resource["type"], "faketype")
Exemple #35
0
 def test_create(self):
     deployment = db.deployment_create({})
     resource = db.resource_create({
         "deployment_uuid": deployment["uuid"],
         "provider_name": "fakeprovider",
         "type": "faketype",
     })
     resources = db.resource_get_all(deployment["uuid"])
     self.assertTrue(resource["id"])
     self.assertEqual(len(resources), 1)
     self.assertTrue(resource["id"], resources[0]["id"])
     self.assertEqual(resource["deployment_uuid"], deployment["uuid"])
     self.assertEqual(resource["provider_name"], "fakeprovider")
     self.assertEqual(resource["type"], "faketype")
Exemple #36
0
 def test_create(self):
     deployment = db.deployment_create({})
     resource = db.resource_create({
         'deployment_uuid': deployment['uuid'],
         'provider_name': 'fakeprovider',
         'type': 'faketype',
     })
     resources = db.resource_get_all(deployment['uuid'])
     self.assertTrue(resource['id'])
     self.assertEqual(len(resources), 1)
     self.assertTrue(resource['id'], resources[0]['id'])
     self.assertEqual(resource['deployment_uuid'], deployment['uuid'])
     self.assertEqual(resource['provider_name'], 'fakeprovider')
     self.assertEqual(resource['type'], 'faketype')
Exemple #37
0
 def test_get_all_by_provider_type(self):
     deployment = db.deployment_create({})
     res_one = db.resource_create({
         'deployment_uuid': deployment['uuid'],
         'type': 'one',
     })
     res_two = db.resource_create({
         'deployment_uuid': deployment['uuid'],
         'type': 'two',
     })
     resources = db.resource_get_all(deployment['uuid'], type='one')
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_one['id'], resources[0]['id'])
     resources = db.resource_get_all(deployment['uuid'], type='two')
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_two['id'], resources[0]['id'])
Exemple #38
0
 def test_get_all_by_provider_type(self):
     deployment = db.deployment_create({})
     res_one = db.resource_create({
         "deployment_uuid": deployment["uuid"],
         "type": "one",
     })
     res_two = db.resource_create({
         "deployment_uuid": deployment["uuid"],
         "type": "two",
     })
     resources = db.resource_get_all(deployment["uuid"], type="one")
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_one["id"], resources[0]["id"])
     resources = db.resource_get_all(deployment["uuid"], type="two")
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_two["id"], resources[0]["id"])
Exemple #39
0
 def test_get_all_by_provider_type(self):
     deployment = db.deployment_create({})
     res_one = db.resource_create({
         "deployment_uuid": deployment["uuid"],
         "type": "one",
     })
     res_two = db.resource_create({
         "deployment_uuid": deployment["uuid"],
         "type": "two",
     })
     resources = db.resource_get_all(deployment["uuid"], type="one")
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_one["id"], resources[0]["id"])
     resources = db.resource_get_all(deployment["uuid"], type="two")
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_two["id"], resources[0]["id"])
Exemple #40
0
 def test_get_all_by_provider_type(self):
     deployment = db.deployment_create({})
     res_one = db.resource_create({
         'deployment_uuid': deployment['uuid'],
         'type': 'one',
     })
     res_two = db.resource_create({
         'deployment_uuid': deployment['uuid'],
         'type': 'two',
     })
     resources = db.resource_get_all(deployment['uuid'],
                                     type='one')
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_one['id'], resources[0]['id'])
     resources = db.resource_get_all(deployment['uuid'],
                                     type='two')
     self.assertEqual(len(resources), 1)
     self.assertEqual(res_two['id'], resources[0]['id'])
Exemple #41
0
 def setUp(self):
     super(VerificationTestCase, self).setUp()
     self.deploy = db.deployment_create({})
Exemple #42
0
 def test_delete(self):
     deployment = db.deployment_create({})
     res = db.resource_create({"deployment_uuid": deployment["uuid"]})
     db.resource_delete(res["id"])
     resources = db.resource_get_all(deployment["uuid"])
     self.assertEqual(len(resources), 0)
Exemple #43
0
 def test_delete(self):
     deployment = db.deployment_create({})
     res = db.resource_create({'deployment_uuid': deployment['uuid']})
     db.resource_delete(res['id'])
     resources = db.resource_get_all(deployment['id'])
     self.assertEqual(len(resources), 0)
Exemple #44
0
 def setUp(self):
     super(TasksTestCase, self).setUp()
     self.deploy = db.deployment_create({})
Exemple #45
0
 def test_deployment_delete_is_busy(self):
     deployment = db.deployment_create({})
     db.resource_create({'deployment_uuid': deployment['uuid']})
     db.resource_create({'deployment_uuid': deployment['uuid']})
     self.assertRaises(exceptions.DeploymentIsBusy, db.deployment_delete,
                       deployment['uuid'])
Exemple #46
0
 def test_deployment_list(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({})
     deploys = db.deployment_list()
     self.assertEqual(sorted([deploy_one['uuid'], deploy_two['uuid']]),
                      sorted([deploy['uuid'] for deploy in deploys]))
Exemple #47
0
 def test_deployment_list(self):
     deploy_one = db.deployment_create({})
     deploy_two = db.deployment_create({})
     deploys = db.deployment_list()
     self.assertEqual(sorted([deploy_one['uuid'], deploy_two['uuid']]),
                      sorted([deploy['uuid'] for deploy in deploys]))
Exemple #48
0
 def test_delete(self):
     deployment = db.deployment_create({})
     res = db.resource_create({"deployment_uuid": deployment["uuid"]})
     db.resource_delete(res["id"])
     resources = db.resource_get_all(deployment["uuid"])
     self.assertEqual(len(resources), 0)
Exemple #49
0
 def setUp(self):
     super(TasksTestCase, self).setUp()
     self.deploy = db.deployment_create({})
Exemple #50
0
 def test_deployment_delete_is_busy(self):
     deployment = db.deployment_create({})
     db.resource_create({'deployment_uuid': deployment['uuid']})
     db.resource_create({'deployment_uuid': deployment['uuid']})
     self.assertRaises(exceptions.DeploymentIsBusy, db.deployment_delete,
                       deployment['uuid'])
Exemple #51
0
 def test_delete(self):
     deployment = db.deployment_create({})
     res = db.resource_create({'deployment_uuid': deployment['uuid']})
     db.resource_delete(res['id'])
     resources = db.resource_get_all(deployment['id'])
     self.assertEqual(len(resources), 0)
Exemple #52
0
 def __init__(self, deployment=None, **attributes):
     if deployment:
         self.deployment = deployment
     else:
         self.deployment = db.deployment_create(attributes)
Exemple #53
0
 def setUp(self):
     super(VerificationTestCase, self).setUp()
     self.deploy = db.deployment_create({})
Exemple #54
0
 def __init__(self, deployment=None, **attributes):
     if deployment:
         self.deployment = deployment
     else:
         self.deployment = db.deployment_create(attributes)