diff --git a/tests/apitests/python/library/cnab.py b/tests/apitests/python/library/cnab.py index add51d259..b53bb667c 100644 --- a/tests/apitests/python/library/cnab.py +++ b/tests/apitests/python/library/cnab.py @@ -20,7 +20,7 @@ def load_bundle(service_image, invocation_image): def cnab_fixup_bundle(bundle_file, target, auto_update_bundle = True): fixed_bundle_file = "./tests/apitests/python/bundle_data/fixed-bundle.json" - command = ["sudo", "cnab-to-oci", "--log-level", "debug", "fixup", bundle_file, "--target", target, "--bundle", fixed_bundle_file] + command = ["cnab-to-oci", "--log-level", "debug", "fixup", bundle_file, "--target", target, "--bundle", fixed_bundle_file] if auto_update_bundle == True: command.append("--auto-update-bundle") #fixed_bundle_file = bundle_file diff --git a/tests/apitests/python/library/containerd.py b/tests/apitests/python/library/containerd.py index 7f318363f..ef8f83d49 100644 --- a/tests/apitests/python/library/containerd.py +++ b/tests/apitests/python/library/containerd.py @@ -5,13 +5,13 @@ import json import docker_api def ctr_images_pull(username, password, oci): - command = ["sudo", "ctr", "images", "pull","--snapshotter", "native", "-u", username+":"+password, oci] + command = ["ctr", "images", "pull","--snapshotter", "native", "-u", username+":"+password, oci] print("Command: ", command) ret = base.run_command(command) print("Command return: ", ret) def ctr_images_list(oci_ref = None): - command = ["sudo", "ctr", "images", "list", "--q"] + command = ["ctr", "images", "list", "--q"] print("Command: ", command) ret = base.run_command(command) print("Command return: ", ret) diff --git a/tests/apitests/python/library/docker_api.py b/tests/apitests/python/library/docker_api.py index 724ee5aac..c537324cf 100644 --- a/tests/apitests/python/library/docker_api.py +++ b/tests/apitests/python/library/docker_api.py @@ -22,7 +22,7 @@ def docker_login_cmd(harbor_host, username, password, cfg_file = "./tests/apites if username == "" or password == "": print("[Warnig]: No docker credential was provided.") return - command = ["sudo", "docker", "login", harbor_host, "-u", username, "-p", password] + command = ["docker", "login", harbor_host, "-u", username, "-p", password] print( "Docker Login Command: ", command) base.run_command(command) if enable_manifest == True: @@ -33,29 +33,29 @@ def docker_login_cmd(harbor_host, username, password, cfg_file = "./tests/apites raise Exception("Failed to update docker config, error is {} {}.".format(exc.returncode, exc.output)) def docker_manifest_create(index, manifests): - command = ["sudo", "docker","manifest","create", "--amend", index] + command = ["docker","manifest","create", "--amend", index] command.extend(manifests) print( "Docker Manifest Command: ", command) base.run_command(command) def docker_images_all_list(): - command = ["sudo", "docker","images","-a"] + command = ["docker","images","-a"] base.run_command(command) def docker_load_image(image): - command = ["sudo", "docker","load","-i", image] + command = ["docker","load","-i", image] base.run_command(command) def docker_image_clean_all(): docker_images_all_list() - command = ["sudo docker rmi -f $(docker images -a -q)"] + command = ["docker rmi -f $(docker images -a -q)"] base.run_command_with_popen(command) - command = ["sudo", "docker","system", "prune", "-a", "-f"] + command = ["docker","system", "prune", "-a", "-f"] base.run_command(command) docker_images_all_list() def docker_manifest_push(index): - command = ["sudo", "docker","manifest","push",index] + command = ["docker","manifest","push",index] print( "Docker Manifest Command: ", command) ret = base.run_command(command) index_sha256="" @@ -139,7 +139,7 @@ class DockerAPI(object): _tag = tag else: _tag = "latest" - if expected_error_message is "": + if expected_error_message == "": expected_error_message = None try: ret = self.DCLIENT.pull(r'{}:{}'.format(image, _tag)) @@ -179,7 +179,7 @@ class DockerAPI(object): ret = "" err_message = "" docker_images_all_list() - if expected_error_message is "": + if expected_error_message == "": expected_error_message = None try: ret = self.DCLIENT.push(harbor_registry, tag) @@ -247,4 +247,4 @@ class DockerAPI(object): else: if str(err_message).lower().find("error".lower()) >= 0: raise Exception(r" It's was not suppose to catch error when build image {}, return message is [{}]".format (harbor_registry, err_message)) - docker_image_clean_all() \ No newline at end of file + docker_image_clean_all() diff --git a/tests/apitests/python/test_assign_role_to_ldap_group.py b/tests/apitests/python/test_assign_role_to_ldap_group.py index 1a918bcfe..1efafc1cc 100644 --- a/tests/apitests/python/test_assign_role_to_ldap_group.py +++ b/tests/apitests/python/test_assign_role_to_ldap_group.py @@ -8,10 +8,10 @@ from testutils import created_user, created_project from library.project import Project from library.user import User from library.repository import Repository -from library.repository import push_image_to_project from library.artifact import Artifact from library.configurations import Configurations from library.projectV2 import ProjectV2 +from library.repository import push_self_build_image_to_project class TestAssignRoleToLdapGroup(unittest.TestCase): @@ -69,13 +69,13 @@ class TestAssignRoleToLdapGroup(unittest.TestCase): self.project.add_project_members(project_id, user_id=mike.user_id, member_role_id = 3, expect_status_code=403, **USER_DEV) self.project.add_project_members(project_id, user_id=mike.user_id, member_role_id = 3, expect_status_code=403, **USER_GUEST) - repo_name_admin, _ = push_image_to_project(project_name, harbor_server, USER_ADMIN["username"], USER_ADMIN["password"], USER_ADMIN["repo"], "latest") + repo_name_admin, _ = push_self_build_image_to_project(project_name, harbor_server, USER_ADMIN["username"], USER_ADMIN["password"], USER_ADMIN["repo"], "latest") artifacts = self.artifact.list_artifacts(project_name, USER_ADMIN["repo"], **USER_ADMIN) self.assertTrue(len(artifacts) == 1) - repo_name_dev, _ = push_image_to_project(project_name, harbor_server, USER_DEV["username"], USER_DEV["password"], USER_DEV["repo"], "latest") + repo_name_dev, _ = push_self_build_image_to_project(project_name, harbor_server, USER_DEV["username"], USER_DEV["password"], USER_DEV["repo"], "latest") artifacts = self.artifact.list_artifacts(project_name, USER_DEV["repo"], **USER_DEV) self.assertTrue(len(artifacts) == 1) - push_image_to_project(project_name, harbor_server, USER_GUEST["username"], USER_GUEST["password"], USER_GUEST["repo"], "latest", expected_error_message = "unauthorized to access repository") + push_self_build_image_to_project(project_name, harbor_server, USER_GUEST["username"], USER_GUEST["password"], USER_GUEST["repo"], "latest", expected_error_message = "unauthorized to access repository") artifacts = self.artifact.list_artifacts(project_name, USER_GUEST["repo"], **USER_GUEST) self.assertTrue(len(artifacts) == 0) diff --git a/tests/apitests/python/test_del_repo.py b/tests/apitests/python/test_del_repo.py index c39194d49..72f4d905c 100644 --- a/tests/apitests/python/test_del_repo.py +++ b/tests/apitests/python/test_del_repo.py @@ -54,7 +54,7 @@ class TestProjects(unittest.TestCase): TestProjects.project_del_repo_id, TestProjects.project_del_repo_name = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_del_repo_CLIENT) #3. Create a new repository(RA) in project(PA) by user(UA); - repo_name, _ = push_self_build_image_to_project(TestProjects.project_del_repo_name, harbor_server, 'admin', 'Harbor12345', "test_del_repo", "latest") + repo_name, _ = push_self_build_image_to_project(TestProjects.project_del_repo_name, harbor_server, 'admin', 'Harbor12345', "test_del_repo", "latest", size=512) #4. Get repository in project(PA), there should be one repository which was created by user(UA); repo_data = self.repo.list_repositories(TestProjects.project_del_repo_name, **TestProjects.USER_del_repo_CLIENT) diff --git a/tests/apitests/python/update_docker_cfg.sh b/tests/apitests/python/update_docker_cfg.sh index 2e26e9007..2bdb263ab 100755 --- a/tests/apitests/python/update_docker_cfg.sh +++ b/tests/apitests/python/update_docker_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ $(cat /$HOME/.docker/config.json |grep experimental |wc -l) -eq 0 ];then - sudo sed -i '$d' /$HOME/.docker/config.json - sudo sed -i '$d' /$HOME/.docker/config.json - sudo echo -e "},\n \"experimental\": \"enabled\"\n}" >> /$HOME/.docker/config.json + sed -i '$d' /$HOME/.docker/config.json + sed -i '$d' /$HOME/.docker/config.json + echo -e "},\n \"experimental\": \"enabled\"\n}" >> /$HOME/.docker/config.json fi diff --git a/tests/ci/api_common_install.sh b/tests/ci/api_common_install.sh index 9750646f7..936915ff0 100755 --- a/tests/ci/api_common_install.sh +++ b/tests/ci/api_common_install.sh @@ -18,32 +18,31 @@ cat /proc/version sudo -H pip install --ignore-installed urllib3 chardet requests --upgrade python --version -#---------------Set DNS for docker v20-------------------# +#---------------Set DNS for docker v20-----------------------# # In docker v20, it fixed an issue named "Wrong resolv.conf -# used on Ubuntu 19", this fix caused DNS solve problem +# used on Ubuntu 19", this fix caused DNS solve problem # in container. So the current work round is read DNS server # from system and set the value in /etc/docker/daemon.json. ip addr -dns_ip=$(netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}') -dns_ip_list=$(echo $dns_ip | tr " " "\n") -dns_cfg="" -for ip in $dns_ip_list -do - dns_cfg="$dns_cfg,\"$ip\"" -done +docker_config_file="/etc/docker/daemon.json" +dns_ip_string=$(netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}' | tr " " "\n" | sed 's/,/","/g') +dns=[\"${dns_ip_string}\"] +echo dns=${dns} -cat /etc/docker/daemon.json - -if [ $(cat /etc/docker/daemon.json |grep \"dns\" |wc -l) -eq 0 ];then - sudo sed "s/}/,\n \"dns\": [${dns_cfg:1}]\n}/" -i /etc/docker/daemon.json +cat $docker_config_file +if [ -f $docker_config_file ];then + if [ $(cat /etc/docker/daemon.json |grep \"dns\" |wc -l) -eq 0 ];then + sudo sed "s/}/,\n \"dns\": $dns\n}/" -i $docker_config_file + fi +else + echo "{\"dns\": $dns}" > $docker_config_file fi - -cat /etc/docker/daemon.json -sudo systemctl daemon-reload -sudo systemctl restart docker -sudo systemctl status docker -#--------------------------------------------------------# +cat $docker_config_file +sudo systemctl stop docker +sudo systemctl start docker +sleep 2 +#------------------------------------------------------------# sudo ./tests/hostcfg.sh diff --git a/tests/ci/api_run.sh b/tests/ci/api_run.sh index f7bc821e4..2e8f4b174 100755 --- a/tests/ci/api_run.sh +++ b/tests/ci/api_run.sh @@ -18,7 +18,7 @@ harbor_logs_bucket="harbor-ci-logs" #echo "content_language = en" >> $botofile #echo "default_project_id = $GS_PROJECT_ID" >> $botofile DIR="$(cd "$(dirname "$0")" && pwd)" -E2E_IMAGE="goharbor/harbor-e2e-engine:2.6.3" +E2E_IMAGE="goharbor/harbor-e2e-engine:3.0.0-api" # GS util function uploader { @@ -31,9 +31,9 @@ set +e docker ps # run db auth api cases if [ "$1" = 'DB' ]; then - docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot --exclude proxy_cache -v DOCKER_USER:${DOCKER_USER} -v DOCKER_PWD:${DOCKER_PWD} -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_DB.robot + docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot --exclude proxy_cache -v DOCKER_USER:${DOCKER_USER} -v DOCKER_PWD:${DOCKER_PWD} -v ip:$2 -v ip1: -v http_get_ca:false -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_DB.robot elif [ "$1" = 'PROXY_CACHE' ]; then - docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot --include setup --include proxy_cache -v DOCKER_USER:${DOCKER_USER} -v DOCKER_PWD:${DOCKER_PWD} -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_DB.robot + docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot --include setup --include proxy_cache -v DOCKER_USER:${DOCKER_USER} -v DOCKER_PWD:${DOCKER_PWD} -v ip:$2 -v ip1: -v http_get_ca:false -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_DB.robot elif [ "$1" = 'LDAP' ]; then # run ldap api cases python $DIR/../../tests/configharbor.py -H $IP -u $HARBOR_ADMIN -p $HARBOR_ADMIN_PASSWD -c auth_mode=ldap_auth \ @@ -42,7 +42,7 @@ elif [ "$1" = 'LDAP' ]; then ldap_search_password=admin \ ldap_base_dn=dc=example,dc=com \ ldap_uid=cn - docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot -v DOCKER_USER:${DOCKER_USER} -v DOCKER_PWD:${DOCKER_PWD} -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_LDAP.robot + docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot -v DOCKER_USER:${DOCKER_USER} -v DOCKER_PWD:${DOCKER_PWD} -v ip:$2 -v ip1: -v http_get_ca:false -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_LDAP.robot else rc=999 fi diff --git a/tests/e2e-image/Dockerfile b/tests/e2e-image/Dockerfile deleted file mode 100644 index 521a6355d..000000000 --- a/tests/e2e-image/Dockerfile +++ /dev/null @@ -1,182 +0,0 @@ -FROM ubuntu:18.04 -ENV LANG C.UTF-8 -# V 2.0 -# V 2.0.1: Upgrade docker to version 19.03.12. -# V 2.5 Add support for e2e py-test (especially containerd). -# V 2.6 Upgrade docker 19.03.12. -# V 2.6.1 Upgrade containerd(ctr) to v1.4.3, docker 20.10.3. -# V 2.6.2 Package busybox into E2E image. -# V 2.6.3 a. Swith python version from 3.7 to 3.6; -# b. Upgrade and fix cnab-to-oci build issue; -# c. Install hurry.filesize tool in python. - -RUN apt-get update && apt-get install -y --no-install-recommends wget curl gnupg2 -RUN apt-get install libseccomp2 -RUN wget --no-check-certificate -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 apt-get update && apt-get install -y --no-install-recommends \ - jq \ - bc \ - time \ - gcc \ - git \ - 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 \ - #ip tool - #ethtool \ - iproute2 \ - #bridge-utils \ - #iputils-ping \ - # 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 apt-get update && apt-get install -y software-properties-common && \ - add-apt-repository -y ppa:longsleep/golang-backports -RUN apt-get update && \ - apt-get install -y golang-go - -RUN apt-get update -y ; apt-get install -y zbar-tools libzbar-dev python-zbar python3.6 -RUN rm /usr/bin/python ; ln -s /usr/bin/python3.6 /usr/bin/python ; apt-get install -y python3-pip -RUN python -m pip install --upgrade pip - -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 pip3 install pyasn1 google-apitools==0.5.31 gsutil robotframework==3.2.1 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-seleniumlibrary==4.3.0 robotframework-pabot robotframework-JSONLibrary hurry.filesize --upgrade - -ENV CONTAINERD_VERSION 1.4.3 -RUN wget https://github.com/containerd/containerd/releases/download/v1.4.3/containerd-$CONTAINERD_VERSION-linux-amd64.tar.gz && \ - tar zxvf containerd-$CONTAINERD_VERSION-linux-amd64.tar.gz && \ - cd bin && cp -f containerd ctr /usr/bin/ && cp -f containerd ctr /usr/local/bin/ - -# Install docker, docker compose -ENV DOCKER_VERSION 20.10.3 -RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz && \ - tar --strip-components=1 -xvzf docker-$DOCKER_VERSION.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 && mv drone drone_src - -RUN set -x \ - && groupadd --system dockremap \ - && adduser --system --ingroup dockremap dockremap \ - && echo 'dockremap:165536:65536' >> /etc/subuid \ - && echo 'dockremap:165536:65536' >> /etc/subgid - -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.16.12-linux-amd64.tar.gz && tar zxvf helm-v2.16.12-linux-amd64.tar.gz && \ - cp linux-amd64/helm /usr/local/bin/helm && \ - cp linux-amd64/helm /usr/local/bin/helm2 && \ - helm init --stable-repo-url https://charts.helm.sh/stable --client-only && \ - helm plugin install https://github.com/chartmuseum/helm-push - -RUN wget https://get.helm.sh/helm-v3.3.3-linux-amd64.tar.gz && tar zxvf helm-v3.3.3-linux-amd64.tar.gz && \ - mv linux-amd64/helm /usr/local/bin/helm3 && \ - helm3 plugin install https://github.com/chartmuseum/helm-push - -RUN curl -LO https://github.com/deislabs/oras/releases/download/v0.9.0/oras_0.9.0_linux_amd64.tar.gz && \ - mkdir -p oras-install/ && \ - tar -zxf oras_0.9.0_*.tar.gz -C oras-install/ && \ - mv oras-install/oras /usr/local/bin/ - -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/cnabio && 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.1-beta1 && \ - go list && \ - make build && \ - mv bin/cnab-to-oci /usr/local/bin - -RUN apt-get install -y sudo uuid-dev - -RUN wget https://github.com/sylabs/singularity/releases/download/v3.3.0/singularity-3.3.0.tar.gz && \ - tar -xzf singularity-3.3.0.tar.gz && \ - cd singularity && \ - ./mconfig && \ - make -C builddir && \ - make -C builddir install - -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 - -COPY containerd_config.toml /etc/containerd/config.toml - -COPY busybox.tar / - -# 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/e2e-image/Dockerfile.api_test b/tests/e2e-image/Dockerfile.api_test new file mode 100644 index 000000000..39580123e --- /dev/null +++ b/tests/e2e-image/Dockerfile.api_test @@ -0,0 +1,45 @@ + +# photon based image +FROM photon:4.0 +ENV LANG C.UTF-8 + +COPY --from=tool_builder /tool/tools.tar.gz /usr/local/bin + +RUN tdnf install -y \ + wget \ + git \ + openjdk8 \ + iproute2 \ + iptables \ + build-essential \ + sed \ + openssl-devel \ + tar \ + which \ + procps-ng \ + gzip && \ + tdnf erase -y toybox && \ + tdnf install -y python3 python3-pip python3-setuptools httpd && \ + pip3 install --upgrade pip pyasn1 google-apitools==0.5.31 gsutil \ + robotframework==3.2.1 robotframework-sshlibrary robotframework-httplibrary \ + requests dbbot robotframework-seleniumlibrary==4.3.0 robotframework-pabot \ + robotframework-JSONLibrary hurry.filesize --upgrade && \ + tdnf clean all + +RUN pwd && ls && \ + # Install docker + DOCKER_VERSION=20.10.3 && wget https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz && \ + tar --strip-components=1 -xvzf docker-$DOCKER_VERSION.tgz -C /usr/bin && \ + rm docker-$DOCKER_VERSION.tgz + +COPY containerd_config.toml /etc/containerd/config.toml +COPY busybox.tar / +# 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 && \ + mkdir -p $HOME/.pki/nssdb && \ + echo Harbor12345 > password.ca && \ + certutil -d sql:$HOME/.pki/nssdb -N -f password.ca + +VOLUME /var/lib/docker diff --git a/tests/e2e-image/Dockerfile.base b/tests/e2e-image/Dockerfile.base new file mode 100644 index 000000000..6a8039120 --- /dev/null +++ b/tests/e2e-image/Dockerfile.base @@ -0,0 +1,79 @@ +FROM ubuntu:18.04 as tool_builder +ENV LANG C.UTF-8 +WORKDIR /tool + +#RUN tdnf install -y \ +RUN apt-get update && apt-get install -y \ + build-essential \ + wget \ + git \ + tar \ + #go + #ubuntu + curl \ + libssl-dev \ + uuid-dev +#ubuntu +RUN apt-get update && apt-get install -y software-properties-common && \ + add-apt-repository -y ppa:longsleep/golang-backports && \ + apt-get install -y golang-go + +RUN pwd && mkdir /tool/binary && \ + # Install CONTAINERD + CONTAINERD_VERSION=1.4.4 && \ + wget https://github.com/containerd/containerd/releases/download/v$CONTAINERD_VERSION/containerd-$CONTAINERD_VERSION-linux-amd64.tar.gz && \ + tar zxvf containerd-$CONTAINERD_VERSION-linux-amd64.tar.gz && \ + cd bin && cp -f containerd ctr /tool/binary/ && \ + # docker compose + curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /tool/binary/docker-compose && \ + chmod +x /tool/binary/docker-compose && \ + # Install helm v2 + HELM2_VERSION=2.16.12 && wget https://get.helm.sh/helm-v$HELM2_VERSION-linux-amd64.tar.gz && \ + tar zxvf helm-v$HELM2_VERSION-linux-amd64.tar.gz && \ + cp linux-amd64/helm /tool/binary/helm && \ + cp linux-amd64/helm /tool/binary/helm2 && \ + # Install helm v3 + HELM3_VERSION=3.3.3 && wget https://get.helm.sh/helm-v$HELM3_VERSION-linux-amd64.tar.gz && \ + tar zxvf helm-v$HELM3_VERSION-linux-amd64.tar.gz && \ + ls || pwd && \ + mv linux-amd64/helm /tool/binary/helm3 && \ + # Install ORAS + ORAS_VERSION=0.9.0 && curl -LO https://github.com/deislabs/oras/releases/download/v$ORAS_VERSION/oras_${ORAS_VERSION}_linux_amd64.tar.gz && \ + mkdir -p oras-install/ && \ + tar -zxf oras_${ORAS_VERSION}_*.tar.gz -C oras-install/ && \ + mv oras-install/oras /tool/binary/ && \ + # Install notary + NOTARY_VERSION=0.6.1 && wget https://github.com/theupdateframework/notary/releases/download/v$NOTARY_VERSION/notary-Linux-amd64 && \ + chmod +x notary-Linux-amd64 && \ + mv notary-Linux-amd64 /tool/binary/notary && \ + # Install CNAB + CNAB_PATH=$(go env GOPATH)/src/github.com/cnabio && \ + 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.1-beta1 && \ + go list && \ + make build && \ + mv bin/cnab-to-oci /tool/binary/ && \ + # Install DIND + DIND_COMMIT=3b5fac462d21ca164b3778647420016315289034 && \ + wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /tool/binary/dind \ + && chmod +x /tool/binary/dind && \ + pwd + +#ubuntu +RUN wget https://github.com/sylabs/singularity/releases/download/v3.3.0/singularity-3.3.0.tar.gz && \ + tar -xzf singularity-3.3.0.tar.gz && \ + cd singularity && \ + ./mconfig && \ + make -C builddir && \ + make -C builddir install +RUN pwd && \ + ls -l /usr/local/bin && \ + rm -rf singularity && \ + mv /usr/local/bin/singularity /tool/binary/ + +RUN cd /tool/binary/ && tar czvf tools.tar.gz * && cp tools.tar.gz /tool +# --- End of base file --- + + + + diff --git a/tests/e2e-image/Dockerfile.ui_test b/tests/e2e-image/Dockerfile.ui_test new file mode 100644 index 000000000..6de1f16c4 --- /dev/null +++ b/tests/e2e-image/Dockerfile.ui_test @@ -0,0 +1,60 @@ + +#ubuntm based image +FROM ubuntu:18.04 +ENV LANG C.UTF-8 +RUN apt-get update && apt-get install -y --no-install-recommends wget curl gnupg2 +RUN apt-get install libseccomp2 +RUN wget --no-check-certificate -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' + +COPY --from=tool_builder /tool/tools.tar.gz /usr/local/bin + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + openjdk-8-jdk \ + iproute2 \ + iptables \ + build-essential \ + sed \ + libssl-dev \ + tar \ + unzip \ + gzip \ + # certutil + libnss3-tools \ + google-chrome-stable + +RUN apt-get update -y ; apt-get install -y python3.6 && \ + rm /usr/bin/python ; ln -s /usr/bin/python3.6 /usr/bin/python ; apt-get install -y python3-pip && \ + python -m pip install --upgrade pip + +RUN pip3 install --upgrade pip pyasn1 google-apitools==0.5.31 gsutil \ + robotframework==3.2.1 robotframework-sshlibrary robotframework-httplibrary \ + requests dbbot robotframework-seleniumlibrary==4.3.0 robotframework-pabot \ + robotframework-JSONLibrary hurry.filesize --upgrade && \ + apt-get clean all + +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 pwd && ls && \ + # Install docker + DOCKER_VERSION=20.10.3 && wget https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz && \ + tar --strip-components=1 -xvzf docker-$DOCKER_VERSION.tgz -C /usr/bin && \ + rm docker-$DOCKER_VERSION.tgz + +COPY containerd_config.toml /etc/containerd/config.toml +COPY busybox.tar / +# 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 && \ + mkdir -p $HOME/.pki/nssdb && \ + echo Harbor12345 > password.ca && \ + certutil -d sql:$HOME/.pki/nssdb -N -f password.ca + +VOLUME /var/lib/docker diff --git a/tests/e2e-image/build.sh b/tests/e2e-image/build.sh new file mode 100755 index 000000000..f2cab8402 --- /dev/null +++ b/tests/e2e-image/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -x +set -e + +IMAGE_FOR=$1 +VERSION=$2 + +CMD_BASE="cat Dockerfile.base" +SRC_FILE="" +DST_FILE=Dockerfile + +echo "Starting to prepare Dockerfile for $IMAGE_FOR ..." +if [ "$IMAGE_FOR" == "api" ]; then + SRC_FILE=Dockerfile.api_test +else + SRC_FILE=Dockerfile.ui_test +fi + +if [ ! -r $SRC_FILE ]; then + echo "File $SRC_FILE does not exists at all!" + exit -1 +fi + +if [ -f $DST_FILE ]; then + rm $DST_FILE +fi +$CMD_BASE $SRC_FILE >> $DST_FILE + +echo "Starting to build image ..." +TARGET_IMAGE=goharbor/harbor-e2e-engine:${VERSION}-${IMAGE_FOR} +docker build -t $TARGET_IMAGE . + diff --git a/tests/e2e-image/drone/Dockerfile b/tests/e2e-image/drone/Dockerfile deleted file mode 100644 index 6ab76371f..000000000 --- a/tests/e2e-image/drone/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM ubuntu:18.04 -ENV LANG C.UTF-8 - - -RUN apt-get update && apt-get install -y --no-install-recommends \ - jq \ - bc \ - time \ - gcc \ - git \ - python-dev \ - libffi-dev \ - libssl-dev \ - sshpass \ - ant \ - ant-optional \ - xvfb \ - libxi6 \ - libgconf-2-4 \ - openjdk-8-jdk \ - rpcbind \ - nfs-common \ - unzip \ - zip \ - bzip2 \ - wget curl \ - parted \ - #ip tool - #ethtool \ - iproute2 \ - #bridge-utils \ - #iputils-ping \ - # Add docker in docker support - btrfs-tools \ - e2fsprogs \ - iptables \ - xfsprogs \ - dnsutils \ - netcat \ - # 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 apt-get update && \ - apt-get install golang -y - -RUN apt-get update -y && \ - apt-get install -y zbar-tools libzbar-dev python-zbar -RUN dpkg -L libzbar-dev; ls -l /usr/include/zbar.h -RUN apt-get update -y -RUN apt-get install -y python3.6 -RUN rm /usr/bin/python -RUN ln -s /usr/bin/python3.6 /usr/bin/python -RUN apt-get install -y python3-pip - - - -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 pip3 install pyasn1 google-apitools==0.5.31 gsutil robotframework==3.2.1 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-seleniumlibrary==4.3.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 && mv drone drone_src - -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/Cert-Util.robot b/tests/resources/Cert-Util.robot index 0263d7c52..f34307e32 100644 --- a/tests/resources/Cert-Util.robot +++ b/tests/resources/Cert-Util.robot @@ -18,14 +18,14 @@ Documentation This resource contains keywords related to creating and using cer *** Keywords *** Generate Certificate Authority For Chrome # add the ca to chrome trust list to enable https testing. - [Arguments] ${password}=%{HARBOR_PASSWORD} + [Arguments] ${password}=%{HARBOR_PASSWORD} ${cert}=harbor_ca.crt ${rand}= Evaluate random.randint(0, 100000) modules=random Log To Console Generate Certificate Authority For Chrome ${rc} ${out}= Run And Return Rc And Output echo ${password} > password${rand}.ca - Log ${out} + Log ALL ${out} Should Be Equal As Integers ${rc} 0 ${rc} ${out}= Run And Return Rc And Output certutil -d sql:$HOME/.pki/nssdb -A -t TC -f password${rand}.ca -n "Harbor${rand}" -i ./harbor_ca.crt - Log ${out} + Log ALL ${out} Should Be Equal As Integers ${rc} 0 Generate Certificate Authority diff --git a/tests/resources/Docker-Util.robot b/tests/resources/Docker-Util.robot index e669bdd07..f16ee7a07 100644 --- a/tests/resources/Docker-Util.robot +++ b/tests/resources/Docker-Util.robot @@ -194,22 +194,24 @@ Restart Process Locally Log All result : ${result} [Return] ${handle} -Prepare Docker Cert - [Arguments] ${ip} +Prepare Docker Cert In Ubuntu + [Arguments] ${ip} ${cert} Wait Unitl Command Success mkdir -p /etc/docker/certs.d/${ip} - Wait Unitl Command Success cp harbor_ca.crt /etc/docker/certs.d/${ip} - Wait Unitl Command Success cp harbor_ca.crt /usr/local/share/ca-certificates/ - Wait Unitl Command Success update-ca-certificates - -Prepare Docker Cert For Nightly - [Arguments] ${ip} - Wait Unitl Command Success mkdir -p /etc/docker/certs.d/${ip} - Wait Unitl Command Success cp harbor_ca.crt /etc/docker/certs.d/${ip} - Wait Unitl Command Success cp harbor_ca.crt /usr/local/share/ca-certificates/ + Wait Unitl Command Success cp ${cert} /etc/docker/certs.d/${ip} + Wait Unitl Command Success cp ${cert} /usr/local/share/ca-certificates/ #Add pivotal ecs cert for docker manifest push test. Wait Unitl Command Success cp /ecs_ca/vmwarecert.crt /usr/local/share/ca-certificates/ Wait Unitl Command Success update-ca-certificates +Prepare Docker Cert In Photon + [Arguments] ${ip} ${cert} + Log All Prepare Docker Cert In Photon ${cert} + ${rc} ${output}= Run And Return Rc and Output cat ${cert} + Log All CA output: ${output} + Wait Unitl Command Success cat ${cert} >> /etc/pki/tls/certs/ca-bundle.crt + Wait Unitl Command Success mkdir -p /etc/docker/certs.d/${ip} + Wait Unitl Command Success cp ${cert} /etc/docker/certs.d/${ip} + Kill Local Docker Daemon [Arguments] ${handle} ${dockerd-pid} Terminate Process ${handle} diff --git a/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot b/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot index 56ba12c59..cecf5f2f0 100644 --- a/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot +++ b/tests/resources/Harbor-Pages/Project-Artifact-Elements.robot @@ -21,6 +21,7 @@ ${artifact_action_delete_xpath} //clr-dropdown-menu//div[contains(.,'Delete')] ${artifact_action_copy_xpath} //clr-dropdown-menu//div[contains(.,'Copy') and @aria-label='retag'] ${artifact_achieve_icon} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//a ${artifact_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')] +${archive_rows} //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256')]//clr-dg-cell[1]//clr-tooltip//a ${artifact_list_spinner} xpath=//clr-datagrid//clr-spinner ${artifact_tag_component} xpath=//artifact-tag diff --git a/tests/resources/Harbor-Pages/Project-Artifact.robot b/tests/resources/Harbor-Pages/Project-Artifact.robot index bf5510397..62f3b35e7 100644 --- a/tests/resources/Harbor-Pages/Project-Artifact.robot +++ b/tests/resources/Harbor-Pages/Project-Artifact.robot @@ -22,6 +22,8 @@ Go Into Artifact Retry Wait Until Page Not Contains Element ${artifact_list_spinner} Retry Element Click xpath=//clr-dg-row[contains(.,'${tag}')]//a[contains(.,'sha256')] Retry Wait Until Page Contains Element ${artifact_tag_component} + Retry Wait Until Page Not Contains Element ${artifact_list_spinner} + Should Contain Tag [Arguments] ${tag} Retry Wait Until Page Contains Element xpath=//artifact-tag//clr-dg-row//clr-dg-cell[contains(.,'${tag}')] diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 64496943c..b56fc24a9 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -254,15 +254,17 @@ Click Index Achieve Retry Element Click //artifact-list-tab//clr-datagrid//clr-dg-row[contains(.,'sha256') and contains(.,'${tag_name}')]//clr-dg-cell[1]//clr-tooltip//a Go Into Index And Contain Artifacts - [Arguments] ${tag_name} ${limit}=3 + [Arguments] ${tag_name} ${total_artifact_count}=3 ${archive_count}=0 Retry Double Keywords When Error Click Index Achieve ${tag_name} Page Should Contain Element ${tag_table_column_os_arch} FOR ${n} IN RANGE 1 10 - ${out} Run Keyword And Ignore Error Page Should Contain Element ${artifact_rows} limit=${limit} - Exit For Loop If '${out[0]}'=='PASS' + ${out1} Run Keyword And Ignore Error Page Should Contain Element ${artifact_rows} limit=${total_artifact_count} + ${out2} Run Keyword And Ignore Error Page Should Contain Element ${archive_rows} limit=${archive_count} + Exit For Loop If '${out1[0]}'=='PASS' and '${out2[0]}'=='PASS' Sleep 3 END - Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot - Should Be Equal As Strings '${out[0]}' 'PASS' + Run Keyword If '${out1[0]}'=='FAIL' or '${out2[0]}'=='FAIL' Capture Page Screenshot + Should Be Equal As Strings '${out1[0]}' 'PASS' + Should Be Equal As Strings '${out2[0]}' 'PASS' Switch To CardView Retry Element Click xpath=//hbr-repository-gridview//span[@class='card-btn']/clr-icon diff --git a/tests/resources/Harbor-Pages/Replication.robot b/tests/resources/Harbor-Pages/Replication.robot index ba47f6de8..444ed420b 100644 --- a/tests/resources/Harbor-Pages/Replication.robot +++ b/tests/resources/Harbor-Pages/Replication.robot @@ -229,12 +229,11 @@ Select Rule And Replicate Retry Double Keywords When Error Retry Element Click xpath=${dialog_replicate} Retry Wait Until Page Not Contains Element xpath=${dialog_replicate} Image Should Be Replicated To Project - [Arguments] ${project} ${image} ${period}=60 ${times}=20 ${tag}=${null} ${expected_image_size_in_regexp}=${null} + [Arguments] ${project} ${image} ${period}=60 ${times}=20 ${tag}=${EMPTY} ${expected_image_size_in_regexp}=${null} ${total_artifact_count}=${null} ${archive_count}=${null} FOR ${n} IN RANGE 0 ${times} Sleep ${period} Go Into Project ${project} Switch To Project Repo - #In AWS-ECR, under repository a, there're only several images: httpd,alpine,hello-world. ${out} Run Keyword And Ignore Error Retry Wait Until Page Contains ${project}/${image} Log To Console Return value is ${out[0]} Exit For Loop If '${out[0]}'=='PASS' @@ -243,8 +242,11 @@ Image Should Be Replicated To Project Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot Should Be Equal As Strings '${out[0]}' 'PASS' Go Into Repo ${project}/${image} - ${size}= Run Keyword If '${tag}'!='${null}' and '${expected_image_size_in_regexp}'!='${null}' Get Text //clr-dg-row[contains(., '${tag}')]//clr-dg-cell[4]/div - Run Keyword If '${tag}'!='${null}' and '${expected_image_size_in_regexp}'!='${null}' Should Match Regexp '${size}' '${expected_image_size_in_regexp}' + ${size}= Run Keyword If '${tag}'!='${EMPTY}' and '${expected_image_size_in_regexp}'!='${null}' Get Text //clr-dg-row[contains(., '${tag}')]//clr-dg-cell[4]/div + Run Keyword If '${tag}'!='${EMPTY}' and '${expected_image_size_in_regexp}'!='${null}' Should Match Regexp '${size}' '${expected_image_size_in_regexp}' + Run Keyword If '${total_artifact_count}'!='${null}' Run Keywords + ... Should Not Be Empty ${tag} + ... AND Go Into Index And Contain Artifacts ${tag} total_artifact_count=${total_artifact_count} archive_count=${archive_count} Executions Result Count Should Be [Arguments] ${expected_status} ${expected_trigger_type} ${expected_result_count} diff --git a/tests/resources/Harbor-Pages/Verify.robot b/tests/resources/Harbor-Pages/Verify.robot index 50a2b5dce..0c7ec23ed 100644 --- a/tests/resources/Harbor-Pages/Verify.robot +++ b/tests/resources/Harbor-Pages/Verify.robot @@ -477,7 +477,7 @@ Verify Artifact Index ${tag}= Get Value From Json ${json} $.projects[?(@.name=${project})].artifact_index.tag Go Into Project ${project} has_image=${true} Go Into Repo ${project}/${name}[0] - Go Into Index And Contain Artifacts ${tag}[0] limit=2 + Go Into Index And Contain Artifacts ${tag}[0] total_artifact_count=2 Pull image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project} ${name}[0]:${tag}[0] Navigate To Projects END diff --git a/tests/resources/Harbor-Util.robot b/tests/resources/Harbor-Util.robot index a326d7d65..ba7cfa8fa 100644 --- a/tests/resources/Harbor-Util.robot +++ b/tests/resources/Harbor-Util.robot @@ -90,6 +90,18 @@ Switch To LDAP Should Be Equal As Integers ${rc} 0 Generate Certificate Authority For Chrome +Get Harbor CA + [Arguments] ${ip} ${cert} + Log All Start to get harbor ca: ${ip} ${cert} + Run Keyword If '${http_get_ca}' == 'false' Run Keywords + ... Wait Unitl Command Success cp /ca/harbor_ca.crt ${cert} + ... AND Return From Keyword + ${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/ + Log All ${rc} + ${rc} ${output}= Run And Return Rc and Output curl -o ${cert} -s -k -X GET -u 'admin:Harbor12345' 'https://${ip}/api/v2.0/systeminfo/getcert' + Log All ${output} + Should Be Equal As Integers ${rc} 0 + Enable Notary Client ${rc} ${output}= Run And Return Rc And Output rm -rf ~/.docker/ Log ${rc} diff --git a/tests/resources/Helm-Util.robot b/tests/resources/Helm-Util.robot index 6f1f91c69..14f07526d 100644 --- a/tests/resources/Helm-Util.robot +++ b/tests/resources/Helm-Util.robot @@ -18,21 +18,23 @@ Library OperatingSystem Library Process *** Keywords *** -Prepare Helm Cert - Wait Unitl Command Success cp harbor_ca.crt /ca/server.crt +Prepare Helm Plugin + Wait Unitl Command Success helm init --stable-repo-url https://charts.helm.sh/stable --client-only + Wait Unitl Command Success helm plugin install https://github.com/chartmuseum/helm-push + Wait Unitl Command Success helm3 plugin install https://github.com/chartmuseum/helm-push Helm Repo Add [Arguments] ${harbor_url} ${user} ${pwd} ${project_name}=library ${helm_repo_name}=myrepo ${rc} ${output}= Run And Return Rc And Output helm repo remove ${project_name} Log To Console ${output} - Wait Unitl Command Success helm repo add --ca-file /ca/server.crt --username=${user} --password=${pwd} ${helm_repo_name} ${harbor_url}/chartrepo/${project_name} + Wait Unitl Command Success helm repo add --ca-file /ca/ca.crt --username=${user} --password=${pwd} ${helm_repo_name} ${harbor_url}/chartrepo/${project_name} Helm Repo Push [Arguments] ${user} ${pwd} ${chart_filename} ${helm_repo_name}=myrepo ${helm_cmd}=helm ${current_dir}= Run pwd Run cd ${current_dir} Run wget ${harbor_chart_file_url} - Wait Unitl Command Success ${helm_cmd} push --ca-file=/ca/server.crt --username=${user} --password=${pwd} ${chart_filename} ${helm_repo_name} + Wait Unitl Command Success ${helm_cmd} push --ca-file=/ca/ca.crt --username=${user} --password=${pwd} ${chart_filename} ${helm_repo_name} Helm Chart Push [Arguments] ${ip} ${user} ${pwd} ${chart_file} ${archive} ${project} ${repo_name} ${verion} diff --git a/tests/resources/Nightly-Util.robot b/tests/resources/Nightly-Util.robot index 561268d02..87a34a2cc 100644 --- a/tests/resources/Nightly-Util.robot +++ b/tests/resources/Nightly-Util.robot @@ -20,46 +20,51 @@ Resource Util.robot ${SSH_USER} root *** Keywords *** -Nightly Test Setup +Prepare Test Tools + Wait Unitl Command Success tar zxvf /usr/local/bin/tools.tar.gz -C /usr/local/bin/ + +Get And Setup Harbor CA + [Arguments] ${ip} ${HARBOR_PASSWORD} ${ca_setup_keyword} ${ip1}==${EMPTY} + Run Keyword If '${ip1}' != '${EMPTY}' Run Keywords + ... Get Harbor CA ${ip1} /drone/harbor_ca1.crt + ... AND Run Keyword ${ca_setup_keyword} ${ip1} ${HARBOR_PASSWORD} /drone/harbor_ca1.crt + Get Harbor CA ${ip} /drone/harbor_ca.crt + Log To Console ${ca_setup_keyword} ... + Run Keyword ${ca_setup_keyword} ${ip} ${HARBOR_PASSWORD} /drone/harbor_ca.crt + +Nightly Test Setup In Photon [Arguments] ${ip} ${HARBOR_PASSWORD} ${ip1}==${EMPTY} - Run Keyword If '${ip1}' != '${EMPTY}' CA setup ${ip1} ${HARBOR_PASSWORD} /ca/ca1.crt - Run Keyword If '${ip1}' != '${EMPTY}' Run rm -rf ./harbor_ca.crt - Log To Console CA setup ... - Run Keyword CA setup ${ip} ${HARBOR_PASSWORD} + Get And Setup Harbor CA ${ip} ${HARBOR_PASSWORD} CA Setup In Photon ip1=${ip1} + Prepare Test Tools Log To Console Start Docker Daemon Locally ... - Run Keyword Start Docker Daemon Locally + Start Docker Daemon Locally Log To Console Start Containerd Daemon Locally ... - Run Keyword Start Containerd Daemon Locally + Start Containerd Daemon Locally Log To Console wget mariadb ... Run wget ${prometheus_chart_file_url} + Prepare Helm Plugin #Prepare docker image for push special image keyword in replication test Run Keyword If '${DOCKER_USER}' != '${EMPTY}' Docker Login "" ${DOCKER_USER} ${DOCKER_PWD} -CA Setup - [Arguments] ${ip} ${HARBOR_PASSWORD} ${cert}=/ca/ca.crt - Log To Console cp /ca/harbor_ca.crt harbor_ca.crt ... - Run cp /ca/harbor_ca.crt harbor_ca.crt - Log To Console Generate Certificate Authority For Chrome ... - Generate Certificate Authority For Chrome ${HARBOR_PASSWORD} - Log To Console Prepare Docker Cert ... - Prepare Docker Cert ${ip} - -Nightly Test Setup For Nightly +Nightly Test Setup In Ubuntu [Arguments] ${ip} ${HARBOR_PASSWORD} ${ip1}==${EMPTY} - Run Keyword If '${ip1}' != '${EMPTY}' CA setup For Nightly ${ip1} ${HARBOR_PASSWORD} /ca/ca1.crt - Run Keyword If '${ip1}' != '${EMPTY}' Run rm -rf ./harbor_ca.crt - Run Keyword CA setup For Nightly ${ip} ${HARBOR_PASSWORD} + Get And Setup Harbor CA ${ip} ${HARBOR_PASSWORD} CA Setup In ubuntu ip1=${ip1} + Prepare Test Tools Log To Console Start Docker Daemon Locally ... Run Keyword Start Docker Daemon Locally Log To Console Start Containerd Daemon Locally ... Run Keyword Start Containerd Daemon Locally + Prepare Helm Plugin + Run Keyword If '${DOCKER_USER}' != '${EMPTY}' Docker Login "" ${DOCKER_USER} ${DOCKER_PWD} -CA Setup For Nightly - [Arguments] ${ip} ${HARBOR_PASSWORD} ${cert}=/ca/ca.crt - Run cp ${cert} harbor_ca.crt - Generate Certificate Authority For Chrome ${HARBOR_PASSWORD} - Prepare Docker Cert For Nightly ${ip} - Prepare Helm Cert +CA Setup In ubuntu + [Arguments] ${ip} ${HARBOR_PASSWORD} ${cert} + Prepare Docker Cert In Ubuntu ${ip} ${cert} + #Generate Certificate Authority For Chrome ${HARBOR_PASSWORD} + +CA Setup In Photon + [Arguments] ${ip} ${HARBOR_PASSWORD} ${cert} + Prepare Docker Cert In Photon ${ip} ${cert} Collect Nightly Logs [Arguments] ${ip} ${SSH_PWD} ${ip1}==${EMPTY} @@ -81,4 +86,4 @@ Collect Logs SSHLibrary.Get File /var/log/harbor/chartmuseum.log SSHLibrary.Get File /var/log/harbor/registryctl.log Run rename 's/^/${ip}/' *.log - Close All Connections \ No newline at end of file + Close All Connections diff --git a/tests/resources/SeleniumUtil.robot b/tests/resources/SeleniumUtil.robot index 0ab7f7a9c..2615b3a35 100644 --- a/tests/resources/SeleniumUtil.robot +++ b/tests/resources/SeleniumUtil.robot @@ -46,4 +46,4 @@ Init Chrome Driver END Run Keyword If '${out[0]}'=='FAIL' Capture Page Screenshot Should Be Equal As Strings '${out[0]}' 'PASS' - Sleep 5 + Sleep 5 \ No newline at end of file diff --git a/tests/resources/TestCaseBody.robot b/tests/resources/TestCaseBody.robot index cc2b14a23..3bd2c05e7 100644 --- a/tests/resources/TestCaseBody.robot +++ b/tests/resources/TestCaseBody.robot @@ -362,7 +362,7 @@ Body Of Replication Of Push Images to Registry Triggered By Event Executions Result Count Should Be Succeeded event_based 2 Body Of Replication Of Pull Images from Registry To Self - [Arguments] ${provider} ${endpoint} ${username} ${pwd} ${src_project_name} ${des_project_name} @{target_images} + [Arguments] ${provider} ${endpoint} ${username} ${pwd} ${src_project_name} ${des_project_name} ${verify_verbose} @{target_images} Init Chrome Driver ${d}= Get Current Date result_format=%m%s ${_des_pro_name}= Set Variable If '${des_project_name}'=='${null}' project${d} ${des_project_name} @@ -372,10 +372,30 @@ Body Of Replication Of Pull Images from Registry To Self 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} pull ${src_project_name} image e${d} ${_des_pro_name} + Create A Rule With Existing Endpoint rule${d} pull ${src_project_name} all e${d} ${_des_pro_name} Select Rule And Replicate rule${d} - FOR ${item} IN @{target_images} - Log To Console Check image replicated to Project ${_des_pro_name} ${item} - Image Should Be Replicated To Project ${_des_pro_name} ${item} times=2 - END + Run Keyword If '${verify_verbose}'=='Y' Verify Artifact Display Verbose ${_des_pro_name} @{target_images} + ... ELSE Verify Artifact Display ${_des_pro_name} @{target_images} Close Browser + +Verify Artifact Display Verbose + [Arguments] ${pro_name} @{target_images} + FOR ${item} IN @{target_images} + ${item}= Get Substring ${item} 1 -1 + ${item}= Evaluate ${item} + ${image}= Get From Dictionary ${item} image + ${tag}= Get From Dictionary ${item} tag + ${total_artifact_count}= Get From Dictionary ${item} total_artifact_count + ${archive_count}= Get From Dictionary ${item} archive_count + Log To Console Check image ${image}:${tag} replication to Project ${pro_name} + Image Should Be Replicated To Project ${pro_name} ${image} tag=${tag} total_artifact_count=${total_artifact_count} archive_count=${archive_count} times=2 + END + +Verify Artifact Display + [Arguments] ${pro_name} @{target_images} + FOR ${item} IN @{target_images} + ${item}= Get Substring ${item} 1 -1 + ${item}= Evaluate ${item} + ${image}= Get From Dictionary ${item} image + Image Should Be Replicated To Project ${pro_name} ${image} times=2 + END \ No newline at end of file diff --git a/tests/robot-cases/Group0-Util/docker_push_manifest_list.sh b/tests/robot-cases/Group0-Util/docker_push_manifest_list.sh index 55edafe12..26a7f683b 100755 --- a/tests/robot-cases/Group0-Util/docker_push_manifest_list.sh +++ b/tests/robot-cases/Group0-Util/docker_push_manifest_list.sh @@ -15,9 +15,9 @@ docker login $IP -u $USER -p $PWD cat /$HOME/.docker/config.json if [ $(cat /$HOME/.docker/config.json |grep experimental |wc -l) -eq 0 ];then - sudo sed -i '$d' /$HOME/.docker/config.json - sudo sed -i '$d' /$HOME/.docker/config.json - sudo echo -e "},\n \"experimental\": \"enabled\"\n}" >> /$HOME/.docker/config.json + sed -i '$d' /$HOME/.docker/config.json + sed -i '$d' /$HOME/.docker/config.json + echo -e "},\n \"experimental\": \"enabled\"\n}" >> /$HOME/.docker/config.json fi cat /$HOME/.docker/config.json diff --git a/tests/robot-cases/Group0-Util/notary-remove-image-signature.expect b/tests/robot-cases/Group0-Util/notary-remove-image-signature.expect deleted file mode 100755 index 7ee0a30fa..000000000 --- a/tests/robot-cases/Group0-Util/notary-remove-image-signature.expect +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env expect - -set HOST [lindex $argv 0] -set PROJECT [lindex $argv 1] -set IMAGE [lindex $argv 2] -set notaryServerEndpoint [lindex $argv 3] -set timeout 30 - -spawn notary -s https://$notaryServerEndpoint --tlscacert /notary_ca.crt -d /root/.docker/trust remove -p $HOST/$PROJECT/$IMAGE latest - -expect { - "Enter username:" {send "admin\r";exp_continue} - "Enter password:" {send "Harbor12345\r";exp_continue} - "Enter passphrase for targets key with ID*" {send "Harbor12345\r"} - timeout {exit 1} -} -expect eof -exit 0 - diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 90f7150b8..ae330fb48 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -15,6 +15,9 @@ *** Settings *** Documentation Harbor BATs +Library ../../apitests/python/testutils.py +Library ../../apitests/python/library/oras.py +Library ../../apitests/python/library/singularity.py Resource ../../resources/Util.robot Default Tags Nightly @@ -25,12 +28,55 @@ ${HARBOR_ADMIN} admin *** Test Cases *** Test Case - Sign With Admin + [tags] admin Init Chrome Driver Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} Close Browser +Test Case - Push ORAS and Display + [Tags] push_oras + Init Chrome Driver + ${d}= Get Current Date result_format=%m%s + + Sign In Harbor ${HARBOR_URL} user010 Test1@34 + Create An New Project And Go Into Project test${d} + + ${repo_name}= Set Variable hello-oras-artifact + ${tag}= Set Variable 1.0.0 + Retry Keyword N Times When Error 5 Oras Push ${ip} user010 Test1@34 test${d} ${repo_name} ${tag} + + Go Into Project test${d} + Wait Until Page Contains test${d}/${repo_name} + + Go Into Repo test${d}/${repo_name} + Wait Until Page Contains ${tag} + Close Browser + +# Test Case - Push SIF and Display +# [Tags] push_sif +# Init Chrome Driver +# ${d}= Get Current Date result_format=%m%s +# ${user}= Set Variable user010 +# ${pwd}= Set Variable Test1@34 + +# Sign In Harbor ${HARBOR_URL} ${user} ${pwd} +# Create An New Project And Go Into Project test${d} + +# Clean All Local Images + +# ${repo_name}= Set Variable busybox +# ${tag}= Set Variable 1.28 +# Retry Keyword N Times When Error 5 Push Singularity To Harbor library: library/default/ ${ip} ${user} ${pwd} test${d} ${repo_name} ${tag} + +# Go Into Project test${d} +# Wait Until Page Contains test${d}/${repo_name} + +# Go Into Repo test${d}/${repo_name} +# Wait Until Page Contains ${tag} +# Close Browser + Test Case - Push CNAB Bundle and Display - [Tags] run-once + [Tags] push_cnab Init Chrome Driver ${d}= Get Current Date result_format=%m%s @@ -48,7 +94,7 @@ Test Case - Push CNAB Bundle and Display Go Into Project test${d} Wait Until Page Contains test${d}/cnab${d} Go Into Repo test${d}/cnab${d} - Go Into Index And Contain Artifacts cnab_tag${d} limit=3 + Go Into Index And Contain Artifacts cnab_tag${d} total_artifact_count=3 archive_count=2 Close Browser Test Case - Create An New Project @@ -229,17 +275,18 @@ Test Case - User View Logs ${d}= Get Current Date result_format=%m%s ${img}= Set Variable kong ${tag}= Set Variable latest - ${replication_image}= Set Variable for_log_view - ${replication_tag}= Set Variable base - @{target_images}= Create List ${replication_image} ${user}= Set Variable user002 ${pwd}= Set Variable Test1@34 + &{image_with_tag}= Create Dictionary image=for_log_view tag=base + ${replication_image}= Get From Dictionary ${image_with_tag} image + ${replication_tag}= Get From Dictionary ${image_with_tag} tag + @{target_images}= Create List '&{image_with_tag}' Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Create An New Project And Go Into Project project${d} Logout Harbor - Body Of Replication Of Pull Images from Registry To Self harbor https://cicd.harbor.vmwarecna.net ${null} ${null} nightly/${replication_image} project${d} @{target_images} + Body Of Replication Of Pull Images from Registry To Self harbor https://cicd.harbor.vmwarecna.net ${null} ${null} nightly/${replication_image} project${d} N @{target_images} Push image ${ip} ${user} ${pwd} project${d} ${img}:${tag} Pull image ${ip} ${user} ${pwd} project${d} ${replication_image}:${replication_tag} @@ -653,7 +700,7 @@ Test Case - Push Docker Manifest Index and Display Go Into Project test${d} Wait Until Page Contains test${d}/index${d} Go Into Repo test${d}/index${d} - Go Into Index And Contain Artifacts index_tag${d} limit=2 + Go Into Index And Contain Artifacts index_tag${d} total_artifact_count=2 Close Browser Test Case - Push Helm Chart and Display diff --git a/tests/robot-cases/Group1-Nightly/Replication.robot b/tests/robot-cases/Group1-Nightly/Replication.robot index 89b1d6cdb..b102ab404 100644 --- a/tests/robot-cases/Group1-Nightly/Replication.robot +++ b/tests/robot-cases/Group1-Nightly/Replication.robot @@ -150,7 +150,14 @@ Test Case - Replication Rule Delete Test Case - Replication Of Pull Images from DockerHub To Self @{target_images}= Create List mariadb centos - Body Of Replication Of Pull Images from Registry To Self docker-hub https://hub.docker.com/ ${DOCKER_USER} ${DOCKER_PWD} ${DOCKER_USER}/{cent*,mariadb} ${null} @{target_images} + &{image1_with_tag}= Create Dictionary image=centos tag=1.0 + &{image2_with_tag}= Create Dictionary image=mariadb tag=latest + ${image1}= Get From Dictionary ${image1_with_tag} image + ${image1}= Get Substring ${image1} 0 -2 + Log All image1:${image1} + ${image2}= Get From Dictionary ${image2_with_tag} image + @{target_images}= Create List '&{image1_with_tag}' '&{image2_with_tag}' + Body Of Replication Of Pull Images from Registry To Self docker-hub https://hub.docker.com/ ${DOCKER_USER} ${DOCKER_PWD} ${DOCKER_USER}/{${image1}*,${image2}} ${null} N @{target_images} Test Case - Replication Of Push Images from Self To Harbor Init Chrome Driver @@ -280,8 +287,22 @@ 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 Test Case - Replication Of Pull Images from Gitlab To Self - @{target_images}= Create List photon alpine - Body Of Replication Of Pull Images from Registry To Self gitlab https://registry.gitlab.com ${gitlab_id} ${gitlab_key} dannylunsa/test_replication/{photon,alpine} ${null} @{target_images} + &{image1_with_tag}= Create Dictionary image=photon tag=1.0 + &{image2_with_tag}= Create Dictionary image=alpine tag=latest + ${image1}= Get From Dictionary ${image1_with_tag} image + ${image2}= Get From Dictionary ${image2_with_tag} image + @{target_images}= Create List '&{image1_with_tag}' '&{image2_with_tag}' + Body Of Replication Of Pull Images from Registry To Self gitlab https://registry.gitlab.com ${gitlab_id} ${gitlab_key} dannylunsa/test_replication/{${image1},${image2}} ${null} N @{target_images} Test Case - Replication Of Push Images to Gitlab Triggered By Event Body Of Replication Of Push Images to Registry Triggered By Event gitlab https://registry.gitlab.com ${gitlab_id} ${gitlab_key} dannylunsa/test_replication + +Test Case - Replication Of Pull Manifest List and CNAB from Harbor To Self + &{image1_with_tag}= Create Dictionary image=busybox tag=1.32.0 total_artifact_count=9 archive_count=0 + &{image2_with_tag}= Create Dictionary image=index101603308079 tag=index_tag101603308079 total_artifact_count=2 archive_count=0 + &{image3_with_tag}= Create Dictionary image=cnab011609785126 tag=cnab_tag011609785126 total_artifact_count=3 archive_count=2 + ${image1}= Get From Dictionary ${image1_with_tag} image + ${image2}= Get From Dictionary ${image2_with_tag} image + ${image3}= Get From Dictionary ${image3_with_tag} image + @{target_images}= Create List '&{image1_with_tag}' '&{image2_with_tag}' '&{image3_with_tag}' + Body Of Replication Of Pull Images from Registry To Self harbor https://cicd.harbor.vmwarecna.net admin qA5ZgV nightly/{${image1},${image2},${image3}} ${null} Y @{target_images} diff --git a/tests/robot-cases/Group1-Nightly/Schedule.robot b/tests/robot-cases/Group1-Nightly/Schedule.robot index a9f72ea00..3645f5405 100644 --- a/tests/robot-cases/Group1-Nightly/Schedule.robot +++ b/tests/robot-cases/Group1-Nightly/Schedule.robot @@ -58,7 +58,7 @@ Test Case - Proxy Cache Go Into Project project${d} ${repo_out}= Run Keyword And Ignore Error Go Into Repo project${d}/${user_namespace}/${manifest_index} Continue For Loop If '${repo_out[0]}'=='FAIL' - ${artifact_out}= Run Keyword And Ignore Error Go Into Index And Contain Artifacts ${manifest_tag} limit=1 + ${artifact_out}= Run Keyword And Ignore Error Go Into Index And Contain Artifacts ${manifest_tag} total_artifact_count=1 Exit For Loop If '${artifact_out[0]}'=='PASS' END Should Be Equal As Strings '${artifact_out[0]}' 'PASS' diff --git a/tests/robot-cases/Group1-Nightly/Setup.robot b/tests/robot-cases/Group1-Nightly/Setup.robot index c98f6c130..48dc32724 100644 --- a/tests/robot-cases/Group1-Nightly/Setup.robot +++ b/tests/robot-cases/Group1-Nightly/Setup.robot @@ -1,28 +1,28 @@ -// 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 Harbor BATs -Resource ../../resources/Util.robot -Default Tags Nightly - -*** Test Cases *** -Test Suites Setup - [Tags] setup - Nightly Test Setup ${ip} ${HARBOR_PASSWORD} ${ip1} - Setup API Test - -Test Case - Get Harbor Version -#Just get harbor version and log it +// 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 Harbor BATs +Resource ../../resources/Util.robot +Default Tags Nightly + +*** Test Cases *** +Test Suites Setup + [Tags] setup + Nightly Test Setup In Photon ${ip} ${HARBOR_PASSWORD} ${ip1} + Setup API Test + +Test Case - Get Harbor Version +#Just get harbor version and log it Get Harbor Version \ No newline at end of file diff --git a/tests/robot-cases/Group1-Nightly/Setup_Nightly.robot b/tests/robot-cases/Group1-Nightly/Setup_Nightly.robot index 665a61e31..946ef5379 100644 --- a/tests/robot-cases/Group1-Nightly/Setup_Nightly.robot +++ b/tests/robot-cases/Group1-Nightly/Setup_Nightly.robot @@ -19,9 +19,10 @@ Default Tags Nightly *** Test Cases *** Test Suites Setup For UI Test - Nightly Test Setup For Nightly ${ip} ${HARBOR_PASSWORD} ${ip1} + [Tags] setup + Nightly Test Setup In Ubuntu ${ip} ${HARBOR_PASSWORD} ${ip1} Setup API Test Test Case - Get Harbor Version #Just get harbor version and log it - Get Harbor Version \ No newline at end of file + Get Harbor Version diff --git a/tests/robot-cases/Group3-Upgrade/run.sh b/tests/robot-cases/Group3-Upgrade/run.sh index 7b1127a2a..f3b6e5bc8 100755 --- a/tests/robot-cases/Group3-Upgrade/run.sh +++ b/tests/robot-cases/Group3-Upgrade/run.sh @@ -4,6 +4,6 @@ HARBOR_VERSION=$2 DOCKER_USER=$3 DOCKER_PWD=$4 -robot -v ip:$IP -v ip1: -v HARBOR_PASSWORD:Harbor12345 -v DOCKER_USER:$DOCKER_USER -v DOCKER_PWD:$DOCKER_PWD /drone/tests/robot-cases/Group1-Nightly/Setup.robot +robot -v ip:$IP -v ip1: -v HARBOR_PASSWORD:Harbor12345 -v DOCKER_USER:$DOCKER_USER -v DOCKER_PWD:$DOCKER_PWD -v http_get_ca:true /drone/tests/robot-cases/Group1-Nightly/Setup.robot cd /drone/tests/robot-cases/Group3-Upgrade DOCKER_USER=$DOCKER_USER DOCKER_PWD=$DOCKER_PWD python ./prepare.py -e $IP -v $HARBOR_VERSION -l /drone/tests/apitests/python/