Support replication test in nightly infrastructure (#4302)

This commit is contained in:
Yan 2018-02-28 19:37:25 +08:00 committed by GitHub
parent 15f4315b74
commit c37b3748b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 7 deletions

View File

@ -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()
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:
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)

View File

@ -19,11 +19,12 @@ Documentation This resource contains keywords related to creating and using cer
Generate Certificate Authority For Chrome
# add the ca to chrome trust list to enable https testing.
[Arguments] ${password}=%{HARBOR_PASSWORD}
${rand}= Evaluate random.randint(0, 100000) modules=random
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}
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}
Should Be Equal As Integers ${rc} 0

View File

@ -21,9 +21,12 @@ ${SSH_USER} root
*** Keywords ***
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 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
CA Setup
@ -36,6 +39,11 @@ CA Setup
Generate Certificate Authority For Chrome ${HARBOR_PASSWORD}
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}
Open Connection ${ip}
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-server.log
SSHLibrary.Get File /var/log/harbor/notary-signer.log
Run rename 's/^/${ip}/' *.log
Close All Connections

View File

@ -15,8 +15,8 @@
*** Settings ***
Documentation Harbor BATs
Resource ../../resources/Util.robot
Suite Setup Nightly Test Setup ${ip} ${SSH_PWD} ${HARBOR_PASSWORD}
Suite Teardown Collect Nightly Logs ${ip} ${SSH_PWD}
Suite Setup Nightly Test Setup ${ip} ${SSH_PWD} ${HARBOR_PASSWORD} ${ip1}
Suite Teardown Collect Nightly Logs ${ip} ${SSH_PWD} ${ip1}
Default Tags Nightly
*** Variables ***