Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp824688iol; Thu, 9 Jun 2022 15:05:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySg1/gUQ67fqq/+Hb2Ji4XEEtOK0lt/d1f86IrmChb6ZbiUKMEywDNfu4WOl0jC3d7RLJ4 X-Received: by 2002:a17:906:7952:b0:711:d4e0:da23 with SMTP id l18-20020a170906795200b00711d4e0da23mr19370695ejo.305.1654812319747; Thu, 09 Jun 2022 15:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654812319; cv=none; d=google.com; s=arc-20160816; b=SqX/AnV+8N7BZxM5cXsp8TH9ZLAwJGDb2I6mbmCHncDNc62HwCzxuqfdjHr1IDfeVS /W4NM3g+SSoewJRaUPVn467nVy+gSqzeYUhs91o2pkPZ5wqu6FMSFYdruCfD+kkDH8Xg dMYBXJf0r3sagQmYOoLy87NfYl62XOv0mMyeKWM6WI84sgFFm1s61CGsLX879mOd+UIJ cPg4eAZbE6Br5yqznhhj0AwXxfNzeGwv1wTFhHjht97Uk67c7fKq34IcdiBlSpmHssIP J04lPMw88yTSw3JMb+hj2TeuunHfgIeiCQroeot4xcx1rTd8sQxhI5zSu1XHKcD9NkTm +Eow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=2hlxC/7qz3rkqiEMmnuUy2kFg97wCcOEWXRVX3/7MpQ=; b=h6Ekfewcz6Djt8OKTzvzdQO2qQN6QuISKLMY4iYWpGo/IRL0ylAxZh+c6dJS4nneUe 36f68YW1ocOyr7+7AOAfqmHqHfiw1wfUZhBt9seaCUagNXk4CcOU7lLCjZ97vqhDbN1X uxFWgfiJoukxAQG5P+un1jyRmC1xyA64oKDDHxqfwuIRrei/18p9ehCRQtYNM/0cJt02 fibroKZPY76/7zFM0L4x4ETW0MM4C6o4aCWYxv+ieS+PesSEtFOKZEC+30xOit7md51T mB7EYTyaL2xExVF76GJPBZYS1bheD6c3wGFPgnJ5S8u8CFO3BkuGWDX5jqb+FhnGB3WW v4jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Eg2pN7mN; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga30-20020a1709070c1e00b006f3dae85820si8052892ejc.472.2022.06.09.15.04.52; Thu, 09 Jun 2022 15:05:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Eg2pN7mN; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233619AbiFIVmk (ORCPT + 99 others); Thu, 9 Jun 2022 17:42:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiFIVmi (ORCPT ); Thu, 9 Jun 2022 17:42:38 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C05F266213 for ; Thu, 9 Jun 2022 14:42:32 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8467122080; Thu, 9 Jun 2022 21:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1654810951; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2hlxC/7qz3rkqiEMmnuUy2kFg97wCcOEWXRVX3/7MpQ=; b=Eg2pN7mNipAkGNH0v/qDyuXDMQOMvsYudPDSko5jEUk9tVSteKTLCvRabHsOvzBSLTrPDm rzT4b3sI5d0kCvq/WV0vMs9eAgoE9VQnoG+NffBmKNx7HTa2s4F26zaLdWCefNKrn60nD4 0Y80FoQs0Hr53QaBUKwq4qOjWZdf9ao= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1654810951; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2hlxC/7qz3rkqiEMmnuUy2kFg97wCcOEWXRVX3/7MpQ=; b=gmuKW6KYu2nWa3tAocxR1p7YelLXNHY1koQsJRjTapuWdUk9yrWe673V+03dnhnK5MDH4B egAscXyUgfV1CdBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F210813A8C; Thu, 9 Jun 2022 21:42:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4CZSOEZpomIQDgAAMHmgww (envelope-from ); Thu, 09 Jun 2022 21:42:30 +0000 From: Petr Vorel To: ltp@lists.linux.it Cc: Petr Vorel , linux-nfs@vger.kernel.org, Cyril Hrubis Subject: [PATCH v2 1/9] tst_test.sh: Add $TST_MOUNT_DEVICE Date: Thu, 9 Jun 2022 23:42:15 +0200 Message-Id: <20220609214223.4608-2-pvorel@suse.cz> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220609214223.4608-1-pvorel@suse.cz> References: <20220609214223.4608-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Reviewed-by: Cyril Hrubis Signed-off-by: Petr Vorel --- doc/shell-test-api.txt | 2 ++ testcases/lib/tst_test.sh | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt index df5ebbdf0..65444541e 100644 --- a/doc/shell-test-api.txt +++ b/doc/shell-test-api.txt @@ -214,6 +214,8 @@ simply by setting right '$TST_FOO'. https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#formatting-device-with-a-filesystem[Formatting device with a filesystem]. | 'TST_MNT_PARAMS' | Extra mount params for 'tst_mount', see https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#formatting-device-with-a-filesystem[Formatting device with a filesystem]. +| 'TST_MOUNT_DEVICE' | Mount device, see + https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#mounting-and-unmounting-filesystems[Mounting and unmounting filesystems]. | 'TST_NEEDS_ROOT' | Exit the test with 'TCONF' unless executed under root. Alternatively the 'tst_require_root' command can be used. | 'TST_NEEDS_TMPDIR' | Create test temporary directory and cd into it. diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index c6e0752f3..740115385 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -41,6 +41,10 @@ _tst_do_exit() fi fi + if [ "$TST_MOUNT_FLAG" = 1 ]; then + tst_umount + fi + if [ "$TST_NEEDS_DEVICE" = 1 -a "$TST_DEVICE_FLAG" = 1 ]; then if ! tst_device release "$TST_DEVICE"; then tst_res TWARN "Failed to release device '$TST_DEVICE'" @@ -632,7 +636,7 @@ tst_run() NET_SKIP_VARIABLE_INIT|NEEDS_CHECKPOINTS);; CHECKPOINT_WAIT|CHECKPOINT_WAKE);; CHECKPOINT_WAKE2|CHECKPOINT_WAKE_AND_WAIT);; - DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE);; + DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE|MOUNT_DEVICE);; *) tst_res TWARN "Reserved variable TST_$_tst_i used!";; esac done @@ -666,6 +670,7 @@ tst_run() _tst_setup_timer + [ "$TST_MOUNT_DEVICE" = 1 ] && TST_FORMAT_DEVICE=1 [ "$TST_FORMAT_DEVICE" = 1 ] && TST_NEEDS_DEVICE=1 [ "$TST_NEEDS_DEVICE" = 1 ] && TST_NEEDS_TMPDIR=1 @@ -702,6 +707,11 @@ tst_run() tst_mkfs $TST_FS_TYPE $TST_DEV_FS_OPTS $TST_DEVICE $TST_DEV_EXTRA_OPTS fi + if [ "$TST_MOUNT_DEVICE" = 1 ]; then + tst_mount + TST_MOUNT_FLAG=1 + fi + [ -n "$TST_NEEDS_CHECKPOINTS" ] && _tst_init_checkpoints if [ -n "$TST_SETUP" ]; then -- 2.36.1