2018-03-20 06:25:03 +01:00
|
|
|
// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
*** Settings ***
|
|
|
|
Documentation Harbor BATs
|
|
|
|
Resource ../../resources/Util.robot
|
|
|
|
Default Tags Replication
|
|
|
|
|
|
|
|
*** Variables ***
|
|
|
|
${HARBOR_URL} https://${ip}
|
|
|
|
${SSH_USER} root
|
|
|
|
${HARBOR_ADMIN} admin
|
2018-07-19 11:02:09 +02:00
|
|
|
|
2018-03-20 06:25:03 +01:00
|
|
|
*** Test Cases ***
|
2018-06-04 08:24:47 +02:00
|
|
|
Test Case - Get Harbor Version
|
|
|
|
#Just get harbor version and log it
|
|
|
|
Get Harbor Version
|
2018-03-20 06:25:03 +01:00
|
|
|
|
|
|
|
Test Case - Pro Replication Rules Add
|
|
|
|
Init Chrome Driver
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Replication Manage
|
|
|
|
Check New Rule UI Without Endpoint
|
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Endpoint Verification
|
|
|
|
#This case need vailid info and selfsign cert
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Registries
|
|
|
|
Create A New Endpoint edp1${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} N
|
|
|
|
Endpoint Is Pingable
|
|
|
|
Enable Certificate Verification
|
|
|
|
Endpoint Is Unpingable
|
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Endpoint Add
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Registries
|
|
|
|
Create A New Endpoint testabc https://${d} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Wait Until Page Contains testabc
|
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Endpoint Edit
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Registries
|
|
|
|
Rename Endpoint testabc deletea
|
|
|
|
Wait Until Page Contains deletea
|
|
|
|
Close Browser
|
|
|
|
|
2018-04-25 10:24:11 +02:00
|
|
|
Test Case - Endpoint Delete
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Registries
|
|
|
|
Delete Endpoint deletea
|
2018-05-24 13:53:23 +02:00
|
|
|
Delete Success deletea
|
2018-04-25 10:24:11 +02:00
|
|
|
Close Browser
|
2018-03-20 06:25:03 +01:00
|
|
|
|
|
|
|
Test Case - Rule Edit
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Create An New Project project${d}
|
|
|
|
Switch To Registries
|
|
|
|
Create A New Endpoint e${d} https://ip ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Replication Manage
|
|
|
|
Create A Rule With Existing Endpoint rule${d} project${d} e${d} Immediate
|
|
|
|
Rename Rule rule${d} newname
|
|
|
|
Wait Until Page Contains newname
|
|
|
|
Close Browser
|
|
|
|
|
|
|
|
Test Case - Rule Delete
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Replication Manage
|
|
|
|
Delete Rule newname
|
2018-05-24 13:53:23 +02:00
|
|
|
Delete Success newname
|
2018-03-20 06:25:03 +01:00
|
|
|
Close Browser
|
|
|
|
|
|
|
|
|
|
|
|
Test Case - Trigger Immediate
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Create An New Project project${d}
|
|
|
|
Switch To Registries
|
|
|
|
Create A New Endpoint edp${d} https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Replication Manage
|
|
|
|
Create A Rule With Existing Endpoint rule${d} project${d} edp${d} Immediate
|
|
|
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world
|
|
|
|
Logout Harbor
|
|
|
|
#logout and login target
|
|
|
|
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Go Into Project project${d}
|
|
|
|
Page Should Contain hello-world
|
|
|
|
Go Into Repo hello-world
|
|
|
|
Page Should Contain latest
|
2018-04-25 10:24:11 +02:00
|
|
|
Close Browser
|
2018-03-20 06:25:03 +01:00
|
|
|
|
|
|
|
Test Case - Trigger Manual
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Create An New Project project${d}
|
|
|
|
#using existing endpoint added before for only one replication endpoint
|
|
|
|
Switch To Replication Manage
|
|
|
|
Create A Rule With Existing Endpoint rule${d} project${d} edp Manual
|
|
|
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world
|
|
|
|
Trigger Replication Manual rule${d}
|
|
|
|
Logout Harbor
|
|
|
|
#logout and login target
|
|
|
|
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Go Into Project project${d}
|
|
|
|
Page Should Contain hello-world
|
|
|
|
Go Into Repo hello-world
|
|
|
|
Page Should Contain latest
|
2018-04-25 10:24:11 +02:00
|
|
|
Close Browser
|
2018-03-20 06:25:03 +01:00
|
|
|
|
2018-04-25 10:24:11 +02:00
|
|
|
Test Case - Large Image Replicate
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Create An New Project project${d}
|
|
|
|
Push Image with tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ubuntu 16.04 16.04
|
|
|
|
Switch To Replication Manage
|
|
|
|
Create A Rule With Existing Endpoint rule${d} project${d} edp Immediate
|
|
|
|
Logout Harbor
|
|
|
|
#logout and login target
|
|
|
|
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Go Into Project project${d}
|
|
|
|
Page Should Contain ubuntu
|
|
|
|
Go Into Repo ubuntu
|
|
|
|
Page Should Contain 16.04
|
|
|
|
Close Browser
|
2018-03-20 06:25:03 +01:00
|
|
|
|
|
|
|
Test Case - Proj Replication Jobs Log View
|
|
|
|
Init Chrome Driver
|
|
|
|
${d}= Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Create An New Project project${d}
|
|
|
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} hello-world
|
|
|
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} busybox
|
|
|
|
Switch To Registries
|
|
|
|
Create A New Endpoint edp${d} aaa ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Switch To Replication Manage
|
|
|
|
Create A Rule With Existing Endpoint rule${d} project${d} edp${d} Immediate
|
2018-03-20 11:11:39 +01:00
|
|
|
Filter Rule rule${d}
|
|
|
|
Select Rule rule${d}
|
2018-03-20 06:25:03 +01:00
|
|
|
Wait Until Page Contains transfer
|
2018-04-12 05:42:54 +02:00
|
|
|
Wait Until Page Contains error
|
2018-03-20 06:25:03 +01:00
|
|
|
View Job Log busybox
|
|
|
|
Close Browser
|
2018-04-25 10:24:11 +02:00
|
|
|
|
|
|
|
Test Case - Project LeveL Replication Operation
|
|
|
|
Init Chrome Driver
|
|
|
|
${d} = Get Current Date result_format=%m%s
|
|
|
|
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Create An New Project proj${d}
|
|
|
|
Go Into Project proj${d}
|
|
|
|
Switch To Replication
|
|
|
|
Project Create A Rule With Existing Endpoint rule${d} proj${d} edp Manual
|
|
|
|
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} proj${d} hello-world
|
|
|
|
Trigger Replication Manual rule${d}
|
|
|
|
Logout Harbor
|
|
|
|
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
|
|
|
|
Go Into Project proj${d}
|
|
|
|
Page Should Contain hello-world
|
|
|
|
Go Into Repo hello-world
|
|
|
|
Page Should Contain latest
|
|
|
|
Close Browser
|