From patchwork Thu Sep 27 07:07:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 147678 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1635202lji; Thu, 27 Sep 2018 00:06:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV63PsyuwGhAEy0MUE5bA8Ts0UpJNaD6UP6QtkN2qyq2FU5NA3h/7fFrYgB/7gfxDLO3OlR4i X-Received: by 2002:aa7:c759:: with SMTP id c25-v6mr16116602eds.231.1538031985409; Thu, 27 Sep 2018 00:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538031985; cv=none; d=google.com; s=arc-20160816; b=yJAx7u9R51jiqDFsWqhZg+rIZaM3klJcal6oUsUsEEpoY3JU25B0iCRGT/uGEPay7L rx4dvRkwt/dM/qBU1UIdOxWgYeOG0dqlzWhvMDk64Df459NmEgpp4XTH4mw2kD9fcM5b py/FogqkHbJMW0vFA0kEKNT5vlFm+9hZNzrNaN9/oBGgXSY2SSukR1HuFT65UMCf+dUQ U+9lAISDykHRVBRljQPx6kEKeEwH9mFXkxcmU/OvkG6U9cmAlk+qSvUD6y1ROCAM8gxA vRLTBWSsKYcgWWRGkAimK8ZLB6P5rY/oDGZI6okRG+rsAXXaut3e3VKpq7dXo/394C65 WgVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature; bh=Oyn0he73VA8WAhWpWOlPrPi6brBlQIIXbJhhwaJa/rE=; b=RCagAtOFyAMRutyW5Nj6jO5oEzmRCbXOgVO7Sznv0gJ1QwkdhzQ7sm8btz4CBtPmi1 Vv5Z0Happ9uoPEz9Fn6x3jBlqgMI7F4zZfmIRALBikJ8D6CLRDwWaiV2i/41eAqaNcMH 1v2KPaDCbh0ohACYEO7ZnjsVA56PyDgoHR52890tzRRZe6+aRLUC54ldbVjE/xnvmCtI EeOP+/ADKkUmKMKgNIaeN35ZjNby5E3hMFxLR5JWfccRFZXJN3m8wECAAOBl0VSsA6dS ta7k/rCTTpKsRuaNmqpSMFMv6nkeJ0DfbgO5KgRWmPohqg3c52ybJuqmjBoiMZJlYQSE vPwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hEa6YSWo; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 19-v6si2646052edt.374.2018.09.27.00.06.25; Thu, 27 Sep 2018 00:06:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hEa6YSWo; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 0F60DC21DA1; Thu, 27 Sep 2018 07:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EB449C21C6A; Thu, 27 Sep 2018 07:06:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 62D14C21C29; Thu, 27 Sep 2018 07:06:21 +0000 (UTC) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by lists.denx.de (Postfix) with ESMTPS id BF983C21C29 for ; Thu, 27 Sep 2018 07:06:20 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id d8-v6so1177194pfo.13 for ; Thu, 27 Sep 2018 00:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=21yXiPXc3yfrDM7C/MRlAFrtjNNv97hbehWa2jF5qKU=; b=hEa6YSWoWDJpHBm3K8V8WROWN8iv2sU5Wkiu0IS662TsAelsCWxN3EJFixfcBp9p/l FeuzAdufk5FposXmR8K9EANke2wMK9tJmOlyjzZKJII+lEXzODXN8ogXiE/LIcM/BBT1 GrZg7vh7Cgq5nwhFom8hKSJl06AB9EUwk/zko= 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:in-reply-to :references; bh=21yXiPXc3yfrDM7C/MRlAFrtjNNv97hbehWa2jF5qKU=; b=uIF7w1+lR+8I5E9HukezvqREhR7DBL2Mh3M/GtBhKr7vEcYbMJNvqmJn5tGojpTyvY TkxcZmnnzeo4xxzaybIgQTpw5581ZnI/UB4IYZF7AGKChXnoKFAA28jP+ipulI2TnbGg APLyuK+HZTgD809uMTLspDklv0TE0dvrqnqQzABBRR3hdAcKPUlaIYUTnoDY/iKtqBTd KTtx08dEYE4iEOPMz7/O7fi13SsoK6TkKGXcpJPOnk//6RwkdouaTs8LMFTL87H+sfx3 A9dU1Ju2dw5ubBj3CfRBrE2QHInreQHcMvW23ssx1zlvhZZaeVWZ5B0tct1R5S1VnfiI tFGA== X-Gm-Message-State: ABuFfohjPA+tGrHNof8esdwZFf/Wctcs8mpiHpdy5s4dcgIFyd655w3a MxdxM+RsNik3V9aBzN3FD6qJBQ== X-Received: by 2002:a17:902:820a:: with SMTP id x10-v6mr9450288pln.261.1538031979362; Thu, 27 Sep 2018 00:06:19 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id r1-v6sm2153040pff.23.2018.09.27.00.06.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 00:06:15 -0700 (PDT) From: "Akashi, Takahiro" To: trini@konsulko.com, agraf@suse.de Date: Thu, 27 Sep 2018 16:07:22 +0900 Message-Id: <20180927070723.7741-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180927070336.7561-1-takahiro.akashi@linaro.org> References: <20180927070336.7561-1-takahiro.akashi@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] test/py: test_fs: remove fs_type argument from umount_fs() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: "Akashi Takahiro" Since there is no use of fs_type in umount_fs(), just remove it. Signed-off-by: Akashi Takahiro Reviewed-by: Simon Glass --- test/py/tests/test_fs/conftest.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py index 6404b311bc30..826b0f0cb07c 100644 --- a/test/py/tests/test_fs/conftest.py +++ b/test/py/tests/test_fs/conftest.py @@ -129,7 +129,7 @@ def mount_fs(fs_type, device, mount_point): except CalledProcessError: raise -def umount_fs(fs_type, mount_point): +def umount_fs(mount_point): if fuse_mounted: call('sync') call('guestunmount %s' % mount_point, shell=True) @@ -223,14 +223,14 @@ def fs_obj_basic(request, u_boot_config): % big_file, shell=True) md5val.append(out.split()[0]) - umount_fs(fs_type, mount_dir) + umount_fs(mount_dir) except CalledProcessError: pytest.skip('Setup failed for filesystem: ' + fs_type) return else: yield [fs_ubtype, fs_img, md5val] finally: - umount_fs(fs_type, mount_dir) + umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) if fs_img: call('rm -f %s' % fs_img, shell=True) @@ -300,14 +300,14 @@ def fs_obj_ext(request, u_boot_config): md5val.append(out.split()[0]) check_call('rm %s' % tmp_file, shell=True) - umount_fs(fs_type, mount_dir) + umount_fs(mount_dir) except CalledProcessError: pytest.skip('Setup failed for filesystem: ' + fs_type) return else: yield [fs_ubtype, fs_img, md5val] finally: - umount_fs(fs_type, mount_dir) + umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) if fs_img: call('rm -f %s' % fs_img, shell=True) @@ -379,14 +379,14 @@ 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(fs_type, mount_dir) + umount_fs(mount_dir) except CalledProcessError: pytest.skip('Setup failed for filesystem: ' + fs_type) return else: yield [fs_ubtype, fs_img] finally: - umount_fs(fs_type, mount_dir) + umount_fs(mount_dir) call('rmdir %s' % mount_dir, shell=True) if fs_img: call('rm -f %s' % fs_img, shell=True) From patchwork Thu Sep 27 07:07:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 147679 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1635858lji; Thu, 27 Sep 2018 00:07:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Y6wbAL5sHSHKPUy8qT3EjyJCJfasu5scUQEf6SFUgF/6jGA31jaP87Y43FzbENHctOkmJ X-Received: by 2002:a50:a5db:: with SMTP id b27-v6mr15728405edc.137.1538032029148; Thu, 27 Sep 2018 00:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538032029; cv=none; d=google.com; s=arc-20160816; b=h9PqBIYpFX1pbUO2EosxEEghJjOY8o74+iQoU+eFbcbEZZBuR9hcIHNshSTYXDm+Jf LszEILUQ8lCSsQBJegzh4s+R71wX9p/3sVSMHZGqEaxb7JhyKf9hvnMf97sg0pnVGSJQ AbGRwylWQzXGZS1Uh0lN0HQb8pDaAVqrM//5F8fV95Ue/fUEFg9x+sgjIfpRlc4eWuqm j5oNE4X+bRY+S/Fei6xpcm18oUIVuf+RGcwac2IeygB3LQC7wNp4ya7KLndo5RjxwExj pInIK4nIDyZjuDk0jkqkiqaCH0adLGfnQE94cqXo93SKsYX8UATZ/XkjL+HKDAACt/6/ rV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature; bh=puVAc8nqk88H4vPj4Z2U2DxV8ZsG7BGJGDprD2Eb0xI=; b=XGRvOJDwpOx9z8D5hg0V28F4zqyD5XaElIucARbDx8pIWqxILVPdMtD8+8f5W1mGKs 8IqbFWBaRWtfoZA3ee7JTVnONvYjDr8gPrXFCwEmXT2jHFAyNPjC/qMYEl9PIGx65TUV TmibG6Lsb5iDsNi6KAb0UJQjabHlPvZrYKSubk/p+EyOpWSFhIHNEBVwmey+aUNmnYsj MVeQdR7KB6sOQbiMm55XP48R+RIs1eSJ8K+WEMQ3pVW3aqtSCsLhg+cUxsHbx5cfeAtF DIkDbehDcWVGDRcKEwYbLpr1+FGMJwTberm8f8ZFvThBOl8dITWkvelTvwwvl1Xf0UsY ZEQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z46FAqCa; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id y10-v6si462443edt.320.2018.09.27.00.07.08; Thu, 27 Sep 2018 00:07:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z46FAqCa; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id BBDBCC21E02; Thu, 27 Sep 2018 07:06:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9BBADC21DEC; Thu, 27 Sep 2018 07:06:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EAE38C21DB6; Thu, 27 Sep 2018 07:06:32 +0000 (UTC) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by lists.denx.de (Postfix) with ESMTPS id 2A264C21C8B for ; Thu, 27 Sep 2018 07:06:28 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id s5-v6so1200000pfj.7 for ; Thu, 27 Sep 2018 00:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dwKzR3FL2Qd0aiJgGkWTyX48RRD8y7OVjMVwcYwxmDw=; b=Z46FAqCaW7odGL8OgyU8sgnsk+Kg76TJ96cgfkMUVM+wxMWwTGAwny7U/LUln4GNo4 mKJZ4zBfBTr7/gioXPY+kaRA6lsjmJrX1SaXWIm0LsUErtxNB1t6LPdADXyKHQj0Az7t y38ZiIGZwS7U14l3S/i14gN8H+VKDu0m20PkA= 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:in-reply-to :references; bh=dwKzR3FL2Qd0aiJgGkWTyX48RRD8y7OVjMVwcYwxmDw=; b=eNzRpfUJRmUHFtue0Nz+uXGKU2nentWVNomQaXYgOTvGJI7cfJL+wwbfhKYVup/Bin 5tkcEgqN7Vnwyct/v9tgB8FVrrDZjJPee9CaEBYpS4sL0fo5JMmW5fOgeGlREJGgxgE2 CJcaRELeyceqQDdgmC/aihJHjsQ+HaleLZ8x/4GYn5kjH+4t2HwtisxP7u26/ZdmTSAo ARPnoN1xaV4AMWNgDsmccjqhTXUYI1T56WiqWz7Gm27j3ciF9+2Nivp/XIJC7JjeZJOv vamezO/msTCvLgW7O/JWtuKSSYImxVXOVCcCT3lBx+VzMrwDPKn9FuNTi/quVEdLB2kH fQag== X-Gm-Message-State: ABuFfog6xWkh0KYkCJoyZo6syQ342mGrZeE69WHW57N/ROw6wXjfd4ZB Nw3AnqkHHOnUefDlXC9xU5SAug== X-Received: by 2002:a63:5509:: with SMTP id j9-v6mr8559647pgb.208.1538031986753; Thu, 27 Sep 2018 00:06:26 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id s16-v6sm1723658pfm.114.2018.09.27.00.06.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 00:06:26 -0700 (PDT) From: "Akashi, Takahiro" To: trini@konsulko.com, agraf@suse.de Date: Thu, 27 Sep 2018 16:07:23 +0900 Message-Id: <20180927070723.7741-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180927070723.7741-1-takahiro.akashi@linaro.org> References: <20180927070336.7561-1-takahiro.akashi@linaro.org> <20180927070723.7741-1-takahiro.akashi@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/2] test/py: test_fs: add docstring comments to helper functions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: "Akashi Takahiro" After Siomon's comment, add a descriptive comment (docstring) to each of helper functions in conftest.py. No functionality changed. Signed-off-by: Akashi Takahiro Reviewed-by: Simon Glass --- test/py/tests/test_fs/conftest.py | 133 ++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py index 826b0f0cb07c..60b4a2d737b9 100644 --- a/test/py/tests/test_fs/conftest.py +++ b/test/py/tests/test_fs/conftest.py @@ -18,10 +18,32 @@ supported_fs_unlink = ['fat16', 'fat32'] # Filesystem test specific setup # def pytest_addoption(parser): + """Enable --fs-type option. + + See pytest_configure() about how it works. + + Args: + parser: Pytest command-line parser. + + Returns: + Nothing. + """ parser.addoption('--fs-type', action='append', default=None, help='Targeting Filesystem Types') def pytest_configure(config): + """Restrict a file system(s) to be tested. + + A file system explicitly named with --fs-type option is selected + if it belongs to a default supported_fs_xxx list. + Multiple options can be specified. + + Args: + config: Pytest configuration. + + Returns: + Nothing. + """ global supported_fs_basic global supported_fs_ext global supported_fs_mkdir @@ -39,6 +61,17 @@ def pytest_configure(config): supported_fs_unlink = intersect(supported_fs, supported_fs_unlink) def pytest_generate_tests(metafunc): + """Parametrize fixtures, fs_obj_xxx + + Each fixture will be parametrized with a corresponding support_fs_xxx + list. + + Args: + metafunc: Pytest test function. + + Returns: + Nothing. + """ if 'fs_obj_basic' in metafunc.fixturenames: metafunc.parametrize('fs_obj_basic', supported_fs_basic, indirect=True, scope='module') @@ -56,12 +89,36 @@ def pytest_generate_tests(metafunc): # Helper functions # def fstype_to_ubname(fs_type): + """Convert a file system type to an U-boot specific string + + A generated string can be used as part of file system related commands + or a config name in u-boot. Currently fat16 and fat32 are handled + specifically. + + Args: + fs_type: File system type. + + Return: + A corresponding string for file system type. + """ if re.match('fat', fs_type): return 'fat' else: return fs_type def check_ubconfig(config, fs_type): + """Check whether a file system is enabled in u-boot configuration. + + This function is assumed to be called in a fixture function so that + the whole test cases will be skipped if a given file system is not + enabled. + + Args: + fs_type: File system type. + + Return: + Nothing. + """ if not config.buildconfig.get('config_cmd_%s' % fs_type, None): pytest.skip('.config feature "CMD_%s" not enabled' % fs_type.upper()) if not config.buildconfig.get('config_%s_write' % fs_type, None): @@ -69,6 +126,16 @@ def check_ubconfig(config, fs_type): % fs_type.upper()) def mk_fs(config, fs_type, size, id): + """Create a file system volume. + + Args: + fs_type: File system type. + size: Size of file system in MiB. + id: Prefix string of volume's file name. + + Return: + Nothing. + """ fs_img = '%s.%s.img' % (id, fs_type) fs_img = config.persistent_data_dir + '/' + fs_img @@ -99,6 +166,14 @@ def mk_fs(config, fs_type, size, id): # from test/py/conftest.py def tool_is_in_path(tool): + """Check whether a given command is available on host. + + Args: + tool: Command name. + + Return: + True if available, False if not. + """ for path in os.environ["PATH"].split(os.pathsep): fn = os.path.join(path, tool) if os.path.isfile(fn) and os.access(fn, os.X_OK): @@ -108,6 +183,16 @@ def tool_is_in_path(tool): fuse_mounted = False def mount_fs(fs_type, device, mount_point): + """Mount a volume. + + Args: + fs_type: File system type. + device: Volume's file name. + mount_point: Mount point. + + Return: + Nothing. + """ global fuse_mounted fuse_mounted = False @@ -130,6 +215,14 @@ def mount_fs(fs_type, device, mount_point): raise def umount_fs(mount_point): + """Unmount a volume. + + Args: + mount_point: Mount point. + + Return: + Nothing. + """ if fuse_mounted: call('sync') call('guestunmount %s' % mount_point, shell=True) @@ -143,6 +236,16 @@ def umount_fs(mount_point): # NOTE: yield_fixture was deprecated since pytest-3.0 @pytest.yield_fixture() def fs_obj_basic(request, u_boot_config): + """Set up a file system to be used in basic fs test. + + Args: + request: Pytest request object. + u_boot_config: U-boot configuration. + + Return: + A fixture for basic fs test, i.e. a triplet of file system type, + volume file name and a list of MD5 hashes. + """ fs_type = request.param fs_img = '' @@ -241,6 +344,16 @@ def fs_obj_basic(request, u_boot_config): # NOTE: yield_fixture was deprecated since pytest-3.0 @pytest.yield_fixture() def fs_obj_ext(request, u_boot_config): + """Set up a file system to be used in extended fs test. + + Args: + request: Pytest request object. + u_boot_config: U-boot configuration. + + Return: + A fixture for extended fs test, i.e. a triplet of file system type, + volume file name and a list of MD5 hashes. + """ fs_type = request.param fs_img = '' @@ -318,6 +431,16 @@ def fs_obj_ext(request, u_boot_config): # NOTE: yield_fixture was deprecated since pytest-3.0 @pytest.yield_fixture() def fs_obj_mkdir(request, u_boot_config): + """Set up a file system to be used in mkdir test. + + Args: + request: Pytest request object. + u_boot_config: U-boot configuration. + + Return: + A fixture for mkdir test, i.e. a duplet of file system type and + volume file name. + """ fs_type = request.param fs_img = '' @@ -341,6 +464,16 @@ def fs_obj_mkdir(request, u_boot_config): # NOTE: yield_fixture was deprecated since pytest-3.0 @pytest.yield_fixture() def fs_obj_unlink(request, u_boot_config): + """Set up a file system to be used in unlink test. + + Args: + request: Pytest request object. + u_boot_config: U-boot configuration. + + Return: + A fixture for unlink test, i.e. a duplet of file system type and + volume file name. + """ fs_type = request.param fs_img = ''