Skip to contentSkip to conversation

tests/acceptance: Fix the m68k/q800 Linux test

PATCH In review Philippe Mathieu-Daudé 3 participants 8 messages Nov 26, 2019 – Dec 6, 2019

lore
Share & tools
lore
#0 lore raw

v2 cover tests/acceptance: Fix the m68k/q800 Linux test

Today someone (William/Beraldo?) complained this test was still failing while fetching the asset. This test already handle the OSError exception, maybe we are missing another one.

Regardless, it is easier to refresh my previous patch which use a stable link, so the problem should be fixed.

It seems cleaner to add the 2nd patch after the 1st one, but we don't need it for 4.2, so it can wait 5.0 (and I'll update its description to refer to the 1st patch sha1).

William/Beraldo, can you test this please?

Thanks!

Phil.

v1: https://www.mail-archive.com/[email protected]/msg656892.html

Philippe Mathieu-Daudé (2):
tests/boot_linux_console: Fetch assets from Debian snapshot archives Revert "Acceptance test: cancel test if m68k kernel packages goes
missing"

 tests/acceptance/boot_linux_console.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/2 tests/boot_linux_console: Fetch assets from Debian snapshot archives

The kernel packaged was fetched from an unstable repository. Use the stable snapshot archive instead.

---
v2:
- Rebased
- Dropped Alex's Tested-by tag, since commit 2ecde8b2fb got merged since and it changed the tested kernel version.

---
 tests/acceptance/boot_linux_console.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/acceptance/boot_linux_console.py +2 -1
index 7e41cebd47..752f776f68 100644
@@ -479,7 +479,8 @@ class BootLinuxConsole(Test):
         :avocado: tags=arch:m68k
         :avocado: tags=machine:q800
         """
-        deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main'
+        deb_url = ('https://snapshot.debian.org/archive/debian-ports'
+                   '/20191021T083923Z/pool-m68k/main'
                    '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
         deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
         try:
Signature · 1 line
2.21.0
Tested-by on v2 1/2
#2 lore raw

Re: [PATCH-for-4.2? v2 1/2] tests/boot_linux_console: Fetch assets from Debian snapshot archives

Quoted 20 lines · Philippe Mathieu-Daudé

The kernel packaged was fetched from an unstable repository. Use the stable snapshot archive instead.

---
v2:
- Rebased
- Dropped Alex's Tested-by tag, since commit 2ecde8b2fb got merged since and it changed the tested kernel version.

---
 tests/acceptance/boot_linux_console.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/acceptance/boot_linux_console.py +0 -0
index 7e41cebd47..752f776f68 100644

tests/acceptance/boot_linux_console.py class BootLinuxConsole(Test): · line 486

Quoted 9 lines
tests/acceptance/boot_linux_console.py +2 -1
@@ -479,7 +479,8 @@ class BootLinuxConsole(Test):
         :avocado: tags=arch:m68k
         :avocado: tags=machine:q800
         """
