device-mapper-multipath-0.8.4-5

Update CI tests to match RHEL
  * This commit also pulls in changes from Lin Li <lilin@redhat.com>
    and Bruno Goncalves <bgoncalv@redhat.com>
This commit is contained in:
Benjamin Marzinski 2020-07-21 19:45:41 -05:00
parent 9abdc502cf
commit 3140cfbb24
18 changed files with 166 additions and 413 deletions

View File

@ -1,6 +1,6 @@
Name: device-mapper-multipath Name: device-mapper-multipath
Version: 0.8.4 Version: 0.8.4
Release: 4%{?dist} Release: 5%{?dist}
Summary: Tools to manage multipath devices using device-mapper Summary: Tools to manage multipath devices using device-mapper
License: GPLv2 License: GPLv2
URL: http://christophe.varoqui.free.fr/ URL: http://christophe.varoqui.free.fr/
@ -278,6 +278,11 @@ fi
%{_pkgconfdir}/libdmmp.pc %{_pkgconfdir}/libdmmp.pc
%changelog %changelog
* Tue Jul 21 2020 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.4-5
- Update CI tests to match RHEL
* This commit also pulls in changes from Lin Li <lilin@redhat.com>
and Bruno Goncalves <bgoncalv@redhat.com>
* Tue Jul 21 2020 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.4-4 * Tue Jul 21 2020 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.4-4
- Rebased on top of additional commits staged for upstream - Rebased on top of additional commits staged for upstream
* Previous patches 0048-0060 are now patches 0053-0054 & 0059-0069 * Previous patches 0048-0060 are now patches 0053-0054 & 0059-0069

1
tests/.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,49 +0,0 @@
#!/bin/bash
# Copyright (c) 2016 Red Hat, Inc.
# #
# # This program is free software: you can redistribute it and/or modify
# # it under the terms of the GNU General Public License as published by
# # the Free Software Foundation, either version 3 of the License, or
# # (at your option) any later version.
# #
# # This program is distributed in the hope that it will be useful,
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# # GNU General Public License for more details.
# #
# # You should have received a copy of the GNU General Public License
# # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# # Author: Lin Li <lilin@redhat.com>
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE main.sh
run: $(FILES) build
./main.sh
build: $(BUILT_FILES)
chmod a+x ./main.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: LiLin <lilin@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: bindings" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
@echo "Requires: device-mapper-multipath" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -31,8 +31,8 @@ sleep 5
trun "multipath -F" trun "multipath -F"
sleep 5 sleep 5
terr "modprobe -r scsi_debug" terr "modprobe -r scsi_debug"
terr "modprobe scsi_debug dev_size_mb=1024 num_tgts=1 vpd_use_hostno=0 \ terr "modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 \
add_host=2 delay=20 max_luns=2 no_lun_0=1" max_luns=2 no_lun_0=1"
sleep 60 sleep 60
disk_path=$(get_scsi_debug_devices) disk_path=$(get_scsi_debug_devices)

View File

@ -174,13 +174,7 @@ AA
fi fi
#setup scsi_debug #setup scsi_debug
echo "INFO: Loading scsi_debug module for simulation of mpath" echo "INFO: Loading scsi_debug module for simulation of mpath"
local dev_size=100 modprobe scsi_debug \
if [ "CHK$(uname -m)" == "CHKi386" ] \
|| [ "CHK$(uname -m)" == "CHKi686" ]; then
#i386 platform cannot allocate 100 MiB in kernel space
dev_size=10
fi
modprobe scsi_debug dev_size_mb=${dev_size} \
num_tgts=1 vpd_use_hostno=0 \ num_tgts=1 vpd_use_hostno=0 \
add_host=4 delay=20 \ add_host=4 delay=20 \
max_luns=2 no_lun_0=1 2>&1 1>/dev/null max_luns=2 no_lun_0=1 2>&1 1>/dev/null

View File

