mbox series

[00/22] Acceptance Test: introduce base class for Linux based tests

Message ID 20210203172357.1422425-1-crosa@redhat.com (mailing list archive)
Headers show
Series Acceptance Test: introduce base class for Linux based tests | expand

Message

Cleber Rosa Feb. 3, 2021, 5:23 p.m. UTC
This introduces a base class for tests that need to interact with a
Linux guest.  It generalizes the "boot_linux.py" code, already been
used by the "virtiofs_submounts.py" and also SSH related code being
used by that and "linux_ssh_mips_malta.py".

While at it, a number of fixes on hopeful improvements to those tests
were added.

Cleber Rosa (22):
  tests/acceptance/boot_linux.py: fix typo on cloudinit error message
  tests/acceptance/boot_linux.py: rename misleading cloudinit method
  Acceptance Tests: remove unnecessary tag from documentation example
  tests/acceptance/virtiofs_submounts.py: use workdir property
  tests/acceptance/virtiofs_submounts.py: do not ask for ssh key
    password
  tests/acceptance/virtiofs_submounts.py: use a virtio-net device
    instead
  tests/acceptance/virtiofs_submounts.py: evaluate string not length
  tests/acceptance/virtiofs_submounts.py: standardize port as integer
  tests/acceptance/virtiofs_submounts.py: required space between IP and
    port
  Python: add utility function for retrieving port redirection
  tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer
  Acceptance tests: clarify ssh connection failure reason
  tests/acceptance/virtiofs_submounts.py: add missing accel tag
  Acceptance Tests: introduce LinuxTest base class
  Acceptance Tests: move useful ssh methods to base class
  Acceptance Tests: introduce method for requiring an accelerator
  Acceptance Tests: fix population of public key in cloudinit image
  Acceptance Tests: set up existing ssh keys by default
  Acceptance Tests: add port redirection for ssh by default
  Acceptance Tests: add basic documentation on LinuxTest base class
  Acceptance Tests: introduce CPU hotplug test
  [NOTFORMERGE] Bump Avocado version to latest master

 docs/devel/testing.rst                    |  29 +++-
 python/qemu/utils.py                      |  35 +++++
 tests/acceptance/avocado_qemu/__init__.py | 176 ++++++++++++++++++++++
 tests/acceptance/boot_linux.py            | 128 ++--------------
 tests/acceptance/hotplug_cpu.py           |  38 +++++
 tests/acceptance/info_usernet.py          |  29 ++++
 tests/acceptance/linux_ssh_mips_malta.py  |  44 +-----
 tests/acceptance/virtiofs_submounts.py    |  73 +--------
 tests/requirements.txt                    |   2 +-
 tests/vm/basevm.py                        |   7 +-
 10 files changed, 334 insertions(+), 227 deletions(-)
 create mode 100644 python/qemu/utils.py
 create mode 100644 tests/acceptance/hotplug_cpu.py
 create mode 100644 tests/acceptance/info_usernet.py

Comments

