harbor/tests/apitests/python/library/sign.py
danfengliu e020b90bf0 add oras cli py-test
1. Add oras cli py-test;
2. Add env for notary url, allow to input different notary port instead of solid 4443;
3. Add retry for keyword Cannot Pull Image and make it longer during retry.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-08 11:10:07 +08:00

12 lines
473 B
Python

# -*- coding: utf-8 -*-
import subprocess
from testutils import notary_url
def sign_image(registry_ip, project_name, image, tag):
try:
ret = subprocess.check_output(["./tests/apitests/python/sign_image.sh", registry_ip, project_name, image, tag, notary_url], shell=False)
print "sign_image return: ", ret
except subprocess.CalledProcessError, exc:
raise Exception("Failed to sign image error is {} {}.".format(exc.returncode, exc.output))