Code review comment for ~mitchdz/ubuntu/+source/multipath-tools:mitch/remove_init_conf_mantic

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

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