Philippe Mathieu-Daudé Feb. 8, 2021, 11:35 a.m. UTC | #1
On 2/3/21 6:23 PM, Cleber Rosa wrote:
> This introduces a base class for tests that need to interact with a
> Linux guest.  It generalizes the "boot_linux.py" code, already been
> used by the "virtiofs_submounts.py" and also SSH related code being
> used by that and "linux_ssh_mips_malta.py".
> 
> While at it, a number of fixes on hopeful improvements to those tests
> were added.
> 
> Cleber Rosa (22):
>   tests/acceptance/boot_linux.py: fix typo on cloudinit error message
>   tests/acceptance/boot_linux.py: rename misleading cloudinit method
>   Acceptance Tests: remove unnecessary tag from documentation example
>   tests/acceptance/virtiofs_submounts.py: use workdir property
>   tests/acceptance/virtiofs_submounts.py: do not ask for ssh key
>     password
>   tests/acceptance/virtiofs_submounts.py: use a virtio-net device
>     instead
>   tests/acceptance/virtiofs_submounts.py: evaluate string not length
>   tests/acceptance/virtiofs_submounts.py: standardize port as integer
>   tests/acceptance/virtiofs_submounts.py: required space between IP and
>     port
>   Python: add utility function for retrieving port redirection
>   tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer
>   Acceptance tests: clarify ssh connection failure reason
>   tests/acceptance/virtiofs_submounts.py: add missing accel tag
>   Acceptance Tests: introduce LinuxTest base class
>   Acceptance Tests: move useful ssh methods to base class
>   Acceptance Tests: introduce method for requiring an accelerator
>   Acceptance Tests: fix population of public key in cloudinit image
>   Acceptance Tests: set up existing ssh keys by default
>   Acceptance Tests: add port redirection for ssh by default
>   Acceptance Tests: add basic documentation on LinuxTest base class
>   Acceptance Tests: introduce CPU hotplug test
>   [NOTFORMERGE] Bump Avocado version to latest master
> 
>  docs/devel/testing.rst                    |  29 +++-
>  python/qemu/utils.py                      |  35 +++++
>  tests/acceptance/avocado_qemu/__init__.py | 176 ++++++++++++++++++++++
>  tests/acceptance/boot_linux.py            | 128 ++--------------
>  tests/acceptance/hotplug_cpu.py           |  38 +++++
>  tests/acceptance/info_usernet.py          |  29 ++++
>  tests/acceptance/linux_ssh_mips_malta.py  |  44 +-----
>  tests/acceptance/virtiofs_submounts.py    |  73 +--------
>  tests/requirements.txt                    |   2 +-
>  tests/vm/basevm.py                        |   7 +-
>  10 files changed, 334 insertions(+), 227 deletions(-)
>  create mode 100644 python/qemu/utils.py
>  create mode 100644 tests/acceptance/hotplug_cpu.py
>  create mode 100644 tests/acceptance/info_usernet.py

Patches 1-6, 8-9 & 12 queued.
Wainer dos Santos Moschetta Feb. 15, 2021, 3:49 p.m. UTC | #2
Hi,

On 2/8/21 8:35 AM, Philippe Mathieu-Daudé wrote:
> On 2/3/21 6:23 PM, Cleber Rosa wrote:
>> This introduces a base class for tests that need to interact with a
>> Linux guest.  It generalizes the "boot_linux.py" code, already been
>> used by the "virtiofs_submounts.py" and also SSH related code being
>> used by that and "linux_ssh_mips_malta.py".
>>
>> While at it, a number of fixes on hopeful improvements to those tests
>> were added.
>>
>> Cleber Rosa (22):
>>    tests/acceptance/boot_linux.py: fix typo on cloudinit error message
>>    tests/acceptance/boot_linux.py: rename misleading cloudinit method
>>    Acceptance Tests: remove unnecessary tag from documentation example
>>    tests/acceptance/virtiofs_submounts.py: use workdir property
>>    tests/acceptance/virtiofs_submounts.py: do not ask for ssh key
>>      password
>>    tests/acceptance/virtiofs_submounts.py: use a virtio-net device
>>      instead
>>    tests/acceptance/virtiofs_submounts.py: evaluate string not length
>>    tests/acceptance/virtiofs_submounts.py: standardize port as integer
>>    tests/acceptance/virtiofs_submounts.py: required space between IP and
>>      port
>>    Python: add utility function for retrieving port redirection
>>    tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer
>>    Acceptance tests: clarify ssh connection failure reason
>>    tests/acceptance/virtiofs_submounts.py: add missing accel tag
>>    Acceptance Tests: introduce LinuxTest base class
>>    Acceptance Tests: move useful ssh methods to base class
>>    Acceptance Tests: introduce method for requiring an accelerator
>>    Acceptance Tests: fix population of public key in cloudinit image
>>    Acceptance Tests: set up existing ssh keys by default
>>    Acceptance Tests: add port redirection for ssh by default
>>    Acceptance Tests: add basic documentation on LinuxTest base class
>>    Acceptance Tests: introduce CPU hotplug test
>>    [NOTFORMERGE] Bump Avocado version to latest master
>>
>>   docs/devel/testing.rst                    |  29 +++-
>>   python/qemu/utils.py                      |  35 +++++
>>   tests/acceptance/avocado_qemu/__init__.py | 176 ++++++++++++++++++++++
>>   tests/acceptance/boot_linux.py            | 128 ++--------------
>>   tests/acceptance/hotplug_cpu.py           |  38 +++++
>>   tests/acceptance/info_usernet.py          |  29 ++++
>>   tests/acceptance/linux_ssh_mips_malta.py  |  44 +-----
>>   tests/acceptance/virtiofs_submounts.py    |  73 +--------
>>   tests/requirements.txt                    |   2 +-
>>   tests/vm/basevm.py                        |   7 +-
>>   10 files changed, 334 insertions(+), 227 deletions(-)
>>   create mode 100644 python/qemu/utils.py
>>   create mode 100644 tests/acceptance/hotplug_cpu.py
>>   create mode 100644 tests/acceptance/info_usernet.py
> Patches 1-6, 8-9 & 12 queued.


