From patchwork Mon Jun 24 13:43:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 167574 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4250682ilk; Mon, 24 Jun 2019 06:44:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJyhYcl2/ZuPDP8CxHz4qn1CYER3MPVzJS8blexfMIPIVQFRZI1S+omgB4h/2+DYouwKgK X-Received: by 2002:a50:ba28:: with SMTP id g37mr143088226edc.109.1561383869653; Mon, 24 Jun 2019 06:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561383869; cv=none; d=google.com; s=arc-20160816; b=OD31dRoUFGHggP19JDqrBAErfQzdNcJpjzhKXxwGqfaihqqntpo1xsmw/4GGyssoL+ meVayMIlrZyHPwUdOMBoILAo7hATSkUtoSA8OXA1jvBnV1ic1p1jN4M20MHrrg9cMUoU mpgtu2Y2TdBgj7tG2PFzErut7XYCx8PItJn2cPSNBt273j3H/wBB1dw8MCJuqU1aQT23 iR45+IcUpDTPRtoiHrQSDaZSku2hhQKAfcSvna2FAYDscYGtdTnCa3z4h3S3agRiM6fD vB7ScLBRJ5nhaFd+555p3NmGYnEyNo+Zf7wrLKXoM7UtTXqlGDnITr7mL9YkRAvDwwiJ KcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=INLzBrnOdVpVaX735jR9Ql7IOiOc8rJWuc+qFiZ4wMM=; b=UPghOxs1LUAq40qgboIu8aqR3Y/VfSS3RM2l/myeKgKWGzladCtTF7XvMABT/5o+si nPAnw25TtTdce+ijVN8Ab8ZnNSgTW0vSWxHyms1iUVZqB6jL8cQNOdxDcR5XeoxSSGKj lttxsiWFWIiPmV1t7yu+AKitekJa4iJussRjzhnwvSRF/mCHSarMiDB7//AWhIxjIQgZ 8o+2ySWqgVAkdB15vI36STp4AF+3pSDRqSn4RYmhvt8idGxTFAJOhgWtkEeif+uPbBy8 d3qqqTmKORsAfHha99bAY3RQJjE1FHG0DMooUG7f6+HHM+kwORrozFAXTlk1aXlKU2ct tOXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w+gFRtDH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q16si6696218ejm.323.2019.06.24.06.44.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w+gFRtDH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGm-0006gI-K0 for patch@linaro.org; Mon, 24 Jun 2019 09:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41434) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGC-0006ac-Ij for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGA-0007XZ-JK for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:52 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPG6-0007NP-OB for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:48 -0400 Received: by mail-wm1-x332.google.com with SMTP id s15so13429318wmj.3 for ; Mon, 24 Jun 2019 06:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=INLzBrnOdVpVaX735jR9Ql7IOiOc8rJWuc+qFiZ4wMM=; b=w+gFRtDHcBs4MeHAgFdm7/Q0W6J8DVe7h0IihpVSwDry2bm0ZDph9Mwr/57vjLqinJ 79gqC8ZVTWXl/y+N6bPt29fwP8uEfU8jVeaaPqxQCA5oCxsRFRfCFFieZZ4Yqv7jZp4B tj8mA3BrjR9dVY7S6vssL3CxTzL8Gjc5pOvvmwkb0rgXjLw86+CT0GH/qg1RE102xp+m HIMoPlQmtgWJK2uiVu5Yhser7X4b8/yiWDeoOoeyA3H00vqg7U0fS6kBFeXFHCIE017d +G5xqP9HvjBJFyCUuUbnn1QhzwtorKfz3++GhRv1gImjRqwccC6m6QQSwhdid9zIEYyL hCTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=INLzBrnOdVpVaX735jR9Ql7IOiOc8rJWuc+qFiZ4wMM=; b=TV0T3Mm7VI0Uweg2Z6ygZh033BPy2roBE3NsdrvdF28Ea09Cfe9sePfwvY1iHBSFdo x/5YNysu0TFN7E5gzefXNt4AllGhgbxMgOhoAOR+VKu9W2Cxmu25TdYmmlFYv8hSFCWN SgWHzmtsFB/BuJzaHAdmARsoNjnLfjSmv1grvLTrGtonHTMZ3bUNttZXW1wzLyOvnwTC ZeOrQHosfqTiLKzfIYsn+VN9U1/omox+m/kbhM3sMxCd4Wpsprys08KruiN0HeIMehUd xCFebbtODBBwGs4FNP1JNNOp0BdFyCr7NLvTHMKuYMMdeJoMgN3nm63jYdfc0Upcg2Dc 38yA== X-Gm-Message-State: APjAAAW0byZCrcPDzBskyE03VJXZyQx3Cdn6xClCrWTXenNilliCqnhe q69jkPt2BN/lzoQF7dZIUb4wXw== X-Received: by 2002:a1c:b146:: with SMTP id a67mr15829427wmf.124.1561383822192; Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id p3sm8196123wrd.47.2019.06.24.06.43.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:39 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0A2AE1FF93; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:24 +0100 Message-Id: <20190624134337.10532-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 Subject: [Qemu-devel] [PULL 06/19] 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 , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann 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é Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-3-kraxel@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5e30bac661..395eefaec9 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 - def _ssh_do(self, user, cmd, check, interactive=False): - ssh_cmd = ["ssh", "-q", + def _ssh_do(self, user, cmd, check): + ssh_cmd = ["ssh", "-q", "-t", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=" + os.devnull, "-o", "ConnectTimeout=1", "-p", self.ssh_port, "-i", self._ssh_key_file] for var in self.envvars: ssh_cmd += ['-o', "SendEnv=%s" % var ] - if interactive: - ssh_cmd += ['-t'] assert not isinstance(cmd, str) ssh_cmd += ["%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) - 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) @@ -284,9 +279,9 @@ def main(vmcls): return 2 if args.interactive: - if vm.ssh_interactive(*cmd) == 0: + if vm.ssh(*cmd) == 0: return 0 - vm.ssh_interactive() + vm.ssh() return 3 else: if vm.ssh(*cmd) != 0: