def setUp(self):
from kubedock.pods.models import PodIP, IPPool
self.ip = ipaddress.ip_address(u'192.168.43.4')
self.with_ip_conf = {
'public_ip': unicode(self.ip),
'containers': [
{'ports': [{'isPublic': True}, {}, {'isPublic': False}]},
{'ports': [{'isPublic': True}, {}, {'isPublic': False}]},
],
}
self.without_ip_conf = {
'public_ip_before_freed': unicode(self.ip),
'containers': [
{'ports': [{'isPublic_before_freed': True},
{'isPublic_before_freed': None},
{'isPublic_before_freed': False}]},
{'ports': [{'isPublic_before_freed': True},
{'isPublic_before_freed': None},
{'isPublic_before_freed': False}]},
],
}
self.pod = self.fixtures.pod(config=json.dumps(self.with_ip_conf))
self.ippool = IPPool(network='192.168.43.0/29').save()
self.podip = PodIP(pod_id=self.pod.id, network=self.ippool.network,
ip_address=int(self.ip)).save()
test_podcollection.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录