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')
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'
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'
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)
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
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)
def setUp(self): super(TestReplicationControllerObject, self).setUp() self.fake_rc = utils.get_test_rc()