From patchwork Thu May 4 13:14:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 13231217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08024C7EE23 for ; Thu, 4 May 2023 13:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbjEDNOI (ORCPT ); Thu, 4 May 2023 09:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbjEDNOH (ORCPT ); Thu, 4 May 2023 09:14:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFBC96EA2 for ; Thu, 4 May 2023 06:14:05 -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-out2.suse.de (Postfix) with ESMTPS id 5FFCB1FDAB; Thu, 4 May 2023 13:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683206044; 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=ewYSS6/K3VhhpPZUmvT8hvwvjLF4gKgkfo/wRmB4X9g=; b=E9Ih9tvzeZPIKkLAQFfUK+297UXRlZu7kRAYy7slDEtQR2g8qtBKONOk9AK6QS9d+9s3aX H299MRcrEj+LgJKihrQmlEsxCmVFWPeeDvXYholNQZNOpg7gbU5vF9rfeQiRU6y4bDnAof tQrTGOhu+CL3BKhntq3OlDwoyGShJoQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683206044; 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=ewYSS6/K3VhhpPZUmvT8hvwvjLF4gKgkfo/wRmB4X9g=; b=FJhX2+jPNEhQon8s9bfiOgbz3GJsCh+HhcSqBSQCCpp33kzj7SKXaJDBppTmuHy4DPkFeA dPI4XzB+jLto0SDg== 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 D1DD813444; Thu, 4 May 2023 13:14:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WOzGMJuvU2TXVgAAMHmgww (envelope-from ); Thu, 04 May 2023 13:14:03 +0000 From: Petr Vorel To: ltp@lists.linux.it Cc: Petr Vorel , NeilBrown , Cyril Hrubis , linux-nfs@vger.kernel.org, Jeff Layton Subject: [PATCH v5 1/5] nfs_lib.sh: Cleanup local and remote directories setup Date: Thu, 4 May 2023 15:14:10 +0200 Message-Id: <20230504131414.3826283-2-pvorel@suse.cz> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230504131414.3826283-1-pvorel@suse.cz> References: <20230504131414.3826283-1-pvorel@suse.cz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Logic for creating local and remote directories was on more places. Create get_local_dir() and get_remote_dir() functions to keep it on single place. local dir is needed in nfs_mount(), but was defined in nfs_setup() and reused local variable with shell inheritance (ugly!), because there were all parameters from loop. Similarly, remote dir is needed in both nfs_mount() and nfs_setup_server(), but created with shell inheritance in nfs_setup(). Pass these params to nfs_mount() and nfs_setup_server() and define variables with new functions get_local_dir() and get_remote_dir(). Use get_remote_dir() in nfs_get_remote_path(). Move cd to local directory to the end of nfs_mount() (it used to cd after nfs_mount(), but only if -v parameter contained single version, but it does not harm to always cd). Signed-off-by: Petr Vorel --- testcases/network/nfs/nfs_stress/nfs_lib.sh | 52 ++++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index af7d46a21..1b5604ab5 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) Linux Test Project, 2016-2022 +# Copyright (c) Linux Test Project, 2016-2023 # Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001 @@ -53,6 +53,24 @@ get_socket_type() done } +# directory mounted by NFS client +get_local_dir() +{ + local v="$1" + local n="$2" + + echo "$TST_TMPDIR/$v/$n" +} + +# directory on NFS server +get_remote_dir() +{ + local v="$1" + local n="$2" + + echo "$TST_TMPDIR/$v/$n" +} + nfs_get_remote_path() { local v @@ -63,7 +81,7 @@ nfs_get_remote_path() done v=${1:-$v} - echo "$TST_TMPDIR/$v/$type" + echo "$(get_remote_dir $v $type)" } nfs_server_udp_enabled() @@ -78,8 +96,8 @@ nfs_server_udp_enabled() nfs_setup_server() { - - local fsid="$1" + local remote_dir="$1" + local fsid="$2" local export_cmd="exportfs -i -o fsid=$fsid,no_root_squash,rw *:$remote_dir" [ -z "$fsid" ] && tst_brk TBROK "empty fsid" @@ -97,10 +115,14 @@ nfs_setup_server() nfs_mount() { - local opts="$1" + local local_dir="$1" + local remote_dir="$2" + local opts="$3" local host_type=rhost local mount_dir + mkdir -p "$local_dir" + tst_net_use_netns && host_type= if [ $TST_IPV6 ]; then @@ -131,6 +153,8 @@ nfs_mount() tst_brk TBROK "mount command failed" fi + + cd "$local_dir" } nfs_setup() @@ -162,20 +186,12 @@ nfs_setup() tst_brk TCONF "UDP support disabled on NFS server" fi - local_dir="$TST_TMPDIR/$i/$n" - remote_dir="$TST_TMPDIR/$i/$type" - mkdir -p $local_dir - - nfs_setup_server $(($$ + n)) - - nfs_mount "-o proto=$type,vers=$i" + remote_dir="$(get_remote_dir $i $type)" + nfs_setup_server "$remote_dir" "$(($$ + n))" + nfs_mount "$(get_local_dir $i $n)" "$remote_dir" "-o proto=$type,vers=$i" n=$(( n + 1 )) done - - if [ "$n" -eq 1 ]; then - cd ${VERSION}/0 - fi } nfs_cleanup() @@ -190,7 +206,7 @@ nfs_cleanup() local n=0 for i in $VERSION; do - local_dir="$TST_TMPDIR/$i/$n" + local_dir="$(get_local_dir $i $n)" grep -q "$local_dir" /proc/mounts && umount $local_dir n=$(( n + 1 )) done @@ -198,7 +214,7 @@ nfs_cleanup() n=0 for i in $VERSION; do type=$(get_socket_type $n) - remote_dir="$TST_TMPDIR/$i/$type" + remote_dir="$(get_remote_dir $i $type)" tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir" tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir" n=$(( n + 1 )) From patchwork Thu May 4 13:14:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 13231213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60C63C77B7C for ; Thu, 4 May 2023 13:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjEDNOI (ORCPT ); Thu, 4 May 2023 09:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbjEDNOH (ORCPT ); Thu, 4 May 2023 09:14:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41E817289 for ; Thu, 4 May 2023 06:14:06 -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-out2.suse.de (Postfix) with ESMTPS id EC7131FEAE; Thu, 4 May 2023 13:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683206044; 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=/iyzeLzCsMCdsmJwHyVbIHUwIBHNpy11fYoEtMxyvpk=; b=MrqPBCr5EfDFZVab1pxQk0gOd64vBZVkRx7JlLS/d6Ka6wVU5Dg9r0H0kYKKngtJZtyjaP o+L8bmavB3xdAR+szk0AEVfBsHbxP5mDlCG3O7QNZGCBmnjRkBB3r58LIpLeeQxjriTMm3 SPEeJ8K7sXpKcDV5ls1oztZKW2BY7Cs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683206044; 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=/iyzeLzCsMCdsmJwHyVbIHUwIBHNpy11fYoEtMxyvpk=; b=Dw/Ow6bW49kqOGHzAv27rgCkvZ7IIZg+496bKYPP54N1gDq4GahFpRDdfMMdgYWaXda5bD BzKj5Q2fLm6O4bBw== 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 7F83113444; Thu, 4 May 2023 13:14:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4MwUG5yvU2TXVgAAMHmgww (envelope-from ); Thu, 04 May 2023 13:14:04 +0000 From: Petr Vorel To: ltp@lists.linux.it Cc: Petr Vorel , NeilBrown , Cyril Hrubis , linux-nfs@vger.kernel.org, Jeff Layton Subject: [PATCH v5 2/5] nfs_lib.sh: Unexport on proper side on netns Date: Thu, 4 May 2023 15:14:11 +0200 Message-Id: <20230504131414.3826283-3-pvorel@suse.cz> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230504131414.3826283-1-pvorel@suse.cz> References: <20230504131414.3826283-1-pvorel@suse.cz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org f6b267055 changed exportfs run locally on netns, therefore unexporting should be also run at the same namespace. This is not problematic now, but will be a problem with TST_ALL_FILESYSTEMS=1, which is sensitive for timing. Fixes: f6b267055 ("nfs_lib.sh: run exportfs at "server side" in LTP_NETNS case") Signed-off-by: Petr Vorel --- testcases/network/nfs/nfs_stress/nfs_lib.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 1b5604ab5..042fea5e4 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -215,8 +215,16 @@ nfs_cleanup() for i in $VERSION; do type=$(get_socket_type $n) remote_dir="$(get_remote_dir $i $type)" - tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir" - tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir" + + if tst_net_use_netns; then + if test -d $remote_dir; then + exportfs -u *:$remote_dir + rm -rf $remote_dir + fi + else + tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir" + tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir" + fi n=$(( n + 1 )) done } From patchwork Thu May 4 13:14:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 13231214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFE89C7EE29 for ; Thu, 4 May 2023 13:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjEDNOJ (ORCPT ); Thu, 4 May 2023 09:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjEDNOH (ORCPT ); Thu, 4 May 2023 09:14:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA26E6194 for ; Thu, 4 May 2023 06:14:06 -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 5F6CE22B0E; Thu, 4 May 2023 13:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683206045; 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=p/FKdR3mIdN4rPKTA6ko4I1q3qCq+vibsIIkLB7RacM=; b=dEGVOk1vro9p663Uf28UeoFc+8I1gDCRfsGtWPlPRF+sYOIAI47XOCNfwXtdr1qOBgro3p 8PQ/3EEkLV26VQeMb8TJv2xofh2eZ/DF3rR+pjP8fnsWJ2HvaQGyuugL8xo7GvPmBwvouO nNKOEoTx+zKNDXBfKRAx1p+zwTmPhGc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683206045; 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=p/FKdR3mIdN4rPKTA6ko4I1q3qCq+vibsIIkLB7RacM=; b=HNiYDbgWLh/lCqln5c1bfs60SihWBJEh+d/SXg5pVsV+IubmbXwtZ+q1j1qAlO18uAVLGj MoipT0zNy5x1enCQ== 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 0F0F313444; Thu, 4 May 2023 13:14:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mPXhOpyvU2TXVgAAMHmgww (envelope-from ); Thu, 04 May 2023 13:14:04 +0000 From: Petr Vorel To: ltp@lists.linux.it Cc: Petr Vorel , NeilBrown , Cyril Hrubis , linux-nfs@vger.kernel.org, Jeff Layton Subject: [PATCH v5 3/5] nfs05.sh: Lower down the default values Date: Thu, 4 May 2023 15:14:12 +0200 Message-Id: <20230504131414.3826283-4-pvorel@suse.cz> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230504131414.3826283-1-pvorel@suse.cz> References: <20230504131414.3826283-1-pvorel@suse.cz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org nfs05_make_tree.c runs make which needs on Btrfs quite a lot of temporary space. This is a preparation for the next commit which start using all filesystems via TST_ALL_FILESYSTEMS=1. Currently we use 300 MB, which was not enough for Btrfs: Filesystem Type Size Used Avail Use% Mounted on /dev/loop0 btrfs 300M 62M 20K 100% /tmp/LTP_nfs05.Vau10kcszO/mntpoint More space is required on ppc64le (higher page size ?). Proper solution would be to detect available size in nfs05_make_tree.c and lower down values based on free space. Signed-off-by: Petr Vorel --- testcases/network/nfs/nfs_stress/nfs05.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs05.sh b/testcases/network/nfs/nfs_stress/nfs05.sh index c18ef1ab4..760b585e4 100755 --- a/testcases/network/nfs/nfs_stress/nfs05.sh +++ b/testcases/network/nfs/nfs_stress/nfs05.sh @@ -8,9 +8,9 @@ # # Created by: Robbie Williamson (robbiew@us.ibm.com) -DIR_NUM=${DIR_NUM:-"10"} -FILE_NUM=${FILE_NUM:-"30"} -THREAD_NUM=${THREAD_NUM:-"8"} +DIR_NUM=${DIR_NUM:-"5"} +FILE_NUM=${FILE_NUM:-"20"} +THREAD_NUM=${THREAD_NUM:-"5"} TST_NEEDS_CMDS="make gcc" TST_TESTFUNC="do_test" From patchwork Thu May 4 13:14:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 13231215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6188FC7EE26 for ; Thu, 4 May 2023 13:14:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjEDNOK (ORCPT ); Thu, 4 May 2023 09:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230159AbjEDNOI (ORCPT ); Thu, 4 May 2023 09:14:08 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF1072A4 for ; Thu, 4 May 2023 06:14:07 -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 CE25D339F4; Thu, 4 May 2023 13:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683206045; 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=+jeATmQa9pds8zoOmG2NvYcden3y1ZEJm268/wgu1Jw=; b=IzZY4dmxmsqNRW1oNwre6j9bqWEe7pzUkfMtC28Fy3cl2kv1tyeIqwFP1fhvl8zmnHwLUP GowfPtNsiSkCWi+4WNT1KPZwHIifT1UuqnlQaZMtCUXqA4dVfukVaE4v6EL3R4NynGSoCL wSrWHx9rOWy3DXa1llqI+b+NZYfHukc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683206045; 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=+jeATmQa9pds8zoOmG2NvYcden3y1ZEJm268/wgu1Jw=; b=Ra3vFvOkzPBNA13Cm8XU0URILfWBK9hqusNaM0ThTRrVBvT+YIa3eObbU5nh4ByV3BrkBy AIAj9tsMWuoFncDw== 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 73C0313444; Thu, 4 May 2023 13:14:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AP6NGZ2vU2TXVgAAMHmgww (envelope-from ); Thu, 04 May 2023 13:14:05 +0000 From: Petr Vorel To: ltp@lists.linux.it Cc: Petr Vorel , NeilBrown , Cyril Hrubis , linux-nfs@vger.kernel.org, Jeff Layton Subject: [PATCH v5 4/5] nfs03.sh: Lower down the default values Date: Thu, 4 May 2023 15:14:13 +0200 Message-Id: <20230504131414.3826283-5-pvorel@suse.cz> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230504131414.3826283-1-pvorel@suse.cz> References: <20230504131414.3826283-1-pvorel@suse.cz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Needed for tmpfs on ppc64le: nfs03 7 TINFO: Cleaning up testcase nfs03 7 TINFO: === Testing on tmpfs === nfs03 7 TINFO: Skipping mkfs for TMPFS filesystem nfs03 7 TINFO: Mounting device: mount -t tmpfs /dev/loop0 /tmp/LTP_nfs03.5oEyxwo5nP/mntpoint nfs03 7 TINFO: timeout per run is 0h 15m 0s nfs03 7 TINFO: mount.nfs: (linux nfs-utils 2.1.1) nfs03 7 TINFO: setup NFSv3, socket type udp nfs03 7 TINFO: Mounting NFS: mount -v -t nfs -o proto=udp,vers=3 10.0.0.2:/tmp/LTP_nfs03.5oEyxwo5nP/mntpoint/3/udp /tmp/LTP_nfs03.5oEyxwo5nP/3/0 nfs03 7 TINFO: Setting server side nfsd count to 1 nfs03 7 TINFO: Multiple processes creating and deleting files nfs03 7 TINFO: creating dir1 subdirectories & files nfs03 7 TINFO: make '100' directories nfs03 7 TINFO: creating dir2 subdirectories & files nfs03 7 TINFO: make '100' directories nfs03 7 TINFO: cd dir1 & removing files touch: cannot touch 'file5464': No space left on device nfs03 7 TBROK: touch file5464 failed touch: cannot touch 'file5364': No space left on device nfs03 7 TBROK: touch file5364 failed nfs03 7 TINFO: nfs03 7 Cleaning up testcase TINFO: Cleaning up testcase Signed-off-by: Petr Vorel --- testcases/network/nfs/nfs_stress/nfs03.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs03.sh b/testcases/network/nfs/nfs_stress/nfs03.sh index e5f4de67c..5884bb9b9 100755 --- a/testcases/network/nfs/nfs_stress/nfs03.sh +++ b/testcases/network/nfs/nfs_stress/nfs03.sh @@ -8,8 +8,8 @@ TST_CLEANUP="nfs03_cleanup" TST_SETUP="nfs03_setup" TST_TESTFUNC="do_test" -DIR_NUM=${DIR_NUM:-"100"} -FILE_NUM=${FILE_NUM:-"100"} +DIR_NUM=${DIR_NUM:-"80"} +FILE_NUM=${FILE_NUM:-"80"} THREAD_NUM=${THREAD_NUM:-"1"} ORIG_NFSD= From patchwork Thu May 4 13:14:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 13231216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB956C7EE2A for ; Thu, 4 May 2023 13:14:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbjEDNOK (ORCPT ); Thu, 4 May 2023 09:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbjEDNOJ (ORCPT ); Thu, 4 May 2023 09:14:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD0286EA2 for ; Thu, 4 May 2023 06:14:07 -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-out2.suse.de (Postfix) with ESMTPS id 3F26E1FF73; Thu, 4 May 2023 13:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683206046; 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=akIoO/Oc1cHzyjDxWGHLqsPOi6W/co79Mdb3DCW+ZE0=; b=toujx3QUynVly1TxHkF2wc25tiQYgJ82ucdSDpMZJqJ3DbSZcChJptO6LQGZJAIMoGubvy xwp6lucR4YzYV9UcyEB6DPOet7Q2ZHkVgR3RCDmMQjTyCFH1JQ+r7fubryucDF8N3niKK/ bRBY1A3NvcOc6BzuUaPtXLWoMgTpiWM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683206046; 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=akIoO/Oc1cHzyjDxWGHLqsPOi6W/co79Mdb3DCW+ZE0=; b=rXxfh9TujK2VZ8n+y8Q5Ib1tD1VTcnMtibg9lOSsJpEXcbbpF1/25Z3RY1aNdE/zWVs6BU RE3SltDt1gNrB7BA== 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 E0E9F13444; Thu, 4 May 2023 13:14:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OKyCNJ2vU2TXVgAAMHmgww (envelope-from ); Thu, 04 May 2023 13:14:05 +0000 From: Petr Vorel To: ltp@lists.linux.it Cc: Petr Vorel , NeilBrown , Cyril Hrubis , linux-nfs@vger.kernel.org, Jeff Layton Subject: [PATCH v5 5/5] nfs: Run on btrfs, ext4, xfs Date: Thu, 4 May 2023 15:14:14 +0200 Message-Id: <20230504131414.3826283-6-pvorel@suse.cz> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230504131414.3826283-1-pvorel@suse.cz> References: <20230504131414.3826283-1-pvorel@suse.cz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org because there are some problems with at least vfat, exfat and tmpfs (on nfs-utils < 2) instead of testing on all available filesystems, test just on modern Linux filesystems btrfs, ext4, xfs. Use variables: * TST_ALL_FILESYSTEMS=1 to run on all filesystems * TST_FORMAT_DEVICE=1 to get loop device formatted * TST_MOUNT_DEVICE=1 to get it mounted Filesystems (tested the usual LTP way on loop device) are used for server side (exportfs), client side (NFS mount) is kept outside of it. For some reason umounting needs some time before NFS server stops using underlying loop device. Also exportfs needs time before files can be removed. Otherwise second umounting fails: nfs07 4 TINFO: Cleaning up testcase umount: /var/tmp/LTP_nfs07.FNZ7yCbqZe/mntpoint: target is busy. nfs07 4 TINFO: umount(/var/tmp/LTP_nfs07.FNZ7yCbqZe/mntpoint) failed, try 1 ... nfs07 4 TINFO: Likely gvfsd-trash is probing newly mounted fs, kill it to speed up tests. umount: /var/tmp/LTP_nfs07.FNZ7yCbqZe/mntpoint: target is busy. Solved with adding sleep for 2 sec after first umount and sleeps for 1 sec after exportfs. Second umount of the loop device in tst_test.sh works without any extra sleep. Signed-off-by: Petr Vorel --- testcases/network/nfs/nfs_stress/nfs_lib.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 042fea5e4..abf7ba5a2 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -28,7 +28,10 @@ NFS_PARSE_ARGS_CALLER="$TST_PARSE_ARGS" TST_OPTS="v:t:$TST_OPTS" TST_PARSE_ARGS=nfs_parse_args TST_USAGE=nfs_usage -TST_NEEDS_TMPDIR=1 +TST_ALL_FILESYSTEMS=1 +TST_SKIP_FILESYSTEMS="exfat,ext2,ext3,fuse,ntfs,vfat,tmpfs" +TST_MOUNT_DEVICE=1 +TST_FORMAT_DEVICE=1 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs" TST_SETUP="${TST_SETUP:-nfs_setup}" @@ -68,7 +71,7 @@ get_remote_dir() local v="$1" local n="$2" - echo "$TST_TMPDIR/$v/$n" + echo "$TST_MNTPOINT/$v/$n" } nfs_get_remote_path() @@ -210,6 +213,7 @@ nfs_cleanup() grep -q "$local_dir" /proc/mounts && umount $local_dir n=$(( n + 1 )) done + sleep 2 n=0 for i in $VERSION; do @@ -219,12 +223,15 @@ nfs_cleanup() if tst_net_use_netns; then if test -d $remote_dir; then exportfs -u *:$remote_dir + sleep 1 rm -rf $remote_dir fi else tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir" + sleep 1 tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir" fi + n=$(( n + 1 )) done }