mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-09 13:09:13 +01:00
[BAT] add drone to master (#2942)
* add drone to master copyright update update update update update update build process * update * package migrator
This commit is contained in:
parent
0b2d7ae6c2
commit
f40eb993a0
107
.drone.yml
Normal file
107
.drone.yml
Normal file
@ -0,0 +1,107 @@
|
||||
# Harbor drone.
|
||||
---
|
||||
workspace:
|
||||
base: /drone
|
||||
path: src/github.com/vmware/harbor
|
||||
|
||||
pipeline:
|
||||
clone:
|
||||
image: plugins/git
|
||||
tags: true
|
||||
recursive: false
|
||||
|
||||
integration-test-on-pr:
|
||||
image: vmware/harbor-e2e-engine:1.37
|
||||
pull: true
|
||||
privileged: true
|
||||
environment:
|
||||
BIN: bin
|
||||
GOPATH: /drone
|
||||
SHELL: /bin/bash
|
||||
LOG_TEMP_DIR: install-logs
|
||||
GITHUB_AUTOMATION_API_KEY: ${GITHUB_AUTOMATION_API_KEY}
|
||||
DRONE_SERVER: ${DRONE_SERVER}
|
||||
DRONE_TOKEN: ${DRONE_TOKEN_INTE}
|
||||
HARBOR_ADMIN: ${HARBOR_ADMIN}
|
||||
HARBOR_PASSWORD: ${HARBOR_PASSWORD}
|
||||
GS_PROJECT_ID: ${GS_PROJECT_ID}
|
||||
GS_CLIENT_EMAIL: ${GS_CLIENT_EMAIL}
|
||||
GS_PRIVATE_KEY: ${GS_PRIVATE_KEY}
|
||||
DOMAIN: ${CI_DOMAIN}
|
||||
MAIL_PWD: ${MAIL_PWD}
|
||||
commands:
|
||||
- tests/integration.sh
|
||||
when:
|
||||
status: success
|
||||
|
||||
bundle:
|
||||
image: vmware/harbor-e2e-engine:1.37
|
||||
pull: true
|
||||
privileged: true
|
||||
environment:
|
||||
BIN: bin
|
||||
GOPATH: /drone
|
||||
SHELL: /bin/bash
|
||||
BUILD_NUMBER: ${DRONE_BUILD_NUMBER}
|
||||
commands:
|
||||
- du -ks harbor-offline-installer-*.tgz | awk '{print $1 / 1024}' | { read x; echo $x MB; }
|
||||
- mkdir -p bundle
|
||||
- cp harbor-offline-installer-*.tgz bundle
|
||||
- ls -la bundle
|
||||
when:
|
||||
repo: vmware/harbor
|
||||
event: [ push, tag ]
|
||||
branch: [ master, releases/*, refs/tags/* ]
|
||||
status: success
|
||||
|
||||
notify-slack:
|
||||
image: plugins/slack
|
||||
webhook: ${SLACK_URL}
|
||||
username: drone
|
||||
template: >
|
||||
build https://ci.vcna.io/vmware/harbor/{{ build.number }} finished with a {{ build.status }} status. Please find logs at https://storage.googleapis.com/harbor-ci-logs/integration_logs_{{ build.number }}_{{ build.commit }}.zip
|
||||
when:
|
||||
repo: vmware/harbor
|
||||
branch: [ master, releases/*, refs/tags/* ]
|
||||
status: failure
|
||||
|
||||
publish-gcs-builds:
|
||||
image: maplain/drone-gcs:latest
|
||||
pull: true
|
||||
source: bundle
|
||||
target: harbor-builds
|
||||
acl:
|
||||
- allUsers:READER
|
||||
cache_control: public,max-age=3600
|
||||
when:
|
||||
repo: vmware/harbor
|
||||
event: [ push, tag ]
|
||||
branch: [ master, releases/* ]
|
||||
status: success
|
||||
|
||||
publish-gcs-releases:
|
||||
image: maplain/drone-gcs:latest
|
||||
pull: true
|
||||
source: bundle
|
||||
target: harbor-releases
|
||||
acl:
|
||||
- allUsers:READER
|
||||
cache_control: public,max-age=3600
|
||||
when:
|
||||
repo: vmware/harbor
|
||||
event: [ push, tag ]
|
||||
branch: [ refs/tags/* ]
|
||||
status: success
|
||||
|
||||
trigger:
|
||||
image: plugins/downstream
|
||||
server: https://ci.vcna.io
|
||||
token: ${DOWNSTREAM_TOKEN}
|
||||
fork: true
|
||||
repositories:
|
||||
- vmware/vic-product
|
||||
when:
|
||||
repo: vmware/harbor
|
||||
event: [ push, tag ]
|
||||
branch: [ master, releases/*, refs/tags/* ]
|
||||
status: success
|
1
.drone.yml.sig
Normal file
1
.drone.yml.sig
Normal file
@ -0,0 +1 @@
|
||||
eyJhbGciOiJIUzI1NiJ9.IyBIYXJib3IgZHJvbmUuCi0tLQp3b3Jrc3BhY2U6CiAgYmFzZTogL2Ryb25lCiAgcGF0aDogc3JjL2dpdGh1Yi5jb20vdm13YXJlL2hhcmJvcgoKcGlwZWxpbmU6CiAgY2xvbmU6CiAgICBpbWFnZTogcGx1Z2lucy9naXQKICAgIHRhZ3M6IHRydWUKICAgIHJlY3Vyc2l2ZTogZmFsc2UKCiAgaW50ZWdyYXRpb24tdGVzdC1vbi1wcjoKICAgIGltYWdlOiB2bXdhcmUvaGFyYm9yLWUyZS1lbmdpbmU6MS4zNwogICAgcHVsbDogdHJ1ZQogICAgcHJpdmlsZWdlZDogdHJ1ZQogICAgZW52aXJvbm1lbnQ6CiAgICAgIEJJTjogYmluCiAgICAgIEdPUEFUSDogL2Ryb25lCiAgICAgIFNIRUxMOiAvYmluL2Jhc2gKICAgICAgTE9HX1RFTVBfRElSOiBpbnN0YWxsLWxvZ3MKICAgICAgR0lUSFVCX0FVVE9NQVRJT05fQVBJX0tFWTogICR7R0lUSFVCX0FVVE9NQVRJT05fQVBJX0tFWX0KICAgICAgRFJPTkVfU0VSVkVSOiAgJHtEUk9ORV9TRVJWRVJ9CiAgICAgIERST05FX1RPS0VOOiAgJHtEUk9ORV9UT0tFTl9JTlRFfQogICAgICBIQVJCT1JfQURNSU46ICR7SEFSQk9SX0FETUlOfQogICAgICBIQVJCT1JfUEFTU1dPUkQ6ICR7SEFSQk9SX1BBU1NXT1JEfQogICAgICBHU19QUk9KRUNUX0lEOiAke0dTX1BST0pFQ1RfSUR9CiAgICAgIEdTX0NMSUVOVF9FTUFJTDogJHtHU19DTElFTlRfRU1BSUx9CiAgICAgIEdTX1BSSVZBVEVfS0VZOiAke0dTX1BSSVZBVEVfS0VZfQogICAgICBET01BSU46ICR7Q0lfRE9NQUlOfQogICAgICBNQUlMX1BXRDogJHtNQUlMX1BXRH0KICAgIGNvbW1hbmRzOgogICAgICAtIHRlc3RzL2ludGVncmF0aW9uLnNoCiAgICB3aGVuOgogICAgICBzdGF0dXM6IHN1Y2Nlc3MKCiAgYnVuZGxlOgogICAgaW1hZ2U6IHZtd2FyZS9oYXJib3ItZTJlLWVuZ2luZToxLjM3CiAgICBwdWxsOiB0cnVlCiAgICBwcml2aWxlZ2VkOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgQklOOiBiaW4KICAgICAgR09QQVRIOiAvZHJvbmUKICAgICAgU0hFTEw6IC9iaW4vYmFzaAogICAgICBCVUlMRF9OVU1CRVI6ICR7RFJPTkVfQlVJTERfTlVNQkVSfQogICAgY29tbWFuZHM6CiAgICAgIC0gZHUgLWtzIGhhcmJvci1vZmZsaW5lLWluc3RhbGxlci0qLnRneiB8IGF3ayAne3ByaW50ICQxIC8gMTAyNH0nIHwgeyByZWFkIHg7IGVjaG8gJHggTUI7IH0KICAgICAgLSBta2RpciAtcCBidW5kbGUKICAgICAgLSBjcCBoYXJib3Itb2ZmbGluZS1pbnN0YWxsZXItKi50Z3ogYnVuZGxlCiAgICAgIC0gbHMgLWxhIGJ1bmRsZQogICAgd2hlbjoKICAgICAgcmVwbzogdm13YXJlL2hhcmJvcgogICAgICBldmVudDogWyBwdXNoLCB0YWcgXQogICAgICBicmFuY2g6IFsgbWFzdGVyLCByZWxlYXNlcy8qLCByZWZzL3RhZ3MvKiBdCiAgICAgIHN0YXR1czogc3VjY2VzcwoKICBub3RpZnktc2xhY2s6CiAgICBpbWFnZTogcGx1Z2lucy9zbGFjawogICAgd2ViaG9vazogJHtTTEFDS19VUkx9CiAgICB1c2VybmFtZTogZHJvbmUKICAgIHRlbXBsYXRlOiA-CiAgICAgIGJ1aWxkIGh0dHBzOi8vY2kudmNuYS5pby92bXdhcmUvaGFyYm9yL3t7IGJ1aWxkLm51bWJlciB9fSBmaW5pc2hlZCB3aXRoIGEge3sgYnVpbGQuc3RhdHVzIH19IHN0YXR1cy4gUGxlYXNlIGZpbmQgbG9ncyBhdCBodHRwczovL3N0b3JhZ2UuZ29vZ2xlYXBpcy5jb20vaGFyYm9yLWNpLWxvZ3MvaW50ZWdyYXRpb25fbG9nc197eyBidWlsZC5udW1iZXIgfX1fe3sgYnVpbGQuY29tbWl0IH19LnppcAogICAgd2hlbjoKICAgICAgcmVwbzogdm13YXJlL2hhcmJvcgogICAgICBicmFuY2g6IFsgbWFzdGVyLCByZWxlYXNlcy8qLCByZWZzL3RhZ3MvKiBdCiAgICAgIHN0YXR1czogZmFpbHVyZQoKICBwdWJsaXNoLWdjcy1idWlsZHM6CiAgICBpbWFnZTogbWFwbGFpbi9kcm9uZS1nY3M6bGF0ZXN0CiAgICBwdWxsOiB0cnVlCiAgICBzb3VyY2U6IGJ1bmRsZQogICAgdGFyZ2V0OiBoYXJib3ItYnVpbGRzCiAgICBhY2w6CiAgICAgIC0gYWxsVXNlcnM6UkVBREVSCiAgICBjYWNoZV9jb250cm9sOiBwdWJsaWMsbWF4LWFnZT0zNjAwCiAgICB3aGVuOgogICAgICByZXBvOiB2bXdhcmUvaGFyYm9yCiAgICAgIGV2ZW50OiBbIHB1c2gsIHRhZyBdCiAgICAgIGJyYW5jaDogWyBtYXN0ZXIsIHJlbGVhc2VzLyogXQogICAgICBzdGF0dXM6IHN1Y2Nlc3MKCiAgcHVibGlzaC1nY3MtcmVsZWFzZXM6CiAgICBpbWFnZTogbWFwbGFpbi9kcm9uZS1nY3M6bGF0ZXN0CiAgICBwdWxsOiB0cnVlCiAgICBzb3VyY2U6IGJ1bmRsZQogICAgdGFyZ2V0OiBoYXJib3ItcmVsZWFzZXMKICAgIGFjbDoKICAgICAgLSBhbGxVc2VyczpSRUFERVIKICAgIGNhY2hlX2NvbnRyb2w6IHB1YmxpYyxtYXgtYWdlPTM2MDAKICAgIHdoZW46CiAgICAgIHJlcG86IHZtd2FyZS9oYXJib3IKICAgICAgZXZlbnQ6IFsgcHVzaCwgdGFnIF0KICAgICAgYnJhbmNoOiBbIHJlZnMvdGFncy8qIF0KICAgICAgc3RhdHVzOiBzdWNjZXNzCgogIHRyaWdnZXI6CiAgICBpbWFnZTogcGx1Z2lucy9kb3duc3RyZWFtCiAgICBzZXJ2ZXI6IGh0dHBzOi8vY2kudmNuYS5pbwogICAgdG9rZW46ICR7RE9XTlNUUkVBTV9UT0tFTn0KICAgIGZvcms6IHRydWUKICAgIHJlcG9zaXRvcmllczoKICAgICAgIC0gdm13YXJlL3ZpYy1wcm9kdWN0CiAgICB3aGVuOgogICAgICByZXBvOiB2bXdhcmUvaGFyYm9yCiAgICAgIGV2ZW50OiBbIHB1c2gsIHRhZyBdCiAgICAgIGJyYW5jaDogWyBtYXN0ZXIsIHJlbGVhc2VzLyosIHJlZnMvdGFncy8qIF0KICAgICAgc3RhdHVzOiBzdWNjZXNzCg.UHfjlhxr0N-tjA4AIjVThnu1GgzQFL0GIMFoxPVzalo
|
126
tests/integration.sh
Executable file
126
tests/integration.sh
Executable file
@ -0,0 +1,126 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2016 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.
|
||||
#
|
||||
|
||||
set -x
|
||||
gsutil version -l
|
||||
set +x
|
||||
|
||||
## --------------------------------------------- Init Env -------------------------------------------------
|
||||
dpkg -l > package.list
|
||||
# Start Xvfb for Chrome headlesss
|
||||
Xvfb -ac :99 -screen 0 1280x1024x16 & export DISPLAY=:99
|
||||
|
||||
export DRONE_SERVER=$DRONE_SERVER
|
||||
export DRONE_TOKEN=$DRONE_TOKEN
|
||||
buildinfo=$(drone build info vmware/harbor $DRONE_BUILD_NUMBER)
|
||||
echo $buildinfo
|
||||
upload_build=false
|
||||
nightly_run=false
|
||||
|
||||
# GC credentials
|
||||
keyfile="/root/harbor-ci-logs.key"
|
||||
botofile="/root/.boto"
|
||||
echo -en $GS_PRIVATE_KEY > $keyfile
|
||||
chmod 400 $keyfile
|
||||
echo "[Credentials]" >> $botofile
|
||||
echo "gs_service_key_file = $keyfile" >> $botofile
|
||||
echo "gs_service_client_id = $GS_CLIENT_EMAIL" >> $botofile
|
||||
echo "[GSUtil]" >> $botofile
|
||||
echo "content_language = en" >> $botofile
|
||||
echo "default_project_id = $GS_PROJECT_ID" >> $botofile
|
||||
container_ip=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
|
||||
echo $container_ip
|
||||
|
||||
## --------------------------------------------- Run Test Case ---------------------------------------------
|
||||
if [ $DRONE_REPO != "vmware/harbor" ]; then
|
||||
echo "Only run tests again Harbor Repo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# default running mode...
|
||||
if [[ $DRONE_BRANCH == "master" || $DRONE_BRANCH == *"refs/tags"* || $DRONE_BRANCH == "releases/"* ]] && [[ $DRONE_BUILD_EVENT == "push" || $DRONE_BUILD_EVENT == "tag" ]]; then
|
||||
## -------------- Package installer with clean code -----------------
|
||||
echo "Package Harbor build."
|
||||
pybot --removekeywords TAG:secret --include Bundle tests/robot-cases/Group0-Distro-Harbor
|
||||
echo "Running full CI for $DRONE_BUILD_EVENT on $DRONE_BRANCH"
|
||||
pybot -v ip:$container_ip --removekeywords TAG:secret --include BAT tests/robot-cases/Group0-BAT
|
||||
elif (echo $buildinfo | grep -q "\[specific ci="); then
|
||||
buildtype=$(echo $buildinfo | grep "\[specific ci=")
|
||||
testsuite=$(echo $buildtype | awk -v FS="(=|])" '{print $2}')
|
||||
pybot -v ip:$container_ip --removekeywords TAG:secret --suite $testsuite --suite Regression tests/robot-cases
|
||||
elif (echo $buildinfo | grep -q "\[full ci\]"); then
|
||||
upload_build=true
|
||||
pybot -v ip:$container_ip --removekeywords TAG:secret --exclude skip tests/robot-cases
|
||||
elif (echo $buildinfo | grep -q "\[BAT\]"); then
|
||||
upload_build=true
|
||||
pybot -v ip:$container_ip --removekeywords TAG:secret --include BAT tests/robot-cases/Group0-BAT
|
||||
elif (echo $buildinfo | grep -q "\[Nightly\]"); then
|
||||
upload_build=true
|
||||
nightly_run=false
|
||||
pybot -v ip:$container_ip --removekeywords TAG:secret --include BAT tests/robot-cases/Group0-BAT
|
||||
else
|
||||
echo "Please specify the tests, otherwise no case will be triggered."
|
||||
fi
|
||||
|
||||
rc="$?"
|
||||
echo $rc
|
||||
|
||||
timestamp=$(date +%s)
|
||||
outfile="integration_logs_"$DRONE_BUILD_NUMBER"_"$DRONE_COMMIT".zip"
|
||||
zip -9 $outfile output.xml log.html *.png package.list *container-logs.zip *.log /var/log/harbor/*/*.log /data/config/*
|
||||
if [ -f "$outfile" ]; then
|
||||
gsutil cp $outfile gs://harbor-ci-logs
|
||||
echo "----------------------------------------------"
|
||||
echo "Download test logs:"
|
||||
echo "https://storage.googleapis.com/harbor-ci-logs/$outfile"
|
||||
echo "----------------------------------------------"
|
||||
gsutil -D setacl public-read gs://harbor-ci-logs/$outfile &> /dev/null
|
||||
else
|
||||
echo "No log output file to upload"
|
||||
fi
|
||||
|
||||
## --------------------------------------------- Upload Harbor Build ---------------------------------------
|
||||
#if [ $upload_build == true ] && [ $rc -eq 0 ]; then
|
||||
# ls -la bundle
|
||||
# harbor_build=$(basename bundle/*)
|
||||
# gsutil cp $harbor_build gs://harbor-builds
|
||||
# echo "----------------------------------------------"
|
||||
# echo "Download harbor builds:"
|
||||
# echo "https://storage.googleapis.com/harbor-builds/$harbor_build"
|
||||
# echo "----------------------------------------------"
|
||||
# gsutil -D setacl public-read gs://harbor-builds/$harbor_build &> /dev/null
|
||||
#else
|
||||
# echo "No harbor build to upload"
|
||||
#fi
|
||||
|
||||
## --------------------------------------------- Sendout Email ---------------------------------------------
|
||||
if [ $nightly_run == true ]; then
|
||||
echo "Sendout Nightly Run Email."
|
||||
if [ $rc -eq 0 ]; then
|
||||
result=Pass
|
||||
else
|
||||
result=Fail
|
||||
fi
|
||||
python tests/nightly/sendreport.py --repo $DRONE_REPO --branch $DRONE_BRANCH --commit $DRONE_COMMIT --result $result --log $outfile --mailpwd $MAIL_PWD
|
||||
echo "Sendout Nightly Run Email success."
|
||||
fi
|
||||
|
||||
## --------------------------------------------- Tear Down -------------------------------------------------
|
||||
if [ -f "$keyfile" ]; then
|
||||
rm -f $keyfile
|
||||
fi
|
||||
|
||||
exit $rc
|
105
tests/resources/Admiral-Util.robot
Normal file
105
tests/resources/Admiral-Util.robot
Normal file
@ -0,0 +1,105 @@
|
||||
# Copyright 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 This resource contains all keywords related to creating, deleting, maintaining an instance of Admiral
|
||||
Library Selenium2Library 5 5
|
||||
Library OperatingSystem
|
||||
|
||||
*** Keywords ***
|
||||
Install Admiral
|
||||
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -p 8282:8282 --name admiral vmware/admiral:vic_v1.1.0
|
||||
Should Be Equal As Integers 0 ${rc}
|
||||
Set Environment Variable ADMIRAL_IP %{VCH-IP}:8282
|
||||
:FOR ${idx} IN RANGE 0 10
|
||||
\ ${out}= Run curl %{ADMIRAL_IP}
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} <body class="admiral-default">
|
||||
\ Return From Keyword If ${status}
|
||||
\ Sleep 5
|
||||
Fail Install Admiral failed: Admiral endpoint failed to respond to curl
|
||||
|
||||
Cleanup Admiral
|
||||
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm -f admiral
|
||||
Should Be Equal As Integers 0 ${rc}
|
||||
|
||||
Login To Admiral
|
||||
[Arguments] ${url}=localhost:8282 ${browser}=chrome
|
||||
Open Browser ${url} ${browser}
|
||||
Maximize Browser Window
|
||||
Wait Until Page Contains Welcome!
|
||||
Wait Until Page Contains This is the place for you to create, provision, manage and monitor containerized applications.
|
||||
Wait Until Element Is Visible css=button.btn.btn-primary.enter-btn
|
||||
Wait Until Element Is Enabled css=button.btn.btn-primary.enter-btn
|
||||
Click Button css=button.btn.btn-primary.enter-btn
|
||||
Wait Until Element Is Visible css=div.query-search-input-controls.form-control
|
||||
Wait Until Element Is Enabled css=div.query-search-input-controls.form-control
|
||||
Wait Until Element Is Visible css=a.btn.btn-primary.addHost-btn
|
||||
Wait Until Element Is Enabled css=a.btn.btn-primary.addHost-btn
|
||||
|
||||
Add Host To Admiral
|
||||
[Arguments] ${address} ${credentials}=${EMPTY}
|
||||
Wait Until Element Is Visible css=a[data-cmd="navigation-hosts"]
|
||||
Wait Until Element Is Enabled css=a[data-cmd="navigation-hosts"]
|
||||
Click Element css=a[data-cmd="navigation-hosts"]
|
||||
|
||||
Wait Until Element Is Visible css=div.query-search-input-controls.form-control
|
||||
Wait Until Element Is Enabled css=div.query-search-input-controls.form-control
|
||||
Wait Until Element Is Visible css=a.btn.btn-primary.addHost-btn
|
||||
Wait Until Element Is Enabled css=a.btn.btn-primary.addHost-btn
|
||||
Click Element css=a.btn.btn-primary.addHost-btn
|
||||
|
||||
Wait Until Page Contains Add Host
|
||||
Wait Until Element Is Visible address
|
||||
Wait Until Element Is Enabled address
|
||||
Wait Until Element Is Visible credential
|
||||
Wait Until Element Is Enabled credential
|
||||
|
||||
Input Text css=#address > input.form-control ${address}
|
||||
|
||||
Select From List css=#hostType > div.select > select VCH
|
||||
|
||||
Run Keyword If '${credentials}' != '${EMPTY}' Click Element css=#credential > div.form-control > div.dropdown > button.dropdown-toggle
|
||||
Run Keyword If '${credentials}' != '${EMPTY}' Click Element css=a[data-name=${credentials}]
|
||||
|
||||
Wait Until Element Is Visible css=a.btn.verifyHost
|
||||
Wait Until Element Is Enabled css=a.btn.verifyHost
|
||||
Click Element css=a.btn.verifyHost
|
||||
|
||||
Wait Until Page Contains Verified successfully!
|
||||
Wait Until Element Is Visible css=button.btn.btn-primary.saveHost
|
||||
Wait Until Element Is Enabled css=button.btn.btn-primary.saveHost
|
||||
Click Button css=button.btn.btn-primary.saveHost
|
||||
|
||||
Wait Until Element Is Visible css=div.status.ON
|
||||
Wait Until Element Is Enabled css=div.status.ON
|
||||
|
||||
|
||||
Add Project to Admiral
|
||||
[Arguments] ${name}
|
||||
Wait Until Element Is Visible css=a[data-cmd="navigation-placements"]
|
||||
Wait Until Element Is Enabled css=a[data-cmd="navigation-placements"]
|
||||
Click Element css=a[data-cmd="navigation-placements"]
|
||||
|
||||
Wait Until Element Is Visible css=div.right-context-panel > div.toolbar > div:nth-child(2) > a
|
||||
Wait Until Element Is Enabled css=div.right-context-panel > div.toolbar > div:nth-child(2) > a
|
||||
Click Element css=div.right-context-panel > div.toolbar > div:nth-child(2) > a
|
||||
|
||||
Wait Until Page Contains Project
|
||||
Wait Until Element Is Visible css=div.right-context-panel > div.content > div > div.list-holder > div.inline-editable-list-holder > div.inline-editable-list > div.toolbar > a.new-item
|
||||
Wait Until Element Is Enabled css=div.right-context-panel > div.content > div > div.list-holder > div.inline-editable-list-holder > div.inline-editable-list > div.toolbar > a.new-item
|
||||
Click Element css=div.right-context-panel > div.content > div > div.list-holder > div.inline-editable-list-holder > div.inline-editable-list > div.toolbar > a.new-item
|
||||
Input Text css=input.name-input ${name}
|
||||
Click Element css=button.btn.btn-primary.inline-edit-save
|
||||
|
||||
Table Should Contain css=div.right-context-panel > div.content > div > div > div > div > table ${name}
|
105
tests/resources/Cert-Util.robot
Normal file
105
tests/resources/Cert-Util.robot
Normal file
@ -0,0 +1,105 @@
|
||||
# Copyright 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 This resource contains keywords related to creating and using certificates. Requires scripts in infra/integration-image/scripts be available in PATH
|
||||
|
||||
*** Keywords ***
|
||||
Generate Certificate Authority
|
||||
# Generates CA (private/ca.key.pem, certs/ca.cert.pem, certs/STARK_ENTERPRISES_ROOT_CA.crt) in OUT_DIR
|
||||
[Arguments] ${CA_NAME}=STARK_ENTERPRISES_ROOT_CA ${OUT_DIR}=/root/ca
|
||||
Log To Console Generating Certificate Authority
|
||||
${rc} ${out}= Run And Return Rc And Output generate-ca.sh -c ${CA_NAME} -d ${OUT_DIR}
|
||||
Log ${out}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
|
||||
Generate Wildcard Server Certificate
|
||||
# Generates key and signs with CA for *.DOMAIN (csr/*.DOMAIN.csr.pem,
|
||||
# private/*.DOMAIN.key.pem, certs/*.DOMAIN.cert.pem) in OUT_DIR
|
||||
[Arguments] ${DOMAIN}=%{DOMAIN} ${OUT_DIR}=/root/ca ${CA_NAME}=STARK_ENTERPRISES_ROOT_CA
|
||||
Log To Console Generating Wildcard Server Certificate
|
||||
Run Keyword Generate Server Key And CSR *.${DOMAIN} ${OUT_DIR}
|
||||
Run Keyword Sign Server CSR ${CA_NAME} *.${DOMAIN} ${OUT_DIR}
|
||||
Run Keyword Create Certificate Bundle CA_NAME=${CA_NAME} SRC_DIR=${OUT_DIR} CN=*.${DOMAIN}
|
||||
${out}= Run ls -al ${OUT_DIR}/csr
|
||||
Log ${out}
|
||||
${out}= Run ls -al ${OUT_DIR}/private
|
||||
Log ${out}
|
||||
${out}= Run ls -al ${OUT_DIR}/certs
|
||||
Log ${out}
|
||||
|
||||
|
||||
Generate Server Key And CSR
|
||||
# Generates key and CSR (private/DOMAIN.key.pem, csr/DOMAIN.csr.pem) in OUT_DIR
|
||||
[Arguments] ${CN}=%{DOMAIN} ${OUT_DIR}=/root/ca
|
||||
Log To Console Generating Server Key And CSR
|
||||
${out}= Run generate-server-key-csr.sh -d ${OUT_DIR} -n ${CN}
|
||||
Log ${out}
|
||||
|
||||
|
||||
Sign Server CSR
|
||||
# Generates certificate signed by CA (certs/DOMAIN.cert.pem) in OUT_DIR
|
||||
[Arguments] ${CA_NAME}=STARK_ENTERPRISES_ROOT_CA ${CN}=%{DOMAIN} ${OUT_DIR}=/root/ca
|
||||
Log To Console Signing Server CSR
|
||||
${out}= Run sign-csr.sh -c ${CA_NAME} -d ${OUT_DIR} -n ${CN}
|
||||
Log ${out}
|
||||
|
||||
|
||||
Trust Certificate Authority
|
||||
# Installs root certificate into trust store on Debian based distro
|
||||
[Arguments] ${CRT_FILE}=/root/ca/certs/STARK_ENTERPRISES_ROOT_CA.crt
|
||||
Log To Console Installing CA
|
||||
${rc} ${out}= Run And Return Rc And Output ubuntu-install-ca.sh -f ${CRT_FILE}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${out}
|
||||
|
||||
|
||||
Reload Default Certificate Authorities
|
||||
# Reloads default certificates into trust store on Debian based distro
|
||||
# Removes all user provided CAs
|
||||
Log To Console Reloading Default CAs
|
||||
${rc} ${out}= Run And Return Rc And Output ubuntu-reload-cas.sh
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${out}
|
||||
|
||||
|
||||
Create Certificate Bundle
|
||||
[Arguments] ${CA_NAME}=STARK_ENTERPRISES_ROOT_CA ${SRC_DIR}=/root/ca ${OUT_FILE}=/root/ca/cert-bundle.tgz ${CN}=%{DOMAIN} ${TMP_DIR}=/root/ca/bundle
|
||||
${rc} ${out}= Run And Return Rc And Output bundle-certs.sh -c ${CA_NAME} -d ${SRC_DIR} -f ${OUT_FILE} -n ${CN} -o ${TMP_DIR}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${out}
|
||||
|
||||
|
||||
Get Certificate Authority CRT
|
||||
# Return ascii armored certificate from file e.g. `-----BEGIN CERTIFICATE-----`
|
||||
[Arguments] ${CA_CRT}=STARK_ENTERPRISES_ROOT_CA.crt ${DIR}=/root/ca/certs
|
||||
${out}= Run cat ${DIR}/${CA_CRT}
|
||||
[Return] ${out}
|
||||
|
||||
|
||||
Get Server Certificate
|
||||
# Return ascii armored certificate from file e.g. `-----BEGIN CERTIFICATE-----`
|
||||
# PEM must be provided if using a wildcard cert not specified by DOMAIN
|
||||
[Arguments] ${PEM}=%{DOMAIN}.cert.pem ${DIR}=/root/ca/certs
|
||||
${out}= Run cat ${DIR}/${PEM}
|
||||
[Return] ${out}
|
||||
|
||||
|
||||
Get Server Key
|
||||
# Return ascii armored key from file e.g. `-----BEGIN RSA PRIVATE KEY-----`
|
||||
# PEM must be provided if using a wildcard cert not specified by DOMAIN
|
||||
[Arguments] ${PEM}=%{DOMAIN}.key.pem ${DIR}=/root/ca/private
|
||||
${out}= Run cat ${DIR}/${PEM}
|
||||
[Return] ${out}
|
100
tests/resources/Docker-Util.robot
Normal file
100
tests/resources/Docker-Util.robot
Normal file
@ -0,0 +1,100 @@
|
||||
# Copyright 2016-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 This resource provides helper functions for docker operations
|
||||
Library OperatingSystem
|
||||
Library Process
|
||||
|
||||
*** Keywords ***
|
||||
Run Docker Info
|
||||
[Arguments] ${docker-params}
|
||||
${rc}= Run And Return Rc docker ${docker-params} info
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Pull image
|
||||
[Arguments] ${ip} ${user} ${pwd} ${project} ${image}
|
||||
Log To Console \nRunning docker pull ${image}...
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull ${ip}/${project}/${image}
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Should Contain ${output} Digest:
|
||||
Should Contain ${output} Status:
|
||||
Should Not Contain ${output} No such image:
|
||||
|
||||
Push image
|
||||
[Arguments] ${ip} ${user} ${pwd} ${project} ${image}
|
||||
Log To Console \nRunning docker push ${image}...
|
||||
${rc}= Run And Return Rc docker pull ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker tag ${image} ${ip}/${project}/${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker push ${ip}/${project}/${image}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker logout ${ip}
|
||||
|
||||
Cannot Pull image
|
||||
[Arguments] ${ip} ${user} ${pwd} ${project} ${image}
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u ${user} -p ${pwd} ${ip}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull ${ip}/${project}/${image}
|
||||
Log To Console ${output}
|
||||
Should Not Be Equal As Integers ${rc} 0
|
||||
|
||||
Wait Until Container Stops
|
||||
[Arguments] ${container}
|
||||
:FOR ${idx} IN RANGE 0 60
|
||||
\ ${out}= Run docker %{VCH-PARAMS} inspect ${container} | grep Status
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} exited
|
||||
\ Return From Keyword If ${status}
|
||||
\ Sleep 1
|
||||
Fail Container did not stop within 60 seconds
|
||||
|
||||
Hit Nginx Endpoint
|
||||
[Arguments] ${vch-ip} ${port}
|
||||
${rc} ${output}= Run And Return Rc And Output wget ${vch-ip}:${port}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Get Container IP
|
||||
[Arguments] ${docker-params} ${id} ${network}=default ${dockercmd}=docker
|
||||
${rc} ${ip}= Run And Return Rc And Output ${dockercmd} ${docker-params} network inspect ${network} | jq '.[0].Containers."${id}".IPv4Address' | cut -d \\" -f 2 | cut -d \\/ -f 1
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
[Return] ${ip}
|
||||
|
||||
# The local dind version is embedded in Dockerfile
|
||||
# docker:1.13-dind
|
||||
# If you are running this keyword in a container, make sure it is run with --privileged turned on
|
||||
Start Docker Daemon Locally
|
||||
${pid}= Run pidof dockerd
|
||||
Return From Keyword If '${pid}' != '${EMPTY}'
|
||||
OperatingSystem.File Should Exist /usr/local/bin/dockerd-entrypoint.sh
|
||||
${handle}= Start Process /usr/local/bin/dockerd-entrypoint.sh dockerd>./daemon-local.log 2>&1 shell=True
|
||||
Process Should Be Running ${handle}
|
||||
:FOR ${IDX} IN RANGE 5
|
||||
\ ${pid}= Run pidof dockerd
|
||||
\ Exit For Loop If '${pid}' != '${EMPTY}'
|
||||
\ Sleep 2s
|
||||
Sleep 2s
|
||||
[Return] ${handle}
|
||||
|
||||
Kill Local Docker Daemon
|
||||
[Arguments] ${handle} ${dockerd-pid}
|
||||
Terminate Process ${handle}
|
||||
Process Should Be Stopped ${handle}
|
||||
${rc}= Run And Return Rc kill -9 ${dockerd-pid}
|
||||
Should Be Equal As Integers ${rc} 0
|
31
tests/resources/Drone-Util.robot
Normal file
31
tests/resources/Drone-Util.robot
Normal file
@ -0,0 +1,31 @@
|
||||
# Copyright 2016-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 This resource contains any keywords related to using the Drone CI Build System
|
||||
|
||||
*** Keywords ***
|
||||
Get State Of Drone Build
|
||||
[Arguments] ${num}
|
||||
Return From Keyword If '${num}' == '0' local
|
||||
${out}= Run drone build info vmware/vic ${num}
|
||||
${lines}= Split To Lines ${out}
|
||||
[Return] @{lines}[2]
|
||||
|
||||
Get Title of Drone Build
|
||||
[Arguments] ${num}
|
||||
Return From Keyword If '${num}' == '0' local
|
||||
${out}= Run drone build info vmware/vic ${num}
|
||||
${lines}= Split To Lines ${out}
|
||||
[Return] @{lines}[-1]
|
28
tests/resources/Github-Util.robot
Normal file
28
tests/resources/Github-Util.robot
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright 2016-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 This resource provides keywords to interact with Github
|
||||
|
||||
*** Keywords ***
|
||||
Get State Of Github Issue
|
||||
[Arguments] ${num}
|
||||
[Tags] secret
|
||||
:FOR ${idx} IN RANGE 0 5
|
||||
\ ${status} ${result}= Run Keyword And Ignore Error Get https://api.github.com/repos/vmware/vic/issues/${num}?access_token\=%{GITHUB_AUTOMATION_API_KEY}
|
||||
\ Exit For Loop If '${status}'
|
||||
\ Sleep 1
|
||||
Should Be Equal ${result.status_code} ${200}
|
||||
${status}= Get From Dictionary ${result.json()} state
|
||||
[Return] ${status}
|
38
tests/resources/Harbor-Pages/Administration-Users.robot
Normal file
38
tests/resources/Harbor-Pages/Administration-Users.robot
Normal file
@ -0,0 +1,38 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Assign User Admin
|
||||
[Arguments] ${user}
|
||||
Click Element xpath=//clr-main-container//harbor-user//hbr-filter//clr-icon
|
||||
Input Text xpath=//harbor-shell/clr-main-container//harbor-user//hbr-filter//input ${user}
|
||||
Sleep 2
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container/div/div/harbor-user/div/div/h2
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container//harbor-user//clr-datagrid//clr-dg-action-overflow
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container//harbor-user//clr-datagrid//clr-dg-row//clr-dg-action-overflow//button[1]
|
||||
Sleep 1
|
||||
|
||||
Switch to User Tag
|
||||
Click Element xpath=${administration_user_tag_xpath}
|
||||
Sleep 1
|
||||
|
||||
Administration Tag Should Display
|
||||
Page Should Contain Element xpath=${administration_tag_xpath}
|
@ -0,0 +1,20 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${administration_user_tag_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/section/ul/li[1]/a
|
||||
${administration_tag_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/section/label
|
172
tests/resources/Harbor-Pages/Configuration.robot
Normal file
172
tests/resources/Harbor-Pages/Configuration.robot
Normal file
@ -0,0 +1,172 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Init LDAP
|
||||
${rc} ${output}= Run And Return Rc And Output ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'
|
||||
Log ${output}
|
||||
Sleep 2
|
||||
Input Text xpath=//*[@id="ldapUrl"] ldap://${output}
|
||||
Sleep 1
|
||||
Input Text xpath=//*[@id="ldapSearchDN"] cn=admin,dc=example,dc=org
|
||||
Sleep 1
|
||||
Input Text xpath=//*[@id="ldapSearchPwd"] admin
|
||||
Sleep 1
|
||||
Input Text xpath=//*[@id="ldapBaseDN"] dc=example,dc=org
|
||||
Sleep 1
|
||||
Input Text xpath=//*[@id="ldapUid"] cn
|
||||
Sleep 1
|
||||
Capture Page Screenshot
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 2
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3]
|
||||
Sleep 1
|
||||
Capture Page Screenshot
|
||||
|
||||
Switch To Configure
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/section/ul/li[3]/a
|
||||
Sleep 2
|
||||
|
||||
Set Pro Create Admin Only
|
||||
#set limit to admin only
|
||||
Sleep 2
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Sleep 1
|
||||
Click Element xpath=//select[@id="proCreation"]
|
||||
Click Element xpath=//select[@id="proCreation"]//option[@value="adminonly"]
|
||||
Sleep 1
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot AdminCreateOnly.png
|
||||
|
||||
Set Pro Create Every One
|
||||
#set limit to Every One
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Sleep 1
|
||||
Click Element xpath=//select[@id="proCreation"]
|
||||
Click Element xpath=//select[@id="proCreation"]//option[@value="everyone"]
|
||||
Sleep 1
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 2
|
||||
Capture Page Screenshot EveryoneCreate.png
|
||||
|
||||
Disable Self Reg
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Mouse Down xpath=${self_reg_xpath}
|
||||
Mouse Up xpath=${self_reg_xpath}
|
||||
Sleep 1
|
||||
Self Reg Should Be Disabled
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot DisableSelfReg.png
|
||||
Sleep 1
|
||||
|
||||
Enable Self Reg
|
||||
Mouse Down xpath=${self_reg_xpath}
|
||||
Mouse Up xpath=${self_reg_xpath}
|
||||
Sleep 1
|
||||
Self Reg Should Be Enabled
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot EnableSelfReg.png
|
||||
Sleep 1
|
||||
|
||||
Self Reg Should Be Disabled
|
||||
Checkbox Should Not Be Selected xpath=${self_reg_xpath}
|
||||
|
||||
Self Reg Should Be Enabled
|
||||
Checkbox Should Be Selected xpath=${self_reg_xpath}
|
||||
|
||||
Project Creation Should Display
|
||||
Page Should Contain Element xpath=${project_create_xpath}
|
||||
|
||||
Project Creation Should Not Display
|
||||
Page Should Not Contain Element xpath=${project_create_xpath}
|
||||
|
||||
## System settings
|
||||
Switch To System Settings
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Click Element xpath=//config//ul/li[4]
|
||||
|
||||
Modify Token Expiration
|
||||
[Arguments] ${minutes}
|
||||
Input Text xpath=//*[@id="tokenExpiration"] ${minutes}
|
||||
Click Button xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 1
|
||||
|
||||
Token Must Be Match
|
||||
[Arguments] ${minutes}
|
||||
Textfield Value Should Be xpath=//*[@id="tokenExpiration"] ${minutes}
|
||||
|
||||
## Replication
|
||||
Check Verify Remote Cert
|
||||
Mouse Down xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
Mouse Up xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Capture Page Screenshot RemoteCert.png
|
||||
Sleep 1
|
||||
|
||||
Switch To System Replication
|
||||
Sleep 1
|
||||
Switch To Configure
|
||||
Click Element xpath=//*[@id="config-replication"]
|
||||
Sleep 1
|
||||
|
||||
Should Verify Remote Cert Be Enabled
|
||||
Checkbox Should Not Be Selected xpath=//*[@id="clr-checkbox-verifyRemoteCert"]
|
||||
|
||||
## Email
|
||||
Switch To Email
|
||||
Switch To Configure
|
||||
Click Element xpath=//*[@id="config-email"]
|
||||
Sleep 1
|
||||
|
||||
Config Email
|
||||
Input Text xpath=//*[@id="mailServer"] smtp.vmware.com
|
||||
Input Text xpath=//*[@id="emailPort"] 25
|
||||
Input Text xpath=//*[@id="emailUsername"] example@vmware.com
|
||||
Input Text xpath=//*[@id="emailPassword"] example
|
||||
Input Text xpath=//*[@id="emailFrom"] example<example@vmware.com>
|
||||
Sleep 1
|
||||
Mouse Down xpath=//*[@id="clr-checkbox-emailSSL"]
|
||||
Mouse Up xpath=//*[@id="clr-checkbox-emailSSL"]
|
||||
Sleep 1
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1]
|
||||
Sleep 6
|
||||
|
||||
Verify Email
|
||||
Textfield Value Should Be xpath=//*[@id="mailServer"] smtp.vmware.com
|
||||
Textfield Value Should Be xpath=//*[@id="emailPort"] 25
|
||||
Textfield Value Should Be xpath=//*[@id="emailUsername"] example@vmware.com
|
||||
Textfield Value Should Be xpath=//*[@id="emailFrom"] example<example@vmware.com>
|
||||
Checkbox Should Be Selected xpath=//*[@id="clr-checkbox-emailSSL"]
|
||||
|
||||
Set Scan All To None
|
||||
click element //vulnerability-config//select
|
||||
click element //vulnerability-config//select/option[@value='none']
|
||||
sleep 1
|
||||
click element //config//div/button[contains(.,'SAVE')]
|
||||
Set Scan All To Daily
|
||||
click element //vulnerability-config//select
|
||||
click element //vulnerability-config//select/option[@value='daily']
|
||||
sleep 1
|
||||
click element //config//div/button[contains(.,'SAVE')]
|
||||
Click Scan Now
|
||||
click element //vulnerability-config//button[contains(.,'SCAN')]
|
||||
|
20
tests/resources/Harbor-Pages/Configuration_Elements.robot
Normal file
20
tests/resources/Harbor-Pages/Configuration_Elements.robot
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${project_create_xpath} //project//div[@class="option-left"]/button
|
||||
${self_reg_xpath} //input[@id="clr-checkbox-selfReg"]
|
73
tests/resources/Harbor-Pages/HomePage.robot
Normal file
73
tests/resources/Harbor-Pages/HomePage.robot
Normal file
@ -0,0 +1,73 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Sign In Harbor
|
||||
[Arguments] ${url} ${user} ${pw}
|
||||
Go To ${url}
|
||||
Sleep 5
|
||||
${title}= Get Title
|
||||
Log To Console ${title}
|
||||
Should Be Equal ${title} Harbor
|
||||
Sleep 2
|
||||
Input Text login_username ${user}
|
||||
Input Text login_password ${pw}
|
||||
Sleep 2
|
||||
Click button css=.btn
|
||||
sleep 5
|
||||
Log To Console ${user}
|
||||
Wait Until Page Contains ${user}
|
||||
|
||||
Sign Up Should Not Display
|
||||
Page Should Not Contain Element xpath=${sign_up_button_xpath}
|
||||
|
||||
Create An New User
|
||||
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment}
|
||||
Go To ${url}
|
||||
sleep 5
|
||||
${title}= Get Title
|
||||
Log To Console ${title}
|
||||
Should Be Equal ${title} Harbor
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Sleep 5
|
||||
Click Element xpath=${sign_up_for_an_account_xpath}
|
||||
sleep 3
|
||||
Input Text xpath=${username_xpath} ${username}
|
||||
sleep 1
|
||||
Input Text xpath=${email_xpath} ${email}
|
||||
sleep 1
|
||||
Input Text xpath=${realname_xpath} ${realname}
|
||||
sleep 1
|
||||
Input Text xpath=${newPassword_xpath} ${newPassword}
|
||||
sleep 1
|
||||
Input Text xpath=${confirmPassword_xpath} ${newPassword}
|
||||
sleep 1
|
||||
Input Text xpath=${comment_xpath} ${comment}
|
||||
sleep 2
|
||||
Click button xpath=${signup_xpath}
|
||||
sleep 5
|
||||
Input Text login_username ${username}
|
||||
Input Text login_password ${newPassword}
|
||||
sleep 2
|
||||
Click button css=.btn
|
||||
sleep 5
|
||||
Wait Until Page Contains ${username}
|
||||
Sleep 3
|
28
tests/resources/Harbor-Pages/HomePage_Elements.robot
Normal file
28
tests/resources/Harbor-Pages/HomePage_Elements.robot
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${sign_up_for_an_account_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/sign-in/div/form/div[1]/a
|
||||
${sign_up_button_xpath} //a[@class="signup"]
|
||||
${username_xpath} //*[@id="username"]
|
||||
${email_xpath} //*[@id="email"]
|
||||
${realname_xpath} //*[@id="realname"]
|
||||
${newPassword_xpath} //*[@id="newPassword"]
|
||||
${confirmPassword_xpath} //*[@id="confirmPassword"]
|
||||
${comment_xpath} //*[@id="comment"]
|
||||
${signup_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/sign-in/sign-up/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
|
||||
|
89
tests/resources/Harbor-Pages/Project-Members.robot
Normal file
89
tests/resources/Harbor-Pages/Project-Members.robot
Normal file
@ -0,0 +1,89 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Go Into Project
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Click Element xpath=//*[@id="search_input"]
|
||||
Sleep 2
|
||||
Input Text xpath=//*[@id="search_input"] ${project}
|
||||
Sleep 8
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=//*[@id="results"]/list-project-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo_${project}.png
|
||||
|
||||
Go Into Project2
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo1_${project}.png
|
||||
# search icon
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/clr-icon/svg
|
||||
Sleep 2
|
||||
# text search project
|
||||
Input Text xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/input ${project}
|
||||
Sleep 5
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[2]/a
|
||||
Sleep 3
|
||||
Capture Page Screenshot gointo2_${project}.png
|
||||
|
||||
Add User To Project Admin
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project2
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_add_button_xpath}
|
||||
Sleep 2
|
||||
Input Text xpath=${project_member_add_username_xpath} ${user}
|
||||
Sleep 3
|
||||
Click Element xpath=${project_member_add_admin_xpath}
|
||||
Click Element xpath=${project_member_add_save_button_xpath}
|
||||
Sleep 4
|
||||
|
||||
Search Project Member
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project ${project}
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_search_button_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_search_text_xpath}
|
||||
Sleep 2
|
||||
Wait Until Page Contains ${user}
|
||||
|
||||
Change Project Member Role
|
||||
[Arguments] ${project} ${user} ${role}
|
||||
Click Element xpath=//clr-dg-cell//a[contains(.,"${project}")]
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${user}")]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-action-overflow//button[contains(.,"${role}")]
|
||||
Sleep 2
|
||||
Wait Until Page Contains ${role}
|
||||
|
||||
|
||||
|
25
tests/resources/Harbor-Pages/Project-Members_Elements.robot
Normal file
25
tests/resources/Harbor-Pages/Project-Members_Elements.robot
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${project_member_tag_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/nav/ul/li[2]/a
|
||||
${project_member_add_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/button
|
||||
${project_member_add_username_xpath} //*[@id="member_name"]
|
||||
${project_member_add_admin_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div[1]/label
|
||||
${project_member_add_save_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
|
||||
${project_member_search_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/clr-icon/svg
|
||||
${project_member_search_text_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/input
|
159
tests/resources/Harbor-Pages/Project.robot
Normal file
159
tests/resources/Harbor-Pages/Project.robot
Normal file
@ -0,0 +1,159 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Create An New Project
|
||||
[Arguments] ${projectname} ${public}=false
|
||||
Sleep 1
|
||||
Click Button css=${create_project_button_css}
|
||||
Sleep 1
|
||||
Log To Console Project Name: ${projectname}
|
||||
Input Text xpath=${project_name_xpath} ${projectname}
|
||||
Sleep 3
|
||||
Run Keyword If '${public}' == 'true' Click Element xpath=${project_public_xpath}
|
||||
Click Element css=${project_save_css}
|
||||
Sleep 4
|
||||
Wait Until Page Contains ${projectname}
|
||||
Wait Until Page Contains Project Admin
|
||||
|
||||
Create An New Project With New User
|
||||
[Arguments] ${url} ${username} ${email} ${realname} ${newPassword} ${comment} ${projectname} ${public}
|
||||
Create An New User url=${url} username=${username} email=${email} realname=${realname} newPassword=${newPassword} comment=${comment}
|
||||
Logout Harbor
|
||||
Sign In Harbor ${url} ${username} ${newPassword}
|
||||
Create An New Project ${projectname} ${public}
|
||||
Sleep 1
|
||||
|
||||
#It's the log of project.
|
||||
Go To Project Log
|
||||
Click Element xpath=//project-detail//ul/li[3]
|
||||
Sleep 2
|
||||
|
||||
Switch To Log
|
||||
Click Element xpath=${log_xpath}
|
||||
Sleep 1
|
||||
|
||||
Switch To Replication
|
||||
Click Element xpath=${replication_xpath}
|
||||
Sleep 1
|
||||
|
||||
Back To projects
|
||||
Click Element xpath=${projects_xpath}
|
||||
Sleep 1
|
||||
|
||||
Project Should Display
|
||||
[Arguments] ${projectname}
|
||||
Page Should Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
||||
|
||||
Project Should Not Display
|
||||
[Arguments] ${projectname}
|
||||
Page Should Not Contain Element xpath=//project//list-project//clr-dg-cell/a[contains(.,'${projectname}')]
|
||||
|
||||
Search Private Projects
|
||||
Click element xpath=//select
|
||||
Click element xpath=//select/option[@value=1]
|
||||
Sleep 1
|
||||
Capture Page Screenshot SearchPrivateProjects.png
|
||||
|
||||
Make Project Private
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Private")]
|
||||
|
||||
Make Project Public
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Public")]
|
||||
|
||||
Delete Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${projectname}")]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-dg-action-overflow//button[contains(.,"Delete")]
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-modal//div[@class="modal-dialog"]//button[2]
|
||||
Sleep 2
|
||||
|
||||
Advanced Search Should Display
|
||||
Page Should Contain Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
||||
|
||||
# it's not a common keywords, only used into log case.
|
||||
Do Log Advanced Search
|
||||
Capture Page Screenshot LogAdvancedSearch.png
|
||||
Sleep 1
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"pull")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"push")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"create")]
|
||||
Page Should Contain Element xpath=//clr-dg-row[contains(.,"delete")]
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//div[@class="flex-xs-middle"]/button
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//audit-log//clr-dropdown/button
|
||||
Sleep 1
|
||||
#pull log
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Pull")]
|
||||
Sleep 1
|
||||
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"pull")]
|
||||
#push log
|
||||
Click Element xpath=//audit-log//clr-dropdown/button
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Push")]
|
||||
Sleep 1
|
||||
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"push")]
|
||||
#create log
|
||||
Click Element xpath=//audit-log//clr-dropdown/button
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Create")]
|
||||
Sleep 1
|
||||
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"create")]
|
||||
#delete log
|
||||
Click Element xpath=//audit-log//clr-dropdown/button
|
||||
Sleep 1
|
||||
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Delete")]
|
||||
Sleep 1
|
||||
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"delete")]
|
||||
#others
|
||||
Click Element xpath=//audit-log//clr-dropdown/button
|
||||
Click Element xpath=//audit-log//clr-dropdown//a[contains(.,"Others")]
|
||||
Sleep 1
|
||||
Click element xpath=//audit-log//hbr-filter//clr-icon
|
||||
Input Text xpath = //audit-log//hbr-filter//input harbor
|
||||
Sleep 1
|
||||
${c} = Get Matching Xpath Count //audit-log//clr-dg-row
|
||||
Should be equal as integers ${c} 0
|
||||
|
||||
Expand Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element //repository//clr-dg-row-master[contains(.,'${projectname}')]//button/clr-icon
|
||||
sleep 1
|
||||
|
||||
Scan Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow//button[contains(.,'Scan')]
|
||||
Sleep 15
|
||||
|
||||
Summary Chart Should Display
|
||||
[Arguments] ${projectname}
|
||||
Page Should Contain Element //clr-dg-row-master[contains(.,'${projectname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
25
tests/resources/Harbor-Pages/Project_Elements.robot
Normal file
25
tests/resources/Harbor-Pages/Project_Elements.robot
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${create_project_button_css} .btn
|
||||
${project_name_xpath} //*[@id="create_project_name"]
|
||||
${project_public_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[1]/create-project/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div/label
|
||||
${project_save_css} html body.no-scrolling harbor-app harbor-shell clr-main-container.main-container div.content-container div.content-area.content-area-override project div.row div.col-lg-12.col-md-12.col-sm-12.col-xs-12 div.row.flex-items-xs-between div.option-left create-project clr-modal div.modal div.modal-dialog div.modal-content div.modal-footer button.btn.btn-primary
|
||||
${log_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[2]
|
||||
${projects_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[1]
|
||||
${replication_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/nav/ul/li[4]/a
|
43
tests/resources/Harbor-Pages/Replication.robot
Normal file
43
tests/resources/Harbor-Pages/Replication.robot
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Create An New Rule With New Endpoint
|
||||
[Arguments] ${policy_name} ${policy_description} ${destination_name} ${destination_url} ${destination_username} ${destination_password}
|
||||
Click element xpath=${new_name_xpath}
|
||||
Sleep 2
|
||||
|
||||
Input Text xpath=${policy_name_xpath} ${policy_name}
|
||||
Input Text xpath=${policy_description_xpath} ${policy_description}
|
||||
|
||||
Click element xpath=${policy_enable_checkbox}
|
||||
Click element xpath=${policy_endpoint_checkbox}
|
||||
|
||||
Input text xpath=${destination_name_xpath} ${destination_name}
|
||||
Input text xpath=${destination_url_xpath} ${destination_url}
|
||||
Input text xpath=${destination_username_xpath} ${destination_username}
|
||||
Input text xpath=${destination_password_xpath} ${destination_password}
|
||||
Click element xpath=${replicaton_save_xpath}
|
||||
Sleep 2
|
||||
Capture Page Screenshot rule_${policy_name}.png
|
||||
Wait Until Page Contains ${policy_name}
|
||||
Wait Until Page Contains ${policy_description}
|
||||
Wait Until Page Contains ${destination_name}
|
28
tests/resources/Harbor-Pages/Replication_Elements.robot
Normal file
28
tests/resources/Harbor-Pages/Replication_Elements.robot
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
|
||||
*** Variables ***
|
||||
${new_name_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/replicaton/div/hbr-replication/div/div[1]/div/div[1]/button/clr-icon
|
||||
${policy_name_xpath} //*[@id="policy_name"]
|
||||
${policy_description_xpath} //*[@id="policy_description"]
|
||||
${policy_enable_checkbox} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/replicaton/div/hbr-replication/div/div[1]/div/div[1]/create-edit-rule/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[3]/div/label
|
||||
${policy_endpoint_checkbox} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/replicaton/div/hbr-replication/div/div[1]/div/div[1]/create-edit-rule/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[4]/div[2]/label
|
||||
${destination_name_xpath} //*[@id='destination_name']
|
||||
${destination_url_xpath} //*[@id='destination_url']
|
||||
${destination_username_xpath} //*[@id='destination_username']
|
||||
${destination_password_xpath} //*[@id='destination_password']
|
||||
${replicaton_save_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/replicaton/div/hbr-replication/div/div[1]/div/div[1]/create-edit-rule/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[3]
|
56
tests/resources/Harbor-Pages/UserProfile.robot
Normal file
56
tests/resources/Harbor-Pages/UserProfile.robot
Normal file
@ -0,0 +1,56 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Resource ../../resources/Util.robot
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
|
||||
*** Keywords ***
|
||||
Change Password
|
||||
[Arguments] ${cur_pw} ${new_pw}
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Click Element xpath=//clr-main-container//clr-dropdown//a[2]
|
||||
Sleep 2
|
||||
Input Text xpath=//*[@id="oldPassword"] ${cur_pw}
|
||||
Input Text xpath=//*[@id="newPassword"] ${new_pw}
|
||||
Input Text xpath=//*[@id="reNewPassword"] ${new_pw}
|
||||
Sleep 1
|
||||
Click Element xpath=//password-setting/clr-modal//button[2]
|
||||
Sleep 2
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[2]
|
||||
Sleep 1
|
||||
|
||||
Update User Comment
|
||||
[Arguments] ${new_comment}
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Click Element xpath=//clr-main-container//clr-dropdown//a[1]
|
||||
Sleep 2
|
||||
Input Text xpath=//*[@id="account_settings_comments"] ${new_comment}
|
||||
Sleep 1
|
||||
Click Element xpath=//account-settings-modal/clr-modal//button[2]
|
||||
Sleep 2
|
||||
|
||||
Logout Harbor
|
||||
Wait Until Element Is Visible xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Wait Until Element Is Enabled xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/navigator/clr-header/div[3]/clr-dropdown[2]/button/span
|
||||
Sleep 2
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header//clr-dropdown//a[4]
|
||||
Sleep 1
|
||||
Capture Page Screenshot Logout.png
|
||||
Sleep 2
|
||||
Wait Until Keyword Succeeds 5x 1 Page Should Contain Element xpath=//sign-in//form//*[@class="title"]
|
186
tests/resources/Harbor-Util.robot
Normal file
186
tests/resources/Harbor-Util.robot
Normal file
@ -0,0 +1,186 @@
|
||||
# Copyright 2016-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 This resource provides any keywords related to the Harbor private registry appliance
|
||||
Library Selenium2Library
|
||||
Library OperatingSystem
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_VERSION} v1.1.1
|
||||
${CLAIR_BUILDER} 1.2.7
|
||||
|
||||
|
||||
*** Keywords ***
|
||||
Install Harbor to Test Server
|
||||
Log To Console \nStart Docker Daemon
|
||||
Start Docker Daemon Locally
|
||||
Sleep 5s
|
||||
${rc} ${output}= Run And Return Rc And Output docker ps
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console \n${output}
|
||||
Log To Console \nconfig harbor cfg
|
||||
Run Keywords Config Harbor cfg
|
||||
Run Keywords Prepare Cert
|
||||
Log To Console \ncomplile and up harbor now
|
||||
Run Keywords Compile and Up Harbor With Source Code
|
||||
${rc} ${output}= Run And Return Rc And Output docker ps
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console \n${output}
|
||||
|
||||
Install Harbor With Notary to Test Server
|
||||
Log To Console \nStart Docker Daemon
|
||||
Start Docker Daemon Locally
|
||||
Sleep 5s
|
||||
${rc} ${output}= Run And Return Rc And Output docker ps
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console \n${output}
|
||||
Log To Console \nconfig harbor cfg
|
||||
Config Harbor cfg http_proxy=https
|
||||
${rc} ${ip}= Run And Return Rc And Output ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'
|
||||
Log ${ip}
|
||||
${rc}= Run And Return Rc sed "s/^IP=.*/IP=${ip}/g" -i ./tests/generateCerts.sh
|
||||
Log ${rc}
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/generateCerts.sh
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc mkdir -p /etc/docker/certs.d/${ip}/
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc mkdir -p ~/.docker/tls/${ip}:4443/
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt /etc/docker/certs.d/${ip}/
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt ~/.docker/tls/${ip}:4443/
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console \ncomplile and up harbor now
|
||||
Compile and Up Harbor With Source Code with_notary=true
|
||||
${rc} ${output}= Run And Return Rc And Output docker ps
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console \n${output}
|
||||
|
||||
Up Harbor
|
||||
[Arguments] ${with_notary}=true ${with_clair}=true
|
||||
${rc} ${output}= Run And Return Rc And Output make start -e NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair}
|
||||
Log To Console ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Down Harbor
|
||||
[Arguments] ${with_notary}=true ${with_clair}=true
|
||||
${rc} ${output}= Run And Return Rc And Output echo "Y" | make down -e NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair}
|
||||
Log To Console ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Package Harbor Offline
|
||||
[Arguments] ${golang_image}=golang:1.7.3 ${clarity_image}=vmware/harbor-clarity-ui-builder:${CLAIR_BUILDER} ${with_notary}=true ${with_clair}=true ${with_migrator}=true
|
||||
Log To Console \nStart Docker Daemon
|
||||
Start Docker Daemon Locally
|
||||
${rc} ${output}= Run And Return Rc And Output make package_offline GOBUILDIMAGE=${golang_image} COMPILETAG=compile_golangimage CLARITYIMAGE=${clarity_image} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} MIGRATORFLAG=${with_migrator} HTTPPROXY=
|
||||
Log To Console ${rc}
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Switch To LDAP
|
||||
Down Harbor with_notary=false
|
||||
${rc} ${output}= Run And Return Rc And Output rm -rf /data
|
||||
Log To Console ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Config Harbor cfg auth=ldap_auth
|
||||
Prepare with_notary=false
|
||||
Up Harbor with_notary=false
|
||||
${rc}= Run And Return Rc docker pull vmware/harbor-ldap-test:1.1.1
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker run --name ldap-container -p 389:389 --detach vmware/harbor-ldap-test:1.1.1
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output docker ps
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Switch To Notary
|
||||
Down Harbor with_notary=false
|
||||
${rc} ${output}= Run And Return Rc And Output rm -rf /data
|
||||
Log To Console ${rc}
|
||||
${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/
|
||||
Log To Console ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Config Harbor cfg http_proxy=https
|
||||
${rc} ${ip}= Run And Return Rc And Output ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'
|
||||
Log ${ip}
|
||||
${rc}= Run And Return Rc sed "s/^IP=.*/IP=${ip}/g" -i ./tests/generateCerts.sh
|
||||
Log ${rc}
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/generateCerts.sh
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc mkdir -p /etc/docker/certs.d/${ip}/
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc mkdir -p ~/.docker/tls/${ip}:4443/
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt /etc/docker/certs.d/${ip}/
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output cp ./harbor_ca.crt ~/.docker/tls/${ip}:4443/
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output ls -la /etc/docker/certs.d/${ip}/
|
||||
Log To Console ${output}
|
||||
${rc} ${output}= Run And Return Rc And Output ls -la ~/.docker/tls/${ip}:4443/
|
||||
Log To Console ${output}
|
||||
Prepare
|
||||
Sleep 3s
|
||||
Up Harbor
|
||||
Sleep 30s
|
||||
${rc} ${output}= Run And Return Rc And Output docker ps
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log To Console \n${output}
|
||||
|
||||
Prepare
|
||||
[Arguments] ${with_notary}=true ${with_clair}=true
|
||||
${rc} ${output}= Run And Return Rc And Output make prepare -e NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair}
|
||||
Log To Console ${rc}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Config Harbor cfg
|
||||
# Will change the IP and Protocol in the harbor.cfg
|
||||
[Arguments] ${http_proxy}=http ${auth}=db_auth
|
||||
${rc} ${output}= Run And Return Rc And Output ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'
|
||||
Log ${output}
|
||||
${rc}= Run And Return Rc sed "s/reg.mydomain.com/${output}/" -i ./make/harbor.cfg
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc sed "s/^ui_url_protocol = .*/ui_url_protocol = ${http_proxy}/g" -i ./make/harbor.cfg
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc sed "s/^auth_mode = .*/auth_mode = ${auth}/g" -i ./make/harbor.cfg
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Prepare Cert
|
||||
# Will change the IP and Protocol in the harbor.cfg
|
||||
${rc}= Run And Return Rc ./tests/generateCerts.sh
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Compile and Up Harbor With Source Code
|
||||
[Arguments] ${golang_image}=golang:1.7.3 ${clarity_image}=vmware/harbor-clarity-ui-builder:${CLAIR_BUILDER} ${with_notary}=false ${with_clair}=true
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull ${clarity_image}
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull ${golang_image}
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output make install GOBUILDIMAGE=${golang_image} COMPILETAG=compile_golangimage CLARITYIMAGE=${clarity_image} NOTARYFLAG=${with_notary} CLAIRFLAG=${with_clair} HTTPPROXY=
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Sleep 20
|
407
tests/resources/Nimbus-Util.robot
Normal file
407
tests/resources/Nimbus-Util.robot
Normal file
@ -0,0 +1,407 @@
|
||||
# Copyright 2016-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 This resource contains any keywords related to using the Nimbus cluster
|
||||
|
||||
*** Variables ***
|
||||
${ESX_VERSION} 4564106 #6.5 RTM
|
||||
${VC_VERSION} 4602587 #6.5 RTM
|
||||
${NIMBUS_ESX_PASSWORD} e2eFunctionalTest
|
||||
|
||||
*** Keywords ***
|
||||
Deploy Nimbus ESXi Server
|
||||
[Arguments] ${user} ${password} ${version}=${ESX_VERSION} ${tls_disabled}=True
|
||||
${name}= Evaluate 'ESX-' + str(random.randint(1000,9999)) modules=random
|
||||
Log To Console \nDeploying Nimbus ESXi server: ${name}
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Wait Until Keyword Succeeds 2 min 30 sec Login ${user} ${password}
|
||||
|
||||
:FOR ${IDX} IN RANGE 1 5
|
||||
\ ${out}= Execute Command nimbus-esxdeploy ${name} --disk=48000000 --ssd=24000000 --memory=8192 --nics 2 ob-${version}
|
||||
\ # Make sure the deploy actually worked
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} To manage this VM use
|
||||
\ Exit For Loop If ${status}
|
||||
\ Log To Console ${out}
|
||||
\ Log To Console Nimbus deployment ${IDX} failed, trying again in 5 minutes
|
||||
\ Sleep 5 minutes
|
||||
|
||||
# Now grab the IP address and return the name and ip for later use
|
||||
@{out}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{out}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} IP is
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
@{gotIP}= Split String ${line} ${SPACE}
|
||||
${ip}= Remove String @{gotIP}[5] ,
|
||||
|
||||
# Let's set a password so govc doesn't complain
|
||||
Remove Environment Variable GOVC_PASSWORD
|
||||
Remove Environment Variable GOVC_USERNAME
|
||||
Set Environment Variable GOVC_INSECURE 1
|
||||
Set Environment Variable GOVC_URL root:@${ip}
|
||||
${out}= Run govc host.account.update -id root -password ${NIMBUS_ESX_PASSWORD}
|
||||
Should Be Empty ${out}
|
||||
Run Keyword If ${tls_disabled} Disable TLS On ESX Host
|
||||
Log To Console Successfully deployed new ESXi server - ${user}-${name}
|
||||
Close connection
|
||||
[Return] ${user}-${name} ${ip}
|
||||
|
||||
Deploy Multiple Nimbus ESXi Servers in Parallel
|
||||
[Arguments] ${user} ${password} ${version}=${ESX_VERSION}
|
||||
${name1}= Evaluate 'ESX-' + str(random.randint(1000,9999)) modules=random
|
||||
${name2}= Evaluate 'ESX-' + str(random.randint(1000,9999)) modules=random
|
||||
${name3}= Evaluate 'ESX-' + str(random.randint(1000,9999)) modules=random
|
||||
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Login ${user} ${password}
|
||||
|
||||
${out1}= Deploy Nimbus ESXi Server Async ${name1}
|
||||
${out2}= Deploy Nimbus ESXi Server Async ${name2}
|
||||
${out3}= Deploy Nimbus ESXi Server Async ${name3}
|
||||
|
||||
Wait For Process ${out1}
|
||||
Wait For Process ${out2}
|
||||
Wait For Process ${out3}
|
||||
|
||||
${out}= Execute Command nimbus-ctl ip ${user}-${name1}
|
||||
|
||||
@{out}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{out}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} ${user}-${name1}
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
@{gotIP}= Split String ${line} ${SPACE}
|
||||
${ip1}= Remove String @{gotIP}[2]
|
||||
|
||||
${out}= Execute Command nimbus-ctl ip ${user}-${name2}
|
||||
|
||||
@{out}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{out}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} ${user}-${name2}
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
@{gotIP}= Split String ${line} ${SPACE}
|
||||
${ip2}= Remove String @{gotIP}[2]
|
||||
|
||||
${out}= Execute Command nimbus-ctl ip ${user}-${name3}
|
||||
|
||||
@{out}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{out}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} ${user}-${name3}
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
@{gotIP}= Split String ${line} ${SPACE}
|
||||
${ip3}= Remove String @{gotIP}[2]
|
||||
|
||||
Log To Console \nDeploying Nimbus ESXi server: ${gotIP}
|
||||
|
||||
# Let's set a password so govc doesn't complain
|
||||
Remove Environment Variable GOVC_PASSWORD
|
||||
Remove Environment Variable GOVC_USERNAME
|
||||
Set Environment Variable GOVC_INSECURE 1
|
||||
Set Environment Variable GOVC_URL root:@${ip1}
|
||||
${out}= Run govc host.account.update -id root -password ${NIMBUS_ESX_PASSWORD}
|
||||
Should Be Empty ${out}
|
||||
Disable TLS On ESX Host
|
||||
Log To Console Successfully deployed new ESXi server - ${user}-${name1}
|
||||
Log To Console \nNimbus ESXi server IP: ${ip1}
|
||||
|
||||
Remove Environment Variable GOVC_PASSWORD
|
||||
Remove Environment Variable GOVC_USERNAME
|
||||
Set Environment Variable GOVC_INSECURE 1
|
||||
Set Environment Variable GOVC_URL root:@${ip2}
|
||||
${out}= Run govc host.account.update -id root -password ${NIMBUS_ESX_PASSWORD}
|
||||
Should Be Empty ${out}
|
||||
Disable TLS On ESX Host
|
||||
Log To Console Successfully deployed new ESXi server - ${user}-${name2}
|
||||
Log To Console \nNimbus ESXi server IP: ${ip2}
|
||||
|
||||
Remove Environment Variable GOVC_PASSWORD
|
||||
Remove Environment Variable GOVC_USERNAME
|
||||
Set Environment Variable GOVC_INSECURE 1
|
||||
Set Environment Variable GOVC_URL root:@${ip3}
|
||||
${out}= Run govc host.account.update -id root -password ${NIMBUS_ESX_PASSWORD}
|
||||
Should Be Empty ${out}
|
||||
Disable TLS On ESX Host
|
||||
Log To Console Successfully deployed new ESXi server - ${user}-${name3}
|
||||
Log To Console \nNimbus ESXi server IP: ${ip3}
|
||||
|
||||
Close connection
|
||||
[Return] ${user}-${name1} ${ip1} ${user}-${name2} ${ip2} ${user}-${name3} ${ip3}
|
||||
|
||||
Deploy Nimbus vCenter Server
|
||||
[Arguments] ${user} ${password} ${version}=${VC_VERSION}
|
||||
${name}= Evaluate 'VC-' + str(random.randint(1000,9999)) modules=random
|
||||
Log To Console \nDeploying Nimbus vCenter server: ${name}
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Login ${user} ${password}
|
||||
|
||||
:FOR ${IDX} IN RANGE 1 5
|
||||
\ ${out}= Execute Command nimbus-vcvadeploy --vcvaBuild ${version} ${name}
|
||||
\ # Make sure the deploy actually worked
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} Overall Status: Succeeded
|
||||
\ Exit For Loop If ${status}
|
||||
\ Log To Console Nimbus deployment ${IDX} failed, trying again in 5 minutes
|
||||
\ Sleep 5 minutes
|
||||
|
||||
# Now grab the IP address and return the name and ip for later use
|
||||
@{out}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{out}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} Cloudvm is running on IP
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
${ip}= Fetch From Right ${line} ${SPACE}
|
||||
|
||||
Set Environment Variable GOVC_INSECURE 1
|
||||
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
|
||||
Set Environment Variable GOVC_PASSWORD Admin!23
|
||||
Set Environment Variable GOVC_URL ${ip}
|
||||
Log To Console Successfully deployed new vCenter server - ${user}-${name}
|
||||
Close connection
|
||||
[Return] ${user}-${name} ${ip}
|
||||
|
||||
Deploy Nimbus ESXi Server Async
|
||||
[Tags] secret
|
||||
[Arguments] ${name} ${version}=${ESX_VERSION}
|
||||
Log To Console \nDeploying Nimbus ESXi server: ${name}
|
||||
|
||||
${out}= Run Secret SSHPASS command %{NIMBUS_USER} %{NIMBUS_PASSWORD} 'nimbus-esxdeploy ${name} --disk\=48000000 --ssd\=24000000 --memory\=8192 --nics 2 ${version}'
|
||||
[Return] ${out}
|
||||
|
||||
Run Secret SSHPASS command
|
||||
[Tags] secret
|
||||
[Arguments] ${user} ${password} ${cmd}
|
||||
|
||||
${out}= Start Process sshpass -p ${password} ssh -o StrictHostKeyChecking\=no ${user}@%{NIMBUS_GW} ${cmd} shell=True
|
||||
[Return] ${out}
|
||||
|
||||
Deploy Nimbus vCenter Server Async
|
||||
[Tags] secret
|
||||
[Arguments] ${name} ${version}=${VC_VERSION}
|
||||
Log To Console \nDeploying Nimbus VC server: ${name}
|
||||
|
||||
${out}= Run Secret SSHPASS command %{NIMBUS_USER} %{NIMBUS_PASSWORD} 'nimbus-vcvadeploy --vcvaBuild ${version} ${name}'
|
||||
[Return] ${out}
|
||||
|
||||
Deploy Nimbus Testbed
|
||||
[Arguments] ${user} ${password} ${testbed}
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Login ${user} ${password}
|
||||
|
||||
:FOR ${IDX} IN RANGE 1 5
|
||||
\ ${out}= Execute Command nimbus-testbeddeploy ${testbed}
|
||||
\ # Make sure the deploy actually worked
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} is up. IP:
|
||||
\ Exit For Loop If ${status}
|
||||
\ Log To Console Nimbus deployment ${IDX} failed, trying again in 5 minutes
|
||||
\ Sleep 5 minutes
|
||||
[Return] ${out}
|
||||
|
||||
Kill Nimbus Server
|
||||
[Arguments] ${user} ${password} ${name}
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Login ${user} ${password}
|
||||
${out}= Execute Command nimbus-ctl kill '${name}'
|
||||
Close connection
|
||||
|
||||
Cleanup Nimbus PXE folder
|
||||
[Arguments] ${user} ${password}
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Login ${user} ${password}
|
||||
${out}= Execute Command rm -rf public_html/pxe/*
|
||||
Close connection
|
||||
|
||||
Nimbus Cleanup
|
||||
[Arguments] ${vm_list} ${collect_log}=True ${dontDelete}=${false}
|
||||
Run Keyword If ${collect_log} Run Keyword And Continue On Failure Gather Logs From Test Server
|
||||
Run Keyword And Ignore Error Cleanup Nimbus PXE folder %{NIMBUS_USER} %{NIMBUS_PASSWORD}
|
||||
Return From Keyword If ${dontDelete}
|
||||
:FOR ${item} IN @{vm_list}
|
||||
\ Run Keyword And Ignore Error Kill Nimbus Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} ${item}
|
||||
|
||||
Gather Host IPs
|
||||
${out}= Run govc ls host/cls
|
||||
${out}= Split To Lines ${out}
|
||||
${idx}= Set Variable 1
|
||||
:FOR ${line} IN @{out}
|
||||
\ Continue For Loop If '${line}' == '/vcqaDC/host/cls/Resources'
|
||||
\ ${ip}= Fetch From Right ${line} /
|
||||
\ Set Suite Variable ${esx${idx}-ip} ${ip}
|
||||
\ ${idx}= Evaluate ${idx}+1
|
||||
|
||||
Create a VSAN Cluster
|
||||
Log To Console \nStarting basic VSAN cluster deploy...
|
||||
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --noSupportBundles --vcvaBuild ${VC_VERSION} --esxPxeDir ${ESX_VERSION} --esxBuild ${ESX_VERSION} --testbedName vcqa-vsan-simple-pxeBoot-vcva --runName vic-vmotion
|
||||
${out}= Split To Lines ${out}
|
||||
:FOR ${line} IN @{out}
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${line} .vcva-${VC_VERSION}' is up. IP:
|
||||
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
|
||||
\ Run Keyword If ${status} Set Suite Variable ${vc-ip} ${ip}
|
||||
\ Exit For Loop If ${status}
|
||||
|
||||
Log To Console Set environment variables up for GOVC
|
||||
Set Environment Variable GOVC_URL ${vc-ip}
|
||||
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
|
||||
Set Environment Variable GOVC_PASSWORD Admin\!23
|
||||
|
||||
Log To Console Create a distributed switch
|
||||
${out}= Run govc dvs.create -dc=vcqaDC test-ds
|
||||
Should Contain ${out} OK
|
||||
|
||||
Log To Console Create three new distributed switch port groups for management and vm network traffic
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=vcqaDC -dvs=test-ds management
|
||||
Should Contain ${out} OK
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=vcqaDC -dvs=test-ds vm-network
|
||||
Should Contain ${out} OK
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=vcqaDC -dvs=test-ds bridge
|
||||
Should Contain ${out} OK
|
||||
|
||||
Log To Console Add all the hosts to the distributed switch
|
||||
${out}= Run govc dvs.add -dvs=test-ds -pnic=vmnic1 /vcqaDC/host/cls
|
||||
Should Contain ${out} OK
|
||||
|
||||
Log To Console Enable DRS and VSAN on the cluster
|
||||
${out}= Run govc cluster.change -drs-enabled /vcqaDC/host/cls
|
||||
Should Be Empty ${out}
|
||||
|
||||
Log To Console Deploy VIC to the VC cluster
|
||||
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
|
||||
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
|
||||
Set Environment Variable TEST_PASSWORD Admin\!23
|
||||
Set Environment Variable BRIDGE_NETWORK bridge
|
||||
Set Environment Variable PUBLIC_NETWORK vm-network
|
||||
Set Environment Variable TEST_DATASTORE vsanDatastore
|
||||
Set Environment Variable TEST_RESOURCE cls
|
||||
Set Environment Variable TEST_TIMEOUT 30m
|
||||
|
||||
Gather Host IPs
|
||||
|
||||
Create a Simple VC Cluster
|
||||
[Arguments] ${datacenter}=ha-datacenter ${cluster}=cls ${esx_number}=3 ${network}=True
|
||||
Log To Console \nStarting simple VC cluster deploy...
|
||||
${esx_names}= Create List
|
||||
${esx_ips}= Create List
|
||||
:FOR ${IDX} IN RANGE ${esx_number}
|
||||
\ ${esx} ${esx_ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} ${ESX_VERSION} False
|
||||
\ Append To List ${esx_names} ${esx}
|
||||
\ Append To List ${esx_ips} ${esx_ip}
|
||||
|
||||
${vc} ${vc_ip}= Deploy Nimbus vCenter Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
|
||||
|
||||
Log To Console Create a datacenter on the VC
|
||||
${out}= Run govc datacenter.create ${datacenter}
|
||||
Should Be Empty ${out}
|
||||
|
||||
Log To Console Create a cluster on the VC
|
||||
${out}= Run govc cluster.create ${cluster}
|
||||
Should Be Empty ${out}
|
||||
|
||||
Log To Console Add ESX host to the VC
|
||||
:FOR ${IDX} IN RANGE ${esx_number}
|
||||
\ ${out}= Run govc cluster.add -hostname=@{esx_ips}[${IDX}] -username=root -dc=${datacenter} -password=${NIMBUS_ESX_PASSWORD} -noverify=true
|
||||
\ Should Contain ${out} OK
|
||||
|
||||
Run Keyword If ${network} Setup Network For Simple VC Cluster ${esx_number} ${datacenter} ${cluster}
|
||||
|
||||
Log To Console Enable DRS on the cluster
|
||||
${out}= Run govc cluster.change -drs-enabled /${datacenter}/host/${cluster}
|
||||
Should Be Empty ${out}
|
||||
|
||||
Set Environment Variable TEST_URL_ARRAY ${vc_ip}
|
||||
Set Environment Variable TEST_URL ${vc_ip}
|
||||
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
|
||||
Set Environment Variable TEST_PASSWORD Admin\!23
|
||||
Set Environment Variable TEST_DATASTORE datastore1
|
||||
Set Environment Variable TEST_DATACENTER /${datacenter}
|
||||
Set Environment Variable TEST_RESOURCE ${cluster}
|
||||
Set Environment Variable TEST_TIMEOUT 30m
|
||||
[Return] @{esx_names} ${vc} @{esx_ips} ${vc_ip}
|
||||
|
||||
Setup Network For Simple VC Cluster
|
||||
[Arguments] ${esx_number} ${datacenter} ${cluster}
|
||||
Log To Console Create a distributed switch
|
||||
${out}= Run govc dvs.create -dc=${datacenter} test-ds
|
||||
Should Contain ${out} OK
|
||||
|
||||
Log To Console Create three new distributed switch port groups for management and vm network traffic
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=test-ds management
|
||||
Should Contain ${out} OK
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=test-ds vm-network
|
||||
Should Contain ${out} OK
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=test-ds bridge
|
||||
Should Contain ${out} OK
|
||||
|
||||
Log To Console Add all the hosts to the distributed switch
|
||||
${out}= Run govc dvs.add -dvs=test-ds -pnic=vmnic1 /${datacenter}/host/${cluster}
|
||||
Should Contain ${out} OK
|
||||
|
||||
Log To Console Enable DRS on the cluster
|
||||
${out}= Run govc cluster.change -drs-enabled /${datacenter}/host/${cluster}
|
||||
Should Be Empty ${out}
|
||||
|
||||
Set Environment Variable BRIDGE_NETWORK bridge
|
||||
Set Environment Variable PUBLIC_NETWORK vm-network
|
||||
|
||||
Create A Distributed Switch
|
||||
[Arguments] ${datacenter} ${dvs}=test-ds
|
||||
Log To Console \nCreate a distributed switch
|
||||
${out}= Run govc dvs.create -product-version 5.5.0 -dc=${datacenter} ${dvs}
|
||||
Should Contain ${out} OK
|
||||
|
||||
Create Three Distributed Port Groups
|
||||
[Arguments] ${datacenter} ${dvs}=test-ds
|
||||
Log To Console \nCreate three new distributed switch port groups for management and vm network traffic
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=${dvs} management
|
||||
Should Contain ${out} OK
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=${dvs} vm-network
|
||||
Should Contain ${out} OK
|
||||
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=${dvs} bridge
|
||||
Should Contain ${out} OK
|
||||
|
||||
Add Host To Distributed Switch
|
||||
[Arguments] ${host} ${dvs}=test-ds
|
||||
Log To Console \nAdd host(s) to the distributed switch
|
||||
${out}= Run govc dvs.add -dvs=${dvs} -pnic=vmnic1 ${host}
|
||||
Should Contain ${out} OK
|
||||
|
||||
Disable TLS On ESX Host
|
||||
Log To Console \nDisable TLS on the host
|
||||
${ver}= Get Vsphere Version
|
||||
${out}= Run Keyword If '${ver}' != '5.5.0' Run govc host.option.set UserVars.ESXiVPsDisabledProtocols sslv3,tlsv1,tlsv1.1
|
||||
Run Keyword If '${ver}' != '5.5.0' Should Be Empty ${out}
|
||||
|
||||
Get Vsphere Version
|
||||
${out}= Run govc about
|
||||
${out}= Split To Lines ${out}
|
||||
:FOR ${line} IN @{out}
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${line} Version:
|
||||
\ Run Keyword And Return If ${status} Fetch From Right ${line} ${SPACE}
|
||||
|
||||
Deploy Nimbus NFS Datastore
|
||||
[Arguments] ${user} ${password}
|
||||
${name}= Evaluate 'NFS-' + str(random.randint(1000,9999)) modules=random
|
||||
Log To Console \nDeploying Nimbus NFS server: ${name}
|
||||
Open Connection %{NIMBUS_GW}
|
||||
Login ${user} ${password}
|
||||
|
||||
${out}= Execute Command nimbus-nfsdeploy ${name}
|
||||
# Make sure the deploy actually worked
|
||||
Should Contain ${out} To manage this VM use
|
||||
# Now grab the IP address and return the name and ip for later use
|
||||
@{out}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{out}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} IP is
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
@{gotIP}= Split String ${line} ${SPACE}
|
||||
${ip}= Remove String @{gotIP}[5] ,
|
||||
|
||||
Log To Console Successfully deployed new NFS server - ${user}-${name}
|
||||
Close connection
|
||||
[Return] ${user}-${name} ${ip}
|
89
tests/resources/OVA-Util.robot
Normal file
89
tests/resources/OVA-Util.robot
Normal file
@ -0,0 +1,89 @@
|
||||
# Copyright 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 This resource provides any keywords related to Unified OVA
|
||||
|
||||
*** Variables ***
|
||||
${ova_root_pwd} ova-test-root-pwd
|
||||
${ova_appliance_options} --prop:appliance.root_pwd=${ova_root_pwd} --prop:appliance.permit_root_login=True
|
||||
|
||||
${ova_target_vm_name} vic-unified-ova-integration-test
|
||||
${ovftool_options} --noSSLVerify --acceptAllEulas --name=${ova_target_vm_name} --diskMode=thin --powerOn --X:waitForIp --X:injectOvfEnv --X:enableHiddenProperties
|
||||
|
||||
${ova_network_ip0} 10.17.109.207
|
||||
${ova_network_netmask0} 255.255.255.0
|
||||
${ova_network_gateway} 10.17.109.253
|
||||
${ova_network_dns} 10.118.81.1
|
||||
${ova_network_searchpath} eng.vmware.com
|
||||
${ova_network_domain} mrburns
|
||||
${ova_network_options} --prop:network.ip0=${ova_network_ip0} --prop:network.netmask0=${ova_network_netmask0} --prop:network.gateway=${ova_network_gateway} --prop:network.DNS=${ova_network_dns} --prop:network.searchpath=${ova_network_searchpath} --prop:network.domain=${ova_network_domain}
|
||||
|
||||
${ova_harbor_admin_password} harbor-admin-passwd
|
||||
${ova_harbor_db_password} harbor-db-passwd
|
||||
${ova_service_options} --prop:registry.admin_password=${ova_harbor_admin_password} --prop:registry.db_password=${ova_harbor_db_password}
|
||||
|
||||
${ova_options} ${ovftool_options} ${ova_appliance_options} ${ova_service_options}
|
||||
${ova_options_with_network} ${ova_options} ${ova_network_options}
|
||||
|
||||
${tls_not_disabled} False
|
||||
|
||||
*** Keywords ***
|
||||
# Requires vc credential for govc
|
||||
Deploy VIC-OVA To Test Server
|
||||
[Arguments] ${dhcp}=False ${build}=False ${user}=%{TEST_USERNAME} ${password}=%{TEST_PASSWORD} ${host}=%{TEST_URL} ${datastore}=%{TEST_DATASTORE} ${cluster}=%{TEST_RESOURCE} ${datacenter}=%{TEST_DATACENTER}
|
||||
Run Keyword if ${build} Build Unified OVA
|
||||
${rev}= Run git rev-parse --short HEAD
|
||||
Set Test Variable ${ova_path} bin/vic-1.1.0-${rev}.ova
|
||||
|
||||
Log To Console \nCleanup environment...
|
||||
Run Keyword And Ignore Error Run GOVC_URL=${host} GOVC_USERNAME=${user} GOVC_PASSWORD=${password} GOVC_INSECURE=1 govc vm.destroy ${ova_target_vm_name}
|
||||
Run Keyword And Ignore Error Run GOVC_URL=${host} GOVC_USERNAME=${user} GOVC_PASSWORD=${password} GOVC_INSECURE=1 govc object.destroy /${datacenter}/vm/${ova_target_vm_name}
|
||||
|
||||
Log To Console \nStarting to deploy unified-ova to test server...
|
||||
Run Keyword If ${dhcp} Log To Console ovftool --datastore=${datastore} ${ova_options} ${ova_path} 'vi://${user}:${password}@${host}/${datacenter}/host/${cluster}'
|
||||
... ELSE Log To Console ovftool --datastore=${datastore} ${ova_options_with_network} ${ova_path} 'vi://${user}:${password}@${host}/${datacenter}/host/${cluster}'
|
||||
${out}= Run Keyword If ${dhcp} Run ovftool --datastore=${datastore} ${ova_options} ${ova_path} 'vi://${user}:${password}@${host}/${datacenter}/host/${cluster}'
|
||||
... ELSE Run ovftool --datastore=${datastore} ${ova_options_with_network} ${ova_path} 'vi://${user}:${password}@${host}/${datacenter}/host/${cluster}'
|
||||
Log ${out}
|
||||
|
||||
Log To Console \n${out}
|
||||
@{out}= Split To Lines ${out}
|
||||
Should Contain @{out}[-1] Completed successfully
|
||||
|
||||
Log To Console \nUnified OVA is deployed successfully
|
||||
|
||||
# Requires vc credential for govc
|
||||
Cleanup VIC-OVA On Test Server
|
||||
[Arguments] ${url}=%{GOVC_URL} ${username}=%{GOVC_USERNAME} ${password}=%{GOVC_PASSWORD}
|
||||
${rc} ${output}= Run And Return Rc And Output GOVC_URL=${url} GOVC_USERNAME=${username} GOVC_PASSWORD=${password} GOVC_INSECURE=1 govc vm.destroy ${ova_target_vm_name}
|
||||
Log ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Run Keyword And Ignore Error Run GOVC_URL=${url} GOVC_USERNAME=${username} GOVC_PASSWORD=${password} GOVC_INSECURE=1 govc object.destroy /%{TEST_DATACENTER}/vm/${ova_target_vm_name}
|
||||
Log To Console \nUnified-OVA deployment is cleaned up on test server
|
||||
|
||||
Build Unified OVA
|
||||
[Arguments] ${user}=%{TEST_USERNAME} ${password}=%{TEST_PASSWORD} ${host}=%{TEST_URL}
|
||||
Log To Console \nStarting to build Unified OVA...
|
||||
Log To Console \nRemove stale local OVA artifacts
|
||||
Run Remove OVA Artifacts Locally
|
||||
${out}= Run PACKER_ESX_HOST=${host} PACKER_USER=${user} PACKER_PASSWORD=${password} make ova-release
|
||||
Log ${out}
|
||||
@{out}= Split To Lines ${out}
|
||||
Should Not Contain @{out}[-1] Error
|
||||
Log To Console \nUnified OVA is built successfully
|
||||
|
||||
Remove OVA Artifacts Locally
|
||||
${rev}= Run git rev-parse --short HEAD
|
||||
Remove Files bin/vic-1.1.0-${rev}.ova bin/vic-1.1.0-${rev}.ovf bin/vic-1.1.0-${rev}.mk bin/vic-1.1.0-${rev}-disk*.vmdk
|
40
tests/resources/SeleniumUtil.robot
Normal file
40
tests/resources/SeleniumUtil.robot
Normal file
@ -0,0 +1,40 @@
|
||||
# Copyright 2016-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 This resource provides helper functions for docker operations
|
||||
Resource Util.robot
|
||||
|
||||
*** Keywords ***
|
||||
Start Selenium Standalone Server Locally
|
||||
OperatingSystem.File Should Exist /go/selenium-server-standalone-3.4.0.jar
|
||||
${handle}= Start Process java -jar /go/selenium-server-standalone-3.4.0.jar >./selenium-local.log 2>&1 shell=True
|
||||
Process Should Be Running ${handle}
|
||||
Sleep 10s
|
||||
[Return] ${handle}
|
||||
|
||||
Init Chrome Driver
|
||||
Run pkill chromedriver
|
||||
Run pkill chrome
|
||||
${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
|
||||
Call Method ${chrome options} add_argument --headless
|
||||
Call Method ${chrome options} add_argument --disable-gpu
|
||||
Call Method ${chrome options} add_argument --start-maximized
|
||||
Call Method ${chrome options} add_argument --ignore-certificate-errors
|
||||
Call Method ${chrome options} add_argument --disable-web-security
|
||||
Call Method ${chrome options} add_argument --allow-running-insecure-content
|
||||
Call Method ${chrome options} add_argument --window-size\=1600,900
|
||||
${chrome options.binary_location} Set Variable /usr/bin/google-chrome
|
||||
Create Webdriver Chrome Chrome_headless chrome_options=${chrome options}
|
||||
Sleep 5
|
47
tests/resources/Util.robot
Normal file
47
tests/resources/Util.robot
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright 2016-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 ***
|
||||
Library OperatingSystem
|
||||
Library String
|
||||
Library Collections
|
||||
Library requests
|
||||
Library Process
|
||||
Library SSHLibrary 1 minute
|
||||
Library DateTime
|
||||
Library Selenium2Library 10 10
|
||||
Resource Nimbus-Util.robot
|
||||
Resource Vsphere-Util.robot
|
||||
Resource VCH-Util.robot
|
||||
Resource Drone-Util.robot
|
||||
Resource Github-Util.robot
|
||||
Resource Harbor-Util.robot
|
||||
Resource Harbor-Pages/HomePage.robot
|
||||
Resource Harbor-Pages/HomePage_Elements.robot
|
||||
Resource Harbor-Pages/Project.robot
|
||||
Resource Harbor-Pages/Project_Elements.robot
|
||||
Resource Harbor-Pages/Project-Members.robot
|
||||
Resource Harbor-Pages/Project-Members_Elements.robot
|
||||
Resource Harbor-Pages/Replication.robot
|
||||
Resource Harbor-Pages/Replication_Elements.robot
|
||||
Resource Harbor-Pages/UserProfile.robot
|
||||
Resource Harbor-Pages/Administration-Users.robot
|
||||
Resource Harbor-Pages/Administration-Users_Elements.robot
|
||||
Resource Harbor-Pages/Configuration.robot
|
||||
Resource Harbor-Pages/Configuration_Elements.robot
|
||||
Resource Docker-Util.robot
|
||||
Resource Admiral-Util.robot
|
||||
Resource OVA-Util.robot
|
||||
Resource Cert-Util.robot
|
||||
Resource SeleniumUtil.robot
|
404
tests/resources/VCH-Util.robot
Normal file
404
tests/resources/VCH-Util.robot
Normal file
@ -0,0 +1,404 @@
|
||||
# Copyright 2016-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 This resource contains all keywords related to creating, deleting, maintaining VCHs
|
||||
|
||||
*** Keywords ***
|
||||
Set Test Environment Variables
|
||||
# Finish setting up environment variables
|
||||
${status} ${message}= Run Keyword And Ignore Error Environment Variable Should Be Set DRONE_BUILD_NUMBER
|
||||
Run Keyword If '${status}' == 'FAIL' Set Environment Variable DRONE_BUILD_NUMBER 0
|
||||
${status} ${message}= Run Keyword And Ignore Error Environment Variable Should Be Set BRIDGE_NETWORK
|
||||
Run Keyword If '${status}' == 'FAIL' Set Environment Variable BRIDGE_NETWORK network
|
||||
${status} ${message}= Run Keyword And Ignore Error Environment Variable Should Be Set PUBLIC_NETWORK
|
||||
Run Keyword If '${status}' == 'FAIL' Set Environment Variable PUBLIC_NETWORK 'VM Network'
|
||||
${status} ${message}= Run Keyword And Ignore Error Environment Variable Should Be Set TEST_DATACENTER
|
||||
Run Keyword If '${status}' == 'FAIL' Set Environment Variable TEST_DATACENTER ${SPACE}
|
||||
|
||||
@{URLs}= Split String %{TEST_URL_ARRAY}
|
||||
${len}= Get Length ${URLs}
|
||||
${IDX}= Evaluate %{DRONE_BUILD_NUMBER} \% ${len}
|
||||
|
||||
Set Environment Variable TEST_URL @{URLs}[${IDX}]
|
||||
Set Environment Variable GOVC_URL %{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}
|
||||
# TODO: need an integration/vic-test image update to include the about.cert command
|
||||
#${rc} ${thumbprint}= Run And Return Rc And Output govc about.cert -k | jq -r .ThumbprintSHA1
|
||||
${rc} ${thumbprint}= Run And Return Rc And Output openssl s_client -connect $(govc env -x GOVC_URL_HOST):443 </dev/null 2>/dev/null | openssl x509 -fingerprint -noout | cut -d= -f2
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Set Environment Variable TEST_THUMBPRINT ${thumbprint}
|
||||
Log To Console \nTEST_URL=%{TEST_URL}
|
||||
|
||||
${host}= Run govc ls host
|
||||
${status} ${message}= Run Keyword And Ignore Error Environment Variable Should Be Set TEST_RESOURCE
|
||||
Run Keyword If '${status}' == 'FAIL' Set Environment Variable TEST_RESOURCE ${host}/Resources
|
||||
Set Environment Variable GOVC_RESOURCE_POOL %{TEST_RESOURCE}
|
||||
${noQuotes}= Strip String %{TEST_DATASTORE} characters="
|
||||
Set Environment Variable GOVC_DATASTORE ${noQuotes}
|
||||
|
||||
${about}= Run govc about
|
||||
${status}= Run Keyword And Return Status Should Contain ${about} VMware ESXi
|
||||
Run Keyword If ${status} Set Environment Variable HOST_TYPE ESXi
|
||||
Run Keyword Unless ${status} Set Environment Variable HOST_TYPE VC
|
||||
|
||||
${about}= Run govc datastore.info %{TEST_DATASTORE} | grep 'Type'
|
||||
${status}= Run Keyword And Return Status Should Contain ${about} vsan
|
||||
Run Keyword If ${status} Set Environment Variable DATASTORE_TYPE VSAN
|
||||
Run Keyword Unless ${status} Set Environment Variable DATASTORE_TYPE Non_VSAN
|
||||
|
||||
# set the TLS config options suitable for vic-machine in this env
|
||||
${domain}= Get Environment Variable DOMAIN ''
|
||||
Run Keyword If $domain == '' Set Suite Variable ${vicmachinetls} --no-tlsverify
|
||||
Run Keyword If $domain != '' Set Suite Variable ${vicmachinetls} --tls-cname=*.${domain}
|
||||
|
||||
Set Test VCH Name
|
||||
# Set a unique bridge network for each VCH that has a random VLAN ID
|
||||
${vlan}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Evaluate str(random.randint(1, 4093)) modules=random
|
||||
${out}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.portgroup.add -vlan=${vlan} -vswitch vSwitchLAN %{VCH-NAME}-bridge
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Set Environment Variable BRIDGE_NETWORK %{VCH-NAME}-bridge
|
||||
|
||||
Set Test VCH Name
|
||||
${name}= Evaluate 'VCH-%{DRONE_BUILD_NUMBER}-' + str(random.randint(1000,9999)) modules=random
|
||||
Set Environment Variable VCH-NAME ${name}
|
||||
|
||||
Set List Of Env Variables
|
||||
[Arguments] ${vars}
|
||||
@{vars}= Split String ${vars}
|
||||
:FOR ${var} IN @{vars}
|
||||
\ ${varname} ${varval}= Split String ${var} =
|
||||
\ Set Environment Variable ${varname} ${varval}
|
||||
|
||||
Parse Environment Variables
|
||||
[Arguments] ${line}
|
||||
# If using the old logging format
|
||||
${status}= Run Keyword And Return Status Should Contain ${line} mINFO
|
||||
${logdeco} ${vars}= Run Keyword If ${status} Split String ${line} ${SPACE} 1
|
||||
Run Keyword If ${status} Set List Of Env Variables ${vars}
|
||||
Return From Keyword If ${status}
|
||||
|
||||
# Split the log log into pieces, discarding the initial log decoration, and assign to env vars
|
||||
${logmon} ${logday} ${logyear} ${logtime} ${loglevel} ${vars}= Split String ${line} max_split=5
|
||||
Set List Of Env Variables ${vars}
|
||||
|
||||
Get Docker Params
|
||||
# Get VCH docker params e.g. "-H 192.168.218.181:2376 --tls"
|
||||
[Arguments] ${output} ${certs}
|
||||
@{output}= Split To Lines ${output}
|
||||
:FOR ${item} IN @{output}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} DOCKER_HOST=
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
|
||||
# Ensure we start from a clean slate with docker env vars
|
||||
Remove Environment Variable DOCKER_HOST DOCKER_TLS_VERIFY DOCKER_CERT_PATH CURL_CA_BUNDLE COMPOSE_PARAMS COMPOSE_TLS_VERSION
|
||||
|
||||
Parse Environment Variables ${line}
|
||||
|
||||
${dockerHost}= Get Environment Variable DOCKER_HOST
|
||||
|
||||
@{hostParts}= Split String ${dockerHost} :
|
||||
${ip}= Strip String @{hostParts}[0]
|
||||
${port}= Strip String @{hostParts}[1]
|
||||
Set Environment Variable VCH-IP ${ip}
|
||||
Set Environment Variable VCH-PORT ${port}
|
||||
|
||||
:FOR ${index} ${item} IN ENUMERATE @{output}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} http
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
|
||||
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} Published ports can be reached at
|
||||
\ ${idx} = Evaluate ${index} + 1
|
||||
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${ext-ip} @{output}[${idx}]
|
||||
|
||||
${rest} ${ext-ip} = Split String From Right ${ext-ip} ${SPACE} 1
|
||||
${ext-ip} = Strip String ${ext-ip}
|
||||
Set Environment Variable EXT-IP ${ext-ip}
|
||||
|
||||
${rest} ${vic-admin}= Split String From Right ${line} ${SPACE} 1
|
||||
Set Environment Variable VIC-ADMIN ${vic-admin}
|
||||
|
||||
Run Keyword If ${port} == 2376 Set Environment Variable VCH-PARAMS -H ${dockerHost} --tls
|
||||
Run Keyword If ${port} == 2375 Set Environment Variable VCH-PARAMS -H ${dockerHost}
|
||||
|
||||
### Add environment variables for Compose and TLS
|
||||
|
||||
# Check if tls is enable from vic-machine's output and not trust ${certs} which some tests bypasses
|
||||
${tls_enabled}= Get Environment Variable DOCKER_TLS_VERIFY ${false}
|
||||
|
||||
### Compose case for no-tlsverify
|
||||
|
||||
# Set environment variables if certs not used to create the VCH. This is NOT the recommended
|
||||
# approach to running compose. There will be security warnings in the logs and some compose
|
||||
# operations may not work properly because certs == false currently means we install with
|
||||
# --no-tlsverify. Add CURL_CA_BUNDLE for a workaround in compose tests. If we change
|
||||
# certs == false to install with --no-tls, then we need to change this again.
|
||||
Run Keyword If ${tls_enabled} == ${false} Set Environment Variable CURL_CA_BUNDLE ${EMPTY}
|
||||
|
||||
# Get around quirk in compose if no-tlsverify, then CURL_CA_BUNDLE must exist and compose called with --tls
|
||||
Run Keyword If ${tls_enabled} == ${false} Set Environment Variable COMPOSE-PARAMS -H ${dockerHost} --tls
|
||||
|
||||
### Compose case for tlsverify (assumes DOCKER_TLS_VERIFY also set)
|
||||
|
||||
Run Keyword If ${tls_enabled} == ${true} Set Environment Variable COMPOSE_TLS_VERSION TLSv1_2
|
||||
Run Keyword If ${tls_enabled} == ${true} Set Environment Variable COMPOSE-PARAMS -H ${dockerHost}
|
||||
|
||||
Install VIC Appliance To Test Server
|
||||
[Arguments] ${vic-machine}=bin/vic-machine-linux ${appliance-iso}=bin/appliance.iso ${bootstrap-iso}=bin/bootstrap.iso ${certs}=${true} ${vol}=default ${cleanup}=${true}
|
||||
Set Test Environment Variables
|
||||
# disable firewall
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.esxcli network firewall set -e false
|
||||
# Attempt to cleanup old/canceled tests
|
||||
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling VMs On Test Server
|
||||
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Datastore On Test Server
|
||||
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling Networks On Test Server
|
||||
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling vSwitches On Test Server
|
||||
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling Containers On Test Server
|
||||
|
||||
# Install the VCH now
|
||||
Log To Console \nInstalling VCH to test server...
|
||||
${output}= Run VIC Machine Command ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${certs} ${vol}
|
||||
Log ${output}
|
||||
Should Contain ${output} Installer completed successfully
|
||||
Get Docker Params ${output} ${certs}
|
||||
Log To Console Installer completed successfully: %{VCH-NAME}...
|
||||
|
||||
Run VIC Machine Command
|
||||
[Tags] secret
|
||||
[Arguments] ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${certs} ${vol}
|
||||
${output}= Run Keyword If ${certs} Run ${vic-machine} create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --appliance-iso=${appliance-iso} --bootstrap-iso=${bootstrap-iso} --password=%{TEST_PASSWORD} --force=true --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT} --volume-store=%{TEST_DATASTORE}/test:${vol} ${vicmachinetls}
|
||||
Run Keyword If ${certs} Should Contain ${output} Installer completed successfully
|
||||
Return From Keyword If ${certs} ${output}
|
||||
|
||||
${output}= Run Keyword Unless ${certs} Run ${vic-machine} create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --appliance-iso=${appliance-iso} --bootstrap-iso=${bootstrap-iso} --password=%{TEST_PASSWORD} --force=true --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT} --volume-store=%{TEST_DATASTORE}/test:${vol} --no-tlsverify
|
||||
Run Keyword Unless ${certs} Should Contain ${output} Installer completed successfully
|
||||
[Return] ${output}
|
||||
|
||||
Run Secret VIC Machine Delete Command
|
||||
[Tags] secret
|
||||
[Arguments] ${vch-name}
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux delete --name=${vch-name} --target=%{TEST_URL}%{TEST_DATACENTER} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT}
|
||||
[Return] ${rc} ${output}
|
||||
|
||||
Run Secret VIC Machine Inspect Command
|
||||
[Tags] secret
|
||||
[Arguments] ${name}
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux inspect --name=${name} --target=%{TEST_URL}%{TEST_DATACENTER} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --thumbprint=%{TEST_THUMBPRINT}
|
||||
[Return] ${rc} ${output}
|
||||
|
||||
Run VIC Machine Delete Command
|
||||
${rc} ${output}= Run Secret VIC Machine Delete Command %{VCH-NAME}
|
||||
Wait Until Keyword Succeeds 6x 5s Check Delete Success %{VCH-NAME}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Should Contain ${output} Completed successfully
|
||||
${output}= Run rm -rf %{VCH-NAME}
|
||||
[Return] ${output}
|
||||
|
||||
Run VIC Machine Inspect Command
|
||||
${rc} ${output}= Run Secret VIC Machine Inspect Command %{VCH-NAME}
|
||||
Get Docker Params ${output} ${true}
|
||||
|
||||
Gather Logs From Test Server
|
||||
[Tags] secret
|
||||
Run Keyword And Continue On Failure Run zip %{VCH-NAME}-certs -r %{VCH-NAME}
|
||||
${out}= Run curl -k -D vic-admin-cookies -Fusername=%{TEST_USERNAME} -Fpassword=%{TEST_PASSWORD} %{VIC-ADMIN}/authentication
|
||||
Log ${out}
|
||||
${out}= Run curl -k -b vic-admin-cookies %{VIC-ADMIN}/container-logs.zip -o ${SUITE NAME}-%{VCH-NAME}-container-logs.zip
|
||||
Log ${out}
|
||||
Remove File vic-admin-cookies
|
||||
${out}= Run govc datastore.download %{VCH-NAME}/vmware.log %{VCH-NAME}-vmware.log
|
||||
Should Contain ${out} OK
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc logs -log=vmkernel -n=10000 > vmkernel.log
|
||||
|
||||
Check For The Proper Log Files
|
||||
[Arguments] ${container}
|
||||
# Ensure container logs are correctly being gathered for debugging purposes
|
||||
${rc} ${output}= Run And Return Rc and Output curl -sk %{VIC-ADMIN}/authentication -XPOST -F username=%{TEST_USERNAME} -F password=%{TEST_PASSWORD} -D /tmp/cookies-%{VCH-NAME}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc and Output curl -sk %{VIC-ADMIN}/container-logs.tar.gz -b /tmp/cookies-%{VCH-NAME} | tar tvzf -
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${output}
|
||||
Should Contain ${output} ${container}/output.log
|
||||
Should Contain ${output} ${container}/vmware.log
|
||||
Should Contain ${output} ${container}/tether.debug
|
||||
|
||||
Scrape Logs For the Password
|
||||
[Tags] secret
|
||||
${rc}= Run And Return Rc curl -sk %{VIC-ADMIN}/authentication -XPOST -F username=%{TEST_USERNAME} -F password=%{TEST_PASSWORD} -D /tmp/cookies-%{VCH-NAME}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
${rc}= Run And Return Rc curl -sk %{VIC-ADMIN}/logs/port-layer.log -b /tmp/cookies-%{VCH-NAME} | grep -q "%{TEST_PASSWORD}"
|
||||
Should Be Equal As Integers ${rc} 1
|
||||
${rc}= Run And Return Rc curl -sk %{VIC-ADMIN}/logs/init.log -b /tmp/cookies-%{VCH-NAME} | grep -q "%{TEST_PASSWORD}"
|
||||
Should Be Equal As Integers ${rc} 1
|
||||
${rc}= Run And Return Rc curl -sk %{VIC-ADMIN}/logs/docker-personality.log -b /tmp/cookies-%{VCH-NAME} | grep -q "%{TEST_PASSWORD}"
|
||||
Should Be Equal As Integers ${rc} 1
|
||||
${rc}= Run And Return Rc curl -sk %{VIC-ADMIN}/logs/vicadmin.log -b /tmp/cookies-%{VCH-NAME} | grep -q "%{TEST_PASSWORD}"
|
||||
Should Be Equal As Integers ${rc} 1
|
||||
|
||||
Remove File /tmp/cookies-%{VCH-NAME}
|
||||
|
||||
Cleanup VIC Appliance On Test Server
|
||||
Log To Console Gathering logs from the test server %{VCH-NAME}
|
||||
Gather Logs From Test Server
|
||||
Log To Console Deleting the VCH appliance %{VCH-NAME}
|
||||
${output}= Run VIC Machine Delete Command
|
||||
Run Keyword And Ignore Error Cleanup VCH Bridge Network %{VCH-NAME}
|
||||
[Return] ${output}
|
||||
|
||||
Cleanup VCH Bridge Network
|
||||
[Arguments] ${name}
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.portgroup.remove ${name}-bridge
|
||||
${out}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.portgroup.info
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Should Not Contain ${out} ${name}-bridge
|
||||
|
||||
Cleanup Datastore On Test Server
|
||||
${out}= Run govc datastore.ls
|
||||
${items}= Split To Lines ${out}
|
||||
:FOR ${item} IN @{items}
|
||||
\ ${build}= Split String ${item} -
|
||||
\ # Skip any item that is not associated with integration tests
|
||||
\ Continue For Loop If '@{build}[0]' != 'VCH'
|
||||
\ # Skip any item that is still running
|
||||
\ ${state}= Get State Of Drone Build @{build}[1]
|
||||
\ Continue For Loop If '${state}' == 'running'
|
||||
\ Log To Console Removing the following item from datastore: ${item}
|
||||
\ ${out}= Run govc datastore.rm ${item}
|
||||
\ Wait Until Keyword Succeeds 6x 5s Check Delete Success ${item}
|
||||
|
||||
Cleanup Dangling VMs On Test Server
|
||||
${out}= Run govc ls vm
|
||||
${vms}= Split To Lines ${out}
|
||||
:FOR ${vm} IN @{vms}
|
||||
\ ${vm}= Fetch From Right ${vm} /
|
||||
\ ${build}= Split String ${vm} -
|
||||
\ # Skip any VM that is not associated with integration tests
|
||||
\ Continue For Loop If '@{build}[0]' != 'VCH'
|
||||
\ # Skip any VM that is still running
|
||||
\ ${state}= Get State Of Drone Build @{build}[1]
|
||||
\ Continue For Loop If '${state}' == 'running'
|
||||
\ ${uuid}= Run govc vm.info -json\=true ${vm} | jq -r '.VirtualMachines[0].Config.Uuid'
|
||||
\ Log To Console Destroying dangling VCH: ${vm}
|
||||
\ ${rc} ${output}= Run Secret VIC Machine Delete Command ${vm}
|
||||
\ Wait Until Keyword Succeeds 6x 5s Check Delete Success ${vm}
|
||||
|
||||
Cleanup Dangling Networks On Test Server
|
||||
${out}= Run govc ls network
|
||||
${nets}= Split To Lines ${out}
|
||||
:FOR ${net} IN @{nets}
|
||||
\ ${net}= Fetch From Right ${net} /
|
||||
\ ${build}= Split String ${net} -
|
||||
\ # Skip any Network that is not associated with integration tests
|
||||
\ Continue For Loop If '@{build}[0]' != 'VCH'
|
||||
\ # Skip any Network that is still running
|
||||
\ ${state}= Get State Of Drone Build @{build}[1]
|
||||
\ Continue For Loop If '${state}' == 'running'
|
||||
\ ${uuid}= Run govc host.portgroup.remove ${net}
|
||||
|
||||
Cleanup Dangling vSwitches On Test Server
|
||||
${out}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.vswitch.info | grep VCH
|
||||
${nets}= Split To Lines ${out}
|
||||
:FOR ${net} IN @{nets}
|
||||
\ ${net}= Fetch From Right ${net} ${SPACE}
|
||||
\ ${build}= Split String ${net} -
|
||||
\ # Skip any vSwitch that is not associated with integration tests
|
||||
\ Continue For Loop If '@{build}[0]' != 'VCH'
|
||||
\ # Skip any vSwitch that is still running
|
||||
\ ${state}= Get State Of Drone Build @{build}[1]
|
||||
\ Continue For Loop If '${state}' == 'running'
|
||||
\ ${uuid}= Run govc host.vswitch.remove ${net}
|
||||
|
||||
Get Scratch Disk From VM Info
|
||||
[Arguments] ${vm}
|
||||
${disks}= Run govc vm.info -json ${vm} | jq -r '.VirtualMachines[].Layout.Disk[].DiskFile[]'
|
||||
${disks}= Split To Lines ${disks}
|
||||
:FOR ${disk} IN @{disks}
|
||||
\ ${disk}= Fetch From Right ${disk} ${SPACE}
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${disk} scratch.vmdk
|
||||
\ Return From Keyword If ${status} ${disk}
|
||||
|
||||
Cleanup Dangling Containers On Test Server
|
||||
${vms}= Run govc ls vm
|
||||
${vms}= Split To Lines ${vms}
|
||||
:FOR ${vm} IN @{vms}
|
||||
\ # Ignore VCH's, we only care about containers at this point
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${vm} VCH
|
||||
\ Continue For Loop If ${status}
|
||||
\ ${disk}= Get Scratch Disk From VM Info ${vm}
|
||||
\ ${vch}= Fetch From Left ${disk} /
|
||||
\ ${vch}= Split String ${vch} -
|
||||
\ # Skip any VM that is not associated with integration tests
|
||||
\ Continue For Loop If '@{vch}[0]' != 'VCH'
|
||||
\ ${state}= Get State Of Drone Build @{vch}[1]
|
||||
\ # Skip any VM that is still running
|
||||
\ Continue For Loop If '${state}' == 'running'
|
||||
\ # Destroy the VM and remove it from datastore because it is a dangling container
|
||||
\ Log To Console Cleaning up dangling container: ${vm}
|
||||
\ ${out}= Run govc vm.destroy ${vm}
|
||||
\ ${name}= Fetch From Right ${vm} /
|
||||
\ ${out}= Run govc datastore.rm ${name}
|
||||
\ Wait Until Keyword Succeeds 6x 5s Check Delete Success ${name}
|
||||
|
||||
# VCH upgrade helpers
|
||||
Install VIC with version to Test Server
|
||||
[Arguments] ${version}=7315 ${insecureregistry}=
|
||||
Log To Console \nDownloading vic ${version} from bintray...
|
||||
${rc} ${output}= Run And Return Rc And Output wget https://bintray.com/vmware/vic-repo/download_file?file_path=vic_${version}.tar.gz -O vic.tar.gz
|
||||
${rc} ${output}= Run And Return Rc And Output tar zxvf vic.tar.gz
|
||||
Set Environment Variable TEST_TIMEOUT 20m0s
|
||||
Install VIC Appliance To Test Server vic-machine=./vic/vic-machine-linux appliance-iso=./vic/appliance.iso bootstrap-iso=./vic/bootstrap.iso certs=${false} vol=default ${insecureregistry}
|
||||
Set Environment Variable VIC-ADMIN %{VCH-IP}:2378
|
||||
Set Environment Variable INITIAL-VERSION ${version}
|
||||
|
||||
Clean up VIC Appliance And Local Binary
|
||||
Cleanup VIC Appliance On Test Server
|
||||
Run rm -rf vic.tar.gz vic
|
||||
|
||||
Upgrade
|
||||
Log To Console \nUpgrading VCH...
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux upgrade --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT}
|
||||
Should Contain ${output} Completed successfully
|
||||
Should Not Contain ${output} Rolling back upgrade
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Check Upgraded Version
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux version
|
||||
@{vers}= Split String ${output}
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux inspect --name=%{VCH-NAME} --target=%{TEST_URL} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --compute-resource=%{TEST_RESOURCE}
|
||||
Should Contain ${output} Completed successfully
|
||||
Should Contain ${output} @{vers}[2]
|
||||
Should Not Contain ${output} %{INITIAL-VERSION}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${output}
|
||||
Get Docker Params ${output} ${true}
|
||||
|
||||
Check Original Version
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux version
|
||||
@{vers}= Split String ${output}
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux inspect --name=%{VCH-NAME} --target=%{TEST_URL} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --compute-resource=%{TEST_RESOURCE}
|
||||
Should Contain ${output} Completed successfully
|
||||
Should Contain ${output} @{vers}[2]
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Log ${output}
|
||||
Get Docker Params ${output} ${true}
|
||||
|
||||
Rollback
|
||||
Log To Console \nTesting rollback...
|
||||
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux upgrade --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT} --rollback
|
||||
Should Contain ${output} Completed successfully
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Enable VCH SSH
|
||||
[Arguments] ${vic-machine}=bin/vic-machine-linux ${rootpw}=%{TEST_PASSWORD} ${target}=%{TEST_URL} ${password}=%{TEST_PASSWORD} ${thumbprint}=%{TEST_THUMBPRINT} ${name}=%{VCH-NAME} ${user}=%{TEST_USERNAME} ${resource}=%{TEST_RESOURCE}
|
||||
Log To Console \nEnable SSH on vch...
|
||||
${rc} ${output}= Run And Return Rc And Output ${vic-machine} debug --rootpw ${rootpw} --target ${target} --password ${password} --thumbprint ${thumbprint} --name ${name} --user ${user} --compute-resource ${resource} --enable-ssh
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Should Contain ${output} Completed successfully
|
218
tests/resources/Vsphere-Util.robot
Normal file
218
tests/resources/Vsphere-Util.robot
Normal file
@ -0,0 +1,218 @@
|
||||
# Copyright 2016-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 This resource contains any keywords dealing with operations being performed on a Vsphere instance, mostly govc wrappers
|
||||
|
||||
*** Keywords ***
|
||||
Power On VM OOB
|
||||
[Arguments] ${vm}
|
||||
${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run And Return Rc And Output govc vm.power -on %{VCH-NAME}/"${vm}"
|
||||
Run Keyword If '%{HOST_TYPE}' == 'VC' Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run And Return Rc And Output govc vm.power -on "${vm}"
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Should Be Equal As Integers ${rc} 0
|
||||
Log To Console Waiting for VM to power on ...
|
||||
Wait Until VM Powers On ${vm}
|
||||
|
||||
Power Off VM OOB
|
||||
[Arguments] ${vm}
|
||||
${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run And Return Rc And Output govc vm.power -off %{VCH-NAME}/"${vm}"
|
||||
Run Keyword If '%{HOST_TYPE}' == 'VC' Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run And Return Rc And Output govc vm.power -off "${vm}"
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Should Be Equal As Integers ${rc} 0
|
||||
Log To Console Waiting for VM to power off ...
|
||||
Wait Until VM Powers Off "${vm}"
|
||||
|
||||
Destroy VM OOB
|
||||
[Arguments] ${vm}
|
||||
${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run And Return Rc And Output govc vm.destroy %{VCH-NAME}/"*-${vm}"
|
||||
Run Keyword If '%{HOST_TYPE}' == 'VC' Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run And Return Rc And Output govc vm.destroy "*-${vm}"
|
||||
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Put Host Into Maintenance Mode
|
||||
${rc} ${output}= Run And Return Rc And Output govc host.maintenance.enter -host.ip=%{TEST_URL}
|
||||
Should Contain ${output} entering maintenance mode... OK
|
||||
|
||||
Remove Host From Maintenance Mode
|
||||
${rc} ${output}= Run And Return Rc And Output govc host.maintenance.exit -host.ip=%{TEST_URL}
|
||||
Should Contain ${output} exiting maintenance mode... OK
|
||||
|
||||
Reboot VM
|
||||
[Arguments] ${vm}
|
||||
Log To Console Rebooting ${vm} ...
|
||||
Power Off VM OOB ${vm}
|
||||
Power On VM OOB ${vm}
|
||||
Log To Console ${vm} Powered On
|
||||
|
||||
Wait Until VM Powers On
|
||||
[Arguments] ${vm}
|
||||
:FOR ${idx} IN RANGE 0 30
|
||||
\ ${ret}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run govc vm.info %{VCH-NAME}/${vm}
|
||||
\ Run Keyword If '%{HOST_TYPE}' == 'VC' Set Test Variable ${out} ${ret}
|
||||
\ ${ret}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc vm.info ${vm}
|
||||
\ Run Keyword If '%{HOST_TYPE}' == 'ESXi' Set Test Variable ${out} ${ret}
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} poweredOn
|
||||
\ Return From Keyword If ${status}
|
||||
\ Sleep 1
|
||||
Fail VM did not power on within 30 seconds
|
||||
|
||||
Wait Until VM Powers Off
|
||||
[Arguments] ${vm}
|
||||
:FOR ${idx} IN RANGE 0 30
|
||||
\ ${ret}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run govc vm.info %{VCH-NAME}/${vm}
|
||||
\ Run Keyword If '%{HOST_TYPE}' == 'VC' Set Test Variable ${out} ${ret}
|
||||
\ ${ret}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc vm.info ${vm}
|
||||
\ Run Keyword If '%{HOST_TYPE}' == 'ESXi' Set Test Variable ${out} ${ret}
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} poweredOff
|
||||
\ Return From Keyword If ${status}
|
||||
\ Sleep 1
|
||||
Fail VM did not power off within 30 seconds
|
||||
|
||||
Wait Until VM Is Destroyed
|
||||
[Arguments] ${vm}
|
||||
:FOR ${idx} IN RANGE 0 30
|
||||
\ ${ret}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run govc ls vm/%{VCH-NAME}/${vm}
|
||||
\ Run Keyword If '%{HOST_TYPE}' == 'VC' Set Test Variable ${out} ${ret}
|
||||
\ ${ret}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc ls vm/${vm}
|
||||
\ Run Keyword If '%{HOST_TYPE}' == 'ESXi' Set Test Variable ${out} ${ret}
|
||||
\ ${status}= Run Keyword And Return Status Should Be Empty ${out}
|
||||
\ Return From Keyword If ${status}
|
||||
\ Sleep 1
|
||||
Fail VM was not destroyed within 30 seconds
|
||||
|
||||
Get VM IP
|
||||
[Arguments] ${vm}
|
||||
${rc} ${out}= Run And Return Rc And Output govc vm.ip ${vm}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
[Return] ${out}
|
||||
|
||||
Get VM Host Name
|
||||
[Arguments] ${vm}
|
||||
${out}= Run govc vm.info ${vm}
|
||||
${out}= Split To Lines ${out}
|
||||
${host}= Fetch From Right @{out}[-1] ${SPACE}
|
||||
[Return] ${host}
|
||||
|
||||
Get VM Info
|
||||
[Arguments] ${vm}
|
||||
${rc} ${out}= Run And Return Rc And Output govc vm.info -r ${vm}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
[Return] ${out}
|
||||
|
||||
vMotion A VM
|
||||
[Arguments] ${vm}
|
||||
${host}= Get VM Host Name ${vm}
|
||||
${status}= Run Keyword And Return Status Should Contain ${host} ${esx1-ip}
|
||||
Run Keyword If ${status} Run govc vm.migrate -host cls/${esx2-ip} -pool cls/Resources ${vm}
|
||||
Run Keyword Unless ${status} Run govc vm.migrate -host cls/${esx1-ip} -pool cls/Resources ${vm}
|
||||
|
||||
Create Test Server Snapshot
|
||||
[Arguments] ${vm} ${snapshot}
|
||||
Set Environment Variable GOVC_URL %{BUILD_SERVER}
|
||||
${rc} ${out}= Run And Return Rc And Output govc snapshot.create -vm ${vm} ${snapshot}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Should Be Empty ${out}
|
||||
Set Environment Variable GOVC_URL %{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}
|
||||
|
||||
Revert Test Server Snapshot
|
||||
[Arguments] ${vm} ${snapshot}
|
||||
Set Environment Variable GOVC_URL %{BUILD_SERVER}
|
||||
${rc} ${out}= Run And Return Rc And Output govc snapshot.revert -vm ${vm} ${snapshot}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Should Be Empty ${out}
|
||||
Set Environment Variable GOVC_URL %{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}
|
||||
|
||||
Delete Test Server Snapshot
|
||||
[Arguments] ${vm} ${snapshot}
|
||||
Set Environment Variable GOVC_URL %{BUILD_SERVER}
|
||||
${rc} ${out}= Run And Return Rc And Output govc snapshot.remove -vm ${vm} ${snapshot}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
Should Be Empty ${out}
|
||||
Set Environment Variable GOVC_URL %{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}
|
||||
|
||||
Setup Snapshot
|
||||
${hostname}= Get Test Server Hostname
|
||||
Set Environment Variable TEST_HOSTNAME ${hostname}
|
||||
Set Environment Variable SNAPSHOT vic-ci-test-%{DRONE_BUILD_NUMBER}
|
||||
Create Test Server Snapshot %{TEST_HOSTNAME} %{SNAPSHOT}
|
||||
|
||||
Get Datacenter Name
|
||||
${out}= Run govc datacenter.info
|
||||
${out}= Split To Lines ${out}
|
||||
${name}= Fetch From Right @{out}[0] ${SPACE}
|
||||
[Return] ${name}
|
||||
|
||||
Get Test Server Hostname
|
||||
[Tags] secret
|
||||
${hostname}= Run sshpass -p $TEST_PASSWORD ssh $TEST_USERNAME@$TEST_URL hostname
|
||||
[Return] ${hostname}
|
||||
|
||||
Check Delete Success
|
||||
[Arguments] ${name}
|
||||
${out}= Run govc ls vm
|
||||
Log ${out}
|
||||
Should Not Contain ${out} ${name}
|
||||
${out}= Run govc datastore.ls
|
||||
Log ${out}
|
||||
Should Not Contain ${out} ${name}
|
||||
${out}= Run govc ls host/*/Resources/*
|
||||
Log ${out}
|
||||
Should Not Contain ${out} ${name}
|
||||
|
||||
Gather Logs From ESX Server
|
||||
Environment Variable Should Be Set TEST_URL
|
||||
${out}= Run govc logs.download
|
||||
|
||||
Change Log Level On Server
|
||||
[Arguments] ${level}
|
||||
${out}= Run govc host.option.set Config.HostAgent.log.level ${level}
|
||||
Should Be Empty ${out}
|
||||
|
||||
Add Vsphere License
|
||||
[Tags] secret
|
||||
[Arguments] ${license}
|
||||
${out}= Run govc license.add ${license}
|
||||
Should Contain ${out} Key:
|
||||
|
||||
Assign Vsphere License
|
||||
[Tags] secret
|
||||
[Arguments] ${license} ${host}
|
||||
${out}= Run govc license.assign -host ${host} ${license}
|
||||
Should Contain ${out} Key:
|
||||
|
||||
Add Host To VCenter
|
||||
[Arguments] ${host} ${user} ${dc} ${pw}
|
||||
:FOR ${idx} IN RANGE 1 4
|
||||
\ ${out}= Run govc cluster.add -hostname=${host} -username=${user} -dc=${dc} -password=${pw} -noverify=true
|
||||
\ ${status}= Run Keyword And Return Status Should Contain ${out} OK
|
||||
\ Return From Keyword If ${status}
|
||||
Fail Failed to add the host to the VC in 3 attempts
|
||||
|
||||
Get Host Firewall Enabled
|
||||
${output}= Run govc host.esxcli network firewall get
|
||||
Should Contain ${output} Enabled
|
||||
@{output}= Split To Lines ${output}
|
||||
:FOR ${line} IN @{output}
|
||||
\ Run Keyword If "Enabled" in '''${line}''' Set Test Variable ${out} ${line}
|
||||
${enabled}= Fetch From Right ${out} :
|
||||
${enabled}= Strip String ${enabled}
|
||||
Return From Keyword If '${enabled}' == 'false' ${false}
|
||||
Return From Keyword If '${enabled}' == 'true' ${true}
|
||||
|
||||
Enable Host Firewall
|
||||
Run govc host.esxcli network firewall set --enabled true
|
||||
|
||||
Disable Host Firewall
|
||||
Run govc host.esxcli network firewall set --enabled false
|
289
tests/robot-cases/Group0-BAT/BAT.robot
Normal file
289
tests/robot-cases/Group0-BAT/BAT.robot
Normal file
@ -0,0 +1,289 @@
|
||||
// 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
|
||||
Suite Setup Install Harbor to Test Server
|
||||
Default Tags BAT
|
||||
|
||||
*** Variables ***
|
||||
${HARBOR_URL} http://localhost
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Create An New User
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Close Browser
|
||||
|
||||
Test Case - Sign With Admin
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Close Browser
|
||||
|
||||
Test Case - Update User Comment
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Update User Comment Test12#4
|
||||
Logout Harbor
|
||||
|
||||
Test Case - Update Password
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Change Password Test1@34 Test12#4
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} tester${d} Test12#4
|
||||
Close Browser
|
||||
|
||||
Test Case - Create An New Project
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}
|
||||
Close Browser
|
||||
|
||||
Test Case - User View Projects
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}1
|
||||
Create An New Project test${d}2
|
||||
Create An New Project test${d}3
|
||||
Switch To Log
|
||||
Capture Page Screenshot UserViewProjects.png
|
||||
Wait Until Page Contains test${d}1
|
||||
Wait Until Page Contains test${d}2
|
||||
Wait Until Page Contains test${d}3
|
||||
Close Browser
|
||||
|
||||
Test Case - Push Image
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}
|
||||
|
||||
Push image ${ip} tester${d} Test1@34 test${d} hello-world:latest
|
||||
Go Into Project test${d}
|
||||
Wait Until Page Contains test${d}/hello-world
|
||||
|
||||
Test Case - User View Logs
|
||||
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=true
|
||||
|
||||
Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
|
||||
Go Into Project project${d}
|
||||
Delete Repo project${d}
|
||||
|
||||
Go To Project Log
|
||||
Advanced Search Should Display
|
||||
|
||||
Do Log Advanced Search
|
||||
Close Browser
|
||||
|
||||
Test Case - Manage project publicity
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
|
||||
Create An New User url=${HARBOR_URL} username=usera${d} email=usera${d}@vmware.com realname=usera${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
Create An New User url=${HARBOR_URL} username=userb${d} email=userb${d}@vmware.com realname=userb${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Create An New Project project${d} public=true
|
||||
|
||||
Push image ${ip} usera${d} Test1@34 project${d} hello-world:latest
|
||||
Pull image ${ip} userb${d} Test1@34 project${d} hello-world:latest
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Display project${d}
|
||||
Search Private Projects
|
||||
Project Should Not Display project${d}
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Make Project Private project${d}
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Not Display project${d}
|
||||
Cannot Pull image ${ip} userb${d} Test1@34 project${d} hello-world:latest
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Make Project Public project${d}
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Display project${d}
|
||||
Close Browser
|
||||
|
||||
Test Case - Edit Project Creation
|
||||
# create normal user and login
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
|
||||
Project Creation Should Display
|
||||
Logout Harbor
|
||||
|
||||
Sleep 3
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Set Pro Create Admin Only
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
|
||||
Project Creation Should Not Display
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Set Pro Create Every One
|
||||
Close browser
|
||||
|
||||
Test Case - Edit Self-Registration
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Disable Self Reg
|
||||
Logout Harbor
|
||||
|
||||
Sign Up Should Not Display
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To Configure
|
||||
Self Reg Should Be Disabled
|
||||
Sleep 1
|
||||
|
||||
#restore setting
|
||||
Enable Self Reg
|
||||
Close Browser
|
||||
|
||||
Test Case - Edit Verify Remote Cert
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To System Replication
|
||||
Check Verify Remote Cert
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To System Replication
|
||||
Should Verify Remote Cert Be Enabled
|
||||
|
||||
#restore setting
|
||||
Check Verify Remote Cert
|
||||
Close Browser
|
||||
|
||||
Test Case - Edit Email Settings
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To Email
|
||||
Config Email
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To Email
|
||||
Verify Email
|
||||
|
||||
Close Browser
|
||||
|
||||
Test Case - Edit Token Expire
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Modify Token Expiration 20
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Token Must Be Match 20
|
||||
|
||||
#reset to default
|
||||
Modify Token Expiration 30
|
||||
Close Browser
|
||||
|
||||
Test Case - Create An Replication Rule New Endpoint
|
||||
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}
|
||||
Go Into Project project${d}
|
||||
Switch To Replication
|
||||
Create An New Rule With New Endpoint policy_name=test_policy_${d} policy_description=test_description destination_name=test_destination_name_${d} destination_url=test_destination_url_${d} destination_username=test_destination_username destination_password=test_destination_password
|
||||
Close Browser
|
||||
|
||||
Test Case - Scan A Tag
|
||||
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
|
||||
Go Into Project project${d}
|
||||
Expand Repo project${d}
|
||||
Scan Repo project${d}
|
||||
Summary Chart Should Display project${d}
|
||||
Close Browser
|
||||
|
||||
Test Case - Assign Sys Admin
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch to User Tag
|
||||
Assign User Admin tester${d}
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
|
||||
Administration Tag Should Display
|
||||
Close Browser
|
||||
|
||||
Test Case - Ldap Sign in and out
|
||||
Switch To LDAP
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To Configure
|
||||
Init LDAP
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} user001 user001
|
||||
Close Browser
|
||||
|
||||
Test Case - Admin Push Signed Image
|
||||
Switch To Notary
|
||||
|
||||
${rc} ${output}= Run And Return Rc And Output docker pull hello-world:latest
|
||||
Log To Console ${output}
|
||||
|
||||
Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest
|
||||
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-push-image.sh
|
||||
Log To Console ${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
|
||||
|
||||
Test Case - Admin Push Un-Signed Image
|
||||
${rc} ${output}= Run And Return Rc And Output docker push ${ip}/library/hello-world:latest
|
||||
Log To Console ${output}
|
@ -0,0 +1,22 @@
|
||||
// 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 Bundle
|
||||
|
||||
*** Test Cases ***
|
||||
Distro Harbor Offline
|
||||
Package Harbor Offline
|
@ -0,0 +1,25 @@
|
||||
// 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 Create An New User
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Create An New User
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Close Browser
|
@ -0,0 +1,25 @@
|
||||
// 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 Sign in and out
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Sign in and out
|
||||
Init Chrome Driver
|
||||
Sign In Harbor %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Logout Harbor
|
||||
Close Browser
|
@ -0,0 +1,28 @@
|
||||
// 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 Update Password
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Update Password
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Change Password Test1@34 Test12#4
|
||||
Logout Harbor
|
||||
Sign In Harbor tester${d} Test12#4
|
||||
Close Browser
|
@ -0,0 +1,26 @@
|
||||
// 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 Update account settings
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Update User Comment
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Update User Comment Test12#4
|
||||
Logout Harbor
|
@ -0,0 +1,29 @@
|
||||
// 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 Update account settings
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Ldap Sign in and out
|
||||
Switch To LDAP
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To Configure
|
||||
Init LDAP
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} user001 user001
|
||||
Close Browser
|
@ -0,0 +1,25 @@
|
||||
// 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 Update User Comment
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Update User Comment
|
||||
Init Chrome Driver
|
||||
Sign In Harbor %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Logout Harbor
|
||||
Close Browser
|
@ -0,0 +1,25 @@
|
||||
// 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 Update User Comment
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Update User Comment
|
||||
Init Chrome Driver
|
||||
Sign In Harbor %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Update User Comment Test12#4
|
||||
Logout Harbor
|
@ -0,0 +1,27 @@
|
||||
// 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 Admin Update Password
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Admin Update Password
|
||||
Init Chrome Driver
|
||||
Sign In Harbor %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Change Password %{HARBOR_PASSWORD} Test12#4
|
||||
Logout Harbor
|
||||
Sign In Harbor %{HARBOR_ADMIN} Test12#4
|
||||
Close Browser
|
@ -0,0 +1,32 @@
|
||||
// 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 Assign Sys Admin
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Assign Sys Admin
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch to User Tag
|
||||
Assign User Admin tester${d}
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} tester${d} Test1@34
|
||||
Administration Tag Should Display
|
||||
Close Browser
|
@ -0,0 +1,26 @@
|
||||
// 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 Create An New Project
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Create An New Project
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}
|
||||
Close Browser
|
@ -0,0 +1,32 @@
|
||||
// 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 User View Projects
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - User View Projects
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}1
|
||||
Create An New Project test${d}2
|
||||
Create An New Project test${d}3
|
||||
Switch To Log
|
||||
Wait Until Page Contains test${d}1
|
||||
Wait Until Page Contains test${d}2
|
||||
Wait Until Page Contains test${d}3
|
||||
Close Browser
|
@ -0,0 +1,70 @@
|
||||
// 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 Admin View Project
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Admin View Project
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
Create An New Project test${d}1
|
||||
Create An New Public Project test${d}2
|
||||
Close Browser
|
||||
|
||||
${rc} ${ip}= Run And Return Rc And Output ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'
|
||||
Log To Console ${ip}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker pull hello-world
|
||||
Log ${rc}
|
||||
${rc}= Run And Return Rc docker pull busybox
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc} ${output}= Run And Return Rc And Output docker login -u tester${d} -p Test1@34 ${ip}
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker tag hello-world ${ip}/test${d}1/hello-world:latest
|
||||
Log ${rc}
|
||||
${rc}= Run And Return Rc docker tag hello-world ${ip}/test${d}2/busybox:latest
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker push ${ip}/test${d}1/hello-world:latest
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
${rc}= Run And Return Rc docker push ${ip}/test${d}2/busybox:latest
|
||||
Log ${rc}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
Init Chrome Driver
|
||||
Go To http://localhost
|
||||
Sleep 2
|
||||
${title}= Get Title
|
||||
Should Be Equal ${title} Harbor
|
||||
Sign In Harbor %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Sleep 2
|
||||
Wait Until Page Contains test${d}1
|
||||
Wait Until Page Contains test${d}2
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[2]
|
||||
Sleep 2
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[1]
|
||||
Sleep 2
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
|
||||
Sleep
|
||||
Wait Until Page Contains test${d}1/hello-world
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/nav/ul/li[2]/a
|
||||
Sleep 2
|
||||
Wait Until Page Contains tester${d}
|
@ -0,0 +1,175 @@
|
||||
// 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 Manage Project Member
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
Test Case - Manage Project Member
|
||||
Init Chrome Driver
|
||||
${d}= Get current Date result_format=%m%s
|
||||
${rc} ${ip}= run and return rc and output ip add s eth0|grep "inet "|awk '{print $2}'|awk -F "/" '{print $1}'
|
||||
log to console ${ip}
|
||||
Create An New User ${HARBOR_URL} username=usera${d} email=usera${d}@vmware.com realname=usera${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
Create An New User ${HARBOR_URL} username=userb${d} email=userb${d}@vmware.com realname=userb${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
Create An New User ${HARBOR_URL} username=userc${d} email=userc${d}@vmware.com realname=userc${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
#create project
|
||||
Create An New Project project${d}
|
||||
#verify can not change role
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
page should not contain element xpath=//project-detail//clr-dg-cell//clr-dg-action-overflow
|
||||
Logout Harbor
|
||||
#login console as usera and push
|
||||
${rc}= run and return rc docker pull hello-world
|
||||
${rc} ${output}= run and return rc and output docker login -u usera${d} -p Test1@34 ${ip}
|
||||
${rc}= run and return rc docker tag hello-world ${d}/project${d}/hello-world
|
||||
${rc}= run and return rc docker push ${d}/project${d}/hello-world
|
||||
${rc}= run and return rc docker logout ${d}
|
||||
#logout change userb and pull push
|
||||
${rc} ${output}= run and return rc and output docker login -u userb${d} -p Test1@34 ${ip}
|
||||
${rc}= run and return rc docker tag hello-world ${d}/project${d}/bbbbb
|
||||
${rc}= run and return rc docker pull ${ip}/project${d}/hello-world
|
||||
should not be equal as integers ${rc} 0
|
||||
${rc}= run and return rc docker push ${ip}/project${d}/bbbbb
|
||||
should not be equal as integers ${rc} 0
|
||||
#login ui as b
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
page should not contain element xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Logout Harbor
|
||||
#login as a
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
#click add member
|
||||
click element xpath=//project-detail//button//clr-icon
|
||||
Sleep 1
|
||||
input text xpath=//add-member//input[@id="member_name"] userb${d}
|
||||
#select guest
|
||||
Mouse down xpath=//project-detail//form//input[@id="checkrads_guest"]
|
||||
Mouse up xpath=//project-detail//form//input[@id="checkrads_guest"]
|
||||
click button xpath=//project-detail//add-member//button[2]
|
||||
Logout Harbor
|
||||
#sign in as b
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
#step 12
|
||||
page should contain element xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
#step 13
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
sleep 1
|
||||
#page should contain element xpath=//project-detail//clr-dg-cell//clr-dg-action-overflow[@hidden=""]
|
||||
xpath should match x times //project-detail//clr-dg-action-overflow[@hidden=""] 2
|
||||
#step 14
|
||||
page should not contain element xpath=//project-detail//button//clr-icon
|
||||
${rc} ${output}= run and return rc and output docker login -u userb${d} -p Test1@34 ${ip}
|
||||
#step 15
|
||||
${rc}= run and return rc docker pull ${ip}/project${d}/hello-world
|
||||
#step 16
|
||||
${rc}= run and return rc docker push ${ip}/project${d}/bbbbb
|
||||
should not be equal as integers ${rc} 0
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
#change userb to developer
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
sleep 1
|
||||
click element xpath=//project-detail//clr-dg-row-master[contains(.,'userb${d}')]//clr-dg-action-overflow
|
||||
click element xpath=//project-detail//clr-dg-row-master[contains(.,'userb${d}')]//clr-dg-action-overflow//button[contains(.,"Developer")]
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
page should contain element xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
sleep 1
|
||||
#page should contain element xpath=//project-detail//clr-dg-cell//clr-dg-action-overflow[@hidden=""]
|
||||
xpath should match x times //project-detail//clr-dg-action-overflow[@hidden=""] 2
|
||||
#step 20
|
||||
page should not contain element xpath=//project-detail//button//clr-icon
|
||||
#step 21
|
||||
${rc}= run and return rc docker login -u userb${d} -p Test1@34 ${ip}
|
||||
${rc}= run and return rc docker tag hello-world ${ip}/project${d}/hello-world:v1
|
||||
${rc}= run and return rc docker push ${ip}/project${d}/hello-world:v1
|
||||
should be equal as integers ${rc} 0
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
#step 22
|
||||
#change userb to admin of project
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
sleep 1
|
||||
click element xpath=//project-detail//clr-dg-row-master[contains(.,'userb${d}')]//clr-dg-action-overflow
|
||||
click element xpath=//project-detail//clr-dg-row-master[contains(.,'userb${d}')]//clr-dg-action-overflow//button[contains(.,"Admin")]
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
page should contain element xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
# add userc
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
sleep 1
|
||||
click element xpath=//project-detail//button//clr-icon
|
||||
input text xpath=//add-member//input[@id="member_name"] userc${d}
|
||||
mouse down xpath=//project-detail//form//input[@id="checkrads_guest"]
|
||||
mouse up xpath=//project-detail//form//input[@id="checkrads_guest"]
|
||||
click button xpath=//project-detail//add-member//button[2]
|
||||
sleep 1
|
||||
#step 25 verify b can change c role
|
||||
page should contain element xpath=//project-detail//clr-dg-row-master[contains(.,'userc${d}')]//clr-dg-action-overflow
|
||||
${rc}= run and return rc docker login -u userb${d} -p Test1@34 ${ip}
|
||||
${rc}= run and return rc docker tag hello-world ${ip}/project${d}/hello-world:v2
|
||||
${rc}= run and return rc docker push ${ip}/project${d}/hello-world:v2
|
||||
#should be equal as integers ${rc} 0
|
||||
Logout Harbor
|
||||
#step 27 remove b from project
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Mouse down xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Mouse up xpath=//clr-dg-cell//a[contains(.,'project${d}')]
|
||||
Sleep 1
|
||||
click element xpath=//project-detail//li[2]
|
||||
sleep 1
|
||||
click element xpath=//project-detail//clr-dg-row-master[contains(.,'userb${d}')]//clr-dg-action-overflow
|
||||
click element xpath=//project-detail//clr-dg-cell//clr-dg-action-overflow//button[contains(.,"Delete")]
|
||||
sleep 1
|
||||
click element xpath=//confiramtion-dialog//button[2]
|
||||
sleep 1
|
||||
#step28
|
||||
${rc}= run and return rc docker login -u userb${d} -p Test1@34 ${ip}
|
||||
${rc}= run and return rc docker pull ${ip}/project${d}/hello-world
|
||||
should not be equal as integers ${rc} 0
|
||||
#step 29
|
||||
${rc}= run and return rc docker logout ${ip}
|
||||
#step 30
|
||||
${rc}= run and return rc docker login -u userc${d} -p Test1@34 ${ip}
|
||||
${rc}= run and return rc docker pull ${ip}/project${d}/hello-world
|
||||
should be equal as integers ${rc} 0
|
||||
Close Browser
|
@ -0,0 +1,59 @@
|
||||
// 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 Manage project publicity
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
Test Case - Manage project publicity
|
||||
#Start Docker Daemon Locally
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
${rc} ${ip}= run and return rc and output ip a s eth0|grep "inet "|awk '{print $2}'|awk -F "/" '{print $1}'
|
||||
Log to console ${ip}
|
||||
|
||||
Create An New User url=${HARBOR_URL} username=usera${d} email=usera${d}@vmware.com realname=usera${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
Create An New User url=${HARBOR_URL} username=userb${d} email=userb${d}@vmware.com realname=userb${d} newPassword=Test1@34 comment=harbor
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Create An New Public Project project${d}
|
||||
|
||||
Push image ${ip} usera${d} Test1@34 project${d} hello-world:latest
|
||||
Pull image ${ip} userb${d} Test1@34 project${d} hello-world:latest
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Display project${d}
|
||||
Search Private Projects
|
||||
Project Should Not Display project${d}
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Make Project Private project${d}
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Not Display project${d}
|
||||
Cannot Pull image ${ip} usera${d} Test1@34 project${d} hello-world:latest
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} usera${d} Test1@34
|
||||
Make Project Public project${d}
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} userb${d} Test1@34
|
||||
Project Should Display project${d}
|
@ -0,0 +1,36 @@
|
||||
// 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 User View Logs
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
Test Case - User View Logs
|
||||
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=true
|
||||
|
||||
Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
Pull image ${ip} tester${d} Test1@34 project${d} busybox:latest
|
||||
|
||||
Go Into Project project${d}
|
||||
Delete Repo project${d}
|
||||
|
||||
Go To Project Log
|
||||
Advanced Search Should Display
|
||||
|
||||
Do Log Advanced Search
|
||||
Close Browser
|
@ -0,0 +1,29 @@
|
||||
// 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 Bundle
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Create An Replication Rule New Endpoint
|
||||
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}
|
||||
Go Into Project project${d}
|
||||
Switch To Replication
|
||||
Create An New Rule With New Endpoint policy_name=test_policy_${d} policy_description=test_description destination_name=test_destination_name_${d} destination_url=test_destination_url_${d} destination_username=test_destination_username destination_password=test_destination_password
|
||||
Close Browser
|
@ -0,0 +1,61 @@
|
||||
// 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 ***
|
||||
Resource ../../resources/Uitl.robot
|
||||
suite setup Start Docker Daemon Locally
|
||||
default tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Edit authentication
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Sign In Harbor admin Harbor12345
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Click Element xpath=//select[@id="authMode"]
|
||||
Click Element xpath=//select[@id="authMode"]//option[@value="ldap_auth"]
|
||||
Sleep 1
|
||||
Input Text xpath=//input[@id="ldapUrl"]
|
||||
Input Text xpath=//input[@id="ldapSearchDN"]
|
||||
Input Text xpath=//input[@id="ldapSearchPwd"]
|
||||
Input Text xpath=//input[@id="ldapUid"]
|
||||
#scope keep subtree
|
||||
#click save
|
||||
Click Button xpath=//config//div/button[1]
|
||||
Logout Harbor
|
||||
#check can change back to db
|
||||
Sign In Harbor admin Harbor12345
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Page Should Not Contain Element xpath=//select[@disabled='']
|
||||
Logout Harbor
|
||||
#signin ldap user
|
||||
Sign In Harbor user001 user001
|
||||
Logout Harbor
|
||||
#sign in as admin
|
||||
Sign In Harbor admin Harbor12345
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Page Should Contain Element xpath=//select[@disabled='']
|
||||
|
||||
#clean database and restart harbor
|
||||
Down Harbor
|
||||
${rc} ${output}= Run And Return Rc And Output rm -rf /data
|
||||
Prepare
|
||||
Up Harbor
|
||||
|
||||
Create An New User username=test${d} email=test${d}@vmware.com realname=test{d} newPassword=Test1@34 comment=harbor
|
||||
Sign In Harbor admin Harbor12345
|
||||
Click Element xpath=//clr-main-containter//nav//ul/li[3]
|
||||
Page Should Contain Element xpath=//select[@disabled='']
|
||||
Sleep 1
|
||||
Close Browser
|
@ -0,0 +1,48 @@
|
||||
// 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 ***
|
||||
resource ../../resources/Util.robot
|
||||
suite setup Start Docker Daemon Locally
|
||||
default tags regression
|
||||
|
||||
*** Test cases ***
|
||||
Test Case - Edit Project Creation
|
||||
# create normal user and login
|
||||
Init Chrome Driver
|
||||
${d}= Get Current Date result_format=%m%s
|
||||
Create An New User username=tester${d} email=tester${d}@vmware.com realname=harbortest newPassword=Test1@34 comment=harbortest
|
||||
#check project creation
|
||||
Page Should Contain Element xpath=//project//div[@class="option-left"]/button
|
||||
#logout and login admin
|
||||
Logout Harbor
|
||||
Sign In Harbor admin Harbor12345
|
||||
#set limit to admin only
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Click Element xpath=//select[@id="proCreation"]
|
||||
Click Element xpath=//select[@id="proCreation"]//option[@value="adminonly"]
|
||||
Click Element xpath=//config//div/button[1]
|
||||
#logout and login normal user
|
||||
Logout Harbor
|
||||
Sign In Harbor tester${d} Test1@34
|
||||
#check if can create project
|
||||
Page Should Not Contain Element xpath=//project//div[@class="option-left"]/button
|
||||
Logout Harbor
|
||||
Sign In Harbor admin Harbor12345
|
||||
Click Element xpath=//clr-main-container//nav//ul/li[3]
|
||||
Click Element xpath=//select[@id="proCreation"]
|
||||
Click Element xpath=//select[@id="proCreation"]//option[@value="everyone"]
|
||||
Click Element xpath=//config//div/button[1]
|
||||
Sleep 2
|
||||
Close browser
|
@ -0,0 +1,36 @@
|
||||
// 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 ***
|
||||
Resource ../../resources/Util.robot
|
||||
Suite Setup Start Docker Daemon Locally
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Edit Self-Registration
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Disable Self Reg
|
||||
Logout Harbor
|
||||
|
||||
Sign Up Should Not Display
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To Configure
|
||||
Self Reg Should Be Disabled
|
||||
Sleep 1
|
||||
|
||||
#restore setting
|
||||
Enable Self Reg
|
||||
Close Browser
|
@ -0,0 +1,36 @@
|
||||
// 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 ***
|
||||
Resource ../../resources/Util.robot
|
||||
Suite Setup Start Docker Daemon Locally
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Edit Verify Remote Cert
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To System Replication
|
||||
Check Verify Remote Cert
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To System Replication
|
||||
Should Verify Remote Cert Be Enabled
|
||||
|
||||
#restore setting
|
||||
Check Verify Remote Cert
|
||||
Close Browser
|
@ -0,0 +1,34 @@
|
||||
// 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 ***
|
||||
Resource ../../resources/Util.robot
|
||||
Suite setup Start Docker Daemon Locally
|
||||
default tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Edit Email Settings
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To Email
|
||||
Config Email
|
||||
|
||||
Logout Harbor
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
|
||||
Switch To Email
|
||||
Verify Email
|
||||
|
||||
Close Browser
|
@ -0,0 +1,34 @@
|
||||
// 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 ***
|
||||
Resource ../../resources/Util.robot
|
||||
Suite Setup Start Docker Daemon Locally
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Edit Token Expire
|
||||
Init Chrome Driver
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Modify Token Expiration 20
|
||||
Logout Harbor
|
||||
|
||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||
Switch To System Settings
|
||||
Token Must Be Match 20
|
||||
|
||||
#reset to default
|
||||
Modify Token Expiration 30
|
||||
Close Browser
|
@ -0,0 +1,34 @@
|
||||
// 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 Admin Push Signed Image
|
||||
Resource ../../resources/Util.robot
|
||||
Default Tags regression
|
||||
|
||||
*** Test Cases ***
|
||||
Test Case - Admin Push Signed Image
|
||||
Install Harbor With Notary to Test Server
|
||||
|
||||
${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-push-image.sh
|
||||
Log To Console ${output}
|
||||
Should Be Equal As Integers ${rc} 0
|
||||
|
||||
${rc} ${ip}= Run And Return Rc And Output ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'
|
||||
Log ${ip}
|
||||
|
||||
${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
|
@ -0,0 +1,26 @@
|
||||
#Test Case - Notary Inteceptor
|
||||
# ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-pull-image-inteceptor.sh
|
||||
# Log To Console ${output}
|
||||
# Should Be Equal As Integers ${rc} 0
|
||||
#
|
||||
# Down Harbor with_notary=true
|
||||
# ${rc} ${output}= Run And Return Rc And Output echo "PROJECT_CONTENT_TRUST=1\n" >> ./make/common/config/ui/env
|
||||
# Log To Console ${output}
|
||||
# Should Be Equal As Integers ${rc} 0
|
||||
# ${rc} ${output}= Run And Return Rc And Output cat ./make/common/config/ui/env
|
||||
#
|
||||
# Log To Console ${output}
|
||||
# Up Harbor with_notary=true
|
||||
# ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-pull-image-inteceptor.sh
|
||||
# Log To Console ${output}
|
||||
#
|
||||
# Down Harbor with_notary=true
|
||||
# ${rc} ${output}= Run And Return Rc And Output sed "s/^PROJECT_CONTENT_TRUST=1.*/PROJECT_CONTENT_TRUST=0/g" -i ./make/common/config/ui/env
|
||||
# Log To Console ${output}
|
||||
# Should Be Equal As Integers ${rc} 0
|
||||
# ${rc} ${output}= Run And Return Rc And Output cat ./make/common/config/ui/env
|
||||
#
|
||||
# Up Harbor with_notary=true
|
||||
# ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-pull-image-inteceptor.sh
|
||||
# Log To Console ${output}
|
||||
# Should Be Equal As Integers ${rc} 0
|
8
tests/robot-cases/Group9-Content-trust/notary-pull-image-inteceptor.sh
Executable file
8
tests/robot-cases/Group9-Content-trust/notary-pull-image-inteceptor.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
|
||||
export DOCKER_CONTENT_TRUST=1
|
||||
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443
|
||||
|
||||
docker login -u admin -p Harbor12345 $IP
|
||||
docker pull $IP/library/tomcat:latest
|
27
tests/robot-cases/Group9-Content-trust/notary-push-image.py
Executable file
27
tests/robot-cases/Group9-Content-trust/notary-push-image.py
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import pexpect
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import socket
|
||||
|
||||
ip = socket.gethostbyname(socket.gethostname())
|
||||
cmd = "docker push "+ip+"/library/tomcat:latest"
|
||||
passw = "Harbor12345"
|
||||
child = pexpect.spawn(cmd)
|
||||
time.sleep(5)
|
||||
|
||||
child.expect(':')
|
||||
child.sendline(passw)
|
||||
time.sleep(1)
|
||||
child.expect(':')
|
||||
child.sendline(passw)
|
||||
time.sleep(1)
|
||||
child.expect(':')
|
||||
child.sendline(passw)
|
||||
time.sleep(1)
|
||||
child.expect(':')
|
||||
child.sendline(passw)
|
||||
time.sleep(1)
|
||||
child.expect(pexpect.EOF)
|
12
tests/robot-cases/Group9-Content-trust/notary-push-image.sh
Executable file
12
tests/robot-cases/Group9-Content-trust/notary-push-image.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker pull tomcat
|
||||
|
||||
IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
|
||||
export DOCKER_CONTENT_TRUST=1
|
||||
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443
|
||||
|
||||
docker login -u admin -p Harbor12345 $IP
|
||||
|
||||
docker tag tomcat $IP/library/tomcat:latest
|
||||
python ./tests/robot-cases/Group9-Content-trust/notary-push-image.py
|
101
tests/robot-indices/BuiltIn.index
Normal file
101
tests/robot-indices/BuiltIn.index
Normal file
@ -0,0 +1,101 @@
|
||||
Call Method
|
||||
Catenate
|
||||
Comment
|
||||
Continue For Loop
|
||||
Continue For Loop If
|
||||
Convert To Binary
|
||||
Convert To Boolean
|
||||
Convert To Bytes
|
||||
Convert To Hex
|
||||
Convert To Integer
|
||||
Convert To Number
|
||||
Convert To Octal
|
||||
Convert To String
|
||||
Create Dictionary
|
||||
Create List
|
||||
Evaluate
|
||||
Exit For Loop
|
||||
Exit For Loop If
|
||||
Fail
|
||||
Fatal Error
|
||||
Get Count
|
||||
Get Length
|
||||
Get Library Instance
|
||||
Get Time
|
||||
Get Variable Value
|
||||
Get Variables
|
||||
Import Library
|
||||
Import Resource
|
||||
Import Variables
|
||||
Keyword Should Exist
|
||||
Length Should Be
|
||||
Log
|
||||
Log Many
|
||||
Log To Console
|
||||
Log Variables
|
||||
No Operation
|
||||
Pass Execution
|
||||
Pass Execution If
|
||||
Regexp Escape
|
||||
Reload Library
|
||||
Remove Tags
|
||||
Repeat Keyword
|
||||
Replace Variables
|
||||
Return From Keyword
|
||||
Return From Keyword If
|
||||
Run Keyword
|
||||
Run Keyword And Continue On Failure
|
||||
Run Keyword And Expect Error
|
||||
Run Keyword And Ignore Error
|
||||
Run Keyword And Return
|
||||
Run Keyword And Return If
|
||||
Run Keyword And Return Status
|
||||
Run Keyword If
|
||||
Run Keyword If All Critical Tests Passed
|
||||
Run Keyword If All Tests Passed
|
||||
Run Keyword If Any Critical Tests Failed
|
||||
Run Keyword If Any Tests Failed
|
||||
Run Keyword If Test Failed
|
||||
Run Keyword If Test Passed
|
||||
Run Keyword If Timeout Occurred
|
||||
Run Keyword Unless
|
||||
Run Keywords
|
||||
Set Global Variable
|
||||
Set Library Search Order
|
||||
Set Log Level
|
||||
Set Suite Documentation
|
||||
Set Suite Metadata
|
||||
Set Suite Variable
|
||||
Set Tags
|
||||
Set Test Documentation
|
||||
Set Test Message
|
||||
Set Test Variable
|
||||
Set Variable
|
||||
Set Variable If
|
||||
Should Be Empty
|
||||
Should Be Equal
|
||||
Should Be Equal As Integers
|
||||
Should Be Equal As Numbers
|
||||
Should Be Equal As Strings
|
||||
Should Be True
|
||||
Should Contain
|
||||
Should Contain X Times
|
||||
Should End With
|
||||
Should Match
|
||||
Should Match Regexp
|
||||
Should Not Be Empty
|
||||
Should Not Be Equal
|
||||
Should Not Be Equal As Integers
|
||||
Should Not Be Equal As Numbers
|
||||
Should Not Be Equal As Strings
|
||||
Should Not Be True
|
||||
Should Not Contain
|
||||
Should Not End With
|
||||
Should Not Match
|
||||
Should Not Match Regexp
|
||||
Should Not Start With
|
||||
Should Start With
|
||||
Sleep
|
||||
Variable Should Exist
|
||||
Variable Should Not Exist
|
||||
Wait Until Keyword Succeeds
|
43
tests/robot-indices/Collections.index
Normal file
43
tests/robot-indices/Collections.index
Normal file
@ -0,0 +1,43 @@
|
||||
Append To List
|
||||
Combine Lists
|
||||
Convert To Dictionary
|
||||
Convert To List
|
||||
Copy Dictionary
|
||||
Copy List
|
||||
Count Values In List
|
||||
Dictionaries Should Be Equal
|
||||
Dictionary Should Contain Item
|
||||
Dictionary Should Contain Key
|
||||
Dictionary Should Contain Sub Dictionary
|
||||
Dictionary Should Contain Value
|
||||
Dictionary Should Not Contain Key
|
||||
Dictionary Should Not Contain Value
|
||||
Get Dictionary Items
|
||||
Get Dictionary Keys
|
||||
Get Dictionary Values
|
||||
Get From Dictionary
|
||||
Get From List
|
||||
Get Index From List
|
||||
Get Match Count
|
||||
Get Matches
|
||||
Get Slice From List
|
||||
Insert Into List
|
||||
Keep In Dictionary
|
||||
List Should Contain Sub List
|
||||
List Should Contain Value
|
||||
List Should Not Contain Duplicates
|
||||
List Should Not Contain Value
|
||||
Lists Should Be Equal
|
||||
Log Dictionary
|
||||
Log List
|
||||
Pop From Dictionary
|
||||
Remove Duplicates
|
||||
Remove From Dictionary
|
||||
Remove From List
|
||||
Remove Values From List
|
||||
Reverse List
|
||||
Set List Value
|
||||
Set To Dictionary
|
||||
Should Contain Match
|
||||
Should Not Contain Match
|
||||
Sort List
|
8
tests/robot-indices/DateTime.index
Normal file
8
tests/robot-indices/DateTime.index
Normal file
@ -0,0 +1,8 @@
|
||||
Add Time To Date
|
||||
Add Time To Time
|
||||
Convert Date
|
||||
Convert Time
|
||||
Get Current Date
|
||||
Subtract Date From Date
|
||||
Subtract Time From Date
|
||||
Subtract Time From Time
|
56
tests/robot-indices/OperatingSystem.index
Normal file
56
tests/robot-indices/OperatingSystem.index
Normal file
@ -0,0 +1,56 @@
|
||||
Append To Environment Variable
|
||||
Append To File
|
||||
Copy Directory
|
||||
Copy File
|
||||
Copy Files
|
||||
Count Directories In Directory
|
||||
Count Files In Directory
|
||||
Count Items In Directory
|
||||
Create Binary File
|
||||
Create Directory
|
||||
Create File
|
||||
Directory Should Be Empty
|
||||
Directory Should Exist
|
||||
Directory Should Not Be Empty
|
||||
Directory Should Not Exist
|
||||
Empty Directory
|
||||
Environment Variable Should Be Set
|
||||
Environment Variable Should Not Be Set
|
||||
File Should Be Empty
|
||||
File Should Exist
|
||||
File Should Not Be Empty
|
||||
File Should Not Exist
|
||||
Get Binary File
|
||||
Get Environment Variable
|
||||
Get Environment Variables
|
||||
Get File
|
||||
Get File Size
|
||||
Get Modified Time
|
||||
Grep File
|
||||
Join Path
|
||||
Join Paths
|
||||
List Directories In Directory
|
||||
List Directory
|
||||
List Files In Directory
|
||||
Log Environment Variables
|
||||
Log File
|
||||
Move Directory
|
||||
Move File
|
||||
Move Files
|
||||
Normalize Path
|
||||
Remove Directory
|
||||
Remove Environment Variable
|
||||
Remove File
|
||||
Remove Files
|
||||
Run
|
||||
Run And Return Rc
|
||||
Run And Return Rc And Output
|
||||
Set Environment Variable
|
||||
Set Modified Time
|
||||
Should Exist
|
||||
Should Not Exist
|
||||
Split Extension
|
||||
Split Path
|
||||
Touch
|
||||
Wait Until Created
|
||||
Wait Until Removed
|
15
tests/robot-indices/Process.index
Normal file
15
tests/robot-indices/Process.index
Normal file
@ -0,0 +1,15 @@
|
||||
Get Process Id
|
||||
Get Process Object
|
||||
Get Process Result
|
||||
Is Process Running
|
||||
Join Command Line
|
||||
Process Should Be Running
|
||||
Process Should Be Stopped
|
||||
Run Process
|
||||
Send Signal To Process
|
||||
Split Command Line
|
||||
Start Process
|
||||
Switch Process
|
||||
Terminate All Processes
|
||||
Terminate Process
|
||||
Wait For Process
|
32
tests/robot-indices/SSHLibrary.index
Normal file
32
tests/robot-indices/SSHLibrary.index
Normal file
@ -0,0 +1,32 @@
|
||||
Close All Connections
|
||||
Close Connection
|
||||
Directory Should Exist
|
||||
Directory Should Not Exist
|
||||
Enable Ssh Logging
|
||||
Execute Command
|
||||
File Should Exist
|
||||
File Should Not Exist
|
||||
Get Connection
|
||||
Get Connections
|
||||
Get Directory
|
||||
Get File
|
||||
List Directories In Directory
|
||||
List Directory
|
||||
List Files In Directory
|
||||
Login
|
||||
Login With Public Key
|
||||
Open Connection
|
||||
Put Directory
|
||||
Put File
|
||||
Read
|
||||
Read Command Output
|
||||
Read Until
|
||||
Read Until Prompt
|
||||
Read Until Regexp
|
||||
Set Client Configuration
|
||||
Set Default Configuration
|
||||
Start Command
|
||||
Switch Connection
|
||||
Write
|
||||
Write Bare
|
||||
Write Until Expected Output
|
164
tests/robot-indices/Selenium2Library.index
Normal file
164
tests/robot-indices/Selenium2Library.index
Normal file
@ -0,0 +1,164 @@
|
||||
Add Cookie
|
||||
Add Location Strategy
|
||||
Alert Should Be Present
|
||||
Assign Id To Element
|
||||
Capture Page Screenshot
|
||||
Checkbox Should Be Selected
|
||||
Checkbox Should Not Be Selected
|
||||
Choose Cancel On Next Confirmation
|
||||
Choose File
|
||||
Choose Ok On Next Confirmation
|
||||
Clear Element Text
|
||||
Click Button
|
||||
Click Element
|
||||
Click Element At Coordinates
|
||||
Click Image
|
||||
Click Link
|
||||
Close All Browsers
|
||||
Close Browser
|
||||
Close Window
|
||||
Confirm Action
|
||||
Create Webdriver
|
||||
Current Frame Contains
|
||||
Current Frame Should Not Contain
|
||||
Delete All Cookies
|
||||
Delete Cookie
|
||||
Dismiss Alert
|
||||
Double Click Element
|
||||
Drag And Drop
|
||||
Drag And Drop By Offset
|
||||
Element Should Be Disabled
|
||||
Element Should Be Enabled
|
||||
Element Should Be Visible
|
||||
Element Should Contain
|
||||
Element Should Not Be Visible
|
||||
Element Should Not Contain
|
||||
Element Text Should Be
|
||||
Execute Async Javascript
|
||||
Execute Javascript
|
||||
Focus
|
||||
Frame Should Contain
|
||||
Get Alert Message
|
||||
Get All Links
|
||||
Get Cookie Value
|
||||
Get Cookies
|
||||
Get Element Attribute
|
||||
Get Element Size
|
||||
Get Horizontal Position
|
||||
Get List Items
|
||||
Get Location
|
||||
Get Matching Xpath Count
|
||||
Get Selected List Label
|
||||
Get Selected List Labels
|
||||
Get Selected List Value
|
||||
Get Selected List Values
|
||||
Get Selenium Implicit Wait
|
||||
Get Selenium Speed
|
||||
Get Selenium Timeout
|
||||
Get Source
|
||||
Get Table Cell
|
||||
Get Text
|
||||
Get Title
|
||||
Get Value
|
||||
Get Vertical Position
|
||||
Get Webelement
|
||||
Get Webelements
|
||||
Get Window Identifiers
|
||||
Get Window Names
|
||||
Get Window Position
|
||||
Get Window Size
|
||||
Get Window Titles
|
||||
Go Back
|
||||
Go To
|
||||
Input Password
|
||||
Input Text
|
||||
Input Text Into Prompt
|
||||
List Selection Should Be
|
||||
List Should Have No Selections
|
||||
List Windows
|
||||
Location Should Be
|
||||
Location Should Contain
|
||||
Locator Should Match X Times
|
||||
Log Location
|
||||
Log Source
|
||||
Log Title
|
||||
Maximize Browser Window
|
||||
Mouse Down
|
||||
Mouse Down On Image
|
||||
Mouse Down On Link
|
||||
Mouse Out
|
||||
Mouse Over
|
||||
Mouse Up
|
||||
Open Browser
|
||||
Open Context Menu
|
||||
Page Should Contain
|
||||
Page Should Contain Button
|
||||
Page Should Contain Checkbox
|
||||
Page Should Contain Element
|
||||
Page Should Contain Image
|
||||
Page Should Contain Link
|
||||
Page Should Contain List
|
||||
Page Should Contain Radio Button
|
||||
Page Should Contain Textfield
|
||||
Page Should Not Contain
|
||||
Page Should Not Contain Button
|
||||
Page Should Not Contain Checkbox
|
||||
Page Should Not Contain Element
|
||||
Page Should Not Contain Image
|
||||
Page Should Not Contain Link
|
||||
Page Should Not Contain List
|
||||
Page Should Not Contain Radio Button
|
||||
Page Should Not Contain Textfield
|
||||
Press Key
|
||||
Radio Button Should Be Set To
|
||||
Radio Button Should Not Be Selected
|
||||
Register Keyword To Run On Failure
|
||||
Reload Page
|
||||
Remove Location Strategy
|
||||
Select All From List
|
||||
Select Checkbox
|
||||
Select Frame
|
||||
Select From List
|
||||
Select From List By Index
|
||||
Select From List By Label
|
||||
Select From List By Value
|
||||
Select Radio Button
|
||||
Select Window
|
||||
Set Browser Implicit Wait
|
||||
Set Screenshot Directory
|
||||
Set Selenium Implicit Wait
|
||||
Set Selenium Speed
|
||||
Set Selenium Timeout
|
||||
Set Window Position
|
||||
Set Window Size
|
||||
Simulate
|
||||
Submit Form
|
||||
Switch Browser
|
||||
Table Cell Should Contain
|
||||
Table Column Should Contain
|
||||
Table Footer Should Contain
|
||||
Table Header Should Contain
|
||||
Table Row Should Contain
|
||||
Table Should Contain
|
||||
Textarea Should Contain
|
||||
Textarea Value Should Be
|
||||
Textfield Should Contain
|
||||
Textfield Value Should Be
|
||||
Title Should Be
|
||||
Unselect Checkbox
|
||||
Unselect Frame
|
||||
Unselect From List
|
||||
Unselect From List By Index
|
||||
Unselect From List By Label
|
||||
Unselect From List By Value
|
||||
Wait For Condition
|
||||
Wait Until Element Contains
|
||||
Wait Until Element Does Not Contain
|
||||
Wait Until Element Is Enabled
|
||||
Wait Until Element Is Not Visible
|
||||
Wait Until Element Is Visible
|
||||
Wait Until Page Contains
|
||||
Wait Until Page Contains Element
|
||||
Wait Until Page Does Not Contain
|
||||
Wait Until Page Does Not Contain Element
|
||||
Xpath Should Match X Times
|
30
tests/robot-indices/String.index
Normal file
30
tests/robot-indices/String.index
Normal file
@ -0,0 +1,30 @@
|
||||
Convert To Lowercase
|
||||
Convert To Uppercase
|
||||
Decode Bytes To String
|
||||
Encode String To Bytes
|
||||
Fetch From Left
|
||||
Fetch From Right
|
||||
Generate Random String
|
||||
Get Line
|
||||
Get Line Count
|
||||
Get Lines Containing String
|
||||
Get Lines Matching Pattern
|
||||
Get Lines Matching Regexp
|
||||
Get Regexp Matches
|
||||
Get Substring
|
||||
Remove String
|
||||
Remove String Using Regexp
|
||||
Replace String
|
||||
Replace String Using Regexp
|
||||
Should Be Byte String
|
||||
Should Be Lowercase
|
||||
Should Be String
|
||||
Should Be Titlecase
|
||||
Should Be Unicode String
|
||||
Should Be Uppercase
|
||||
Should Not Be String
|
||||
Split String
|
||||
Split String From Right
|
||||
Split String To Characters
|
||||
Split To Lines
|
||||
Strip String
|
Loading…
Reference in New Issue
Block a user