From patchwork Mon Apr 24 09:22:39 2023 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: 676567 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp2055030wrs; Mon, 24 Apr 2023 02:26:13 -0700 (PDT) X-Google-Smtp-Source: AKy350YjSXQZccpJi53JJzmaz4afxQuodHWM4a+SIiFXZVA4n2wWGvHOkcrrgxCPDZRThfJr/Qbp X-Received: by 2002:a05:622a:1b8c:b0:3e6:938a:2aef with SMTP id bp12-20020a05622a1b8c00b003e6938a2aefmr19767076qtb.9.1682328373144; Mon, 24 Apr 2023 02:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682328373; cv=none; d=google.com; s=arc-20160816; b=KaWMaMZxlBV/KKimOSyCcghcnex4xcVqx7CRkOpKt/WZPWOhlZSIgshYSkYhIHHjwN lPpwdD/fLGlzh9FA+YU7Vh0cBdZObONekXmQOSf6yDJtNBPszWbxL7W0CBjGnM6VJ1K+ liLGGPJXdSihkUmNtGl0bpCbZ7NQYQxRhuW34Caszvh+pReV3D+OoMRri5ttTpd46b80 qUxuvBTOW65jEysYmSjmLYh4w2U5m7KXUGDuIU9F4J/QGXk8ecbYf5FSf3JMhZfCToGT 5+VyOjSyH78o5jCMwJjKGxkrZDsDyEKRd51yvQQt5YlHMA4hpL5oy04FFkvG83wGCxx9 oYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=IPLhtaZltjDsm0+7czRR+umbyKr+Au9dGft4aGwUTwE=; b=fzoSO5kTSrHgCsvk3Oyxy0ZTMuqSzvQ0ZxPHirFpTnRoM39pvSmKXpFgcav0IEJynn xZjZSNBamCT0UUmvW6Dbp7I1TEHFUGkKCWisrTAE+IhWZygZy2re7qDKp9eYXOf1FqCS nnAPnuzfFwJAk7TpueSxwrRDHvFdpI+H1MqwkR7nEyQBWEoeUFOLOBPFJtHsdmnOT5OQ 7/FTCq5AuD5EaX6ozuiWupttSlyTWFSTfdXvxzRn7sV/bg+M8pswGD1HQLp5bmQNCp4G x7g+6uqOkouw92hLsFr2wGgIsxVLpZqXEa5ar2RkdrDZ+aV1GubLRU0LaEozOZStE054 KIxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JINczLzo; 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=pass (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 m20-20020a05620a221400b0074e314ae820si5808115qkh.306.2023.04.24.02.26.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Apr 2023 02:26:13 -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=pass header.i=@linaro.org header.s=google header.b=JINczLzo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqsPX-0007Af-7t; Mon, 24 Apr 2023 05:23:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqsPW-00079j-1T for qemu-devel@nongnu.org; Mon, 24 Apr 2023 05:23:02 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqsPO-0004ld-Gm for qemu-devel@nongnu.org; Mon, 24 Apr 2023 05:23:01 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f1950f5676so29974915e9.3 for ; Mon, 24 Apr 2023 02:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682328173; x=1684920173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IPLhtaZltjDsm0+7czRR+umbyKr+Au9dGft4aGwUTwE=; b=JINczLzorryr1mK2BH3fpR1gApIw8GzNALXrpymsuVON0Gn4Zjj4FV45bHu6JVcEmi 1ZpejeXyznctGAtmf2FOlGGJLZyT1TCAAZxsPjc8L8tkaK4KtgDdLj2zLpQD+x4bj5HY 4yKizdrwwPEYSLAl+FY144Tqyt8pE1Y3GhnTvjVwvtPWg75sqw4HawGm0uCMEniBMFDr ubeaNkmgUaNUn7WHgMj08albaZmnvRdMKQyPOX2hWdNPKMRA7hisfQLIlUmCED7XAQK1 xdxp6/HL3E9zvtOeYEIriGhrxsjRCpckN+8ZC0I6J3qGNOhtq2ywInkOD/GlDaJh1zrK 5crA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682328173; x=1684920173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IPLhtaZltjDsm0+7czRR+umbyKr+Au9dGft4aGwUTwE=; b=bWHM8tQrlsguQIfm5h2jsOqTN1C0yF2AWAHE+i1t0wruwHXf+caG/kB05q6O2k55IY JGZ7M3sy5owAJzlbipwo+eQCwE22zSlfoqV9QnuENpt1FdrgAcsCXpdy8qEnBJ7n43hh jt0t6mdJws5F5w0XLdPIKSYag4q932z6bb/WqNU4iUmTid2ETnk3f04Wn/OJg3zahNOm RKh2r/8mzaIiK24HM1LAzf2wWyK4rH4IGWnILqy/BY7u1YbpzPQwUVvxPll9oycris4x ak1KHJAjxjm7GmVQP0ebSQgD0EvSCewW+438/5EcIQFLskspYQ3sQPuoPWRbb3t+7dge aNPw== X-Gm-Message-State: AAQBX9cbqvNF5PiNWFVksMcCNU77hstwTsR37BaOP1/24gDMIiZuOXga HlNbdgJLuFw7MeTRCnEifvNt9Q== X-Received: by 2002:a7b:cb96:0:b0:3f0:7e15:f8fc with SMTP id m22-20020a7bcb96000000b003f07e15f8fcmr7214993wmi.14.1682328173070; Mon, 24 Apr 2023 02:22:53 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id eo9-20020a05600c82c900b003f0ad8d1c69sm8698363wmb.25.2023.04.24.02.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 02:22:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5C14C1FFC0; Mon, 24 Apr 2023 10:22:50 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Beraldo Leal , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , "Edgar E. Iglesias" , Paolo Bonzini , Aurelien Jarno , Peter Maydell , Juan Quintela , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Richard Henderson , Joel Stanley , Leif Lindholm , Markus Armbruster , Radoslaw Biernacki , Stefan Hajnoczi , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , John Snow , Andrew Jeffery , David Hildenbrand , Bastian Koppelmann , Max Filippov , qemu-s390x@nongnu.org, Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , qemu-arm@nongnu.org, Eduardo Habkost , Ilya Leoshkevich Subject: [PATCH 08/18] tests/avocado: Make ssh_command_output_contains() globally available Date: Mon, 24 Apr 2023 10:22:39 +0100 Message-Id: <20230424092249.58552-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230424092249.58552-1-alex.bennee@linaro.org> References: <20230424092249.58552-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth This function will be useful in other tests, too, so move it to the core LinuxSSHMixIn class. Signed-off-by: Thomas Huth Reviewed-by: Cédric Le Goater Message-Id: <20230421110345.1294131-2-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/avocado/avocado_qemu/__init__.py | 8 ++++++++ tests/avocado/linux_ssh_mips_malta.py | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index cb71f50db9..6788837e1b 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -431,6 +431,14 @@ def ssh_command(self, command): f'Guest command failed: {command}') return stdout_lines, stderr_lines + def ssh_command_output_contains(self, cmd, exp): + stdout, _ = self.ssh_command(cmd) + for line in stdout: + if exp in line: + break + else: + self.fail('"%s" output does not contain "%s"' % (cmd, exp)) + class LinuxDistro: """Represents a Linux distribution diff --git a/tests/avocado/linux_ssh_mips_malta.py b/tests/avocado/linux_ssh_mips_malta.py index 0179d8a6ca..d9bb525ad9 100644 --- a/tests/avocado/linux_ssh_mips_malta.py +++ b/tests/avocado/linux_ssh_mips_malta.py @@ -101,14 +101,6 @@ def shutdown_via_ssh(self): self.ssh_disconnect_vm() wait_for_console_pattern(self, 'Power down', 'Oops') - def ssh_command_output_contains(self, cmd, exp): - stdout, _ = self.ssh_command(cmd) - for line in stdout: - if exp in line: - break - else: - self.fail('"%s" output does not contain "%s"' % (cmd, exp)) - def run_common_commands(self, wordsize): self.ssh_command_output_contains( 'cat /proc/cpuinfo',