Ejemplo n.º 1
0
 def list_repo(self, repo):
     url = 'https://localhost:{port}/repositories/{repo}/tags'.format(
             port=self.port,
             repo=urllib.quote(repo, safe=''))
     res = requests.get(url, **tls_opts())
     res.raise_for_status()
     return res.json()['result']
Ejemplo n.º 2
0
def test_origin_upload_no_client_cert(origin_cluster):
    name, blob = _generate_blob()
    addr = origin_cluster.get_location(name)
    url = 'https://{addr}/namespace/testfs/blobs/sha256:{name}/uploads'.format(
            addr=addr, name=name)
    res = requests.post(url, **tls_opts())
    assert res.status_code == 403
Ejemplo n.º 3
0
 def get_location(self, name):
     url = 'https://localhost:{port}/blobs/sha256:{name}/locations'.format(
         port=random.choice(self.origins).instance.port, name=name)
     res = requests.get(url, **tls_opts())
     res.raise_for_status()
     addr = random.choice(res.headers['Origin-Locations'].split(','))
     # Origin addresses are configured under the bridge network, but we
     # need to speak via localhost.
     addr = addr.replace(get_docker_bridge(), 'localhost')
     return addr