mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 21:54:13 +01:00
After helm cli test was added to nightly, ca was get by reading from local file, but in helm nighly test, ca file was not in local, it has to be got from harbor api.
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
6cd79218b3
commit
3eeb8cf355
@ -8,7 +8,7 @@ import replication
|
|||||||
import repository
|
import repository
|
||||||
import swagger_client
|
import swagger_client
|
||||||
|
|
||||||
class Harbor(project.Project, label.Label,
|
class Harbor(project.Project, label.Label,
|
||||||
registry.Registry, replication.Replication,
|
registry.Registry, replication.Replication,
|
||||||
repository.Repository):
|
repository.Repository):
|
||||||
pass
|
pass
|
@ -51,7 +51,7 @@ def _get_string_from_unicode(udata):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
class Base:
|
class Base:
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
server = Server(endpoint="http://localhost:8080/api", verify_ssl=False),
|
server = Server(endpoint="http://localhost:8080/api", verify_ssl=False),
|
||||||
credential = Credential(type="basic_auth", username="admin", password="Harbor12345"),
|
credential = Credential(type="basic_auth", username="admin", password="Harbor12345"),
|
||||||
debug = True):
|
debug = True):
|
||||||
|
@ -14,7 +14,7 @@ class Registry(base.Base):
|
|||||||
username=username, password=password, insecure=insecure)
|
username=username, password=password, insecure=insecure)
|
||||||
_, _, header = client.targets_post_with_http_info(registry)
|
_, _, header = client.targets_post_with_http_info(registry)
|
||||||
return base._get_id_from_header(header), name
|
return base._get_id_from_header(header), name
|
||||||
|
|
||||||
def get_registry_id_by_endpoint(self, endpoint, **kwargs):
|
def get_registry_id_by_endpoint(self, endpoint, **kwargs):
|
||||||
client = self._get_client(**kwargs)
|
client = self._get_client(**kwargs)
|
||||||
registries = client.targets_get()
|
registries = client.targets_get()
|
||||||
|
@ -6,31 +6,6 @@ import base
|
|||||||
import swagger_client
|
import swagger_client
|
||||||
|
|
||||||
class Replication(base.Base):
|
class Replication(base.Base):
|
||||||
def create_replication_rule(self,
|
|
||||||
projectIDList, targetIDList, name=None, desc="",
|
|
||||||
filters=[], trigger=swagger_client.RepTrigger(kind="Manual"),
|
|
||||||
replicate_deletion=True,
|
|
||||||
replicate_existing_image_now=False,
|
|
||||||
expect_status_code = 201,
|
|
||||||
**kwargs):
|
|
||||||
if name is None:
|
|
||||||
name = base._random_name("rule")
|
|
||||||
projects = []
|
|
||||||
for projectID in projectIDList:
|
|
||||||
projects.append(swagger_client.Project(project_id=int(projectID)))
|
|
||||||
targets = []
|
|
||||||
for targetID in targetIDList:
|
|
||||||
targets.append(swagger_client.RepTarget(id=int(targetID)))
|
|
||||||
for filter in filters:
|
|
||||||
filter["value"] = int(filter["value"])
|
|
||||||
client = self._get_client(**kwargs)
|
|
||||||
policy = swagger_client.RepPolicy(name=name, description=desc,
|
|
||||||
projects=projects, targets=targets, filters=filters,
|
|
||||||
trigger=trigger, replicate_deletion=replicate_deletion,
|
|
||||||
replicate_existing_image_now=replicate_existing_image_now)
|
|
||||||
_, status_code, header = client.policies_replication_post_with_http_info(policy)
|
|
||||||
base._assert_status_code(expect_status_code, status_code)
|
|
||||||
return base._get_id_from_header(header), name
|
|
||||||
|
|
||||||
def get_replication_rule(self, param = None, rule_id = None, expect_status_code = 200, **kwargs):
|
def get_replication_rule(self, param = None, rule_id = None, expect_status_code = 200, **kwargs):
|
||||||
client = self._get_client(**kwargs)
|
client = self._get_client(**kwargs)
|
||||||
|
@ -18,6 +18,9 @@ Library OperatingSystem
|
|||||||
Library Process
|
Library Process
|
||||||
|
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
|
Prepare Helm Cert
|
||||||
|
Wait Unitl Command Success cp harbor_ca.crt /helm_ca/server.crt
|
||||||
|
|
||||||
Helm Repo Add
|
Helm Repo Add
|
||||||
[Arguments] ${harbor_url} ${user} ${pwd} ${project_name}=library ${helm_repo_name}=myrepo
|
[Arguments] ${harbor_url} ${user} ${pwd} ${project_name}=library ${helm_repo_name}=myrepo
|
||||||
${rc} ${output}= Run And Return Rc And Output helm repo remove ${project_name}
|
${rc} ${output}= Run And Return Rc And Output helm repo remove ${project_name}
|
||||||
|
@ -32,6 +32,7 @@ CA Setup
|
|||||||
Run mv ${cert} harbor_ca.crt
|
Run mv ${cert} harbor_ca.crt
|
||||||
Generate Certificate Authority For Chrome ${HARBOR_PASSWORD}
|
Generate Certificate Authority For Chrome ${HARBOR_PASSWORD}
|
||||||
Prepare Docker Cert ${ip}
|
Prepare Docker Cert ${ip}
|
||||||
|
Prepare Helm Cert
|
||||||
|
|
||||||
Collect Nightly Logs
|
Collect Nightly Logs
|
||||||
[Arguments] ${ip} ${SSH_PWD} ${ip1}==${EMPTY}
|
[Arguments] ${ip} ${SSH_PWD} ${ip1}==${EMPTY}
|
||||||
|
Loading…
Reference in New Issue
Block a user