From 2b36a6ba64de37fb6908d94d88854872a3bcb027 Mon Sep 17 00:00:00 2001 From: Yang Jiao <72076317+YangJiao0817@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:18:18 +0800 Subject: [PATCH] [cherry-pick] Remove singularity testcase (#17666) Singularity has been renamed to Apptainer Signed-off-by: Yang Jiao --- .../python/test_push_sif_by_singularity.py | 72 ------------------- tests/robot-cases/Group0-BAT/API_DB.robot | 4 -- 2 files changed, 76 deletions(-) delete mode 100644 tests/apitests/python/test_push_sif_by_singularity.py diff --git a/tests/apitests/python/test_push_sif_by_singularity.py b/tests/apitests/python/test_push_sif_by_singularity.py deleted file mode 100644 index 1be1eda79..000000000 --- a/tests/apitests/python/test_push_sif_by_singularity.py +++ /dev/null @@ -1,72 +0,0 @@ -from __future__ import absolute_import -import unittest -import urllib - -from testutils import ADMIN_CLIENT, suppress_urllib3_warning -from testutils import harbor_server -from testutils import TEARDOWN -import library.singularity -from library.sign import sign_image -from library.user import User -from library.project import Project -from library.repository import Repository -from library.artifact import Artifact - - -class TestProjects(unittest.TestCase): - @suppress_urllib3_warning - def setUp(self): - self.project = Project() - self.user = User() - self.artifact = Artifact() - self.repo = Repository() - self.repo_name = "busybox" - self.tag = "1.28" - - @unittest.skipIf(TEARDOWN == False, "Test data won't be erased.") - def tearDown(self): - #1. Delete user(UA); - self.user.delete_user(TestProjects.user_sign_image_id, **ADMIN_CLIENT) - - def testPushSingularity(self): - """ - Test case: - Push Singularity file With Singularity CLI - Test step and expected result: - 1. Create user-001 - 2. Create a new private project(PA) by user(UA); - 3. Push a sif file to harbor by singularity; - 4. Get repository from Harbor successfully, and verfiy repository name is repo pushed by singularity CLI; - 5. Get and verify artifacts by tag; - 6. Pull sif file from harbor by singularity; - Tear down: - NA - """ - url = ADMIN_CLIENT["endpoint"] - user_001_password = "Aa123456" - - #1. Create user-001 - TestProjects.user_sign_image_id, user_name = self.user.create_user(user_password = user_001_password, **ADMIN_CLIENT) - - TestProjects.USER_CLIENT=dict(with_signature = True, endpoint = url, username = user_name, password = user_001_password) - - #2. Create a new private project(PA) by user(UA); - TestProjects.project_id, TestProjects.project_name = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_CLIENT) - - #3. Push a sif file to harbor by singularity; - library.singularity.push_singularity_to_harbor("library:", "library/default/", harbor_server, user_name, user_001_password, TestProjects.project_name, self.repo_name, self.tag) - - - #4. Get repository from Harbor successfully, and verfiy repository name is repo pushed by singularity CLI; - repo_data = self.repo.get_repository(TestProjects.project_name, self.repo_name, **TestProjects.USER_CLIENT) - self.assertEqual(repo_data.name, TestProjects.project_name + "/" + self.repo_name) - - #5. Get and verify artifacts by tag; - artifact = self.artifact.get_reference_info(TestProjects.project_name, self.repo_name, self.tag, **TestProjects.USER_CLIENT) - self.assertEqual(artifact.tags[0].name, self.tag) - - #6. Pull sif file from harbor by singularity; - library.singularity.singularity_pull(TestProjects.project_name + ".sif", "oras://"+harbor_server + "/" + TestProjects.project_name + "/" + self.repo_name+":"+ self.tag) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/robot-cases/Group0-BAT/API_DB.robot b/tests/robot-cases/Group0-BAT/API_DB.robot index 47bc3c91e..23ad9ccea 100644 --- a/tests/robot-cases/Group0-BAT/API_DB.robot +++ b/tests/robot-cases/Group0-BAT/API_DB.robot @@ -141,10 +141,6 @@ Test Case - Push Artifact With ORAS CLI [Tags] oras Harbor API Test ./tests/apitests/python/test_push_files_by_oras.py -Test Case - Push Singularity file With Singularity CLI - [Tags] singularity - Harbor API Test ./tests/apitests/python/test_push_sif_by_singularity.py - Test Case - Push Chart File To Chart Repository By Helm V2 With Robot Account [Tags] helm2 Harbor API Test ./tests/apitests/python/test_push_chart_by_helm2_helm3_with_robot_Account.py