2018-09-19 18:57:15 +02:00
// Copyright Project Harbor Authors
2017-08-07 08:02:38 +02:00
//
// 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
Suite Setup Install Harbor to Test Server
2018-01-25 11:09:39 +01:00
Suite Teardown Down Harbor
2017-08-07 08:02:38 +02:00
Default Tags BAT
*** Variables ***
2017-10-30 07:55:03 +01:00
${HARBOR_URL} https://${ip}
2017-08-07 08:02:38 +02:00
*** Test Cases ***
2018-01-25 11:09:39 +01:00
Test Case - Registry Basic Verfication
2017-08-07 08:02:38 +02:00
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
2017-10-30 07:55:03 +01:00
Create An New Project With New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=tester${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=true
2017-09-07 12:29:05 +02:00
Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
2018-01-25 11:09:39 +01:00
Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest
2017-09-07 12:29:05 +02:00
Go Into Project project${d}
Delete Repo project${d}
2017-08-07 08:02:38 +02:00
Close Browser
2018-01-25 11:09:39 +01:00
Test Case - Clair Basic Verfication
2017-08-07 08:02:38 +02:00
Init Chrome Driver
${d}= get current date result_format=%m%s
Create An New Project With New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=tester${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=false
Push Image ${ip} tester${d} Test1@34 project${d} hello-world
2017-12-21 04:00:12 +01:00
Go Into Project project${d}
2017-12-08 08:05:52 +01:00
Go Into Repo project${d}/hello-world
2018-03-12 07:20:37 +01:00
Scan Repo latest Succeed
2017-10-12 05:31:44 +02:00
Summary Chart Should Display latest
2017-12-21 04:00:12 +01:00
#Edit Repo Info
2017-09-07 12:29:05 +02:00
Close Browser
2018-01-25 11:09:39 +01:00
Test Case - Notary Basic Verfication
2018-01-23 06:04:19 +01:00
Enable Notary Client
2017-10-30 07:55:03 +01:00
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
Log ${output}
Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest
2018-08-24 07:30:07 +02:00
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group0-Util/notary-push-image.sh ${ip} ${notaryServerEndpoint}
2017-10-30 07:55:03 +01:00
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output curl -u admin:Harbor12345 -s --insecure -H "Content-Type: application/json" -X GET "https://${ip}/api/repositories/library/tomcat/signatures"
Log To Console ${output}
Should Be Equal As Integers ${rc} 0
#Should Contain ${output} sha256
2018-01-25 11:09:39 +01:00
Test Case - Ldap Basic Verfication
2017-08-07 08:02:38 +02:00
Switch To LDAP
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
Switch To Configure
Init LDAP
Logout Harbor
2017-11-29 12:29:51 +01:00
Sign In Harbor ${HARBOR_URL} mike zhu88jie
2018-03-12 07:20:37 +01:00
Close Browser
2018-08-01 00:38:23 +02:00
Test Case - Run LDAP Group Related API Test
Harbor API Test ./tests/apitests/python/test_ldap_admin_role.py
Harbor API Test ./tests/apitests/python/test_user_group.py
Harbor API Test ./tests/apitests/python/test_assign_role_to_ldap_group.py