Those are merged. Most of the remaining patches got at least one review, 
so could you (Cleber or Philippe) open a pull request for them as well? 
Telling it because there are many series in flight for the acceptance 
tests, and to avoid conflicts with future series...

Thanks!

- Wainer


>
>
Philippe Mathieu-Daudé Feb. 15, 2021, 5:03 p.m. UTC | #3
On 2/15/21 4:49 PM, Wainer dos Santos Moschetta wrote:
> Hi,
> 
> On 2/8/21 8:35 AM, Philippe Mathieu-Daudé wrote:
>> On 2/3/21 6:23 PM, Cleber Rosa wrote:
>>> This introduces a base class for tests that need to interact with a
>>> Linux guest.  It generalizes the "boot_linux.py" code, already been
>>> used by the "virtiofs_submounts.py" and also SSH related code being
>>> used by that and "linux_ssh_mips_malta.py".
>>>
>>> While at it, a number of fixes on hopeful improvements to those tests
>>> were added.
>>>
>>> Cleber Rosa (22):
>>>    tests/acceptance/boot_linux.py: fix typo on cloudinit error message
>>>    tests/acceptance/boot_linux.py: rename misleading cloudinit method
>>>    Acceptance Tests: remove unnecessary tag from documentation example
>>>    tests/acceptance/virtiofs_submounts.py: use workdir property
>>>    tests/acceptance/virtiofs_submounts.py: do not ask for ssh key
>>>      password
>>>    tests/acceptance/virtiofs_submounts.py: use a virtio-net device
>>>      instead
>>>    tests/acceptance/virtiofs_submounts.py: evaluate string not length
>>>    tests/acceptance/virtiofs_submounts.py: standardize port as integer
>>>    tests/acceptance/virtiofs_submounts.py: required space between IP and
>>>      port
>>>    Python: add utility function for retrieving port redirection
>>>    tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer
>>>    Acceptance tests: clarify ssh connection failure reason
>>>    tests/acceptance/virtiofs_submounts.py: add missing accel tag
>>>    Acceptance Tests: introduce LinuxTest base class
>>>    Acceptance Tests: move useful ssh methods to base class
>>>    Acceptance Tests: introduce method for requiring an accelerator
>>>    Acceptance Tests: fix population of public key in cloudinit image
>>>    Acceptance Tests: set up existing ssh keys by default
>>>    Acceptance Tests: add port redirection for ssh by default
>>>    Acceptance Tests: add basic documentation on LinuxTest base class
>>>    Acceptance Tests: introduce CPU hotplug test
>>>    [NOTFORMERGE] Bump Avocado version to latest master
>>>
>>>   docs/devel/testing.rst                    |  29 +++-
>>>   python/qemu/utils.py                      |  35 +++++
>>>   tests/acceptance/avocado_qemu/__init__.py | 176 ++++++++++++++++++++++
>>>   tests/acceptance/boot_linux.py            | 128 ++--------------
>>>   tests/acceptance/hotplug_cpu.py           |  38 +++++
>>>   tests/acceptance/info_usernet.py          |  29 ++++
>>>   tests/acceptance/linux_ssh_mips_malta.py  |  44 +-----
>>>   tests/acceptance/virtiofs_submounts.py    |  73 +--------
>>>   tests/requirements.txt                    |   2 +-
>>>   tests/vm/basevm.py                        |   7 +-
>>>   10 files changed, 334 insertions(+), 227 deletions(-)
>>>   create mode 100644 python/qemu/utils.py
>>>   create mode 100644 tests/acceptance/hotplug_cpu.py
>>>   create mode 100644 tests/acceptance/info_usernet.py
>> Patches 1-6, 8-9 & 12 queued.
> 
> 
> Those are merged. Most of the remaining patches got at least one review,
> so could you (Cleber or Philippe) open a pull request for them as well?
> Telling it because there are many series in flight for the acceptance
> tests, and to avoid conflicts with future series...

I asked a question to Cleber in patch 13 and am waiting what he meant
before queuing the series (fixing the typo Marc-André noticed).

Regards,

