コード例 #1
0
ファイル: test_rpcapi.py プロジェクト: mkscala/magnum
 def setUp(self):
     super(RPCAPITestCase, self).setUp()
     self.fake_bay = dbutils.get_test_bay(driver='fake-driver')
     self.fake_container = dbutils.get_test_container(driver='fake-driver')
     self.fake_pod = dbutils.get_test_pod(driver='fake-driver')
     self.fake_rc = dbutils.get_test_rc(driver='fake-driver')
     self.fake_service = dbutils.get_test_service(driver='fake-driver')
コード例 #2
0
ファイル: test_rpcapi.py プロジェクト: ISCAS-VDI/magnum-base
 def setUp(self):
     super(RPCAPITestCase, self).setUp()
     self.fake_bay = dbutils.get_test_bay(driver='fake-driver')
     self.fake_container = dbutils.get_test_container(driver='fake-driver')
     self.fake_rc = dbutils.get_test_rc(driver='fake-driver')
     self.fake_certificate = objects.Certificate.from_db_bay(self.fake_bay)
     self.fake_certificate.csr = 'fake-csr'
コード例 #3
0
ファイル: test_rpcapi.py プロジェクト: mjura/magnum
 def setUp(self):
     super(RPCAPITestCase, self).setUp()
     self.fake_bay = dbutils.get_test_bay(driver='fake-driver')
     self.fake_container = dbutils.get_test_container(driver='fake-driver')
     self.fake_rc = dbutils.get_test_rc(driver='fake-driver')
     self.fake_service = dbutils.get_test_service(driver='fake-driver')
     self.fake_x509keypair = dbutils.get_test_x509keypair(
         driver='fake-driver')
     self.fake_certificate = objects.Certificate.from_db_bay(self.fake_bay)
     self.fake_certificate.csr = 'fake-csr'
コード例 #4
0
def rc_post_data(**kw):
    rc = utils.get_test_rc(**kw)
    if 'manifest' not in rc:
        rc['manifest'] = '''{
            "id": "name_of_rc",
            "replicas": 3,
            "labels": {
                "foo": "foo1"
            }
        }'''
    internal = rc_controller.ReplicationControllerPatchType.internal_attrs()
    return remove_internal(rc, internal)
コード例 #5
0
def get_test_rc(context, **kw):
    """Return a ReplicationController object with appropriate attributes.

    NOTE: The object leaves the attributes marked as changed, such
    that a create() could be used to commit it to the DB.
    """
    db_rc = db_utils.get_test_rc(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del db_rc['id']
    rc = objects.ReplicationController(context)
    for key in db_rc:
        setattr(rc, key, db_rc[key])
    return rc
コード例 #6
0
ファイル: utils.py プロジェクト: mkscala/magnum
def rc_post_data(**kw):
    rc = utils.get_test_rc(**kw)
    if 'manifest' not in rc:
        rc['manifest'] = '''{
            "metadata": {
                "name": "name_of_rc"
                },
                "spec":{
                    "replicas":2,
                    "selector":{
                        "name":"frontend"
                    },
                    "template":{
                        "metadata":{
                            "labels":{
                                "name":"frontend"
                            }
                        },
                        "spec":{
                            "containers":[
                                {
                                    "name":"test-redis",
                                    "image":"steak/for-dinner",
                                    "ports":[
                                        {
                                            "containerPort":80,
                                            "protocol":"TCP"
                                        }
                                    ]
                                }
                            ]
                        }
                   }
               }
           }'''
    internal = rc_controller.ReplicationControllerPatchType.internal_attrs()
    return remove_internal(rc, internal)
コード例 #7
0
 def setUp(self):
     super(TestReplicationControllerObject, self).setUp()
     self.fake_rc = utils.get_test_rc()
コード例 #8
0
 def setUp(self):
     super(TestReplicationControllerObject, self).setUp()
     self.fake_rc = utils.get_test_rc()