@ -1,49 +0,0 @@
#!/bin/bash
# Copyright (c) 2016 Red Hat, Inc.
# #
# # This program is free software: you can redistribute it and/or modify
# # it under the terms of the GNU General Public License as published by
# # the Free Software Foundation, either version 3 of the License, or
# # (at your option) any later version.
# #
# # This program is distributed in the hope that it will be useful,
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# # GNU General Public License for more details.
# #
# # You should have received a copy of the GNU General Public License
# # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# # Author: Lin Li <lilin@redhat.com>
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE main.sh
run: $(FILES) build
./main.sh
build: $(BUILT_FILES)
chmod a+x ./main.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: LiLin <lilin@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: kpartx_4k_aligned" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
@echo "Requires: device-mapper-multipath" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,47 +0,0 @@
# Copyright (c) 2006 Red Hat, Inc. This copyrighted
# material is made available to anyone wishing to use, modify, copy, or
# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Author: LiLin <lilin@redhat.com>
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE main.sh
run: $(FILES) build
./main.sh
build: $(BUILT_FILES)
chmod a+x ./main.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: LiLin <lilin@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: CEE feedback" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
@echo "Requires: device-mapper-multipath" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,8 +1,8 @@
multipath: Test that some fatal errors which should not be retried, for example a medium error, correctly generate an I/O error and do not get infinitely retried. multipath: Test that some fatal errors which should not be retried, for example a medium error, correctly generate an I/O error and do not get infinitely retried.
steps: steps:
1.# modprobe scsi_debug dev_size_mb=1024 num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1 opts=2 every_nth=1 1.# modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1 opts=2
2.# multipath -ll | grep -C 5 scsi_debug 2.# multipath -ll | grep -C 5 scsi_debug
3.# dd if=/dev/zero of=/dev/sdf bs=1024 count=262144 3.# dd if=/dev/zero of=/dev/mapper/$mpathdev bs=1024 seek=2330 count=10
4. check if an I/O error generated 4. check if an I/O error generated

View File

@ -19,37 +19,44 @@
function cleanup() function cleanup()
{ {
sleep 5
udevadm settle
multipath -F multipath -F
service multipathd stop sleep 5
sleep 15
modprobe -r scsi_debug modprobe -r scsi_debug
rt=$?
while [ $rt -ne 0 ] return 0
do
sleep 15
modprobe -r scsi_debug
rt=$?
done
} }
yum -y install device-mapper device-mapper-multipath yum -y install device-mapper device-mapper-multipath
mpathconf --enable mpathconf --enable
modprobe scsi_debug dev_size_mb=1024 num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1 opts=2 every_nth=1 service multipathd stop
modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1 opts=2
sleep 5 sleep 5
service multipathd restart multipath > /dev/null
sleep 10 sleep 5
disk1=`multipath -ll | grep -A 5 scsi_debug | grep -oE "sd." | head -1` mpathdev=`multipath -l | grep scsi_debug | awk '{print $1}' | head -1`
if [ -z "$disk1" ]; then if [ -z "$mpathdev" ]; then
echo "------- FAIL, no multipath device created -----"
cleanup cleanup
exit 1 exit 1
fi fi
before_active=`multipath -l $mpathdev | grep "active undef" | wc -l`
IO_error=`dd if=/dev/zero of=/dev/$disk1 bs=1024 count=262144 2>&1 | grep -o "Input/output error" ` IO_error=`dd if=/dev/zero of=/dev/mapper/$mpathdev bs=1024 seek=2330 count=10 2>&1 | grep -o "Input/output error" `
if [ -n "$IO_error" ];then if [ -n "$IO_error" ];then
echo "------- PASS, a medium error, correctly generate an I/O error and do not get infinitely retried -----" after_active=`multipath -l $mpathdev | grep "active undef" | wc -l`
if [ "$before_active" -eq "$after_active" ]; then
echo "------- PASS, a medium error, correctly generated an I/O error and did not fail paths -----"
cleanup cleanup
exit 0
else else
echo "------- FAIL, not generate an I/O error -----" echo "------- FAIL, paths failed -----"
cleanup cleanup
exit -1 exit 1
fi
else
echo "------- FAIL, did not generate an I/O error -----"
cleanup
exit 1
fi fi

View File