Phil.
Cleber Rosa Feb. 16, 2021, 3:35 a.m. UTC | #4
On Mon, Feb 15, 2021 at 06:03:33PM +0100, Philippe Mathieu-Daudé wrote:
> On 2/15/21 4:49 PM, Wainer dos Santos Moschetta wrote:
> > Hi,
> > 
> > On 2/8/21 8:35 AM, Philippe Mathieu-Daudé wrote:
> >> On 2/3/21 6:23 PM, Cleber Rosa wrote:
> >>> This introduces a base class for tests that need to interact with a
> >>> Linux guest.  It generalizes the "boot_linux.py" code, already been
> >>> used by the "virtiofs_submounts.py" and also SSH related code being
> >>> used by that and "linux_ssh_mips_malta.py".
> >>>
> >>> While at it, a number of fixes on hopeful improvements to those tests
> >>> were added.
> >>>
> >>> Cleber Rosa (22):
> >>>    tests/acceptance/boot_linux.py: fix typo on cloudinit error message
> >>>    tests/acceptance/boot_linux.py: rename misleading cloudinit method
> >>>    Acceptance Tests: remove unnecessary tag from documentation example
> >>>    tests/acceptance/virtiofs_submounts.py: use workdir property
> >>>    tests/acceptance/virtiofs_submounts.py: do not ask for ssh key
> >>>      password
> >>>    tests/acceptance/virtiofs_submounts.py: use a virtio-net device
> >>>      instead
> >>>    tests/acceptance/virtiofs_submounts.py: evaluate string not length
> >>>    tests/acceptance/virtiofs_submounts.py: standardize port as integer
> >>>    tests/acceptance/virtiofs_submounts.py: required space between IP and
> >>>      port
> >>>    Python: add utility function for retrieving port redirection
> >>>    tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer
> >>>    Acceptance tests: clarify ssh connection failure reason
> >>>    tests/acceptance/virtiofs_submounts.py: add missing accel tag
> >>>    Acceptance Tests: introduce LinuxTest base class
> >>>    Acceptance Tests: move useful ssh methods to base class
> >>>    Acceptance Tests: introduce method for requiring an accelerator
> >>>    Acceptance Tests: fix population of public key in cloudinit image
> >>>    Acceptance Tests: set up existing ssh keys by default
> >>>    Acceptance Tests: add port redirection for ssh by default
> >>>    Acceptance Tests: add basic documentation on LinuxTest base class
> >>>    Acceptance Tests: introduce CPU hotplug test
> >>>    [NOTFORMERGE] Bump Avocado version to latest master
> >>>
> >>>   docs/devel/testing.rst                    |  29 +++-
> >>>   python/qemu/utils.py                      |  35 +++++
> >>>   tests/acceptance/avocado_qemu/__init__.py | 176 ++++++++++++++++++++++
> >>>   tests/acceptance/boot_linux.py            | 128 ++--------------
> >>>   tests/acceptance/hotplug_cpu.py           |  38 +++++
> >>>   tests/acceptance/info_usernet.py          |  29 ++++
> >>>   tests/acceptance/linux_ssh_mips_malta.py  |  44 +-----
> >>>   tests/acceptance/virtiofs_submounts.py    |  73 +--------
> >>>   tests/requirements.txt                    |   2 +-
> >>>   tests/vm/basevm.py                        |   7 +-
> >>>   10 files changed, 334 insertions(+), 227 deletions(-)
> >>>   create mode 100644 python/qemu/utils.py
> >>>   create mode 100644 tests/acceptance/hotplug_cpu.py
> >>>   create mode 100644 tests/acceptance/info_usernet.py
> >> Patches 1-6, 8-9 & 12 queued.
> > 
> > 
> > Those are merged. Most of the remaining patches got at least one review,
> > so could you (Cleber or Philippe) open a pull request for them as well?
> > Telling it because there are many series in flight for the acceptance
> > tests, and to avoid conflicts with future series...
> 
> I asked a question to Cleber in patch 13 and am waiting what he meant
> before queuing the series (fixing the typo Marc-André noticed).
> 
> Regards,
> 
> Phil.
> 

Hi Phil,

Thanks for taking the previous patches, and thanks for the willingness
to take (and tweak) some more.  I only saw this comment now, and I
have a bunch of these ready to fire a PR.

I guess I also provided an answer to the question you're referring to.

If my tree passes CI, then I should be sending a PR within the next
few hours.

Best,
- Cleber.