Whamcloud - gitweb
EX-5366 test: handle missing lpcc.conf in test_210
authorLei Feng <flei@whamcloud.com>
Fri, 24 Jun 2022 00:31:16 +0000 (08:31 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 29 Jun 2022 19:10:13 +0000 (19:10 +0000)
Handle missing /etc/lpcc.conf in sanity-pcc test_210

Signed-off-by: Lei Feng <flei@whamcloud.com>
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 <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-pcc.sh

index eb45620..ba514b6 100644 (file)
@@ -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"