Merge ~seb128/utah:without-desktop-rename into utah:master
- Git
- lp:~seb128/utah
- without-desktop-rename
- Merge into master
Status: | Needs review |
---|---|
Proposed branch: | ~seb128/utah:without-desktop-rename |
Merge into: | utah:master |
Diff against target: |
175 lines (+57/-12) 2 files modified
utah/isotest/data/file_list_udi (+18/-0) utah/isotest/iso_static_validation.py (+39/-12) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UTAH Dev | Pending | ||
Review via email: mp+436867@code.launchpad.net |
Commit message
Alternative to https:/
Description of the change
Paride Legovini (paride) wrote : | # |
Thanks Heather! Unfortunately that still doesn't seem to be working with legacy images.
I prepared yet another version of the fix, hopefully covering all the cases of interest.
Here is the MP:
https:/
Heather Ellsworth (hellsworth) wrote : | # |
Ah dang, I only tested with the latest lunar desktop iso so my apologies for not catching the mistakes. I can go test MP 437355.
Sebastien Bacher (seb128) wrote : | # |
Thanks Heather, I've reviewed Paride's merge request but side notes there
1. indeed seems like a pytho3.11 fix which isn't really related to this changeset but needed
2. I think the suggested change isn't correct either because self.st_variant is used to build the iso name and 'desktop-legacy' is part of the name only in Lunar. Paride's variant of change doesn't have that issue though so we can probably consider it resolved if we merge his
3. seems like an improvement worth suggesting but that's an existing problem and not related to the new iso right?
perhaps you could do a merge request with the fix from 3.?
Paride Legovini (paride) wrote : | # |
I am not sure I understand when the 3. issue happens: I had a look at the code and looks like we *want* that directory to be a git repo? @Heather maybe it ended up somehow corrupted on your system?
Unmerged commits
- fb4596f... by Sebastien Bacher
-
Update the ISO tests for the new desktop installer
Preview Diff
1 | diff --git a/utah/isotest/data/file_list_udi b/utah/isotest/data/file_list_udi | |||
2 | 0 | new file mode 100644 | 0 | new file mode 100644 |
3 | index 0000000..926c5c3 | |||
4 | --- /dev/null | |||
5 | +++ b/utah/isotest/data/file_list_udi | |||
6 | @@ -0,0 +1,18 @@ | |||
7 | 1 | boot | ||
8 | 2 | casper | ||
9 | 3 | .disk | ||
10 | 4 | dists | ||
11 | 5 | EFI | ||
12 | 6 | install | ||
13 | 7 | md5sum.txt | ||
14 | 8 | pool | ||
15 | 9 | preseed | ||
16 | 10 | ubuntu | ||
17 | 11 | casper | ||
18 | 12 | casper/install-sources.yaml | ||
19 | 13 | casper/minimal.squashfs | ||
20 | 14 | casper/minimal.standard.squashfs | ||
21 | 15 | casper/vmlinuz | ||
22 | 16 | casper/initrd | ||
23 | 17 | casper/filesystem.manifest | ||
24 | 18 | casper/filesystem.size | ||
25 | diff --git a/utah/isotest/iso_static_validation.py b/utah/isotest/iso_static_validation.py | |||
26 | index 4480d33..9123813 100755 | |||
27 | --- a/utah/isotest/iso_static_validation.py | |||
28 | +++ b/utah/isotest/iso_static_validation.py | |||
29 | @@ -124,9 +124,16 @@ else: | |||
30 | 124 | st_variant = "legacy-server" | 124 | st_variant = "legacy-server" |
31 | 125 | st_arch = iso.arch | 125 | st_arch = iso.arch |
32 | 126 | 126 | ||
33 | 127 | # Checking the squashfs content to tell legacy vs desktop | ||
34 | 128 | if st_variant == "desktop" and st_release > "kinetic": | ||
35 | 129 | files = set(iso.listfiles(returnlist=True)) | ||
36 | 130 | if ('install/filesystem.squashfs' in files | ||
37 | 131 | or './install/filesystem.squashfs' in files): | ||
38 | 132 | st_variant = "desktop-legacy" | ||
39 | 127 | 133 | ||
40 | 128 | #Set a flag for ubiquity based images | 134 | #Set a flag for ubiquity based images |
42 | 129 | if st_variant == 'desktop' or st_variant == 'dvd': | 135 | if st_variant == 'desktop-legacy' or st_variant == 'dvd' or \ |
43 | 136 | (st_variant == 'desktop' and st_release < 'lunar'): | ||
44 | 130 | ubiquity_image = True | 137 | ubiquity_image = True |
45 | 131 | else: | 138 | else: |
46 | 132 | ubiquity_image = False | 139 | ubiquity_image = False |
47 | @@ -138,7 +145,7 @@ else: | |||
48 | 138 | subiquity_image = False | 145 | subiquity_image = False |
49 | 139 | 146 | ||
50 | 140 | #Set a flag for UEFI&SecureBoot | 147 | #Set a flag for UEFI&SecureBoot |
52 | 141 | if (st_variant in ('desktop', 'server', 'live-server', 'dvd') | 148 | if (st_variant in ('desktop', 'desktop-legacy', 'server', 'live-server', 'dvd') |
53 | 142 | and st_arch == 'amd64'): | 149 | and st_arch == 'amd64'): |
54 | 143 | uefi_image = True | 150 | uefi_image = True |
55 | 144 | else: | 151 | else: |
56 | @@ -169,6 +176,8 @@ class TestValidateISO(unittest.TestCase): | |||
57 | 169 | self.iso = ISO(image=self.iso_location, logger=logging) | 176 | self.iso = ISO(image=self.iso_location, logger=logging) |
58 | 170 | self.st_release = self.iso.series | 177 | self.st_release = self.iso.series |
59 | 171 | self.st_variant = self.iso.installtype | 178 | self.st_variant = self.iso.installtype |
60 | 179 | if self.st_variant == "desktop" and self.st_release > "kinetic": | ||
61 | 180 | self.st_variant = "desktop-legacy" | ||
62 | 172 | self.st_arch = self.iso.arch | 181 | self.st_arch = self.iso.arch |
63 | 173 | 182 | ||
64 | 174 | if self.st_variant == "server" and self.st_release == "focal": | 183 | if self.st_variant == "server" and self.st_release == "focal": |
65 | @@ -190,8 +199,10 @@ class TestValidateISO(unittest.TestCase): | |||
66 | 190 | else: | 199 | else: |
67 | 191 | self.url = DEFAULT_URL | 200 | self.url = DEFAULT_URL |
68 | 192 | 201 | ||
70 | 193 | if self.st_variant == 'desktop': | 202 | if self.st_variant =='desktop': |
71 | 194 | self.url = os.path.join(self.url, 'daily-live') | 203 | self.url = os.path.join(self.url, 'daily-live') |
72 | 204 | elif self.st_variant =='desktop-legacy': | ||
73 | 205 | self.url = os.path.join(self.url, 'daily-legacy') | ||
74 | 195 | elif self.st_variant == 'dvd': | 206 | elif self.st_variant == 'dvd': |
75 | 196 | self.url = os.path.join(self.url, 'dvd') | 207 | self.url = os.path.join(self.url, 'dvd') |
76 | 197 | elif self.st_variant == 'alternate': | 208 | elif self.st_variant == 'alternate': |
77 | @@ -295,8 +306,8 @@ class TestValidateISO(unittest.TestCase): | |||
78 | 295 | '{!r} not found in:\n{}' | 306 | '{!r} not found in:\n{}' |
79 | 296 | .format(fname, stdout)) | 307 | .format(fname, stdout)) |
80 | 297 | 308 | ||
83 | 298 | @unittest.skipUnless(ubiquity_image, | 309 | @unittest.skipUnless(ubiquity_image or st_variant == 'desktop', |
84 | 299 | "manifest only for ubiquity based images") | 310 | "manifest only for ubiquity and desktop images") |
85 | 300 | def test_manifest(self): | 311 | def test_manifest(self): |
86 | 301 | """Test if the ISO manifest matches the one in the server.""" | 312 | """Test if the ISO manifest matches the one in the server.""" |
87 | 302 | manifest_url = os.path.join( | 313 | manifest_url = os.path.join( |
88 | @@ -341,7 +352,7 @@ class TestValidateISO(unittest.TestCase): | |||
89 | 341 | logging.debug('Checking buildids are the same in iso and repo') | 352 | logging.debug('Checking buildids are the same in iso and repo') |
90 | 342 | self.assertIn(id_server, build_info_line) | 353 | self.assertIn(id_server, build_info_line) |
91 | 343 | 354 | ||
93 | 344 | @unittest.skipUnless(st_variant == 'desktop' and | 355 | @unittest.skipUnless(ubiquity_image == True and |
94 | 345 | st_arch != 'powerpc', | 356 | st_arch != 'powerpc', |
95 | 346 | "Skipping images that aren't ubiquity-based.") | 357 | "Skipping images that aren't ubiquity-based.") |
96 | 347 | @unittest.skipIf(st_release != 'trusty', "Skipping images without wubi.") | 358 | @unittest.skipIf(st_release != 'trusty', "Skipping images without wubi.") |
97 | @@ -358,8 +369,8 @@ class TestValidateISO(unittest.TestCase): | |||
98 | 358 | self.assertEqual(stderr, '') | 369 | self.assertEqual(stderr, '') |
99 | 359 | self.assertIn(" PE32 executable (GUI)", stdout) | 370 | self.assertIn(" PE32 executable (GUI)", stdout) |
100 | 360 | 371 | ||
103 | 361 | @unittest.skipUnless(st_variant == 'desktop' and | 372 | @unittest.skipUnless(ubiquity_image == True and |
104 | 362 | st_arch != 'powerpc', "Skipping for non desktop iso") | 373 | st_arch != 'powerpc', "Skipping for non desktop legacy iso") |
105 | 363 | def test_files_ubiquity(self): | 374 | def test_files_ubiquity(self): |
106 | 364 | """Test if the relevant files are present in the ISO for desktop.""" | 375 | """Test if the relevant files are present in the ISO for desktop.""" |
107 | 365 | (stdout, stderr) = self.iso.listfiles() | 376 | (stdout, stderr) = self.iso.listfiles() |
108 | @@ -376,9 +387,10 @@ class TestValidateISO(unittest.TestCase): | |||
109 | 376 | else: | 387 | else: |
110 | 377 | self.assertIn(path, stdout) | 388 | self.assertIn(path, stdout) |
111 | 378 | 389 | ||
113 | 379 | # Test is skipped for [s]ubiquity based images | 390 | # Test is skipped for [s]ubiquity based and desktop images |
114 | 380 | @unittest.skipIf(ubiquity_image, "Skipping for ubiquity images") | 391 | @unittest.skipIf(ubiquity_image, "Skipping for ubiquity images") |
115 | 381 | @unittest.skipIf(subiquity_image, "Skipping for subiquity images") | 392 | @unittest.skipIf(subiquity_image, "Skipping for subiquity images") |
116 | 393 | @unittest.skipIf(st_variant == 'desktop', "Skipping for desktop images") | ||
117 | 382 | def test_files_di(self): | 394 | def test_files_di(self): |
118 | 383 | """Test if the relevant files are present for d-i based images ISO. | 395 | """Test if the relevant files are present for d-i based images ISO. |
119 | 384 | 396 | ||
120 | @@ -429,6 +441,19 @@ class TestValidateISO(unittest.TestCase): | |||
121 | 429 | path = list_server.rstrip() | 441 | path = list_server.rstrip() |
122 | 430 | self.assertIn(path, stdout) | 442 | self.assertIn(path, stdout) |
123 | 431 | 443 | ||
124 | 444 | @unittest.skipUnless(st_variant == 'desktop' and not ubiquity_image, "Skipping for non desktop iso") | ||
125 | 445 | def test_files_udi(self): | ||
126 | 446 | """Test if the relevant files are present for u-d-i isos.""" | ||
127 | 447 | (stdout, stderr) = self.iso.listfiles() | ||
128 | 448 | logging.debug('Check for error in extracting file list from the iso') | ||
129 | 449 | self.assertEqual(stderr, '') | ||
130 | 450 | file_list_path = self.get_latest_file_list("file_list_udi") | ||
131 | 451 | file_list = open(file_list_path) | ||
132 | 452 | logging.debug('Check if relevant files are present in the iso') | ||
133 | 453 | for list_server in file_list: | ||
134 | 454 | path = list_server.rstrip() | ||
135 | 455 | self.assertIn(path, stdout) | ||
136 | 456 | |||
137 | 432 | @unittest.skipIf(st_arch in ['powerpc', 'ppc64el'], | 457 | @unittest.skipIf(st_arch in ['powerpc', 'ppc64el'], |
138 | 433 | "vmlinuz is not present only for powerpc images") | 458 | "vmlinuz is not present only for powerpc images") |
139 | 434 | def test_vmlinuz(self): | 459 | def test_vmlinuz(self): |
140 | @@ -456,7 +481,7 @@ class TestValidateISO(unittest.TestCase): | |||
141 | 456 | self.assertEqual(stderr, '') | 481 | self.assertEqual(stderr, '') |
142 | 457 | self.assertIn(kernel_string, stdout) | 482 | self.assertIn(kernel_string, stdout) |
143 | 458 | 483 | ||
145 | 459 | @unittest.skipUnless(ubiquity_image or | 484 | @unittest.skipUnless(ubiquity_image or st_variant == 'desktop' or |
146 | 460 | (st_variant == 'server' and st_release > 'precise'), | 485 | (st_variant == 'server' and st_release > 'precise'), |
147 | 461 | "Skipping for d-i images without squashfs.") | 486 | "Skipping for d-i images without squashfs.") |
148 | 462 | def test_filesystem_squashfs(self): | 487 | def test_filesystem_squashfs(self): |
149 | @@ -468,6 +493,8 @@ class TestValidateISO(unittest.TestCase): | |||
150 | 468 | logging.debug('Extracting the filesystem.squashfs') | 493 | logging.debug('Extracting the filesystem.squashfs') |
151 | 469 | if ubiquity_image: | 494 | if ubiquity_image: |
152 | 470 | squashfs_name = 'casper/filesystem.squashfs' | 495 | squashfs_name = 'casper/filesystem.squashfs' |
153 | 496 | elif st_variant == 'desktop': | ||
154 | 497 | squashfs_name = 'casper/minimal.squashfs' | ||
155 | 471 | else: | 498 | else: |
156 | 472 | squashfs_name = 'install/filesystem.squashfs' | 499 | squashfs_name = 'install/filesystem.squashfs' |
157 | 473 | 500 | ||
158 | @@ -484,7 +511,7 @@ class TestValidateISO(unittest.TestCase): | |||
159 | 484 | self.assertIn("Squashfs filesystem", stdout) | 511 | self.assertIn("Squashfs filesystem", stdout) |
160 | 485 | 512 | ||
161 | 486 | # Skipping vmlinuz image extraction on server images | 513 | # Skipping vmlinuz image extraction on server images |
163 | 487 | if not ubiquity_image: | 514 | if st_variant == 'server': |
164 | 488 | return | 515 | return |
165 | 489 | 516 | ||
166 | 490 | #unsquashfs extracts only in pwd | 517 | #unsquashfs extracts only in pwd |
167 | @@ -502,7 +529,7 @@ class TestValidateISO(unittest.TestCase): | |||
168 | 502 | 529 | ||
169 | 503 | logging.debug('Check that vmlinuz could be extracted') | 530 | logging.debug('Check that vmlinuz could be extracted') |
170 | 504 | self.assertEqual(stderr, '') | 531 | self.assertEqual(stderr, '') |
172 | 505 | self.assertIn("created 1 directories", stdout) | 532 | self.assertIn("created 1 directory", stdout) |
173 | 506 | 533 | ||
174 | 507 | @unittest.skipUnless(uefi_image, | 534 | @unittest.skipUnless(uefi_image, |
175 | 508 | "Test EFI files on ubuntu amd64 images") | 535 | "Test EFI files on ubuntu amd64 images") |
Thanks Seb for working on this! To support your work, I've tested this PR but a few changes were needed to make all of the tests pass. With the following changes, here is my local test log showing all passing tests: https:/ /pastebin. ubuntu. com/p/mW8xNfj3s v/
The only remaining strange thing is that all of the utah*.deb files are put in two places: just outside the root utah directory (as is usual), and then also inside the utah directory but it's not clear to me why they are duplicated. I've just been ignoring the debs inside the utah directory, when building/ installing/ testing.
Here are the test changes previously mentioned:
1) The change to test_run_ utah_tests. py fixes an issue in python 3.11 where 'U' is deprecated.
diff --git a/tests/ test_run_ utah_tests. py b/tests/ test_run_ utah_tests. py test_run_ utah_tests. py test_run_ utah_tests. py join(os. path.dirname( __file_ _), module( 'run_utah_ tests',
open( server_ script_ path),
server_ script_ path,
index 4c756b40..419c1e68 100644
--- a/tests/
+++ b/tests/
@@ -29,7 +29,7 @@ server_script_path = os.path.
server_script = imp.load_
- ('.py', 'U', 1))
+ ('.py', 'r', 1))
2) A change to iso_static_ validation. py to fix the cdimage url used for comparison. Without this change, pointing to a lunar desktop iso generates a file not found error (because self.st_variant was not getting set to equal st_variant): cdimage. ubuntu. com/daily- legacy/ pending/ lunar-desktop- amd64.manifest': HTTP Error 404: Not Found
ERROR: Failed to fetch URL 'http://
diff --git a/utah/ isotest/ iso_static_ validation. py b/utah/ isotest/ iso_static_ validation. py isotest/ iso_static_ validation. py isotest/ iso_static_ validation. py (unittest. TestCase) : self.iso_ location, logger=logging)
self. st_release = self.iso.series
self. st_variant = self.iso. installtype
self. st_variant = "desktop-legacy"
self. st_arch = self.iso.arch
index 9123813c..e220a7b9 100755
--- a/utah/
+++ b/utah/
@@ -176,7 +176,7 @@ class TestValidateISO
self.iso = ISO(image=
- if self.st_variant == "desktop" and self.st_release > "kinetic":
+ if self.st_variant == "desktop" and self.st_release < "lunar":
3) Another change to iso_static_ validation. py to remove the .git folder from the secure boot test before doing the sparse checkout, otherwise the test fails because the git checkout fails to reinitialize the git repo.
@@ -563,6 +563,9 @@ class TestValidateISO (unittest. TestCase) :
git_ keys.pull( ) join(repo_ dir, '.git') rmtree( keys_dot_ git)
git_ keys.sparse_ checkout( paths=[ keys_repo_ path]) Popen(cmd, stdout= subprocess. PIPE,
# so we just pull to ensure it is up to date
else:
+ # Remove .git folder before the sparse checkout
+ keys_dot_git = os.path.
+ shutil.
cmd = ["make", "-C", keys]
output = subprocess.