diff mbox series

[v4,05/35] tests/avocado/avocado_qemu: Fix the "from" statements in linuxtest.py

Message ID 20240821082748.65853-6-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series Convert avocado tests to normal Python unittests | expand

Commit Message

Thomas Huth Aug. 21, 2024, 8:27 a.m. UTC
Without this change, the new Avocado v103 fails to find the tests
that are based on the LinuxTest class.

Suggested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/avocado/avocado_qemu/linuxtest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 21, 2024, 9:31 a.m. UTC | #1
On 21/8/24 10:27, Thomas Huth wrote:
> Without this change, the new Avocado v103 fails to find the tests
> that are based on the LinuxTest class.

Reorder before previous patch?

> Suggested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/avocado/avocado_qemu/linuxtest.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/avocado/avocado_qemu/linuxtest.py b/tests/avocado/avocado_qemu/linuxtest.py
> index e1dc838b1c..66fb9f1507 100644
> --- a/tests/avocado/avocado_qemu/linuxtest.py
> +++ b/tests/avocado/avocado_qemu/linuxtest.py
> @@ -13,8 +13,8 @@
>   
>   from avocado.utils import cloudinit, datadrainer, process, vmimage
>   
> -from . import LinuxSSHMixIn
> -from . import QemuSystemTest
> +from avocado_qemu import LinuxSSHMixIn
> +from avocado_qemu import QemuSystemTest
>   
>   if os.path.islink(os.path.dirname(os.path.dirname(__file__))):
>       # The link to the avocado tests dir in the source code directory
Thomas Huth Aug. 21, 2024, 10:07 a.m. UTC | #2
On 21/08/2024 11.31, Philippe Mathieu-Daudé wrote:
> On 21/8/24 10:27, Thomas Huth wrote:
>> Without this change, the new Avocado v103 fails to find the tests
>> that are based on the LinuxTest class.
> 
> Reorder before previous patch?

The funny thing is that Avocado v88 breaks the other way round if this patch 
gets applied first. So if you are worried about bisecting, we'd need to 
squash this into the patch that updates the version. OTOH, it's not a big 
breakage, just some tests are not run by the test runner, so I think it's ok 
to keep it separate.

  Thomas


>> Suggested-by: Cleber Rosa <crosa@redhat.com>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   tests/avocado/avocado_qemu/linuxtest.py | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/avocado/avocado_qemu/linuxtest.py 
>> b/tests/avocado/avocado_qemu/linuxtest.py
>> index e1dc838b1c..66fb9f1507 100644
>> --- a/tests/avocado/avocado_qemu/linuxtest.py
>> +++ b/tests/avocado/avocado_qemu/linuxtest.py
>> @@ -13,8 +13,8 @@
>>   from avocado.utils import cloudinit, datadrainer, process, vmimage
>> -from . import LinuxSSHMixIn
>> -from . import QemuSystemTest
>> +from avocado_qemu import LinuxSSHMixIn
>> +from avocado_qemu import QemuSystemTest
>>   if os.path.islink(os.path.dirname(os.path.dirname(__file__))):
>>       # The link to the avocado tests dir in the source code directory
>
Philippe Mathieu-Daudé Aug. 21, 2024, 10:18 a.m. UTC | #3
On 21/8/24 12:07, Thomas Huth wrote:
> On 21/08/2024 11.31, Philippe Mathieu-Daudé wrote:
>> On 21/8/24 10:27, Thomas Huth wrote:
>>> Without this change, the new Avocado v103 fails to find the tests
>>> that are based on the LinuxTest class.
>>
>> Reorder before previous patch?
> 
> The funny thing is that Avocado v88 breaks the other way round if this 
> patch gets applied first. So if you are worried about bisecting, we'd 
> need to squash this into the patch that updates the version. OTOH, it's 
> not a big breakage, just some tests are not run by the test runner, so I 
> think it's ok to keep it separate.

Argh OK, fine then!

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>

I'm not adding my R-b because I don't understand what is
wrong in the current code and the commit description is
a justification but not an explanation; but I don't mind.

> 
>   Thomas
> 
> 
>>> Suggested-by: Cleber Rosa <crosa@redhat.com>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>   tests/avocado/avocado_qemu/linuxtest.py | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tests/avocado/avocado_qemu/linuxtest.py 
>>> b/tests/avocado/avocado_qemu/linuxtest.py
>>> index e1dc838b1c..66fb9f1507 100644
>>> --- a/tests/avocado/avocado_qemu/linuxtest.py
>>> +++ b/tests/avocado/avocado_qemu/linuxtest.py
>>> @@ -13,8 +13,8 @@
>>>   from avocado.utils import cloudinit, datadrainer, process, vmimage
>>> -from . import LinuxSSHMixIn
>>> -from . import QemuSystemTest
>>> +from avocado_qemu import LinuxSSHMixIn
>>> +from avocado_qemu import QemuSystemTest
>>>   if os.path.islink(os.path.dirname(os.path.dirname(__file__))):
>>>       # The link to the avocado tests dir in the source code directory
>>
>
diff mbox series

Patch

diff --git a/tests/avocado/avocado_qemu/linuxtest.py b/tests/avocado/avocado_qemu/linuxtest.py
index e1dc838b1c..66fb9f1507 100644
--- a/tests/avocado/avocado_qemu/linuxtest.py
+++ b/tests/avocado/avocado_qemu/linuxtest.py
@@ -13,8 +13,8 @@ 
 
 from avocado.utils import cloudinit, datadrainer, process, vmimage
 
-from . import LinuxSSHMixIn
-from . import QemuSystemTest
+from avocado_qemu import LinuxSSHMixIn
+from avocado_qemu import QemuSystemTest
 
 if os.path.islink(os.path.dirname(os.path.dirname(__file__))):
     # The link to the avocado tests dir in the source code directory