From nobody Tue Feb 10 04:15:17 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1588263233; cv=none; d=zohomail.com; s=zohoarc; b=UIVh9c9Oof0o2rFeaoJx/QrVYDULLbx9XG8ecL1ZULBsi37oF9k9dHbnuYtcTXKIm+2uF4REjh0JnSHBzCY6m2+NVgvAgj14eUwHQ/BMEUa5aYjl0Oas75g+TXB2S9Pav44R17lvDadIU6d56607KtrtshxjiQdGpGEH525NPCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588263233; 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; bh=aF24IKnVFhq1UB6gmNrnCUeMXZezC3NkQoX6jpUZt8c=; b=h+anM71E8tcG+PLxXHSpfMlnSm2ZdaCNvgiPhhJqWtdT3umaLWuGTmVDCVpaopM2Bb8so10aOKjME5Y8FjJXA/1lriP1T4D4PLT0u8vJ/A/FMZ/TXf+iTEPcAz7GrFQdxH+uYA4IodnFcIow1z5jozgHBVOj5dG/05QtMDJkXPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1588263233165589.1947665693708; Thu, 30 Apr 2020 09:13:53 -0700 (PDT) Received: from localhost ([::1]:38270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUBot-0003hC-Rt for importer@patchew.org; Thu, 30 Apr 2020 12:13:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45444) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUBdX-0000Y9-8r for qemu-devel@nongnu.org; Thu, 30 Apr 2020 12:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUBaF-0003MX-Ef for qemu-devel@nongnu.org; Thu, 30 Apr 2020 12:02:07 -0400 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]:34303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUBaE-0003HS-WA for qemu-devel@nongnu.org; Thu, 30 Apr 2020 11:58:43 -0400 Received: by mail-qt1-x82a.google.com with SMTP id b1so5420468qtt.1 for ; Thu, 30 Apr 2020 08:58:42 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:7489:3328:3806:7c3]) by smtp.gmail.com with ESMTPSA id v16sm305254qkf.80.2020.04.30.08.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 08:58:41 -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; bh=aF24IKnVFhq1UB6gmNrnCUeMXZezC3NkQoX6jpUZt8c=; b=cy6JHVlpNUxfV38LmzXrlZLRwgiMfwqKMzLXkOM80giZPGva/sjsp7XttnRlBN02I5 ml3IlaUEwaaJJmeDCg+kPXE1uehAbXZ71YgAXDiPYs3bFtQLs26PHCVFRdPTqKrc4wMb eyaAmT1H64ZJbKVoXTe3NcOjER7uxy7s82L6OC8HiXxtWniZtk+IkEU1emfia48ytlbM IZrXrxrqcxSeBn978UVeQSDzCHBW+KcC9NJr4BsCTpwJq/VC3gmorfbLVYHHLcC/Xwvy cTErmVnS4DRizUZuKfyfQTEISU2kNQ7BvRw1Elk1uq7ZUMLEWoLLthhxaUeCKN4xmlMS pyCg== 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; bh=aF24IKnVFhq1UB6gmNrnCUeMXZezC3NkQoX6jpUZt8c=; b=io64806EKT/AaCrW7uq/VQBAo63VOk62RdbEzuZ5drplVgwyCMfA6HhGUKE2Kum+6o ntEc3g9x+zTe3AqxWp8w3Jn/oiIB6k5HHVNBE2JI0Eg4fyo3m1kP5X9wcWK+2/XJkQZr 194G11XntryLJmISWG8qCnfy+hR+dqRZHhe+FBMhDL0s0eA91XEw4pTqMkzxzrxGyB0C QgHX8ERtKQxSqNQ1XXjntrHPNXIGL5vQJEs0bcdf42wqJ/MpRqVdxTrFwjXRDH/RuQVZ 3AmWBSG5TJm2g8jT+yUZUfQV9HVPi1jCliR5ZzErl6GZEO810ntN0QtkV0Va5+iG92AX 47dw== X-Gm-Message-State: AGi0PuZ2yLN5gzVDcYm4iYXv98UMNUSfc/BVN2RTH9g7h4QSVQtulE8P n36s3URbwpPa/42lk/7VbB4SB/SGDWVOZw== X-Google-Smtp-Source: APiQypLDIgBAsh6qAW4H+Ry/jg/6OKc9HeIAwK008JYk0QbltXw27ekaV+e6mTip+PjWKuHJZZm60Q== X-Received: by 2002:ac8:5653:: with SMTP id 19mr4289832qtt.252.1588262321752; Thu, 30 Apr 2020 08:58:41 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v5 5/9] tests/vm: allow wait_ssh() to specify command Date: Thu, 30 Apr 2020 11:57:14 -0400 Message-Id: <20200430155718.212-6-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200430155718.212-1-robert.foley@linaro.org> References: <20200430155718.212-1-robert.foley@linaro.org> Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x82a.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::82a 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: philmd@redhat.com, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This allows for waiting for completion of arbitrary commands. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov --- tests/vm/basevm.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 7b86ccd018..9f06f84974 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -410,24 +410,24 @@ class BaseVM(object): def print_step(self, text): sys.stderr.write("### %s ...\n" % text) =20 - def wait_ssh(self, wait_root=3DFalse, seconds=3D300): + def wait_ssh(self, wait_root=3DFalse, seconds=3D300, cmd=3D"exit 0"): # Allow more time for VM to boot under TCG. if not kvm_available(self.arch): seconds *=3D self.tcg_ssh_timeout_multiplier starttime =3D datetime.datetime.now() endtime =3D starttime + datetime.timedelta(seconds=3Dseconds) - guest_up =3D False + cmd_success =3D False while datetime.datetime.now() < endtime: - if wait_root and self.ssh_root("exit 0") =3D=3D 0: - guest_up =3D True + if wait_root and self.ssh_root(cmd) =3D=3D 0: + cmd_success =3D True break - elif self.ssh("exit 0") =3D=3D 0: - guest_up =3D True + elif self.ssh(cmd) =3D=3D 0: + cmd_success =3D True break seconds =3D (endtime - datetime.datetime.now()).total_seconds() logging.debug("%ds before timeout", seconds) time.sleep(1) - if not guest_up: + if not cmd_success: raise Exception("Timeout while waiting for guest ssh") =20 def shutdown(self): --=20 2.17.1