From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8566C433DB for ; Wed, 24 Mar 2021 08:38:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 209E1619E0 for ; Wed, 24 Mar 2021 08:38:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 209E1619E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOz22-0004uH-Tc for qemu-devel@archiver.kernel.org; Wed, 24 Mar 2021 04:38:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOyxl-0002tj-Ek for qemu-devel@nongnu.org; Wed, 24 Mar 2021 04:34:01 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:44678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOyxi-00008a-Fp for qemu-devel@nongnu.org; Wed, 24 Mar 2021 04:34:01 -0400 Received: by mail-ed1-x529.google.com with SMTP id j3so26589249edp.11 for ; Wed, 24 Mar 2021 01:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2xiIDmFfuYt8rIajQ5Upzs+2F1lBI2dSreXIXyWcO1o=; b=IMa1v3LVXlYMSt6+tSdXDCDJ7ykGCwEVkIwjKOps77SLyy5luuMybIQFvd879lbON+ ng+Dx8c1bde0imDjvmFTeG4T5HxVJTHWYhBrMYiKf0hAk9OQXt9pgedyyyu2Nu0ykrZW 9ODSNk+lcFAEf6vT2Y9X42o3UNmutIWoJdSQk5RgbtPukrzR2f9+CDOKpI3Dez0ko2vu NxTLLZ8v7RgBZ6wyGaWU3d0Fvoj2wFZlJvv7jnvMfPsjKjrIUmnV9MM/31TIRwuB15oa TL0sUAcI80k3GwDD4tlOWitVKdyvweOk1qaJJFyhfYh/zVKpwq/4RQWe6UyJ6uR2dmN/ 3VSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2xiIDmFfuYt8rIajQ5Upzs+2F1lBI2dSreXIXyWcO1o=; b=E8/EiaR5D41ZS4UqKFUGIE7KHdZElBmM20D/ydTvfaRrhsCQg3fk6NbYweDXQyf8PI ZOVL8D1UEj7I75s7FQagdfl0/7URy9ITg2QaEhPmtf8BvB+b/Ic98N8XFI3lIjtSp+JB yGv0CU4F2H1xSS6k/qZAF0iue+oSYz6i+ojl6eaTpE7bBqIbSDPGKx1Q9FZETWu6cxf/ TsHw3Uiw4Cx+m0QHr4ELVm8+OKG2PuLiRbxiZdvISGHT2MHcQ443jFonkBPTF8Rf+LLo v7vtT4x/gCIi87HH4cOkklWCQEtWddbEgb+2dfMXfrHLEXXFtu445bAzgq5zPlqP3O2i OkfQ== X-Gm-Message-State: AOAM530v1OklGkONTKF8S+4KaIF08EC2j/8N97PldiZzIZ6u0A946iMH vBrPgtHZxKrmmca2zq8rAbCnpW+g44W355NNl+I= X-Google-Smtp-Source: ABdhPJzNkx7mVhUUUYfGeopRejmeS5Zfbyd0Njm/4K+RIXF1mRfcdgfsbbTchGLXC2cGPCQtxvT2T9iPS16YZIYBKO4= X-Received: by 2002:a05:6402:31b7:: with SMTP id dj23mr2186126edb.245.1616574836920; Wed, 24 Mar 2021 01:33:56 -0700 (PDT) MIME-Version: 1.0 References: <20210323221539.3532660-1-crosa@redhat.com> <20210323221539.3532660-8-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-8-crosa@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Wed, 24 Mar 2021 12:33:45 +0400 Message-ID: Subject: Re: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default after boot for LinuxTest To: Cleber Rosa Content-Type: multipart/alternative; boundary="000000000000e853c605be4428f7" Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=marcandre.lureau@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Aleksandar Rikalo , Eduardo Habkost , John Snow , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Wainer dos Santos Moschetta , QEMU , Willian Rampazzo , Eric Auger , Willian Rampazzo , Thomas Huth , Max Reitz , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Aurelien Jarno , Beraldo Leal Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000e853c605be4428f7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 24, 2021 at 2:34 AM 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 > Reviewed-by: Marc-Andr=C3=A9 Lureau > --- > 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=3DNone): > cloudinit_iso =3D self.prepare_cloudinit(ssh_pubkey) > self.vm.add_args('-drive', 'file=3D%s,format=3Draw' % cloudinit_= iso) > > - def launch_and_wait(self): > + def launch_and_wait(self, set_up_ssh_connection=3DTrue): > self.vm.set_console() > self.vm.launch() > console_drainer =3D > 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 =3D os.path.join(self.shared_dir, 'scratch') > -- > 2.25.4 > > > --=20 Marc-Andr=C3=A9 Lureau --000000000000e853c605be4428f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Mar 24, 2021 at 2:34 AM Clebe= r Rosa <crosa@redhat.com> wro= te:
The LinuxTes= t specifically targets users that need to interact with Linux
guests.=C2=A0 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>

Reviewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com> =C2=A0
---
=C2=A0tests/acceptance/avocado_qemu/__init__.py | 5 ++++-
=C2=A0tests/acceptance/virtiofs_submounts.py=C2=A0 =C2=A0 | 1 -
=C2=A02 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_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=3DNone):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cloudinit_iso =3D self.prepare_cloudinit(= ssh_pubkey)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.vm.add_args('-drive', 'f= ile=3D%s,format=3Draw' % cloudinit_iso)

-=C2=A0 =C2=A0 def launch_and_wait(self):
+=C2=A0 =C2=A0 def launch_and_wait(self, set_up_ssh_connection=3DTrue):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.vm.set_console()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.vm.launch()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0console_drainer =3D datadrainer.LineLogge= r(self.vm.console_socket.fileno(),
@@ -398,3 +398,6 @@ def launch_and_wait(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0console_drainer.start()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.log.info('VM launched, waiting fo= r boot confirmation from guest')
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cloudinit.wait_for_phone_home(('0.0.0= .0', self.phone_home_port), self.name)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if set_up_ssh_connection:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.log.info('Setting up the= SSH connection')
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.ssh_connect(self.username, = self.ssh_key)
diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_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):

=C2=A0 =C2=A0 =C2=A0def launch_vm(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.launch_and_wait()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.ssh_connect('root', self.ssh_key)=

=C2=A0 =C2=A0 =C2=A0def set_up_nested_mounts(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0scratch_dir =3D os.path.join(self.shared_= dir, 'scratch')
--
2.25.4




--
Marc-Andr=C3=A9 Lureau
--000000000000e853c605be4428f7--