Tested this in a Mantic VM. Like I said, the autopkgtests are good enough to test against regressions. This test is mainly checking that the in-place upgrade has no errors and that the daemon still works.
1. Create Mantic VM 2. Install required packages # apt install -y lsscsi multipath-tools open-iscsi tgt fio 3. Setup iscsi targets ``` targetname="iqn.2016-11.foo.com:target.iscsi" cwd=$(pwd) testdir="/mnt/tgtmpathtest" localhost="127.0.0.1" portal="${localhost}:3260" maxpaths=4 backfn="backingfile" expectwwid="60000000000000000e00000000010001" testdisk="/dev/disk/by-id/wwn-0x${expectwwid}"
### Setup mpath devices
# Restart tgtd to make sure modules are all loaded service tgt restart || echo "Failed to restart tgt" >&2
# prep SINGLE test file truncate --size 100M ${backfn}
# create target tgtadm --lld iscsi --op new --mode target --tid 1 -T "${targetname}" # allow all to bind the target tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL # set backing file tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b "${cwd}/${backfn}"
# scan for targets (locally) iscsiadm --mode discovery --type sendtargets --portal ${localhost}
# login echo "login #1" iscsiadm --mode node --targetname "${targetname}" --portal ${portal} --login # duplicate this session (always 1) for i in $(seq 2 ${maxpaths}) do echo "extra login #${i}" iscsiadm --mode session -r 1 --op new done
udevadm settle sleep 5 # sleep a bit to allow device to be created.
# status summary echo "Status after initial setup" tgtadm --lld iscsi --mode target --op show tgtadm --lld iscsi --op show --mode conn --tid 1 iscsiadm --mode session -P 1 lsscsi -liv multipath -v3 -ll dmsetup table
echo "Test WWN should now point to DM" readlink "${testdisk}" | grep dm ``` 4. Check multipath devices # multipath -ll mpatha (360000000000000000e00000000010001) dm-0 IET,VIRTUAL-DISK size=100M features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 9:0:0:1 sdd 8:48 active ready running |-+- policy='service-time 0' prio=1 status=enabled | `- 6:0:0:1 sda 8:0 active ready running |-+- policy='service-time 0' prio=1 status=enabled | `- 7:0:0:1 sdb 8:16 active ready running `-+- policy='service-time 0' prio=1 status=enabled `- 8:0:0:1 sdc 8:32 active ready running
5. Test in-place ugprade (which calls a daemon restart) # dpkg -l multipath-tools | awk '/^ii/ {print $3}' 0.9.4-5ubuntu1 # add-apt-repository ppa:mitchdz/multipath-tools-mantic-rm-initscript -y && apt update -y && apt upgrade -y # dpkg -l multipath-tools | awk '/^ii/ {print $3}' 0.9.4-5ubuntu2~mantic2 # multipath -ll mpatha (360000000000000000e00000000010001) dm-0 IET,VIRTUAL-DISK size=100M features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 9:0:0:1 sdd 8:48 active ready running |-+- policy='service-time 0' prio=1 status=enabled | `- 6:0:0:1 sda 8:0 active ready running |-+- policy='service-time 0' prio=1 status=enabled | `- 7:0:0:1 sdb 8:16 active ready running `-+- policy='service-time 0' prio=1 status=enabled `- 8:0:0:1 sdc 8:32 active ready running
« Back to merge proposal
Tested this in a Mantic VM. Like I said, the autopkgtests are good enough to test against regressions. This test is mainly checking that the in-place upgrade has no errors and that the daemon still works.
1. Create Mantic VM "iqn.2016- 11.foo. com:target. iscsi" "/mnt/tgtmpatht est" "127.0. 0.1" "${localhost} :3260" "backingfile" "60000000000000 000e00000000010 001" "/dev/disk/ by-id/wwn- 0x${expectwwid} "
2. Install required packages
# apt install -y lsscsi multipath-tools open-iscsi tgt fio
3. Setup iscsi targets
```
targetname=
cwd=$(pwd)
testdir=
localhost=
portal=
maxpaths=4
backfn=
expectwwid=
testdisk=
### Setup mpath devices
# Restart tgtd to make sure modules are all loaded
service tgt restart || echo "Failed to restart tgt" >&2
# prep SINGLE test file
truncate --size 100M ${backfn}
# create target
tgtadm --lld iscsi --op new --mode target --tid 1 -T "${targetname}"
# allow all to bind the target
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
# set backing file
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b "${cwd}/${backfn}"
# scan for targets (locally)
iscsiadm --mode discovery --type sendtargets --portal ${localhost}
# login
echo "login #1"
iscsiadm --mode node --targetname "${targetname}" --portal ${portal} --login
# duplicate this session (always 1)
for i in $(seq 2 ${maxpaths})
do
echo "extra login #${i}"
iscsiadm --mode session -r 1 --op new
done
udevadm settle
sleep 5 # sleep a bit to allow device to be created.
# status summary
echo "Status after initial setup"
tgtadm --lld iscsi --mode target --op show
tgtadm --lld iscsi --op show --mode conn --tid 1
iscsiadm --mode session -P 1
lsscsi -liv
multipath -v3 -ll
dmsetup table
echo "Test WWN should now point to DM" 0000e0000000001 0001) dm-0 IET,VIRTUAL-DISK 'service- time 0' prio=1 status=active 'service- time 0' prio=1 status=enabled 'service- time 0' prio=1 status=enabled 'service- time 0' prio=1 status=enabled
readlink "${testdisk}" | grep dm
```
4. Check multipath devices
# multipath -ll
mpatha (36000000000000
size=100M features='0' hwhandler='0' wp=rw
|-+- policy=
| `- 9:0:0:1 sdd 8:48 active ready running
|-+- policy=
| `- 6:0:0:1 sda 8:0 active ready running
|-+- policy=
| `- 7:0:0:1 sdb 8:16 active ready running
`-+- policy=
`- 8:0:0:1 sdc 8:32 active ready running
5. Test in-place ugprade (which calls a daemon restart) multipath- tools-mantic- rm-initscript -y && apt update -y && apt upgrade -y mantic2 0000e0000000001 0001) dm-0 IET,VIRTUAL-DISK 'service- time 0' prio=1 status=active 'service- time 0' prio=1 status=enabled 'service- time 0' prio=1 status=enabled 'service- time 0' prio=1 status=enabled
# dpkg -l multipath-tools | awk '/^ii/ {print $3}'
0.9.4-5ubuntu1
# add-apt-repository ppa:mitchdz/
# dpkg -l multipath-tools | awk '/^ii/ {print $3}'
0.9.4-5ubuntu2~
# multipath -ll
mpatha (36000000000000
size=100M features='0' hwhandler='0' wp=rw
|-+- policy=
| `- 9:0:0:1 sdd 8:48 active ready running
|-+- policy=
| `- 6:0:0:1 sda 8:0 active ready running
|-+- policy=
| `- 7:0:0:1 sdb 8:16 active ready running
`-+- policy=
`- 8:0:0:1 sdc 8:32 active ready running