@ -50,39 +50,46 @@ multipaths {
} }
_EOF_ _EOF_
rlRun "multipath 2>&1 | grep 'missing closing quotes on line'" 0 "test missing closing quote on alias" rlRun "multipath 2>&1 | grep 'missing closing quotes on line'" 0 "test missing closing quote on alias"
rlRun "multipath -r |grep mypath" 0 "mpath rename to mypath" rlRun "multipath -r"
rlRun "multipath -ll |grep mypath" 0 "check if mpath rename to mypath successfully"
# test no value for alias # test no value for alias
rlRun "sed -i 's/alias.*$/alias/g' /etc/multipath.conf" rlRun "sed -i 's/alias.*$/alias/g' /etc/multipath.conf"
rlRun "multipath 2>&1 | grep \"missing value for option 'alias' on line\"" 0 "test no value for alias" rlRun "multipath 2>&1 | grep \"missing value for option 'alias' on line\"" 0 "test no value for alias"
rlRun "multipath -r |grep mpath*" 0 "mpath rename to mpath* from mypath" rlRun "multipath -r"
rlRun "multipath -ll |grep mpath*" 0 "check if mpath rename to mpath* from mypath successfully"
# test missing starting quote on alias # test missing starting quote on alias
rlRun "sed -i 's/alias.*$/alias mypath\"/g' /etc/multipath.conf" rlRun "sed -i 's/alias.*$/alias mypath\"/g' /etc/multipath.conf"
rlRun "multipath 2>&1 |grep 'ignoring extra data starting with'" 0 "test missing starting quote on alias" rlRun "multipath 2>&1 |grep 'ignoring extra data starting with'" 0 "test missing starting quote on alias"
rlRun "multipath -r |grep mypath" 0 "mpath rename to mypath" rlRun "multipath -r"
rlRun "multipath -ll |grep mypath" 0 "check if mpath rename to mypath successfully"
# test wrong quote on alias # test wrong quote on alias
rlRun "sed -i 's/alias.*$/alias <mypath>/g' /etc/multipath.conf" rlRun "sed -i 's/alias.*$/alias <mypath>/g' /etc/multipath.conf"
rlRun "multipath 2>&1 | grep config" 1 "no warning" rlRun "multipath 2>&1 | grep config" 1 "no warning"
rlRun "multipath -r |grep '<mypath>'" 0 "mpath rename to <mypath>" rlRun "multipath -r"
rlRun "multipath -ll |grep '<mypath>'" 0 "check if mpath rename to <mypath> successfully"
# test value has a space # test value has a space
rlRun "sed -i 's/alias.*$/alias mypath test/g' /etc/multipath.conf" rlRun "sed -i 's/alias.*$/alias mypath test/g' /etc/multipath.conf"
rlRun "multipath 2>&1 |grep 'ignoring extra data starting with'" 0 "test value has a space" rlRun "multipath 2>&1 |grep 'ignoring extra data starting with'" 0 "test value has a space"
rlRun "multipath -r |grep mypath" 0 "mpath rename to mypath" rlRun "multipath -r"
rlRun "multipath -ll |grep mypath" 0 "check if mpath rename to mypath successfully"
# test wrong alias keyword # test wrong alias keyword
rlRun "sed -i 's/alias.*$/alia mypath/g' /etc/multipath.conf" rlRun "sed -i 's/alias.*$/alia mypath/g' /etc/multipath.conf"
rlRun "multipath 2>&1 |grep 'invalid keyword: alia'" 0 "invalid keyword: alia" rlRun "multipath 2>&1 |grep 'invalid keyword: alia'" 0 "invalid keyword: alia"
rlRun "multipath -r |grep mpath*" 0 "mpath rename to mpath* from mypath" rlRun "multipath -r"
rlRun "multipath -ll |grep mpath*" 0 "check if mpath rename to mpath* from mypath successfully"
rlRun "sed -i 's/alia.*$/alias mypath/g' /etc/multipath.conf" rlRun "sed -i 's/alia.*$/alias mypath/g' /etc/multipath.conf"
# test no space between the section name and the open bracket that followed it # test no space between the section name and the open bracket that followed it
# fix issue about if a section doesn't have a space between the section name and the open bracket, that section isn't read in. # fix issue about if a section doesn't have a space between the section name and the open bracket, that section isn't read in.
rlRun "sed -i 's/multipaths.*/multipaths{/g' /etc/multipath.conf" rlRun "sed -i 's/multipaths.*/multipaths{/g' /etc/multipath.conf"
rlRun "multipath 2>&1 | grep config" 1 "no warning" rlRun "multipath 2>&1 | grep config" 1 "no warning"
rlRun "multipath -r |grep mypath" 0 "mpath rename to mypath" rlRun "multipath -r"
rlRun "multipath -ll |grep mypath" 0 "check if mpath rename to mypath successfully"
# test wrong section keywords # test wrong section keywords
rlRun "sed -i 's/multipaths.*/ultipaths {/g' /etc/multipath.conf" rlRun "sed -i 's/multipaths.*/ultipaths {/g' /etc/multipath.conf"
@ -95,6 +102,7 @@ _EOF_
rlPhaseEnd rlPhaseEnd
rlPhaseStartCleanup rlPhaseStartCleanup
rlRun "udevadm settle"
rlRun "multipath -F" 0 "Flush all unused multipath device maps" rlRun "multipath -F" 0 "Flush all unused multipath device maps"
rlServiceStop multipathd rlServiceStop multipathd
rlRun "modprobe -r scsi_debug" 0 "Remove scsi_debug" rlRun "modprobe -r scsi_debug" 0 "Remove scsi_debug"