-        deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main'
+        deb_url = ('https://snapshot.debian.org/archive/debian-ports'
+                   '/20191021T083923Z/pool-m68k/main'
                    '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
         deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
         try:

The code was tested and works as expected.

---
Willian

#3 lore raw

Re: [PATCH-for-4.2? v2 1/2] tests/boot_linux_console: Fetch assets from Debian snapshot archives

In reply to Philippe Mathieu-Daudé
Quoted 31 lines · Philippe Mathieu-Daudé

The kernel packaged was fetched from an unstable repository. Use the stable snapshot archive instead.

---
v2:
- Rebased
- Dropped Alex's Tested-by tag, since commit 2ecde8b2fb got merged since and it changed the tested kernel version.

---
 tests/acceptance/boot_linux_console.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/acceptance/boot_linux_console.py +2 -1
index 7e41cebd47..752f776f68 100644
@@ -479,7 +479,8 @@ class BootLinuxConsole(Test):
         :avocado: tags=arch:m68k
         :avocado: tags=machine:q800
         """
-        deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main'
+        deb_url = ('https://snapshot.debian.org/archive/debian-ports'
+                   '/20191021T083923Z/pool-m68k/main'
                    '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
         deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
         try:
Signature · 1 line
2.21.0

Works great, sorry for not picking it up earlier. Now with rc-4, I'll check with Peter if we can still have this on 4.2 and send a PR.

Thanks!
- Cleber.

#4 lore raw

Re: [PATCH-for-4.2? v2 1/2] tests/boot_linux_console: Fetch assets from Debian snapshot archives

Quoted 27 lines · Cleber Rosa
Quoted 26 lines · Philippe Mathieu-Daudé

The kernel packaged was fetched from an unstable repository. Use the stable snapshot archive instead.

---
v2:
- Rebased
- Dropped Alex's Tested-by tag, since commit 2ecde8b2fb got merged since and it changed the tested kernel version.

---
 tests/acceptance/boot_linux_console.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/acceptance/boot_linux_console.py +2 -1
index 7e41cebd47..752f776f68 100644
@@ -479,7 +479,8 @@ class BootLinuxConsole(Test):
         :avocado: tags=arch:m68k
         :avocado: tags=machine:q800
         """
-        deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main'
+        deb_url = ('https://snapshot.debian.org/archive/debian-ports'
+                   '/20191021T083923Z/pool-m68k/main'
                    '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
Quoted 8 lines
Quoted 5 lines
tests/acceptance/boot_linux_console.py +0 -1
         deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
         try:
--

2.21.0

Works great, sorry for not picking it up earlier. Now with rc-4, I'll check with Peter if we can still have this on 4.2 and send a PR.

Nobody complained and this is not a critical bugfix, so I'd now defer it, to not delay 5.0 any longer.

Quoted 2 lines

Thanks!
- Cleber.

#5 lore raw

PATCH v2 2/2 Revert "Acceptance test: cancel test if m68k kernel packages goes missing"

In reply to Philippe Mathieu-Daudé

Now than we use the stable snapshot archive, we can remove this check.

This reverts commit d2499aca4bac613d837e2720e7bbe3378bc91245.

---
 tests/acceptance/boot_linux_console.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
tests/acceptance/boot_linux_console.py +1 -4
index 752f776f68..ab4c8a5e5a 100644
@@ -483,10 +483,7 @@ class BootLinuxConsole(Test):
                    '/20191021T083923Z/pool-m68k/main'
                    '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
         deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
-        try:
-            deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
-        except OSError as exp:
-            self.cancel(exp)
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
                                             '/boot/vmlinux-5.3.0-1-m68k')
 
Signature · 1 line
2.21.0
Tested-by on v2 2/2
#6 lore raw

Re: [PATCH-for-5.0? v2 2/2] Revert "Acceptance test: cancel test if m68k kernel packages goes missing"

Quoted 16 lines · Philippe Mathieu-Daudé

Now than we use the stable snapshot archive, we can remove this check.

This reverts commit d2499aca4bac613d837e2720e7bbe3378bc91245.

---
 tests/acceptance/boot_linux_console.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
tests/acceptance/boot_linux_console.py +0 -0
index 752f776f68..ab4c8a5e5a 100644
@@ -483,10 +483,7 @@ class BootLinuxConsole(Test):
                    '/20191021T083923Z/pool-m68k/main'

tests/acceptance/boot_linux_console.py class BootLinuxConsole(Test): · line 489

Quoted 10 lines
tests/acceptance/boot_linux_console.py +1 -4
                    '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
         deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
-        try:
-            deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
-        except OSError as exp:
-            self.cancel(exp)
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
                                             '/boot/vmlinux-5.3.0-1-m68k')
 

Although I prefer to be on the safe side and keep the verification, the code works as expected.

---
Willian

#7 lore raw

Re: [PATCH-for-5.0? v2 2/2] Revert "Acceptance test: cancel test if m68k kernel packages goes missing"

Quoted 22 lines · Willian Rampazzo
Quoted 20 lines · Philippe Mathieu-Daudé

Now than we use the stable snapshot archive, we can remove this check.

This reverts commit d2499aca4bac613d837e2720e7bbe3378bc91245.

---
  tests/acceptance/boot_linux_console.py | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
tests/acceptance/boot_linux_console.py +0 -2
index 752f776f68..ab4c8a5e5a 100644
@@ -483,10 +483,7 @@ class BootLinuxConsole(Test):
                     '/20191021T083923Z/pool-m68k/main'
                     '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
          deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
-        try:
-            deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
Quoted 8 lines

tests/acceptance/boot_linux_console.py class BootLinuxConsole(Test): · line 489

Quoted 6 lines
tests/acceptance/boot_linux_console.py +1 -2
-        except OSError as exp:
-            self.cancel(exp)
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
          kernel_path = self.extract_from_deb(deb_path,
                                              '/boot/vmlinux-5.3.0-1-m68k')
 

Thanks for testing!

Quoted 2 lines

Although I prefer to be on the safe side and keep the verification, the code works as expected.

If we want to catch that kind of errors, we should do it consistently in all the tests.

I understand the recent 'avocado assets' command from release 73 properly fixes our problem, isn't it Cleber?

See https://avocado-framework.readthedocs.io/en/73.0/releases/73_0.html:

INSTRUMENTED tests using the avocado.core.test.Test.fetch_asset() can take advantage of plugins that will attempt to download (and cache) assets before the test execution. This should make the overall test execution more reliable, and give better test execution times as the download time will be excluded. Users can also manually execute the avocado assets command to manually fetch assets from tests.

I'm anxious about testing this new feature :)

Regards,

Phil.