diff --git a/tests/e2e-image/Dockerfile b/tests/e2e-image/Dockerfile index 150941f95..820696b28 100644 --- a/tests/e2e-image/Dockerfile +++ b/tests/e2e-image/Dockerfile @@ -1,140 +1,140 @@ -FROM golang:1.11.2 - -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - -RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' - -#RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt install ./google-chrome-stable_current_amd64.deb - -RUN apt-get update && apt-get install -y --no-install-recommends \ - jq \ - bc \ - time \ - gcc \ - python-dev \ - libffi-dev \ - libssl-dev \ - sshpass \ - ant \ - ant-optional \ - xvfb \ - libxi6 \ - libgconf-2-4 \ - openjdk-8-jdk \ - rpcbind \ - nfs-common \ - unzip \ - zip \ - bzip2 \ - parted \ - # Add docker in docker support - btrfs-tools \ - e2fsprogs \ - iptables \ - xfsprogs \ - dnsutils \ - netcat \ - # Add headless chrome support - google-chrome-stable \ - # Speed up ISO builds with already installed reqs - yum \ - yum-utils \ - cpio \ - rpm \ - ca-certificates \ - xz-utils \ - xorriso \ - sendmail && \ - # Cleanup - apt-get autoremove -y && \ - rm -rf /var/lib/apt/lists/* - -RUN wget -N http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip && \ - unzip chromedriver_linux64.zip && \ - chmod +x chromedriver && \ - mv -f chromedriver /usr/local/share/chromedriver && \ - ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver && \ - ln -s /usr/local/share/chromedriver /usr/bin/chromedriver - -RUN apt-get update && apt install libnss3-tools && \ - mkdir -p $HOME/.pki/nssdb && \ - echo Harbor12345 > password.ca && \ - certutil -d sql:$HOME/.pki/nssdb -N -f password.ca - -RUN wget https://bootstrap.pypa.io/get-pip.py && \ - python ./get-pip.py && \ - pip install pyasn1 google-apitools==0.5.15 gsutil robotframework==3.0.4 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-selenium2library robotframework-pabot robotframework-JSONLibrary --upgrade - -# Install docker, docker compose -RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz && \ - tar --strip-components=1 -xvzf docker-18.06.3-ce.tgz -C /usr/bin && \ - curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \ - chmod +x /usr/local/bin/docker-compose - -RUN wget https://github.com/drone/drone-cli/releases/download/v0.8.3/drone_linux_amd64.tar.gz && tar zxf drone_linux_amd64.tar.gz && \ - install -t /usr/local/bin drone - -RUN curl -sSL https://github.com/vmware/govmomi/releases/download/v0.16.0/govc_linux_amd64.gz | gzip -d > /usr/local/bin/govc && \ - chmod +x /usr/local/bin/govc - -RUN wget https://get.helm.sh/helm-v2.14.1-linux-386.tar.gz && tar zxvf helm-v2.14.1-linux-386.tar.gz && \ - mv linux-386/helm /usr/local/bin/helm && \ - helm init --client-only && \ - helm plugin install https://github.com/chartmuseum/helm-push - -RUN wget https://get.helm.sh/helm-v3.0.0-linux-386.tar.gz && tar zxvf helm-v3.0.0-linux-386.tar.gz && \ - mv linux-386/helm /usr/local/bin/helm3 && \ - helm3 plugin install https://github.com/chartmuseum/helm-push - -RUN wget https://github.com/theupdateframework/notary/releases/download/v0.6.1/notary-Linux-amd64 && \ - chmod +x notary-Linux-amd64 && \ - mv notary-Linux-amd64 /usr/local/bin/notary - -RUN wget http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.11-src.tar.gz && \ - tar xfvz tcl8.4.11-src.tar.gz && \ - cd tcl8.4.11/unix && \ - sed -i "s/relid'/relid/" configure && \ - ./configure --prefix=/ixdba.net && \ - make && \ - make install && \ - cp -r * ../tools && \ - cd .. && \ - cp -r tools / && \ - cd / && \ - wget http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz && \ - tar xzvf expect5.45.tar.gz && \ - cd expect5.45 && \ - ./configure --prefix=/tools --with-tcl=/tools --with-x=no && \ - make && \ - make install && \ - cd /ixdba.net/bin && \ - mv expect /usr/local/bin/expect - -RUN CNAB_PATH=$(go env GOPATH)/src/github.com/docker && mkdir -p $CNAB_PATH && cd $CNAB_PATH && git clone https://github.com/cnabio/cnab-to-oci.git && \ - cd cnab-to-oci && git checkout v0.3.0-beta4 && \ - go list && \ - make build && \ - mv bin/cnab-to-oci /usr/local/bin - -# Add docker in docker support -# version: docker:1.13-dind -# reference: https://github.com/docker-library/docker/blob/b202ec7e529f5426e2ad7e8c0a8b82cacd406573/1.13/dind/Dockerfile -# -# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies - -# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box -RUN set -x \ - && groupadd --system dockremap \ - && adduser --system --ingroup dockremap dockremap \ - && echo 'dockremap:165536:65536' >> /etc/subuid \ - && echo 'dockremap:165536:65536' >> /etc/subgid - -ENV DIND_COMMIT 3b5fac462d21ca164b3778647420016315289034 - -RUN wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ - && chmod +x /usr/local/bin/dind - -# This container needs to be run in privileged mode(run with --privileged option) to make it work -COPY dockerd-entrypoint.sh /usr/local/bin/dockerd-entrypoint.sh -RUN chmod +x /usr/local/bin/dockerd-entrypoint.sh - -VOLUME /var/lib/docker +FROM golang:1.11.2 + +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - +RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' + +#RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt install ./google-chrome-stable_current_amd64.deb + +RUN apt-get update && apt-get install -y --no-install-recommends \ + jq \ + bc \ + time \ + gcc \ + python-dev \ + libffi-dev \ + libssl-dev \ + sshpass \ + ant \ + ant-optional \ + xvfb \ + libxi6 \ + libgconf-2-4 \ + openjdk-8-jdk \ + rpcbind \ + nfs-common \ + unzip \ + zip \ + bzip2 \ + parted \ + # Add docker in docker support + btrfs-tools \ + e2fsprogs \ + iptables \ + xfsprogs \ + dnsutils \ + netcat \ + # Add headless chrome support + google-chrome-stable \ + # Speed up ISO builds with already installed reqs + yum \ + yum-utils \ + cpio \ + rpm \ + ca-certificates \ + xz-utils \ + xorriso \ + sendmail && \ + # Cleanup + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* + +RUN wget -N http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip && \ + unzip chromedriver_linux64.zip && \ + chmod +x chromedriver && \ + mv -f chromedriver /usr/local/share/chromedriver && \ + ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver && \ + ln -s /usr/local/share/chromedriver /usr/bin/chromedriver + +RUN apt-get update && apt install libnss3-tools && \ + mkdir -p $HOME/.pki/nssdb && \ + echo Harbor12345 > password.ca && \ + certutil -d sql:$HOME/.pki/nssdb -N -f password.ca + +RUN wget https://bootstrap.pypa.io/get-pip.py && \ + python ./get-pip.py && \ + pip install pyasn1 google-apitools==0.5.15 gsutil robotframework==3.0.4 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-selenium2library==4.4.0 robotframework-pabot robotframework-JSONLibrary --upgrade + +# Install docker, docker compose +RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz && \ + tar --strip-components=1 -xvzf docker-18.06.3-ce.tgz -C /usr/bin && \ + curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \ + chmod +x /usr/local/bin/docker-compose + +RUN wget https://github.com/drone/drone-cli/releases/download/v0.8.3/drone_linux_amd64.tar.gz && tar zxf drone_linux_amd64.tar.gz && \ + install -t /usr/local/bin drone + +RUN curl -sSL https://github.com/vmware/govmomi/releases/download/v0.16.0/govc_linux_amd64.gz | gzip -d > /usr/local/bin/govc && \ + chmod +x /usr/local/bin/govc + +RUN wget https://get.helm.sh/helm-v2.14.1-linux-386.tar.gz && tar zxvf helm-v2.14.1-linux-386.tar.gz && \ + mv linux-386/helm /usr/local/bin/helm && \ + helm init --client-only && \ + helm plugin install https://github.com/chartmuseum/helm-push + +RUN wget https://get.helm.sh/helm-v3.0.0-linux-386.tar.gz && tar zxvf helm-v3.0.0-linux-386.tar.gz && \ + mv linux-386/helm /usr/local/bin/helm3 && \ + helm3 plugin install https://github.com/chartmuseum/helm-push + +RUN wget https://github.com/theupdateframework/notary/releases/download/v0.6.1/notary-Linux-amd64 && \ + chmod +x notary-Linux-amd64 && \ + mv notary-Linux-amd64 /usr/local/bin/notary + +RUN wget http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.11-src.tar.gz && \ + tar xfvz tcl8.4.11-src.tar.gz && \ + cd tcl8.4.11/unix && \ + sed -i "s/relid'/relid/" configure && \ + ./configure --prefix=/ixdba.net && \ + make && \ + make install && \ + cp -r * ../tools && \ + cd .. && \ + cp -r tools / && \ + cd / && \ + wget http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz && \ + tar xzvf expect5.45.tar.gz && \ + cd expect5.45 && \ + ./configure --prefix=/tools --with-tcl=/tools --with-x=no && \ + make && \ + make install && \ + cd /ixdba.net/bin && \ + mv expect /usr/local/bin/expect + +RUN CNAB_PATH=$(go env GOPATH)/src/github.com/docker && mkdir -p $CNAB_PATH && cd $CNAB_PATH && git clone https://github.com/cnabio/cnab-to-oci.git && \ + cd cnab-to-oci && git checkout v0.3.0-beta4 && \ + go list && \ + make build && \ + mv bin/cnab-to-oci /usr/local/bin + +# Add docker in docker support +# version: docker:1.13-dind +# reference: https://github.com/docker-library/docker/blob/b202ec7e529f5426e2ad7e8c0a8b82cacd406573/1.13/dind/Dockerfile +# +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies + +# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box +RUN set -x \ + && groupadd --system dockremap \ + && adduser --system --ingroup dockremap dockremap \ + && echo 'dockremap:165536:65536' >> /etc/subuid \ + && echo 'dockremap:165536:65536' >> /etc/subgid + +ENV DIND_COMMIT 3b5fac462d21ca164b3778647420016315289034 + +RUN wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ + && chmod +x /usr/local/bin/dind + +# This container needs to be run in privileged mode(run with --privileged option) to make it work +COPY dockerd-entrypoint.sh /usr/local/bin/dockerd-entrypoint.sh +RUN chmod +x /usr/local/bin/dockerd-entrypoint.sh + +VOLUME /var/lib/docker diff --git a/tests/resources/Harbor-Pages/Replication.robot b/tests/resources/Harbor-Pages/Replication.robot index 1a88a8e36..5e8e49aef 100644 --- a/tests/resources/Harbor-Pages/Replication.robot +++ b/tests/resources/Harbor-Pages/Replication.robot @@ -27,6 +27,14 @@ Filter Replication Rule Retry Wait Until Page Contains Element ${rule_name_element} Capture Page Screenshot filter_replic_${ruleName}.png +Filter Registry + [Arguments] ${registry_name} + ${registry_name_element}= Set Variable xpath=//clr-dg-cell[contains(.,'${registry_name}')] + Retry Element Click ${filter_registry_btn} + Retry Text Input ${filter_registry_input} ${ruleName} + Retry Wait Until Page Contains Element ${registry_name_element} + Capture Page Screenshot filter_repistry_${ruleName}.png + Select Dest Registry [Arguments] ${endpoint} Retry Element Click ${dest_registry_dropdown_list} @@ -68,7 +76,7 @@ Create A New Endpoint #cancel verify cert since we use a selfsigned cert Retry Element Click ${destination_insecure_xpath} Run Keyword If '${save}' == 'Y' Run keyword Retry Double Keywords When Error Retry Element Click ${replication_save_xpath} Retry Wait Until Page Not Contains Element ${replication_save_xpath} - Run Keyword If '${save}' == 'Y' Run keyword Retry Wait Until Page Contains ${name} + Run Keyword If '${save}' == 'Y' Run keyword Filter Registry ${name} Run Keyword If '${save}' == 'N' No Operation Create A Rule With Existing Endpoint @@ -155,12 +163,6 @@ Delete Rule Mouse Up ${dialog_delete} Sleep 2 -Filter Rule - [Arguments] ${rule} - Retry Element Click ${rule_filter_search} - Retry Text Input ${rule_filter_input} ${rule} - Sleep 1 - Select Rule [Arguments] ${rule} Retry Element Click //clr-dg-row[contains(.,'${rule}')]//label @@ -246,8 +248,8 @@ Delete Replication Rule Retry Element Click ${dialog_delete} Image Should Be Replicated To Project - [Arguments] ${project} ${image} ${period}=60 ${times}=10 - :For ${n} IN RANGE 1 ${times} + [Arguments] ${project} ${image} ${period}=60 ${times}=3 + :For ${n} IN RANGE 0 ${times} \ Sleep ${period} \ Go Into Project ${project} \ Switch To Project Repo diff --git a/tests/resources/Harbor-Pages/Replication_Elements.robot b/tests/resources/Harbor-Pages/Replication_Elements.robot index 9a72eeb75..97f9d36bb 100644 --- a/tests/resources/Harbor-Pages/Replication_Elements.robot +++ b/tests/resources/Harbor-Pages/Replication_Elements.robot @@ -1,91 +1,93 @@ -# Copyright Project Harbor Authors -# -# 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} //hbr-list-replication-rule//button[contains(.,'New')] -${policy_name_xpath} //*[@id='policy_name'] -${policy_description_xpath} //*[@id='policy_description'] -${policy_enable_checkbox} //input[@id='policy_enable']/../label -${policy_endpoint_checkbox} //input[@id='check_new']/../label -${destination_name_xpath} //*[@id='destination_name'] -${destination_url_xpath} //*[@id='destination_url'] -${destination_username_xpath} //*[@id='destination_access_key'] -${destination_password_xpath} //*[@id='destination_password'] -${replication_save_xpath} //button[contains(.,'OK')] -${replication_xpath} //clr-vertical-nav-group-children/a[contains(.,'Replication')] -${destination_insecure_xpath} //label[@id='destination_insecure_checkbox'] - -${new_replication-rule_button} //button[contains(.,'New Replication Rule')] -${link_to_registries} //clr-modal//span[contains(.,'Endpoint')] -${new_endpoint_button} //hbr-endpoint//button[contains(.,'New Endpoint')] -${rule_name} //input[@id='ruleName'] -${source_image_filter_add} //hbr-create-edit-rule/clr-modal//clr-icon[@id='add-label-list'] -${source_iamge_repo_filter} //hbr-create-edit-rule//section/div[4]/div/div[1]/div/label/input -${source_image_tag_filter} //hbr-create-edit-rule//section/div[4]/div/div[2]/div/label/input -${rule_target_select} //select[@id='ruleTarget'] -${rule_trigger_select} //select[@id='ruleTrigger'] -${schedule_type_select} //select[@name='scheduleType'] -${schedule_day_select} //select[@name='scheduleDay'] -${shcedule_time} //input[@type='time'] -${destination_insecure_checkbox} //hbr-create-edit-endpoint/clr-modal//input[@id='destination_insecure'] -${ping_test_button} //button[contains(.,'Test')] -${nav_to_registries} //clr-vertical-nav//span[contains(.,'Registries')] -${nav_to_replications} //clr-vertical-nav//span[contains(.,'Replications')] -${rule_filter_search} //hbr-replication/div/div[1]//hbr-filter/span/clr-icon -${rule_filter_input} //hbr-replication/div/div[1]//hbr-filter/span//input -${job_filter_search} //hbr-replication/div/div[3]//hbr-filter/span/clr-icon -${job_filter_input} //hbr-replication/div/div[3]//hbr-filter/span//input -${endpoint_filter_search} //hbr-filter/span/clr-icon -${endpoint_filter_input} //hbr-filter/span//input -${action_bar_edit} //button[contains(.,'Edit')] -${action_bar_delete} //button[contains(.,'Delete')] -${stop_jobs_button} //button[contains(.,'Stop Jobs')] -${dialog_close} //clr-modal//button[contains(.,'CLOSE')] -${dialog_delete} //clr-modal//button[contains(.,'DELETE')] -${dialog_replicate} //clr-modal//button[contains(.,'REPLICATE')] -${action_bar_replicate} //button[contains(.,'Replicate')] -${rule_save_button} //button[contains(.,'SAVE')] -${provider_selector} //*[@id='adapter'] -${replication_mode_radio_push} //clr-main-container//hbr-create-edit-rule//label[contains(.,'Push-based')] -${replication_mode_radio_pull} //clr-main-container//hbr-create-edit-rule//label[contains(.,'Pull-based')] -${filter_name_id} //input[@id='filter_name'] -${filter_tag_id} //input[@id='filter_tag'] -${rule_resource_selector} //*[@id='select_resource'] -${trigger_mode_selector} //*[@id='ruleTrigger'] -${dest_namespace_xpath} //*[@id='dest_namespace'] -${new_replication_rule_id} //*[@id='new_replication_rule_id'] -${edit_replication_rule_id} //*[@id='edit_replication_rule_id'] -${delete_replication_rule_id} //*[@id='delete_replication_rule_id'] -${replication_exec_id} //*[@id='replication_exe_id'] -${replication_task_line_1} //clr-datagrid//clr-dg-row/div/div[2]//clr-checkbox-wrapper/label[1] -${is_overide_xpath} //label[contains(.,'Replace the destination resources if name exists')] -${enable_rule_xpath} //label[contains(.,'Enable rule')] -${targetCron_id} //*[@id='targetCron'] -${rule_name_input} //*[@id='ruleName'] -${src_registry_dropdown_list} //select[@id='src_registry_id'] -${dest_registry_dropdown_list} //select[@id='dest_registry'] -${rule_confirm_btn} //*[@id='ruleBtnOk'] -${rule_cancel_btn} //*[@id='ruleBtnCancel'] -${filter_rules_btn} //*[@id='filter-rules'] -${filter_rules_input} //*[@id='filter-rules']//input -${del_remote_checkbox} //label[@for='ruleDeletion'] - - - - - - +# Copyright Project Harbor Authors +# +# 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} //hbr-list-replication-rule//button[contains(.,'New')] +${policy_name_xpath} //*[@id='policy_name'] +${policy_description_xpath} //*[@id='policy_description'] +${policy_enable_checkbox} //input[@id='policy_enable']/../label +${policy_endpoint_checkbox} //input[@id='check_new']/../label +${destination_name_xpath} //*[@id='destination_name'] +${destination_url_xpath} //*[@id='destination_url'] +${destination_username_xpath} //*[@id='destination_access_key'] +${destination_password_xpath} //*[@id='destination_password'] +${replication_save_xpath} //button[contains(.,'OK')] +${replication_xpath} //clr-vertical-nav-group-children/a[contains(.,'Replication')] +${destination_insecure_xpath} //label[@id='destination_insecure_checkbox'] + +${new_replication-rule_button} //button[contains(.,'New Replication Rule')] +${link_to_registries} //clr-modal//span[contains(.,'Endpoint')] +${new_endpoint_button} //hbr-endpoint//button[contains(.,'New Endpoint')] +${rule_name} //input[@id='ruleName'] +${source_image_filter_add} //hbr-create-edit-rule/clr-modal//clr-icon[@id='add-label-list'] +${source_iamge_repo_filter} //hbr-create-edit-rule//section/div[4]/div/div[1]/div/label/input +${source_image_tag_filter} //hbr-create-edit-rule//section/div[4]/div/div[2]/div/label/input +${rule_target_select} //select[@id='ruleTarget'] +${rule_trigger_select} //select[@id='ruleTrigger'] +${schedule_type_select} //select[@name='scheduleType'] +${schedule_day_select} //select[@name='scheduleDay'] +${shcedule_time} //input[@type='time'] +${destination_insecure_checkbox} //hbr-create-edit-endpoint/clr-modal//input[@id='destination_insecure'] +${ping_test_button} //button[contains(.,'Test')] +${nav_to_registries} //clr-vertical-nav//span[contains(.,'Registries')] +${nav_to_replications} //clr-vertical-nav//span[contains(.,'Replications')] +${rule_filter_search} //hbr-replication/div/div[1]//hbr-filter/span/clr-icon +${rule_filter_input} //hbr-replication/div/div[1]//hbr-filter/span//input +${job_filter_search} //hbr-replication/div/div[3]//hbr-filter/span/clr-icon +${job_filter_input} //hbr-replication/div/div[3]//hbr-filter/span//input +${endpoint_filter_search} //hbr-filter/span/clr-icon +${endpoint_filter_input} //hbr-filter/span//input +${action_bar_edit} //button[contains(.,'Edit')] +${action_bar_delete} //button[contains(.,'Delete')] +${stop_jobs_button} //button[contains(.,'Stop Jobs')] +${dialog_close} //clr-modal//button[contains(.,'CLOSE')] +${dialog_delete} //clr-modal//button[contains(.,'DELETE')] +${dialog_replicate} //clr-modal//button[contains(.,'REPLICATE')] +${action_bar_replicate} //button[contains(.,'Replicate')] +${rule_save_button} //button[contains(.,'SAVE')] +${provider_selector} //*[@id='adapter'] +${replication_mode_radio_push} //clr-main-container//hbr-create-edit-rule//label[contains(.,'Push-based')] +${replication_mode_radio_pull} //clr-main-container//hbr-create-edit-rule//label[contains(.,'Pull-based')] +${filter_name_id} //input[@id='filter_name'] +${filter_tag_id} //input[@id='filter_tag'] +${rule_resource_selector} //*[@id='select_resource'] +${trigger_mode_selector} //*[@id='ruleTrigger'] +${dest_namespace_xpath} //*[@id='dest_namespace'] +${new_replication_rule_id} //*[@id='new_replication_rule_id'] +${edit_replication_rule_id} //*[@id='edit_replication_rule_id'] +${delete_replication_rule_id} //*[@id='delete_replication_rule_id'] +${replication_exec_id} //*[@id='replication_exe_id'] +${replication_task_line_1} //clr-datagrid//clr-dg-row/div/div[2]//clr-checkbox-wrapper/label[1] +${is_overide_xpath} //label[contains(.,'Replace the destination resources if name exists')] +${enable_rule_xpath} //label[contains(.,'Enable rule')] +${targetCron_id} //*[@id='targetCron'] +${rule_name_input} //*[@id='ruleName'] +${src_registry_dropdown_list} //select[@id='src_registry_id'] +${dest_registry_dropdown_list} //select[@id='dest_registry'] +${rule_confirm_btn} //*[@id='ruleBtnOk'] +${rule_cancel_btn} //*[@id='ruleBtnCancel'] +${filter_rules_btn} //*[@id='filter-rules'] +${filter_rules_input} //*[@id='filter-rules']//input +${del_remote_checkbox} //label[@for='ruleDeletion'] +${filter_registry_btn} //hbr-filter +${filter_registry_input} //input[contains(@class,'filter-input')] + + + + + + diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index cccf21fea..5c3a66783 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -186,7 +186,7 @@ Manage Project Member Without Sign In Harbor [Arguments] ${sign_in_user} ${sign_in_pwd} ${test_user1}=user005 ${test_user2}=user006 ${is_oidc_mode}=${false} ${d}= Get current Date result_format=%m%s Create An New Project And Go Into Project project${d} - Push image ip=${ip} user=${sign_in_user} pwd=${sign_in_pwd} project=project${d} image=hello-world + Push image ${ip} ${sign_in_user} ${sign_in_pwd} project${d} hello-world Logout Harbor User Should Not Be A Member Of Project ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} @@ -200,7 +200,7 @@ Manage Project Member Without Sign In Harbor User Should Be Maintainer ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} Manage Project Member ${sign_in_user} ${sign_in_pwd} project${d} ${test_user1} Remove is_oidc_mode=${is_oidc_mode} User Should Not Be A Member Of Project ${test_user1} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} - Push image ip=${ip} user=${sign_in_user} pwd=${sign_in_pwd} project=project${d} image=hello-world + Push image ${ip} ${sign_in_user} ${sign_in_pwd} project${d} hello-world User Should Be Guest ${test_user2} ${sign_in_pwd} project${d} is_oidc_mode=${is_oidc_mode} Helm CLI Push Without Sign In Harbor @@ -315,3 +315,31 @@ Body Of Verfiy Project Level CVE Allowlist By Quick Way of Add System Add System CVE Allowlist to Project CVE Allowlist By Add System Button Click Pull Image ${ip} ${signin_user} ${signin_pwd} project${d} ${image} tag=${sha256} Close Browser + +Body Of Replication Of Push Images to Registry Triggered By Event + [Arguments] ${provider} ${endpoint} ${username} ${pwd} ${dest_namespace} + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + ${sha256}= Set Variable 0e67625224c1da47cb3270e7a861a83e332f708d3d89dde0cbed432c94824d9a + ${image}= Set Variable test_push_repli + ${tag1}= Set Variable v1.1.0 + @{tags} Create List ${tag1} + #login source + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + Create An New Project And Go Into Project project${d} + Switch To Registries + Create A New Endpoint ${provider} e${d} ${endpoint} ${username} ${pwd} Y + Switch To Replication Manage + Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} ${dest_namespace} mode=Event Based del_remote=${true} + Push Special Image To Project project${d} ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${image} tags=@{tags} size=12 + Filter Replication Rule rule${d} + Select Rule rule${d} + Run Keyword If '${provider}'=='docker-hub' Docker Image Can Be Pulled ${dest_namespace}/${image}:${tag1} times=3 + Executions Result Count Should Be Succeeded event_based 1 + Go Into Project project${d} + Delete Repo project${d} + Run Keyword If '${provider}'=='docker-hub' Docker Image Can Not Be Pulled ${dest_namespace}/${image}:${tag1} + Switch To Replication Manage + Filter Replication Rule rule${d} + Select Rule rule${d} + Executions Result Count Should Be Succeeded event_based 2 \ No newline at end of file diff --git a/tests/robot-cases/Group1-Nightly/OIDC.robot b/tests/robot-cases/Group1-Nightly/OIDC.robot index 0a64c6eb7..be4ae7e93 100644 --- a/tests/robot-cases/Group1-Nightly/OIDC.robot +++ b/tests/robot-cases/Group1-Nightly/OIDC.robot @@ -71,7 +71,7 @@ Test Case - Generate User CLI Secret Sign In Harbor With OIDC User ${HARBOR_URL} Create An New Project And Go Into Project project${d} ${secret_old}= Get Secrete By API ${HARBOR_URL} - Push image ip=${ip} user=${OIDC_USERNAME} pwd=${secret_old} project=project${d} image=${image} + Push image ${ip} ${OIDC_USERNAME} ${secret_old} project${d} ${image} ${secret_new}= Generate And Return Secret ${HARBOR_URL} Log To Console ${secret_old} Log To Console ${secret_new} diff --git a/tests/robot-cases/Group1-Nightly/Replication.robot b/tests/robot-cases/Group1-Nightly/Replication.robot index ca64ec4d3..51b297f0d 100644 --- a/tests/robot-cases/Group1-Nightly/Replication.robot +++ b/tests/robot-cases/Group1-Nightly/Replication.robot @@ -275,28 +275,11 @@ Test Case - Replication Of Pull Images from Google-GCR To Self Close Browser Test Case - Replication Of Push Images to DockerHub Triggered By Event - Init Chrome Driver - ${d}= Get Current Date result_format=%m%s - ${sha256}= Set Variable 0e67625224c1da47cb3270e7a861a83e332f708d3d89dde0cbed432c94824d9a - ${image}= Set Variable test_push_repli - ${tag1}= Set Variable v1.1.0 - @{tags} Create List ${tag1} - #login source - Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} - Create An New Project And Go Into Project project${d} - Switch To Registries - Create A New Endpoint docker-hub e${d} https://hub.docker.com/ danfengliu Aa123456 Y - Switch To Replication Manage - Create A Rule With Existing Endpoint rule${d} push project${d}/* image e${d} danfengliu mode=Event Based del_remote=${true} - Push Special Image To Project project${d} ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${image} tags=@{tags} size=12 - Filter Replication Rule rule${d} - Select Rule rule${d} - Docker Image Can Be Pulled danfengliu/${image}:${tag1} times=3 - Executions Result Count Should Be Succeeded event_based 1 - Go Into Project project${d} - Delete Repo project${d} - Docker Image Can Not Be Pulled danfengliu/${image}:${tag1} - Switch To Replication Manage - Filter Replication Rule rule${d} - Select Rule rule${d} - Executions Result Count Should Be Succeeded event_based 2 \ No newline at end of file + Body Of Replication Of Push Images to Registry Triggered By Event docker-hub https://hub.docker.com/ danfengliu Aa123456 danfengliu + +#Due to issue of delete event replication +#Test Case - Replication Of Push Images to Google-GCR Triggered By Event + #Body Of Replication Of Push Images to Registry Triggered By Event google-gcr gcr.io ${null} ${gcr_ac_key} eminent-nation-87317/harbor-nightly-replication + +Test Case - Replication Of Push Images to AWS-ECR Triggered By Event + Body Of Replication Of Push Images to Registry Triggered By Event aws-ecr us-east-2 ${ecr_ac_id} ${ecr_ac_key} harbor-nightly-replication \ No newline at end of file