From patchwork Wed Mar 4 10:01:49 2020 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: 184166 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4708464ile; Wed, 4 Mar 2020 02:06:02 -0800 (PST) X-Google-Smtp-Source: ADFU+vtPaREheMlgpNKnaf/lq2d02jbZpggcwbMNYsmA2quuGod6OVijE+MRVOYGosXPd/QOivA3 X-Received: by 2002:ae9:c012:: with SMTP id u18mr2059554qkk.140.1583316362407; Wed, 04 Mar 2020 02:06:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583316362; cv=none; d=google.com; s=arc-20160816; b=Kh4Tby6l1NIpJ5RS2QYpiLn++FZWDyNeE6EtTFjCcOz/9TJO4jpripVLlbmYaz8p5d WtnUaSqC4EKMIYrCqemxKb6oRb7spqV8X7qQpQV5l0NOITj5UKrnwbZqg4W4hUjgyOId N7G9Iyjha4I9Hv7NxJJl4YdRC3BdSlsX2+71MKQd8Lvrao9tZoh6/Us2PWYHu2iq7hfK YRN5cj9ckIoh7hrawZYggYTvqRRGlgiSKJITEzToMXyEtXbFeXbouPqyQ3et/qLzrqZF u+s1lNq1BMkK8LeGZN+/N2jnGbheFi7AkPjcNG9WhfJ1QzOVcLuqoqvvmItblWTryW4U 1FmA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1Z8GPfWQG9JlhViWJSouPuAdwb1TR2JLNt392yI0Vq8=; b=FmgLglLQkPn4YJX8ZZ6aVsxh2nMPJZjW70EBC4AtibpmDMmFiNCXtGqUdRNthUOs3l iN92L3GtKw4EI5YnoSyVtSUZbSR2ju44G+5I+rcX3cNHlc3wUgf+w1nHxFx8NSKrx5Ob 1jyG0fVB1WiY7/cnNFL1kYeQNsAM+QZ/v6gwKasyfkUPvrUdr0l/Gb/JZhfHKgy9wG7F ugvIg3oVrzctYau1JOXVI3R15jBdXLOCjyBjs2X/TtXFB4g/hPEBRJZSIp17eixwGqWD IhCtcoqpoCeiSTN3nN5/d12yTNUk6yVHo0pnC0GlX1sf/4paEQljAKBLeXnahqNgKjRE 9A1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MY2leZOM; 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 d82si612329qkg.211.2020.03.04.02.06.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Mar 2020 02:06:02 -0800 (PST) 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=MY2leZOM; 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]:60048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9Quf-00053q-U7 for patch@linaro.org; Wed, 04 Mar 2020 05:06:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41741) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9Qqu-00071g-0l for qemu-devel@nongnu.org; Wed, 04 Mar 2020 05:02:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9Qqs-0000kK-KB for qemu-devel@nongnu.org; Wed, 04 Mar 2020 05:02:07 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9Qqs-0000fp-C9 for qemu-devel@nongnu.org; Wed, 04 Mar 2020 05:02:06 -0500 Received: by mail-wr1-x436.google.com with SMTP id x7so1627963wrr.0 for ; Wed, 04 Mar 2020 02:02:06 -0800 (PST) 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=1Z8GPfWQG9JlhViWJSouPuAdwb1TR2JLNt392yI0Vq8=; b=MY2leZOMGWHvBHjmG2OR7WEP52MH3U00oVeP2UCl9r8WDU/6OjxYb11m/eKh4npm3L TOnrna0EVAsEv2by9ZC2hXfYVXBuqqq175vAyMCqfx/9jgz1E+12simcJT7LjPVorNWJ 5J8bH1XaEqaaM0BrgAvwTZv1trKFkPg7ekFP8PsfOxBP7fst9WifcgBhIugDCKpXSIga jt3FlWtmovkF+a+pSfB0xAR1v0JLENwcmisRVd86d3z0TzBUB9h1P250PLHd0FHtfD4/ EQVSG1HCcjFeAg/zpj4QVK549PlHRh8d/D0SBbxxn2XiM1Ml74qNJYvo80jAiMg70Ps0 xgpQ== 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=1Z8GPfWQG9JlhViWJSouPuAdwb1TR2JLNt392yI0Vq8=; b=hEh+MHG/hsxQ8tyXtQfkSy2IUtGM5HMbVjgTMemklQehO0Jacy/huxmGqECZRQiDVD cb6zl24PxdRva6hBHHNQyYVbCbiL/p93aBjc8mx0E29UsdwSEfNBs6WhnNEAUqDB13DF w8AVSBfUOzvvtHAWK6XWd1KJg3mFv7PXEyb8xw5y9i//D/OP0faa7yxsEuqTDff+frqS N6wKlJt79Vfl9IgLClp+rN5/0PtoW+0kp6q8AenLxF7k+Bpn7dDmZTAn6PY4k9VVFdXs 4te12P7ME89zXoyBz56A7LbtfS5hZ3F0WMG/9nij4SjwXNAwTEoTJdHDTus5wBvAWUoY pSiQ== X-Gm-Message-State: ANhLgQ27VBIqVjECmITkirr9RdDUOZpNUk/ezlvfWGErKvGgNs5RHzeT HwNpNkjP26n4QaS5mUzJOyEDnA== X-Received: by 2002:adf:cd03:: with SMTP id w3mr3365041wrm.191.1583316125356; Wed, 04 Mar 2020 02:02:05 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z13sm10959666wro.93.2020.03.04.02.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 02:02:00 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3FC7C1FF91; Wed, 4 Mar 2020 10:01:55 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 4/9] tests/vm: give wait_ssh() option to wait for root Date: Wed, 4 Mar 2020 10:01:49 +0000 Message-Id: <20200304100154.14822-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200304100154.14822-1-alex.bennee@linaro.org> References: <20200304100154.14822-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::436 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 , Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Peter Puhov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Allow wait_ssh to wait for root user to be ready. This solves the issue where we perform a wait_ssh() successfully, but the root user is not yet ready to be logged in. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Reviewed-by: Peter Puhov Signed-off-by: Alex Bennée Message-Id: <20200219163537.22098-5-robert.foley@linaro.org> Message-Id: <20200303150622.20133-5-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5ca445e29af..7f268922685 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -312,7 +312,7 @@ class BaseVM(object): def print_step(self, text): sys.stderr.write("### %s ...\n" % text) - def wait_ssh(self, seconds=300): + def wait_ssh(self, wait_root=False, seconds=300): # Allow more time for VM to boot under TCG. if not kvm_available(self.arch): seconds *= self.tcg_ssh_timeout_multiplier @@ -320,7 +320,10 @@ class BaseVM(object): endtime = starttime + datetime.timedelta(seconds=seconds) guest_up = False while datetime.datetime.now() < endtime: - if self.ssh("exit 0") == 0: + if wait_root and self.ssh_root("exit 0") == 0: + guest_up = True + break + elif self.ssh("exit 0") == 0: guest_up = True break seconds = (endtime - datetime.datetime.now()).total_seconds()