View File

@ -1,49 +0,0 @@
#!/bin/bash
# Copyright (c) 2016 Red Hat, Inc.
# #
# # This program is free software: you can redistribute it and/or modify
# # it under the terms of the GNU General Public License as published by
# # the Free Software Foundation, either version 3 of the License, or
# # (at your option) any later version.
# #
# # This program is distributed in the hope that it will be useful,
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# # GNU General Public License for more details.
# #
# # You should have received a copy of the GNU General Public License
# # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# # Author: Lin Li <lilin@redhat.com>
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE main.sh
run: $(FILES) build
./main.sh
build: $(BUILT_FILES)
chmod a+x ./main.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: LiLin <lilin@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: multipathd invoked oom-killer" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
@echo "Requires: device-mapper-multipath" >> $(METADATA)
rhts-lint $(METADATA)

5
tests/provision.fmf Normal file
View File

@ -0,0 +1,5 @@
---
standard-inventory-qcow2:
qemu:
m: 2G

View File

@ -18,81 +18,79 @@
# Author: Lin Li <lilin@redhat.com> # Author: Lin Li <lilin@redhat.com>
source ../include/ec.sh || exit 200 source ../include/ec.sh || exit 200
tlog "running $0"
tlog "start running" cleanup ()
Result=FAILED {
MulDevice=`rpm -qa|grep device-mapper-multipath | wc -l` trun "multipathd disablequeueing maps"
if [ $MulDevice != 2 ]; then trun "service multipathd stop"
tlog "multi-device is not install" sleep 5
exit 1 trun "udevadm settle"
fi
tlog "multi-device is installed"
trun "mpathconf --enable --find_multipaths n --with_module y --with_multipathd y"
trun "echo '' > /var/log/messages"
trun "multipath -F" trun "multipath -F"
sleep 5
trun "modprobe -r scsi_debug" trun "modprobe -r scsi_debug"
trun "dmsetup remove_all" }
OriginalDev=`multipathd show paths | grep "running" | awk '{print $2}'`
OLD_IFS="$IFS"
IFS=" "
OriginalDevList=($OriginalDev)
IFS="$OLD_IFS"
assert ()
{
local cmd="$*"
_trun_ "$cmd" 0
if test $? -eq 0; then
tpass_ "$cmd" ;
else
tfail_ "$cmd" ;
cleanup ;
tend ;
fi
}
rpm -q device-mapper-multipath || yum install -y device-mapper-multipath
tlog "device-mapper-multipath is installed"
# cleanup existing devices
trun "rm /etc/multipath.conf"
trun "mpathconf --enable --with_module y"
sed -i '/^defaults[[:space:]]*{/ a\
max_polling_interval 10
' /etc/multipath.conf
trun "service multipathd stop"
trun "multipath -F"
sleep 5
trun "modprobe -r scsi_debug"
#trun "service multipathd restart" #trun "service multipathd restart"
OriPathCount=`multipathd show paths | grep -i "running" |grep -v grep|wc -l` trun "service multipathd start"
tlog "Original MultPathDevice = ${OriPathCount}" trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2"
trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2 dev_size_mb=1024" sleep 5
trun "multipath -ll" mpathdev=`multipath -l | grep scsi_debug | awk '{print $1}' | head -1`
sleep 1s tlog "using multipathd device ${mpathdev}"
OriPathCount=`multipathd show paths | grep -i "running" |grep -v grep|wc -l` trun "multipath -ll ${mpathdev}"
tlog "After add tow virturl device, MultPathDevice = ${OriPathCount}" pathcount=`multipathd show paths raw format "%m %t" | grep ${mpathdev} | grep "active" | wc -l`
tlog "Checking if active path count equals 2"
assert "[[ $pathcount -eq 2 ]]"
if [ $OriPathCount -eq 0 ];then tlog "offline one path device"
tlog "Virtual MultiPath is Fail" pathname=`multipathd show paths raw format "%d %m" | grep ${mpathdev} | head -1 | awk '{print $1}'`
exit 1 tlog "path to offline: ${pathname}"
fi trun "echo 'offline' > /sys/block/${pathname}/device/state"
tlog "waiting for multipathd to fail path"
tlog "offline one MultiPathDevice" sleep 15
DeviceName=`multipath -ll | grep -i "sd[a|b|c|d|e|f|g|h]" | awk -F" " '{print $3}' | tail -1`
trun "echo 'offline' > /sys/block/${DeviceName}/device/state"
sleep 1s
trun "multipath -ll"
sleep 1s
trun "multipath -r"
sleep 1s
trun "multipathd show paths" trun "multipathd show paths"
sleep 5s pathcount=`multipathd show paths raw format "%m %t" | grep ${mpathdev} | grep "active" | wc -l`
MulPathCount=`multipathd show paths | grep -i "running" |grep -v grep|wc -l` tlog "Checking if active path count equals 1"
let "RightPathCout=$OriPathCount-1" assert "[[ $pathcount -eq 1 ]]"
if [ $MulPathCount != $RightPathCout ]; then
Result=FAIL
tlog "second check fail MulPathCount=$MulPathCount RightPathCout=$RightPathCout"
tlog "running result $Result"
exit 1
fi
tlog "second check is OK MulPathCount=$MulPathCount"
tlog "running one Multipath" tlog "restore ${pathname}"
trun "echo 'running' > /sys/block/${DeviceName}/device/state" trun "echo 'running' > /sys/block/${pathname}/device/state"
sleep 1s sleep 10
trun "multipath -ll"
sleep 4s
#verified #verified
Condition1=`grep "reinstate failed" /var/log/messages | wc -l` multipathd_state=`service multipathd status | grep "Active: active (running)" | wc -l`
Condition2=`grep "segfault" /var/log/messages | wc -l` tlog "Checking if multipathd service is running"
trun "service multipathd status > tmp_file" assert "[[ $multipathd_state -eq 1 ]]"
Condition3=`grep " DM message failed" tmp_file | wc -l` pathcount=`multipathd show paths raw format "%m %t" | grep ${mpathdev} | grep "active" | wc -l`
tlog "Checking if active path count equals 2"
trun "multipath -F" assert "[[ $pathcount -eq 2 ]]"
trun "modprobe -r scsi_debug" path_state=`multipathd show paths raw format "%d %t %T %o" | grep ${pathname} | grep "active ready running" | wc -l`
trun "dmsetup remove_all" tlog "Checking state of ${pathname}"
assert "[[ $path_state -eq 1 ]]"
trun "rm -f tmp_file"
tlog "Condition1=${Condition1} Condition2=${Condition2} Condition3=${Condition3}"
RESULT=PASS
[[ $Condition1 -eq 1 ]]&&[[ $Condition2 -eq 1 ]]&&[[ $Condition3 -eq 1 ]]&&RESULT=FAIL
echo "Test Result = $RESULT"
[[ $RESULT = "FAIL" ]]&&exit 1
exit 0
tend

