qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default


From: Cleber Rosa
Subject: Re: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default after boot for LinuxTest
Date: Wed, 24 Mar 2021 18:45:29 -0400

On Wed, Mar 24, 2021 at 10:22:47AM +0100, Auger Eric wrote:
> Hi Cleber,
> 
> On 3/23/21 11:15 PM, Cleber Rosa wrote:
> > The LinuxTest specifically targets users that need to interact with Linux
> > guests.  So, it makes sense to give a connection by default, and avoid
> > requiring it as boiler-plate code.
> > 
> > Signed-off-by: Cleber Rosa <crosa@redhat.com>
> > ---
> >  tests/acceptance/avocado_qemu/__init__.py | 5 ++++-
> >  tests/acceptance/virtiofs_submounts.py    | 1 -
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/acceptance/avocado_qemu/__init__.py 
> > b/tests/acceptance/avocado_qemu/__init__.py
> > index 535f63a48d..4960142bcc 100644
> > --- a/tests/acceptance/avocado_qemu/__init__.py
> > +++ b/tests/acceptance/avocado_qemu/__init__.py
> > @@ -390,7 +390,7 @@ def set_up_cloudinit(self, ssh_pubkey=None):
> >          cloudinit_iso = self.prepare_cloudinit(ssh_pubkey)
> >          self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso)
> >  
> > -    def launch_and_wait(self):
> > +    def launch_and_wait(self, set_up_ssh_connection=True):
> >          self.vm.set_console()
> >          self.vm.launch()
> >          console_drainer = 
> > datadrainer.LineLogger(self.vm.console_socket.fileno(),
> > @@ -398,3 +398,6 @@ def launch_and_wait(self):
> >          console_drainer.start()
> >          self.log.info('VM launched, waiting for boot confirmation from 
> > guest')
> >          cloudinit.wait_for_phone_home(('0.0.0.0', self.phone_home_port), 
> > self.name)
> > +        if set_up_ssh_connection:
> > +            self.log.info('Setting up the SSH connection')
> > +            self.ssh_connect(self.username, self.ssh_key)
> > diff --git a/tests/acceptance/virtiofs_submounts.py 
> > b/tests/acceptance/virtiofs_submounts.py
> > index e10a935ac4..e019d3b896 100644
> > --- a/tests/acceptance/virtiofs_submounts.py
> > +++ b/tests/acceptance/virtiofs_submounts.py
> > @@ -136,7 +136,6 @@ def set_up_virtiofs(self):
> >  
> >      def launch_vm(self):
> >          self.launch_and_wait()
> > -        self.ssh_connect('root', self.ssh_key)
> >  
> >      def set_up_nested_mounts(self):
> >          scratch_dir = os.path.join(self.shared_dir, 'scratch')
> > 
> what about launch_and_wait calls in boot_linux.py. Don't you want to
> force ssh connection off there?
>

Good point.  I guess one could argue that it doesn't hurt those tests,
and even that it "tests more".  But, I'd argue that less is more here
indeed.

I'll change those launch_and_wait() to include set_up_ssh_connection=False
for those tests.

> Thanks
> 
> Eric

Thanks a lot!
- Cleber.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]