From patchwork Sun Jan 14 14:16:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860439 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (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="hOou41Ko"; 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 3zKJV358p5z9sR8 for ; Mon, 15 Jan 2018 01:17:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 930D387A1C; Sun, 14 Jan 2018 14:17:41 +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 hOb6z6M1x47B; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 98FFB87A35; Sun, 14 Jan 2018 14:17:40 +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 A897E1C14DD for ; Sun, 14 Jan 2018 14:17:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A35FF87982 for ; Sun, 14 Jan 2018 14:17:39 +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 DLfS6lJmOfsG for ; Sun, 14 Jan 2018 14:17:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A435587966 for ; Sun, 14 Jan 2018 14:17:38 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id d9so9245591wre.3 for ; Sun, 14 Jan 2018 06:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CPLbaJtRHkTyAhKpk6USZMnUisJ8PkLryDyVyMaeikM=; b=hOou41KoQ2lHAFJ/lmLjCIlXahiPz7AcYlg7oT6D68Jos6xu0RFXbfOGT1paKfvxiO h7FRJG/Y1DFJjLRDQotMt18DAU4mBi5K5/4FYeJ8MmByH2LipzC2GK+pZwOjZlAsX/wM sJjKOj81V7XJKmNv79EoSuZZc/TuPrdukKcm88sOFexfBlhh2Wq0U4406UWr1Wb4MS2s Di3BLPBcGktSHx1JdcYVZbRys94Sfvr/uhcr0FuDXXCA337QfdDyoBw/3yp29Qzd43qu Pkm/1A0ki0XzVsV/yoDHTtZt0PRgHIwG1P5rtODpanOvy5YfTwIhrb92cs9c1Ww2++zl i/NA== 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 :in-reply-to:references; bh=CPLbaJtRHkTyAhKpk6USZMnUisJ8PkLryDyVyMaeikM=; b=Y9s1aSHfeMh7UgBWzjclCOMQiScXNEsWmH5rp41rLoyoxFOWVojErLCAtdauzF3LZN uoX/rTHm84czaJURsofTXVxjZQvbVLVaCeEGE+WBileHsMpY1nuHJGajbT8dVaFZUkpn +TWkymUN8ifHmOpWHj1TRxmtHSvcmRqOY2zeqodrqoIGbO29ZXUxgrqeAY2YfnjlLQYe RZ2plQdEvQtpQO1ybn66v5o2WdAZXP1oyw9ck0ILYQjrcPX2zZbCLkejpmHLBQIiw7XX j9h4ZMM13aiLzVK1wCYoUjAqLbWKfW9lQUBJoKxZw7szN0BT1d2KDxLqT51Z95FC+BJN 0KmA== X-Gm-Message-State: AKwxytcaGJo/AbkieUGMGLPTxWH+B2pbT84lX2aCewvVkX9g65UG+R1S 9Jh9JN/2PwEjy/AAx5pXcJrOQQ== X-Google-Smtp-Source: ACJfBot59QRrEEKuLuTC2VSQaz5qnsnH+D7pbX8fsmuzFVB+4tYCdapNY+B3Iy2SKHNwie+LHi+hWA== X-Received: by 10.223.133.183 with SMTP id 52mr3175078wrt.78.1515939456884; Sun, 14 Jan 2018 06:17:36 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:35 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:16:58 +0100 Message-Id: <878bd9ac6569877450e28861cb047a93c1550eb9.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 02/17] tests: add test for post-fakeroot script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, only post-build and post-image scripts were tested, each with their own test-script. The two test-scripts only differ in the name of the log file they create, and it is based on the name of the script, so it is easy to share the script. This allows us to easily re-use it for testing post-fakeroot scripts. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Ricardo Martincoski Reviewed-by: Ricardo Martincoski Tested-by: Ricardo Martincoski --- support/testing/tests/core/post-build.sh | 2 +- support/testing/tests/core/post-fakeroot.sh | 1 + support/testing/tests/core/post-image.sh | 13 +------------ support/testing/tests/core/test_post_scripts.py | 4 ++++ 4 files changed, 7 insertions(+), 13 deletions(-) create mode 120000 support/testing/tests/core/post-fakeroot.sh mode change 100755 => 120000 support/testing/tests/core/post-image.sh diff --git a/support/testing/tests/core/post-build.sh b/support/testing/tests/core/post-build.sh index b1fb834bc5..f3d0dbe511 100755 --- a/support/testing/tests/core/post-build.sh +++ b/support/testing/tests/core/post-build.sh @@ -9,4 +9,4 @@ printf "HOST_DIR,%s\n" "${HOST_DIR}" printf "STAGING_DIR,%s\n" "${STAGING_DIR}" printf "BINARIES_DIR,%s\n" "${BINARIES_DIR}" printf "BR2_CONFIG,%s\n" "${BR2_CONFIG}" -) > ${BUILD_DIR}/post-build.log +) > ${BUILD_DIR}/$(basename "${0}" .sh).log diff --git a/support/testing/tests/core/post-fakeroot.sh b/support/testing/tests/core/post-fakeroot.sh new file mode 120000 index 0000000000..d680fccafc --- /dev/null +++ b/support/testing/tests/core/post-fakeroot.sh @@ -0,0 +1 @@ +post-build.sh \ No newline at end of file diff --git a/support/testing/tests/core/post-image.sh b/support/testing/tests/core/post-image.sh deleted file mode 100755 index 1c2a0f2c89..0000000000 --- a/support/testing/tests/core/post-image.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -( -printf "arg1,%s\n" "${1}" -printf "arg2,%s\n" "${2}" -printf "arg3,%s\n" "${3}" -printf "TARGET_DIR,%s\n" "${TARGET_DIR}" -printf "BUILD_DIR,%s\n" "${BUILD_DIR}" -printf "HOST_DIR,%s\n" "${HOST_DIR}" -printf "STAGING_DIR,%s\n" "${STAGING_DIR}" -printf "BINARIES_DIR,%s\n" "${BINARIES_DIR}" -printf "BR2_CONFIG,%s\n" "${BR2_CONFIG}" -) > ${BUILD_DIR}/post-image.log diff --git a/support/testing/tests/core/post-image.sh b/support/testing/tests/core/post-image.sh new file mode 120000 index 0000000000..d680fccafc --- /dev/null +++ b/support/testing/tests/core/post-image.sh @@ -0,0 +1 @@ +post-build.sh \ No newline at end of file diff --git a/support/testing/tests/core/test_post_scripts.py b/support/testing/tests/core/test_post_scripts.py index 1db568b0d6..edb339d8c4 100644 --- a/support/testing/tests/core/test_post_scripts.py +++ b/support/testing/tests/core/test_post_scripts.py @@ -11,9 +11,11 @@ class TestPostScripts(infra.basetest.BRTest): BR2_SYSTEM_BIN_SH_NONE=y # BR2_PACKAGE_BUSYBOX is not set BR2_ROOTFS_POST_BUILD_SCRIPT="{}" + BR2_ROOTFS_POST_FAKEROOT_SCRIPT="{}" BR2_ROOTFS_POST_IMAGE_SCRIPT="{}" BR2_ROOTFS_POST_SCRIPT_ARGS="foobar baz" """.format(infra.filepath("tests/core/post-build.sh"), + infra.filepath("tests/core/post-fakeroot.sh"), infra.filepath("tests/core/post-image.sh")) def check_post_log_file(self, path, what): @@ -37,5 +39,7 @@ class TestPostScripts(infra.basetest.BRTest): def test_run(self): f = os.path.join(self.builddir, "build", "post-build.log") self.check_post_log_file(f, "target") + f = os.path.join(self.builddir, "build", "post-fakeroot.log") + self.check_post_log_file(f, "target") f = os.path.join(self.builddir, "build", "post-image.log") self.check_post_log_file(f, "images")