コード例 #1
0
ファイル: utils.py プロジェクト: mkscala/magnum
def service_post_data(**kw):
    service = utils.get_test_service(**kw)
    if 'manifest' not in service:
        service['manifest'] = '''{
            "metadata": {
                "name": "test",
                "labels": {
                    "key": "value"
                }
            },
            "spec": {
                "ports": [
                    {
                    "port": 88,
                    "targetPort": 6379,
                    "protocol": "TCP"
                    }
                ],
                "selector": {
                    "bar": "foo"
                }
            }
            }'''
    internal = service_controller.ServicePatchType.internal_attrs()
    return remove_internal(service, internal)
コード例 #2
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')
コード例 #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
ファイル: test_rpcapi.py プロジェクト: paperandsoap/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'
コード例 #5
0
def get_test_service(context, **kw):
    """Return a Service 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_service = db_utils.get_test_service(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del db_service['id']
    service = objects.Service(context)
    for key in db_service:
        setattr(service, key, db_service[key])
    return service
コード例 #6
0
def service_post_data(**kw):
    service = utils.get_test_service(**kw)
    if 'manifest' not in service:
        service['manifest'] = '''{
            "id": "service_foo",
            "kind": "Service",
            "apiVersion": "v1beta1",
            "port": 88,
            "selector": {
                "bar": "foo"
            },
            "labels": {
                "bar": "foo"
            }
        }'''
    internal = service_controller.ServicePatchType.internal_attrs()
    return remove_internal(service, internal)
コード例 #7
0
 def setUp(self):
     super(TestServiceObject, self).setUp()
     self.fake_service = utils.get_test_service()
コード例 #8
0
ファイル: test_service.py プロジェクト: chanehua/magnum
 def setUp(self):
     super(TestServiceObject, self).setUp()
     self.fake_service = utils.get_test_service()