def test_login(self):
self.hosts = self.add_hosts([
config['lustre_servers'][0]['address'],
config['lustre_servers'][1]['address']])
# Chroma puts its FQDN in the manager certificate, but the test config may
# be pointing to localhost: if this is the case, substitute the FQDN in the
# URL so that the client can validate the certificate.
url = config['chroma_managers'][0]['server_http_url']
parsed = urlparse.urlparse(url)
if parsed.hostname == 'localhost':
parsed = list(parsed)
parsed[1] = parsed[1].replace("localhost", socket.getfqdn())
url = urlparse.urlunparse(tuple(parsed))
example_api_client.setup_ca(url)
hosts = example_api_client.list_hosts(url,
config['chroma_managers'][0]['users'][0]['username'],
config['chroma_managers'][0]['users'][0]['password']
)
self.assertListEqual(hosts, [h['fqdn'] for h in self.hosts])
test_example_api_client.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录