From patchwork Tue Jul 18 20:38:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 790525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NhdWnZDn"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xBsTG6Y3Bz9s71 for ; Wed, 19 Jul 2017 06:39:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4783887030; Tue, 18 Jul 2017 20:39:10 +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 Nro6wDU_JDie; Tue, 18 Jul 2017 20:39:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 126B787155; Tue, 18 Jul 2017 20:39:04 +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 E6DF41BFBAD for ; Tue, 18 Jul 2017 20:39:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A550086FBA for ; Tue, 18 Jul 2017 20:38:49 +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 4Fm2wY4Lb6gU for ; Tue, 18 Jul 2017 20:38:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6CF6986BA4 for ; Tue, 18 Jul 2017 20:38:48 +0000 (UTC) Received: by mail-wr0-f172.google.com with SMTP id v105so15496288wrb.0 for ; Tue, 18 Jul 2017 13:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=y9i+agapWJu0vCfNMXGyC8aTuq+HJAmUrthJqEyu8Qk=; b=NhdWnZDngg2SLXCmJ0VdW2OAATs/2wFYZvnLSk87aLdhLsupYJ0Jg1AFATHZzEUA6T 1s9j8lWeN3AQunoOhdFfZ5+22VqNTYLjINUF6GB4PfXsQFJZ5Dr667heV2e2tUUSuwdR mtk4Jkh+Kz3yLR24m3lINREMXXRdZOCFUHecz8tZWt5ng6PBzdvAKPVRodLGeYs5ijNC mPEc0nhP6nsSERZTH8as7wQ1/PH8QQ0EHQEQs2zS0/SHRxx7liFgoYd3gTJhnRTbKqc9 8Xmin5Bxu68Rvi/VP85sNVIOPKRBTBSFjq0o00I1NBnHTXLWQStWt4fc2BF/m4XckVQX /NTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=y9i+agapWJu0vCfNMXGyC8aTuq+HJAmUrthJqEyu8Qk=; b=cEEgdjOGYHjNCOkwMcAKjLywblZzZ61dEgEZKVQCPuf8U799yZ5WqQC9cFXtT6cYl7 xAIFGIbDuvvWWO0BUbE0g28NyYdIoQZoIW73mxn3qvuV9o2x91TeNMRIaR0zxeMAjL99 6GTJKNClZ6gcp8dOVjSJncSQPwHNGC3bfK9oYKb1JG2Jxj3WAwMr6FsNGnM7QPtVdihJ x1JBxVFJLkxgJGUnD6OsJe1szUcfrAxAGP8UvjDDovbIve4MRWNQcBSCh9OH9bIt0cIW K02taPge3WXi88dMTzgFShFNVj2kiVhlmEfhRNjIq3SIzvBn0fDNh3l343F/74YMiCG3 ULFw== X-Gm-Message-State: AIVw112/aqj+yQVBYaJ/rrlq4p8dhAY7g1k3yAajYdVozTQXFEXnZA1g 0mfbes0hpMR9UqVY X-Received: by 10.28.180.70 with SMTP id d67mr3115507wmf.121.1500410326669; Tue, 18 Jul 2017 13:38:46 -0700 (PDT) Received: from localhost.localdomain (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id 66sm4258626wmj.29.2017.07.18.13.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 13:38:45 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Tue, 18 Jul 2017 22:38:39 +0200 Message-Id: <20170718203839.14913-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.11.0 Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCHv3] support/tests: allow properly indented config fragment X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, defining a config fragment in the runtime test infra requires that the fragment not to be indented. This is beark, and causes grievance when looking at the code (e.g. to fix it). Just strip out all leading spaces/tabs when writing the configuration lines into the config file, allowing in-line indented config fragments, like so: class TestFoo(bla): config = bla.config + \ """ FOO=y # BAR is not set """ Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle Reviewed-by: Arnout Vandecappelle (Essensium/Mind) --- Changes v2 -> v3: - use and fix code snippet provided by Arnout, thanks! ;-) - do it in our base test class, not on the builder class (Arnout) Changes v1 -> v2: - add example in commit log (Thomas) --- support/testing/infra/basetest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index 1a082bb441..07c180e232 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -41,6 +41,7 @@ class BRTest(unittest.TestCase): self.testname = self.__class__.__name__ self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname) self.emulator = None + self.config = '\n'.join([line.lstrip() for line in self.config.splitlines()]) def show_msg(self, msg): print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),