Fix nightly ca header issue

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2021-07-16 15:13:55 +08:00
parent e46e9631fa
commit 32ea961f9f
3 changed files with 12 additions and 8 deletions

View File

@ -255,6 +255,8 @@ Click Index Achieve
Go Into Index And Contain Artifacts
[Arguments] ${tag_name} ${total_artifact_count}=3 ${archive_count}=0 ${return_immediately}=${false}
Run Keyword If '${total_artifact_count}' == '${null}' Return From Keyword PASS
Should Not Be Empty ${tag_name}
Retry Double Keywords When Error Click Index Achieve ${tag_name} Page Should Contain Element ${tag_table_column_os_arch}
FOR ${n} IN RANGE 1 10
${out1} Run Keyword And Ignore Error Page Should Contain Element ${artifact_rows} limit=${total_artifact_count}

View File

@ -247,13 +247,15 @@ Image Should Be Replicated To Project
Go Into Repo ${project}/${image}
${size}= Run Keyword If '${tag}'!='${EMPTY}' and '${expected_image_size_in_regexp}'!='${null}' Get Text //clr-dg-row[contains(., '${tag}')]//clr-dg-cell[4]/div
Run Keyword If '${tag}'!='${EMPTY}' and '${expected_image_size_in_regexp}'!='${null}' Should Match Regexp '${size}' '${expected_image_size_in_regexp}'
Run Keyword If '${total_artifact_count}'!='${null}' Should Not Be Empty ${tag}
${out} Run Keyword If '${total_artifact_count}'!='${null}' Go Into Index And Contain Artifacts ${tag} total_artifact_count=${total_artifact_count} archive_count=${archive_count} return_immediately=${true}
Log All out: ${out}
Exit For Loop If '${out}'=='PASS'
${index_out} Go Into Index And Contain Artifacts ${tag} total_artifact_count=${total_artifact_count} archive_count=${archive_count} return_immediately=${true}
Log All index_out: ${index_out}
Run Keyword If '${index_out}'=='PASS' Exit For Loop
Sleep 30
END
Verify Artifacts Counts In Archive
[Arguments] ${total_artifact_count} ${tag} ${total_artifact_count} ${archive_count}
Executions Result Count Should Be
[Arguments] ${expected_status} ${expected_trigger_type} ${expected_result_count}
Sleep 10

View File

@ -596,7 +596,7 @@ def request(url, method, user = None, userp = None, **kwargs):
if userp is None:
userp = "Harbor12345"
kwargs.setdefault('headers', kwargs.get('headers', {}))
kwargs['headers']['Accept'] = 'application/json'
#kwargs['headers']['Accept'] = 'application/json'
if 'body' in kwargs:
kwargs['headers']['Content-Type'] = 'application/json'
kwargs['data'] = json.dumps(kwargs['body'])
@ -666,12 +666,12 @@ def do_data_creation():
harborAPI.update_systemsetting(data["configuration"]["emailsetting"]["emailfrom"],
data["configuration"]["emailsetting"]["emailserver"],
float(data["configuration"]["emailsetting"]["emailport"]),
int(data["configuration"]["emailsetting"]["emailport"]),
data["configuration"]["emailsetting"]["emailuser"],
data["configuration"]["projectcreation"],
data["configuration"]["selfreg"],
float(data["configuration"]["token"]),
float(data["configuration"]["robot_token"]), version=args.version)
int(data["configuration"]["token"]),
int(data["configuration"]["robot_token"]), version=args.version)
harborAPI.add_sys_allowlist(data["configuration"]["deployment_security"], version=args.version)