View File

@ -1,49 +0,0 @@
#!/bin/bash
# Copyright (c) 2016 Red Hat, Inc.
# #
# # This program is free software: you can redistribute it and/or modify
# # it under the terms of the GNU General Public License as published by
# # the Free Software Foundation, either version 3 of the License, or
# # (at your option) any later version.
# #
# # This program is distributed in the hope that it will be useful,
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# # GNU General Public License for more details.
# #
# # You should have received a copy of the GNU General Public License
# # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# # Author: Lin Li <lilin@redhat.com>
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE main.sh
run: $(FILES) build
./main.sh
build: $(BUILT_FILES)
chmod a+x ./main.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: LiLin <lilin@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: Squelch scsi_id on multipath -ll" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
@echo "Requires: device-mapper-multipath" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -5,16 +5,38 @@
# Tests suitable for classic environment # Tests suitable for classic environment
- hosts: localhost - hosts: localhost
roles: roles:
- role: standard-test-basic
tags:
- classic
tests:
- medium_error_scsi_debug:
run: ./main.sh
timeout: 15m
- squelch_scsi_id:
run: ./main.sh
timeout: 15m
- multipathd_oom:
run: ./main.sh
timeout: 15m
- user_friendly_names:
run: ./main.sh
timeout: 15m
- kpartx_4k_aligned:
run: ./main.sh
timeout: 15m
- bindings:
run: ./main.sh
timeout: 15m
required_packages:
- device-mapper-multipath
- perl
- role: standard-test-beakerlib - role: standard-test-beakerlib
tags: tags:
- classic - classic
tests: tests:
- medium_error_scsi_debug - multipath_conf_syntax:
- squelch_scsi_id timeout: 15m
- multipathd_oom
- user_friendly_names
- multipath_conf_syntax
- kpartx_4k_aligned
- bindings
required_packages: required_packages:
- device-mapper-multipath - device-mapper-multipath
- perl

