From patchwork Wed Nov 20 13:39:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Havelange X-Patchwork-Id: 1198155 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=essensium.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=essensium-com.20150623.gappssmtp.com header.i=@essensium-com.20150623.gappssmtp.com header.b="KgDaS2aT"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47J3j63QpPz9sSb for ; Thu, 21 Nov 2019 00:40:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C3A8B885D7; Wed, 20 Nov 2019 13:40:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wZXiQB5aO5Cj; Wed, 20 Nov 2019 13:40:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E4E42885CF; Wed, 20 Nov 2019 13:40:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 063ED1BF379 for ; Wed, 20 Nov 2019 13:40:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0385F86C8D for ; Wed, 20 Nov 2019 13:40:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rhFZBT1U_jGr for ; Wed, 20 Nov 2019 13:40:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BC39F86C20 for ; Wed, 20 Nov 2019 13:40:04 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id u18so7022944wmc.3 for ; Wed, 20 Nov 2019 05:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essensium-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kF6JetGgOy6WaGf6ELbwkAn3Go32NFyMEggzKOLXNBM=; b=KgDaS2aTchPr/jiQ2tIhu50npk3LKXz+IFGLPnR2LZ/0z8eebs1iXa/X9V1RANYe7a 03Qxpq/Z+Ycs9z90P/mPIzkENeLmBeYzn8Jc9v8ZIvfw27+vh3Zx5HIJ6ZQEIg0jHDPL HChCCsZrM5aURzDn7OKmCy1rRblYA+OY//p4Oq9Jbzwxx89o4ZHhPL4lBekumpOFQZRQ M1S3UlTJN6aGtEVEjRRzpCmY/nvkPpqE0WW2sMjnGY8kRtiuE990DerPLzoOh92TeZG7 5KH3Tsl3Fm1cywqtik6krsuKaTd9w05I4mg83u7h1zn5rRnleMZgnA2o9IEQM5yVjcHD Yi+g== 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:mime-version :content-transfer-encoding; bh=kF6JetGgOy6WaGf6ELbwkAn3Go32NFyMEggzKOLXNBM=; b=etwjQ3HQinZSklI2DbYcT7Xzl54mTtYDwjgfrZ53heOyDMVkGSYEdgWs5Bt9blAGsr CO+NuorjJizevaFmcmf3n/7dXDYiaFQQpvTWFrvVyKQeCfFsQvR8L7/tlZRjM1HLJ2K5 iHm6DxP9h4kAhBx6S64GMJcxGEwBqktdmDWOG3UqXwOSuPm69G5MaFe+9nfNuJTh3SOW dS/fOBrs5+oyA2oU6SKbbj4t3y95QQjSgTtfHbZXjWiruAzZAhYGnIPSxYXyqFg8Hu+2 28Y+HmdUI/OmrZQoUHlf58nYvSjnlAs9gzsipyaq+L0AydW0beGarGoV1RkuCvP/a1Yp TskQ== X-Gm-Message-State: APjAAAUgc94aAlgAK0C54ZwgiTDzibYdzptLVJlMgRCbhv/28LVvlfGL sMYAqLiAnDkLHqQIV9KZFb25M+/8ics= X-Google-Smtp-Source: APXvYqyvA0Bfd0szoHIZSUxtQKNSAC+qg2IuBnf9flCiYtq+uZSGO+a1WNV5WTq3G+U+NWXaXuGu3w== X-Received: by 2002:a1c:4946:: with SMTP id w67mr3423212wma.16.1574257202678; Wed, 20 Nov 2019 05:40:02 -0800 (PST) Received: from ph-ThinkPad-E560.local.ess-mail.com (ip-188-118-3-185.reverse.destiny.be. [188.118.3.185]) by smtp.gmail.com with ESMTPSA id v9sm30579090wrs.95.2019.11.20.05.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 05:40:02 -0800 (PST) From: Patrick Havelange To: buildroot@buildroot.org Date: Wed, 20 Nov 2019 14:39:51 +0100 Message-Id: <20191120133952.22978-1-patrick.havelange@essensium.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/2] support/testing: add assertRunOk method to BRTest class X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Patrick Havelange , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This method asserts that the given command ran successfully. The goal is for it to be used by the different tests when needed. Signed-off-by: Patrick Havelange --- Changes v1 -> v2 [Thomas - Moved this function to the BRTest class - Removed unnecessary "sh -c" --- support/testing/infra/basetest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index a176bc328a..023039f6af 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -84,3 +84,9 @@ class BRTest(BRConfigTest): if self.emulator: self.emulator.stop() super(BRTest, self).tearDown() + + # Run the given 'cmd' with a 'timeout' on the target and + # assert that the command succeeded + def assertRunOk(self, cmd, timeout=-1): + _, exit_code = self.emulator.run(cmd, timeout) + self.assertEqual(exit_code, 0)