Skip to content

Commit

Permalink
Remove chartmuseum test case
Browse files Browse the repository at this point in the history
Harbor deprecates chartmuseum as of v2.8.0
Epic: goharbor#17958
Discussion: goharbor#15057

Signed-off-by: Yang Jiao <jiaoya@vmware.com>
  • Loading branch information
Yang Jiao committed Feb 21, 2023
1 parent 99b3711 commit 2a0af23
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 488 deletions.
53 changes: 0 additions & 53 deletions tests/apitests/python/library/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,6 @@
import os
import base

def get_chart_file(file_name):
command = ["wget", file_name]
ret = base.run_command(command)
print("Command return: ", ret)
command = ["tar", "xvf", file_name.split('/')[-1]]
ret = base.run_command(command)
print("Command return: ", ret)

def helm_login(harbor_server, user, password):
os.putenv("HELM_EXPERIMENTAL_OCI", "1")
command = ["helm3", "registry", "login", harbor_server, "-u", user, "-p", password]
ret = base.run_command(command)
print("Command return: ", ret)

def helm_save(chart_archive, harbor_server, project, repo_name):
command = ["helm3", "chart","save", chart_archive, harbor_server+"/"+project+"/"+repo_name]
base.run_command(command)

def helm_push(harbor_server, project, repo_name, version):
command = ["helm3", "chart", "push", harbor_server+"/"+project+"/"+repo_name+":"+version]
ret = base.run_command(command)
return ret

def helm_chart_push_to_harbor(chart_file, archive, harbor_server, project, repo_name, version, user, password):
get_chart_file(chart_file)
helm_login(harbor_server, user, password)
helm_save(archive, harbor_server, project, repo_name)
return helm_push(harbor_server, project, repo_name, version)

def helm2_add_repo(helm_repo_name, harbor_url, project, username, password, expected_error_message = None):
command = ["helm2", "repo", "add", "--username=" + username, "--password=" + password, helm_repo_name, harbor_url + "/chartrepo/" + project]
ret = base.run_command(command, expected_error_message = expected_error_message)


def helm2_push(helm_repo_name, chart_file, project, username, password):
get_chart_file(chart_file)
command = ["helm2", "cm-push", "--username=" + username, "--password=" + password, chart_file.split('/')[-1], helm_repo_name]
base.run_command(command)

def helm2_repo_update():
command = ["helm2", "repo", "update"]
base.run_command(command)

def helm2_fetch_chart_file(helm_repo_name, harbor_url, project, username, password, chart_file, expected_add_repo_error_message = None):
helm2_add_repo(helm_repo_name, harbor_url, project, username, password, expected_error_message = expected_add_repo_error_message)
if expected_add_repo_error_message is not None:
return
helm2_repo_update()
command_ls = ["ls"]
base.run_command(command_ls)
command = ["helm2", "fetch", "{}/{}".format(helm_repo_name, chart_file)]
base.run_command(command)
base.run_command(command_ls)

def helm3_7_registry_login(ip, user, password):
command = ["helm3.7", "registry", "login", ip, "-u", user, "-p", password]
Expand Down

This file was deleted.

97 changes: 0 additions & 97 deletions tests/apitests/python/test_push_chart_by_helm3_chart_cli.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/apitests/python/test_robot_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from library.base import _assert_status_code
from library.scan import Scan
from library.label import Label
import library.helm
import base
import v2_swagger_client
class TestRobotAccount(unittest.TestCase):
Expand Down
5 changes: 5 additions & 0 deletions tests/resources/Harbor-Pages/Project-Artifact-Elements.robot
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ ${tag_name_xpath} xpath=//*[@id='name']
${add_ok_button} xpath=//*[@id='add-ok']
${delete_tag_button} xpath=//*[@id='delete-tag']
${dialog_delete_button} xpath=//clr-modal//button[contains(.,'DELETE')]

${harbor_helm_name} harbor-helm-1.7.3
${harbor_helm_filename} harbor-helm-1.7.3.tar.gz
${harbor_helm_version} 1.7.3
${harbor_helm_package} harbor-1.7.3.tgz
7 changes: 1 addition & 6 deletions tests/resources/Harbor-Pages/Robot_Account.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ Create A Random Permission Item List
... Pull Repository
... Delete Repository
... Delete Artifact
... Read Helm Chart
... Create Helm Chart Version
... Delete Helm Chart Version
... Create Helm Chart label
... Delete Helm Chart label
... Create Tag
... Delete Tag
... List Tag
Expand Down Expand Up @@ -142,4 +137,4 @@ Get Robot Account Info By File
${secret}= Set Variable ${json["secret"]}
${creation_time}= Set Variable ${json["creation_time"]}
${expires_at}= Set Variable ${json["expires_at"]}
[Return] ${id} ${name} ${secret} ${creation_time} ${expires_at}
[Return] ${id} ${name} ${secret} ${creation_time} ${expires_at}
7 changes: 1 addition & 6 deletions tests/resources/Helm-Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ Library OperatingSystem
Library Process

*** Keywords ***
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

Helm3.7 Registry Login
[Arguments] ${ip} ${user} ${password}
Wait Unitl Command Success helm3.7 registry login ${ip} -u ${user} -p ${password}
Expand All @@ -41,4 +36,4 @@ Helm3.7 Pull

Helm3.7 Registry Logout
[Arguments] ${ip}
Wait Unitl Command Success helm3.7 registry logout ${ip}
Wait Unitl Command Success helm3.7 registry logout ${ip}
4 changes: 0 additions & 4 deletions tests/resources/Nightly-Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,20 @@ Nightly Test Setup In Photon
Start Docker Daemon Locally
Log To Console Start Containerd Daemon Locally ...
Start Containerd Daemon Locally
Log To Console wget mariadb ...
Prepare Helm Plugin

Nightly Test Setup In Ubuntu
[Arguments] ${ip} ${HARBOR_PASSWORD} ${ip1}==${EMPTY}
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
Prepare Helm Plugin

Nightly Test Setup In Ubuntu For Upgrade
[Arguments] ${ip} ${HARBOR_PASSWORD} ${ip1}==${EMPTY}
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
Prepare Helm Plugin
#For upgrade pipeline: get notary targets key from last execution.
${rc} ${output}= Run And Return Rc And Output [ -f "/key_store/private_keys_backup.tar.gz" ] && tar -zxvf /key_store/private_keys_backup.tar.gz -C /

Expand Down
Loading

0 comments on commit 2a0af23

Please sign in to comment.