def test_logs_container(docker_client, cattle_url): uuid = TEST_IMAGE_UUID container = docker_client.create_container(name='test', imageUuid=uuid) container = docker_client.wait_success(container) assert len(container.hosts()) == 1 logs_access = container.logs() assert logs_access.token.index('.') > 0 assert '/v1/logs/' in logs_access.url
def test_stats_container(docker_client): uuid = TEST_IMAGE_UUID container = docker_client.create_container(name='test', imageUuid=uuid) container = docker_client.wait_success(container) assert container.state == 'running' assert len(container.hosts()) == 1 stats_access = container.stats() assert stats_access.token.index('.') > 0 assert '/v1/stats/%s' % container.externalId in stats_access.url
def test_stats_container(docker_client): uuid = TEST_IMAGE_UUID container = docker_client.create_container(imageUuid=uuid) container = docker_client.wait_success(container) assert container.state == 'running' assert len(container.hosts()) == 1 stats_access = container.stats() assert stats_access.token.index('.') > 0 assert '/v1/stats/%s' % container.externalId in stats_access.url
def test_stats_container(docker_client): uuid = TEST_IMAGE_UUID container = docker_client.create_container(name="test", imageUuid=uuid) container = docker_client.wait_success(container) assert container.state == "running" assert len(container.hosts()) == 1 stats_access = container.stats() assert stats_access.token.index(".") > 0 assert "/v1/stats/%s" % container.externalId in stats_access.url
def test_stats_container(docker_client, cattle_url): uuid = TEST_IMAGE_UUID container = docker_client.create_container(name='test', imageUuid=uuid) container = docker_client.wait_success(container) assert len(container.hosts()) == 1 stats_access = container.containerStats() assert stats_access.token.index('.') > 0 assert '/v1/containerstats/' in stats_access.url try: payload = jwt.decode(stats_access.token, verify=False) assert 'containerIds' in payload containerIds = payload['containerIds'] assert len(containerIds) == 1 except jwt.InvalidTokenError: assert False