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_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') 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 pod_post_data(**kw): pod = utils.get_test_pod(**kw) if 'manifest' not in pod: pod['manifest'] = '''{ "id": "name_of_pod", "labels": { "foo": "foo1" } }''' internal = pod_controller.PodPatchType.internal_attrs() return remove_internal(pod, internal)
def get_test_pod(context, **kw): """Return a Pod 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_pod = db_utils.get_test_pod(**kw) # Let DB generate ID if it isn't specified explicitly if 'id' not in kw: del db_pod['id'] pod = objects.Pod(context) for key in db_pod: setattr(pod, key, db_pod[key]) return pod
def pod_post_data(**kw): pod = utils.get_test_pod(**kw) if 'manifest' not in pod: pod['manifest'] = '''{ "metadata": { "name": "name_of_pod" }, "spec": { "containers": [ { "name": "test", "image": "test" } ] } }''' internal = pod_controller.PodPatchType.internal_attrs() return remove_internal(pod, internal)
def setUp(self): super(TestPodObject, self).setUp() self.fake_pod = utils.get_test_pod()