From patchwork Thu May 13 11:40:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1478038 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=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=MQ1P4Fvj; dkim-atps=neutral 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 4FgqVQ6hWHz9sWP for ; Thu, 13 May 2021 21:41:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F222C81E53; Thu, 13 May 2021 13:40:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="MQ1P4Fvj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A43D381EB0; Thu, 13 May 2021 13:40:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 543ED81D1B for ; Thu, 13 May 2021 13:40:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620906043; bh=piJ1FCDsteB7dplbnnQwWTcRsZehJ5HLZfIlHK3K6+c=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=MQ1P4FvjU1plVPs4ZiBl1INzK7wZl31b+KSqXaKkunarFLk7tYWE7l1pnj8rTl8zX 1EIVULnQazTKFy4vF5+bNql+XcF+2jGdE+/aqGYb4gDDzQRvEr1fBtUpWFf3zxKF5T t1SLX5FtCH5EtMbfqViyaNtO5pIZ+wwiWWQ2otks= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([62.143.247.63]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MrQEn-1lBh9x3Wx5-00oYD2; Thu, 13 May 2021 13:40:42 +0200 From: Heinrich Schuchardt To: Tom Rini Cc: Andy Shevchenko , Simon Glass , Stephen Warren , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/1] test: revert Don't unmount not (yet) mounted system Date: Thu, 13 May 2021 13:40:35 +0200 Message-Id: <20210513114035.177293-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:aQY1XuJNu6Ln63w33TgSu5N1nFv4lQ3eRS5sliPVg2fRfx8XW5C R+VLPS2OYUKIGNHuhYYXmh6ROYlgLmYPPcN1KY3ZZ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fhX+ziYsGyEHha4gglXVfdmArJvgv4MouVq+Hdd36N17Zyipxrd RSw09doBqtSk43oCUvx3ivCaFK2vfSlKHyUEqwQHpaNAUVhH3R3yVn8iORT3gmnvRbwR6PsFC Ez6BzMr1F69HGi2Jk+gC6p2SDBku9c8QdeXoOvE9iL3FiU5M0i5YQjTwPpVO1N7mBtg/le215 JfrEObEawnG2gkHUKR/Mh96Mq4Nwlj8nmZv5OG/6WmuTSG3bmKFTL90hkFsPRM1GlbPRKs72k dTcw7v0BgX4uC/+1RyCU0a90UvWMWQjFxAnsjiES7yltzYEoQqYjD9c4jx7892DKJN46g= 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.4 at phobos.denx.de X-Virus-Status: Clean Since commit 1ba21bb06b08 ("test: Don't unmount not (yet) mounted system") the following tests are skipped: test/py/tests/test_fs/test_basic.py test/py/tests/test_fs/test_ext.py SKIPPED [13] test/py/tests/test_fs/conftest.py:350: Setup failed for filesystem: ext4. Command 'guestmount -a build-sandbox/persistent-data/3GB.ext4.img -m /dev/sda build-sandbox/persistent-data/mnt' returned non-zero exit status 1. Let's revert the patch to get our tests back. Fixes: 1ba21bb06b08 ("test: Don't unmount not (yet) mounted system") Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_fs/conftest.py | 78 +++++++++---------------------- test/run | 8 ++-- 2 files changed, 26 insertions(+), 60 deletions(-) -- 2.30.2 diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py index 50af9efcf7..ec70e8c4ef 100644 --- a/test/py/tests/test_fs/conftest.py +++ b/test/py/tests/test_fs/conftest.py @@ -270,20 +270,9 @@ def fs_obj_basic(request, u_boot_config): # 3GiB volume fs_img = mk_fs(u_boot_config, fs_type, 0xc0000000, '3GB') - except CalledProcessError as err: - pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - - try: - check_call('mkdir -p %s' % mount_dir, shell=True) - except CalledProcessError as err: - pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - finally: - call('rm -f %s' % fs_img, shell=True) - try: # Mount the image so we can populate it. + check_call('mkdir -p %s' % mount_dir, shell=True) mount_fs(fs_type, fs_img, mount_dir) # Create a subdirectory. @@ -346,15 +335,18 @@ def fs_obj_basic(request, u_boot_config): % big_file, shell=True).decode() md5val.append(out.split()[0]) + umount_fs(mount_dir) except CalledProcessError as err: - pytest.skip('Setup failed for filesystem: ' + fs_type + '. {}'.format(err)) + pytest.skip('Setup failed for filesystem: ' + fs_type + \ + '. {}'.format(err)) return else: yield [fs_ubtype, fs_img, md5val] finally: umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) - call('rm -f %s' % fs_img, shell=True) + if fs_img: + call('rm -f %s' % fs_img, shell=True) # # Fixture for extended fs test @@ -386,20 +378,9 @@ def fs_obj_ext(request, u_boot_config): # 128MiB volume fs_img = mk_fs(u_boot_config, fs_type, 0x8000000, '128MB') - except CalledProcessError as err: - pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - - try: - check_call('mkdir -p %s' % mount_dir, shell=True) - except CalledProcessError as err: - pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - finally: - call('rm -f %s' % fs_img, shell=True) - try: # Mount the image so we can populate it. + check_call('mkdir -p %s' % mount_dir, shell=True) mount_fs(fs_type, fs_img, mount_dir) # Create a test directory @@ -441,6 +422,7 @@ def fs_obj_ext(request, u_boot_config): md5val.append(out.split()[0]) check_call('rm %s' % tmp_file, shell=True) + umount_fs(mount_dir) except CalledProcessError: pytest.skip('Setup failed for filesystem: ' + fs_type) return @@ -449,7 +431,8 @@ def fs_obj_ext(request, u_boot_config): finally: umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) - call('rm -f %s' % fs_img, shell=True) + if fs_img: + call('rm -f %s' % fs_img, shell=True) # # Fixture for mkdir test @@ -477,10 +460,11 @@ def fs_obj_mkdir(request, u_boot_config): fs_img = mk_fs(u_boot_config, fs_type, 0x8000000, '128MB') except: pytest.skip('Setup failed for filesystem: ' + fs_type) - return else: yield [fs_ubtype, fs_img] - call('rm -f %s' % fs_img, shell=True) + finally: + if fs_img: + call('rm -f %s' % fs_img, shell=True) # # Fixture for unlink test @@ -509,20 +493,9 @@ def fs_obj_unlink(request, u_boot_config): # 128MiB volume fs_img = mk_fs(u_boot_config, fs_type, 0x8000000, '128MB') - except CalledProcessError as err: - pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - - try: - check_call('mkdir -p %s' % mount_dir, shell=True) - except CalledProcessError as err: - pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - finally: - call('rm -f %s' % fs_img, shell=True) - try: # Mount the image so we can populate it. + check_call('mkdir -p %s' % mount_dir, shell=True) mount_fs(fs_type, fs_img, mount_dir) # Test Case 1 & 3 @@ -546,6 +519,7 @@ def fs_obj_unlink(request, u_boot_config): check_call('dd if=/dev/urandom of=%s/dir5/file1 bs=1K count=1' % mount_dir, shell=True) + umount_fs(mount_dir) except CalledProcessError: pytest.skip('Setup failed for filesystem: ' + fs_type) return @@ -554,7 +528,8 @@ def fs_obj_unlink(request, u_boot_config): finally: umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) - call('rm -f %s' % fs_img, shell=True) + if fs_img: + call('rm -f %s' % fs_img, shell=True) # # Fixture for symlink fs test @@ -584,22 +559,11 @@ def fs_obj_symlink(request, u_boot_config): try: - # 1GiB volume + # 3GiB volume fs_img = mk_fs(u_boot_config, fs_type, 0x40000000, '1GB') - except CalledProcessError as err: - pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - try: - check_call('mkdir -p %s' % mount_dir, shell=True) - except CalledProcessError as err: - pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err)) - return - finally: - call('rm -f %s' % fs_img, shell=True) - - try: # Mount the image so we can populate it. + check_call('mkdir -p %s' % mount_dir, shell=True) mount_fs(fs_type, fs_img, mount_dir) # Create a subdirectory. @@ -623,6 +587,7 @@ def fs_obj_symlink(request, u_boot_config): % medium_file, shell=True).decode() md5val.extend([out.split()[0]]) + umount_fs(mount_dir) except CalledProcessError: pytest.skip('Setup failed for filesystem: ' + fs_type) return @@ -631,4 +596,5 @@ def fs_obj_symlink(request, u_boot_config): finally: umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) - call('rm -f %s' % fs_img, shell=True) + if fs_img: + call('rm -f %s' % fs_img, shell=True) diff --git a/test/run b/test/run index 869406cd8d..04ec1a05e0 100755 --- a/test/run +++ b/test/run @@ -22,16 +22,16 @@ failures=0 if [ -z "$tools_only" ]; then # Run all tests that the standard sandbox build can support - run_test "sandbox" ./test/py/test.py --bd sandbox --build \ + run_test "sandbox" ./test/py/test.py -ra --bd sandbox --build \ -m "${mark_expr}" fi # Run tests which require sandbox_spl -run_test "sandbox_spl" ./test/py/test.py --bd sandbox_spl --build \ +run_test "sandbox_spl" ./test/py/test.py -ra --bd sandbox_spl --build \ -k 'test_ofplatdata or test_handoff or test_spl' # Run the sane tests with sandbox_noinst (i.e. without OF_PLATDATA_INST) -run_test "sandbox_spl" ./test/py/test.py --bd sandbox_noinst --build \ +run_test "sandbox_spl" ./test/py/test.py -ra --bd sandbox_noinst --build \ -k 'test_ofplatdata or test_handoff or test_spl' if [ -z "$tools_only" ]; then @@ -39,7 +39,7 @@ if [ -z "$tools_only" ]; then # build which does not enable CONFIG_OF_LIVE for the live device tree, so we can # check that functionality is the same. The standard sandbox build (above) uses # CONFIG_OF_LIVE. - run_test "sandbox_flattree" ./test/py/test.py --bd sandbox_flattree \ + run_test "sandbox_flattree" ./test/py/test.py -ra --bd sandbox_flattree \ --build -k test_ut fi