View File

@ -1,49 +0,0 @@
#!/bin/bash
# Copyright (c) 2016 Red Hat, Inc.
# #
# # This program is free software: you can redistribute it and/or modify
# # it under the terms of the GNU General Public License as published by
# # the Free Software Foundation, either version 3 of the License, or
# # (at your option) any later version.
# #
# # This program is distributed in the hope that it will be useful,
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# # GNU General Public License for more details.
# #
# # You should have received a copy of the GNU General Public License
# # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# # Author: Lin Li <lilin@redhat.com>
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE main.sh multipath.conf.no multipath.conf.yes
run: $(FILES) build
./main.sh
build: $(BUILT_FILES)
chmod a+x ./main.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: LiLin <lilin@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: user_friendly_names" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
@echo "Requires: device-mapper-multipath" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -13,7 +13,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.cp /etc/multipath.conf /etc/multipath.conf.$$org/licenses/>.
# Author: Lin Li <lilin@redhat.com> # Author: Lin Li <lilin@redhat.com>
@ -28,8 +28,8 @@ trun "mpathconf --enable --with_multipathd y --user_friendly_names y"
trun "cp /etc/multipath.conf /etc/multipath.conf.$$" trun "cp /etc/multipath.conf /etc/multipath.conf.$$"
trun "multipath -F" trun "multipath -F"
trun "modprobe scsi_debug dev_size_mb=256 num_tgts=1 vpd_use_hostno=0 \ trun "modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 \
add_host=2 delay=20 max_luns=2 no_lun_0=1" max_luns=2 no_lun_0=1"
trun "multipath" trun "multipath"
# wwid shown slowly on s390x by the script framework, but normally when run by multipath command directly # wwid shown slowly on s390x by the script framework, but normally when run by multipath command directly
# so extend sleep time # so extend sleep time
@ -43,14 +43,19 @@ mpath=$(get_mpath_disk_by_scsi_device $disk)
# user_friendly_names = yes and mpath=test # user_friendly_names = yes and mpath=test
#cur_dir=/mnt/tests/kernel/storage/multipath/user_friendly_names/ #cur_dir=/mnt/tests/kernel/storage/multipath/user_friendly_names/
#cur_dir=/home/test/scratch/device-mapper-multipath/user_friendly_names #cur_dir=/home/test/scratch/device-mapper-multipath/user_friendly_names
trun "cat multipath.conf.yes | sed 's/your_wwid/$wwid/g' > /etc/multipath.conf" trun "cat multipath.conf.yes | sed "s/your_wwid/$wwid/g" > /etc/multipath.conf"
trun "cat -n /etc/multipath.conf"
trun "multipath -r" trun "multipath -r"
tok "multipath -ll | grep -w '^test'" echo ">>> Verify 'test ($wwid)' is present ..."
trun "multipath -ll"
tok "multipath -ll | egrep \"^test\""
# user_friendly_names = no # user_friendly_names = no
trun "cat multipath.conf.no > /etc/multipath.conf" trun "cat multipath.conf.no > /etc/multipath.conf"
trun "multipath -r" trun "multipath -r"
tok "multipath -ll | grep -w '^$wwid'" echo ">>> Verify 'test' is gone but '$wwid' present ..."
trun "multipath -ll"
tok "multipath -ll | egrep \"^$wwid\""
sleep 10 sleep 10
tok "multipath -F $wwid" tok "multipath -F $wwid"
sleep 10 sleep 10