Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Nov 8, 2024
1 parent 0936922 commit aad12f8
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/t04_mirror/CreateMirror34Test_gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Downloading: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release
Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release
Retrying 0 http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release...
Download Error: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release
Downloading: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/InRelease
ERROR: unable to fetch mirror: no architectures found, please specify
1 change: 1 addition & 0 deletions system/t04_mirror/CreateMirror34Test_mirror_show
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ERROR: unable to show: mirror with name mirror34 not found
7 changes: 7 additions & 0 deletions system/t04_mirror/CreateMirror35Test_gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Downloading & parsing package files...
Applying filter...
Packages filtered: 4743 -> 81.
Building download queue...
Download queue: 81 items (3.00 GiB)
ERROR: unable to update: download errors:

17 changes: 17 additions & 0 deletions system/t04_mirror/CreateMirror35Test_mirror_show
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Name: mirror35
Archive Root URL: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/
Distribution: ./
Components:
Architectures: amd64
Download Sources: no
Download .udebs: no
Filter: cuda-12-6 (= 12.6.2-1)
Filter With Deps: yes
Last update: never

Information from release file:
Acquire-By-Hash: no
Architecture: x86_64
Date: Mon, 04 Nov 2024 16:02:23 +0000
Label: NVIDIA CUDA
Origin: NVIDIA
32 changes: 32 additions & 0 deletions system/t04_mirror/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,3 +454,35 @@ class CreateMirror33Test(BaseTest):
def check(self):
self.check_output()
self.check_cmd_output("aptly mirror show mirror33", "mirror_show")


class CreateMirror34Test(BaseTest):
"""
create mirror error: flat repo with filter but no architectures in InRelease file
"""
configOverride = {"max-tries": 1}
runCmd = "aptly mirror create -ignore-signatures -filter \"cuda-12-6 (= 12.6.2-1)\" -filter-with-deps mirror34 http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ ./"


class CreateMirror35Test(BaseTest):
"""
create mirror: flat repo with filter but no architectures in InRelease file
"""
configOverride = {"max-tries": 1}
fixtureCmds = [
"aptly mirror create -architectures amd64 -ignore-signatures -filter \"cuda-12-6 (= 12.6.2-1)\" -filter-with-deps mirror35 "
"http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ ./",
]
runCmd = "aptly mirror update -ignore-signatures mirror35"

def outputMatchPrepare(self, s):
s = re.sub(r'Downloading: .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'Download Error: .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'Retrying .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'Error \(retrying\): .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'HTTP code 404 while fetching .*\n', '', s, flags=re.MULTILINE)
return s

def check(self):
self.check_output()
self.check_cmd_output("aptly mirror show mirror35", "mirror_show")

0 comments on commit aad12f8

Please sign in to comment.