From patchwork Thu Feb 11 14:40:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1439538 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dbznc1MYNz9rx6 for ; Fri, 12 Feb 2021 01:40:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D03C282663; Thu, 11 Feb 2021 15:40:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 93F7482663; Thu, 11 Feb 2021 15:40:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 468EC82627 for ; Thu, 11 Feb 2021 15:40:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=andriy.shevchenko@linux.intel.com IronPort-SDR: gVYl724zANoNlGLjP1skImdp9+vFuTr4rgBGQmK/rJeakSiLJG+EYvcfFAxEQE5ucqvRXbHBId 3HPXSEASwMFw== X-IronPort-AV: E=McAfee;i="6000,8403,9891"; a="161996927" X-IronPort-AV: E=Sophos;i="5.81,170,1610438400"; d="scan'208";a="161996927" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2021 06:40:15 -0800 IronPort-SDR: tPiNmlU6b2hEXRY2cbg+wC/N/JRn43vIBA5GCMFPOzdIDbjixdlyuG8phwaFM9e+gZnJQDWZbE bF9oNDB7ZMoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,170,1610438400"; d="scan'208";a="588810006" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 11 Feb 2021 06:40:14 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9529ADE; Thu, 11 Feb 2021 16:40:13 +0200 (EET) From: Andy Shevchenko To: Simon Glass , u-boot@lists.denx.de, trini@konsulko.com Cc: Andy Shevchenko , Patrick Delaunay Subject: [PATCH v2 1/4] test: Include /sbin to the PATH when creating ext4 disk image Date: Thu, 11 Feb 2021 16:40:09 +0200 Message-Id: <20210211144012.55676-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean On some distributions the mkfs.ext4 is under /sbin and /sbin is not set for mere users. Include /sbin to the PATH when creating ext4 disk image, so that users won't get a scary traceback from Python. Cc: Patrick Delaunay Signed-off-by: Andy Shevchenko Reviewed-by: Simon Glass --- v2: used '/sbin' as is (Simon) test/py/tests/test_env.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py index 940279651da0..9bed2f48d77e 100644 --- a/test/py/tests/test_env.py +++ b/test/py/tests/test_env.py @@ -414,6 +414,8 @@ def mk_env_ext4(state_test_env): if os.path.exists(persistent): c.log.action('Disk image file ' + persistent + ' already exists') else: + # Some distributions do not add /sbin to the default PATH, where mkfs.ext4 lives + os.environ["PATH"] += os.pathsep + '/sbin' try: u_boot_utils.run_and_log(c, 'dd if=/dev/zero of=%s bs=1M count=16' % persistent) u_boot_utils.run_and_log(c, 'mkfs.ext4 %s' % persistent)