From fe79d0abd0270aaaaed3757a4eec6b46b2018514 Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Fri, 24 Jun 2022 08:31:16 +0800 Subject: [PATCH] EX-5366 test: handle missing lpcc.conf in test_210 Handle missing /etc/lpcc.conf in sanity-pcc test_210 Signed-off-by: Lei Feng Test-Parameters: trivial clientdistro=sles15sp3 testlist=sanity-pcc env=ONLY=210 Test-Parameters: clientdistro=el8.6 clientarch=aarch64 testlist=sanity-pcc env=ONLY=210 Change-Id: Ia19c32ac2719a52ee880a2e633495b9ce3bb9534 Reviewed-on: https://review.whamcloud.com/47728 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/sanity-pcc.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity-pcc.sh b/lustre/tests/sanity-pcc.sh index eb45620..ba514b6 100644 --- a/lustre/tests/sanity-pcc.sh +++ b/lustre/tests/sanity-pcc.sh @@ -4832,11 +4832,18 @@ test_210() { (( $MDS1_VERSION >= $(version_code 2.14.0.38) )) || skip "Need server version at least 2.14.0.38" + [ -x /usr/bin/lpcc ] || + skip "lpcc is not installed" + setup_loopdev $SINGLEAGT $loopfile $mntpt 50 - do_facet $SINGLEAGT mv $config_file $config_file_bak || - error "failed to backup original config file $config_file" - stack_trap "do_facet $SINGLEAGT mv -f $config_file_bak $config_file" + if do_facet $SINGLEAGT test -f $config_file; then + do_facet $SINGLEAGT mv -f $config_file $config_file_bak || + error "failed to backup original config file $config_file" + stack_trap "do_facet $SINGLEAGT mv -f $config_file_bak $config_file" + else + stack_trap "do_facet $SINGLEAGT rm -f $config_file" + fi do_facet $SINGLEAGT "echo \\\"- mount: $DIR\\\" > $config_file" do_facet $SINGLEAGT "echo \\\" cache: $mntpt\\\" >> $config_file" -- 1.8.3.1