From nobody Mon Feb 9 10:29:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560746517; cv=none; d=zoho.com; s=zohoarc; b=NehMVsqBWQIEYRRhfomlajz2WZoGhu4bFWaWkDFSJSSYTgxyRpz/AewjsZiNpd5//ZxkBDo2r5yPDLuCnJM8CNLdfVEXztVK+I6NsXh/4qn/7cSh7QppxYaC5pYJasuXv7OsvAD/POewgAdQRH/gEBwL6Tm8H3MI7nzMFbkHb7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560746517; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=prSBAkGzAoYLd9YD8ojLbKojDPQfgRQHNv0+LMi1J+M=; b=O+pLyWW2hSynpE0HapJpY2iyikSkPskx2BS6ao9wtjsB2pkhuToz9dZEi2OZ6xgyXTrhW9dEE1Fodv+MVyabTP/9pRJR2Nw0xZuYMAjrbx0zKS5ACSMhhR34d6Awmwtp0yDrn4qmaNOGuF1Nn/B0dfWbpOSRXy87kWZuVr7vfdo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560746517355728.196196650037; Sun, 16 Jun 2019 21:41:57 -0700 (PDT) Received: from localhost ([::1]:44206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcjSd-0003Pg-Qd for importer@patchew.org; Mon, 17 Jun 2019 00:41:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60172) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcjQE-0001P7-Pw for qemu-devel@nongnu.org; Mon, 17 Jun 2019 00:39:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcjQC-0005rt-8H for qemu-devel@nongnu.org; Mon, 17 Jun 2019 00:39:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58866) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcjQB-0005oH-Dd for qemu-devel@nongnu.org; Mon, 17 Jun 2019 00:39:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA90D3162900; Mon, 17 Jun 2019 04:39:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id C05FB82A11; Mon, 17 Jun 2019 04:38:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E99BF16E1A; Mon, 17 Jun 2019 06:38:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Jun 2019 06:38:49 +0200 Message-Id: <20190617043858.8290-3-kraxel@redhat.com> In-Reply-To: <20190617043858.8290-1-kraxel@redhat.com> References: <20190617043858.8290-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 17 Jun 2019 04:39:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 02/11] tests/vm: use ssh with pty unconditionally 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 , Ed Maste , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kamil Rytarowski , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li-Wen Hsu , Brad Smith Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Allways ask ssh to run with a pseudo terminal. Not having a terminal causes problems now and then. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/vm/basevm.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5e30bac66154..395eefaec948 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -107,16 +107,14 @@ class BaseVM(object): os.rename(fname + ".download", fname) return fname =20 - def _ssh_do(self, user, cmd, check, interactive=3DFalse): - ssh_cmd =3D ["ssh", "-q", + def _ssh_do(self, user, cmd, check): + ssh_cmd =3D ["ssh", "-q", "-t", "-o", "StrictHostKeyChecking=3Dno", "-o", "UserKnownHostsFile=3D" + os.devnull, "-o", "ConnectTimeout=3D1", "-p", self.ssh_port, "-i", self._ssh_key_file] for var in self.envvars: ssh_cmd +=3D ['-o', "SendEnv=3D%s" % var ] - if interactive: - ssh_cmd +=3D ['-t'] assert not isinstance(cmd, str) ssh_cmd +=3D ["%s@127.0.0.1" % user] + list(cmd) logging.debug("ssh_cmd: %s", " ".join(ssh_cmd)) @@ -128,9 +126,6 @@ class BaseVM(object): def ssh(self, *cmd): return self._ssh_do(self.GUEST_USER, cmd, False) =20 - def ssh_interactive(self, *cmd): - return self._ssh_do(self.GUEST_USER, cmd, False, True) - def ssh_root(self, *cmd): return self._ssh_do("root", cmd, False) =20 @@ -284,9 +279,9 @@ def main(vmcls): return 2 =20 if args.interactive: - if vm.ssh_interactive(*cmd) =3D=3D 0: + if vm.ssh(*cmd) =3D=3D 0: return 0 - vm.ssh_interactive() + vm.ssh() return 3 else: if vm.ssh(*cmd) !=3D 0: --=20 2.18.1