mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-17 04:11:24 +01:00
Support replication test in nightly infrastructure (#4302)
This commit is contained in:
parent
15f4315b74
commit
c37b3748b9
@ -17,7 +17,7 @@ def execute(harbor_endpoints, vm_names, harbor_root_pwd, test_suite, auth_mode ,
|
|||||||
cmd_base = "docker run -i --privileged -v %s:/drone -w /drone vmware/harbor-e2e-engine:1.38 " % os.getcwd()
|
cmd_base = "docker run -i --privileged -v %s:/drone -w /drone vmware/harbor-e2e-engine:1.38 " % os.getcwd()
|
||||||
|
|
||||||
if len(harbor_endpoints) == 1:
|
if len(harbor_endpoints) == 1:
|
||||||
cmd_pybot = "pybot -v ip:%s -v vm_name:%s -v HARBOR_PASSWORD:%s -v SSH_PWD:%s -v vc_host:%s -v vc_user:%s -v vc_password:%s " % (harbor_endpoints[0], vm_names[0], harbor_pwd, harbor_root_pwd, vc_host, vc_user, vc_password)
|
cmd_pybot = "pybot -v ip:%s -v vm_name:%s -v ip1: -v HARBOR_PASSWORD:%s -v SSH_PWD:%s -v vc_host:%s -v vc_user:%s -v vc_password:%s " % (harbor_endpoints[0], vm_names[0], harbor_pwd, harbor_root_pwd, vc_host, vc_user, vc_password)
|
||||||
|
|
||||||
if len(harbor_endpoints) == 2:
|
if len(harbor_endpoints) == 2:
|
||||||
cmd_pybot = "pybot -v ip:%s -v vm_name:%s -v ip1:%s -v vm_name1:%s -v HARBOR_PASSWORD:%s -v SSH_PWD:%s -v vc_host:%s -v vc_user:%s -v vc_password:%s " % (harbor_endpoints[0], vm_names[0], harbor_endpoints[1], vm_names[1], harbor_pwd, harbor_root_pwd, vc_host, vc_user, vc_password)
|
cmd_pybot = "pybot -v ip:%s -v vm_name:%s -v ip1:%s -v vm_name1:%s -v HARBOR_PASSWORD:%s -v SSH_PWD:%s -v vc_host:%s -v vc_user:%s -v vc_password:%s " % (harbor_endpoints[0], vm_names[0], harbor_endpoints[1], vm_names[1], harbor_pwd, harbor_root_pwd, vc_host, vc_user, vc_password)
|
||||||
|
@ -19,11 +19,12 @@ Documentation This resource contains keywords related to creating and using cer
|
|||||||
Generate Certificate Authority For Chrome
|
Generate Certificate Authority For Chrome
|
||||||
# add the ca to chrome trust list to enable https testing.
|
# add the ca to chrome trust list to enable https testing.
|
||||||
[Arguments] ${password}=%{HARBOR_PASSWORD}
|
[Arguments] ${password}=%{HARBOR_PASSWORD}
|
||||||
|
${rand}= Evaluate random.randint(0, 100000) modules=random
|
||||||
Log To Console Generate Certificate Authority For Chrome
|
Log To Console Generate Certificate Authority For Chrome
|
||||||
${rc} ${out}= Run And Return Rc And Output echo ${password} > password.ca
|
${rc} ${out}= Run And Return Rc And Output echo ${password} > password${rand}.ca
|
||||||
Log ${out}
|
Log ${out}
|
||||||
Should Be Equal As Integers ${rc} 0
|
Should Be Equal As Integers ${rc} 0
|
||||||
${rc} ${out}= Run And Return Rc And Output certutil -d sql:$HOME/.pki/nssdb -A -t TC -f password.ca -n "Harbor" -i ./harbor_ca.crt
|
${rc} ${out}= Run And Return Rc And Output certutil -d sql:$HOME/.pki/nssdb -A -t TC -f password${rand}.ca -n "Harbor${rand}" -i ./harbor_ca.crt
|
||||||
Log ${out}
|
Log ${out}
|
||||||
Should Be Equal As Integers ${rc} 0
|
Should Be Equal As Integers ${rc} 0
|
||||||
|
|
||||||
|
@ -21,9 +21,12 @@ ${SSH_USER} root
|
|||||||
|
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
Nightly Test Setup
|
Nightly Test Setup
|
||||||
[Arguments] ${ip} ${SSH_PWD} ${HARBOR_PASSWORD}
|
[Arguments] ${ip} ${SSH_PWD} ${HARBOR_PASSWORD} ${ip1}==${EMPTY}
|
||||||
Run Keyword CA setup ${ip} ${SSH_PWD} ${HARBOR_PASSWORD}
|
Run Keyword CA setup ${ip} ${SSH_PWD} ${HARBOR_PASSWORD}
|
||||||
Run Keyword Prepare Docker Cert ${ip}
|
Run Keyword Prepare Docker Cert ${ip}
|
||||||
|
Run Keyword And Ignore Error Run rm harbor_ca.crt
|
||||||
|
Run Keyword If '${ip1}' != '${EMPTY}' CA setup ${ip1} ${SSH_PWD} ${HARBOR_PASSWORD}
|
||||||
|
Run Keyword If '${ip1}' != '${EMPTY}' Prepare Docker Cert ${ip1}
|
||||||
Run Keyword Start Docker Daemon Locally
|
Run Keyword Start Docker Daemon Locally
|
||||||
|
|
||||||
CA Setup
|
CA Setup
|
||||||
@ -36,6 +39,11 @@ CA Setup
|
|||||||
Generate Certificate Authority For Chrome ${HARBOR_PASSWORD}
|
Generate Certificate Authority For Chrome ${HARBOR_PASSWORD}
|
||||||
|
|
||||||
Collect Nightly Logs
|
Collect Nightly Logs
|
||||||
|
[Arguments] ${ip} ${SSH_PWD} ${ip1}==${EMPTY}
|
||||||
|
Run Keyword Collect Logs ${ip} ${SSH_PWD}
|
||||||
|
Run Keyword If '${ip1}' != '${EMPTY}' Collect Logs ${ip1} ${SSH_PWD}
|
||||||
|
|
||||||
|
Collect Logs
|
||||||
[Arguments] ${ip} ${SSH_PWD}
|
[Arguments] ${ip} ${SSH_PWD}
|
||||||
Open Connection ${ip}
|
Open Connection ${ip}
|
||||||
Login ${SSH_USER} ${SSH_PWD}
|
Login ${SSH_USER} ${SSH_PWD}
|
||||||
@ -50,4 +58,5 @@ Collect Nightly Logs
|
|||||||
SSHLibrary.Get File /var/log/harbor/notary-db.log
|
SSHLibrary.Get File /var/log/harbor/notary-db.log
|
||||||
SSHLibrary.Get File /var/log/harbor/notary-server.log
|
SSHLibrary.Get File /var/log/harbor/notary-server.log
|
||||||
SSHLibrary.Get File /var/log/harbor/notary-signer.log
|
SSHLibrary.Get File /var/log/harbor/notary-signer.log
|
||||||
|
Run rename 's/^/${ip}/' *.log
|
||||||
Close All Connections
|
Close All Connections
|
@ -15,8 +15,8 @@
|
|||||||
*** Settings ***
|
*** Settings ***
|
||||||
Documentation Harbor BATs
|
Documentation Harbor BATs
|
||||||
Resource ../../resources/Util.robot
|
Resource ../../resources/Util.robot
|
||||||
Suite Setup Nightly Test Setup ${ip} ${SSH_PWD} ${HARBOR_PASSWORD}
|
Suite Setup Nightly Test Setup ${ip} ${SSH_PWD} ${HARBOR_PASSWORD} ${ip1}
|
||||||
Suite Teardown Collect Nightly Logs ${ip} ${SSH_PWD}
|
Suite Teardown Collect Nightly Logs ${ip} ${SSH_PWD} ${ip1}
|
||||||
Default Tags Nightly
|
Default Tags Nightly
|
||||||
|
|
||||||
*** Variables ***
|
*** Variables ***
|
||||||
|
Loading…
Reference in New Issue
Block a user