Merge lp://staging/~raharper/curtin/trunk.vmtest-multipath into lp://staging/~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 396
Proposed branch: lp://staging/~raharper/curtin/trunk.vmtest-multipath
Merge into: lp://staging/~curtin-dev/curtin/trunk
Diff against target: 846 lines (+513/-68)
10 files modified
curtin/block/__init__.py (+9/-3)
curtin/commands/block_meta.py (+7/-2)
curtin/commands/curthooks.py (+17/-1)
curtin/util.py (+56/-0)
examples/tests/basic_scsi.yaml (+72/-0)
examples/tests/multipath.yaml (+38/-0)
tests/vmtests/__init__.py (+97/-45)
tests/vmtests/test_basic.py (+117/-0)
tests/vmtests/test_multipath.py (+63/-0)
tools/launch (+37/-17)
To merge this branch: bzr merge lp://staging/~raharper/curtin/trunk.vmtest-multipath
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Scott Moser (community) Approve
Christian Ehrhardt  Needs Fixing
Review via email: mp+297007@code.staging.launchpad.net

Commit message

Add multipath testing

Add multipath testing via a test-case option, cls.multipath which will
if set to true, duplicate all disks in a test class. This has the effect
of looking exactly like multipath setups where we see the same device
with two paths.

To handle devices with wwn or serial numbers with spaces in them
curtin.block was updated to ensure it supports finding devices via there
serial or wwn attribute. Specifically for serial numbers with spaces, we
currently will escape the spaces to underscores; this is supported by
observing the names that show up in /dev/disk/by-id/* for those devices.

For wwn, /dev/disk/by-id/wwn-$wwn ; curtin resolves the symlink target to
obtain a kernel devname for use with sysfs.

For serial with spaces, curtin attempts to remove whitespace like udev to
find the disk under /dev/disk/by-id/ and determine a devname.

Xenial multipath fails without ensuring the multipath/bindings file is
written with whitespace removed; this is triggered on in-target mulitpath
versions >= 1.5.0 fixing LP:1551937.

Description of the change

Add multipath testing

Add multipath testing via a test-case option, cls.multipath which will
if set to true, duplicate all disks in a test class. This has the effect
of looking exactly like multipath setups where we see the same device
with two paths.

To handle devices with wwn or serial numbers with spaces in them
curtin.block was updated to ensure it supports finding devices via there
serial or wwn attribute. Specifically for serial numbers with spaces, we
currently will escape the spaces to underscores; this is supported by
observing the names that show up in /dev/disk/by-id/* for those devices.

For wwn, /dev/disk/by-id/wwn-$wwn ; curtin resolves the symlink target to
obtain a kernel devname for use with sysfs.

For serial with spaces, curtin attempts to remove whitespace like udev to
find the disk under /dev/disk/by-id/ and determine a devname.

Xenial multipath fails without ensuring the multipath/bindings file is
written with whitespace removed; this is triggered on in-target mulitpath
versions >= 1.5.0 fixing LP:1551937.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Ryan,
nice work on multipath testing!

I have found nothing severe but a collection of things that could be more clear, more polished or just were unclear at least to me.

review: Needs Fixing
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Probably also worth to mention that actually running the tests failed me.
I did an sync-images to ensure I'm not just on some older sh$§.

But still running the full testsuite on your branch won't fully work:
Note at the same environment my last branch works (just to ensure the system setup isn't borked)

rm -rf output/; CURTIN_VMTEST_KEEP_DATA_FAIL=all ./tools/jenkins-runner -vv --nologcapture --processes=5 --process-timeout=3600 tests/vmtests 2>&1 | tee ~/curtin-test-multipath.log; rm -rf output/
Yours: => http://paste.ubuntu.com/17167038/
Mine as reference: => http://paste.ubuntu.com/17167042/

You can give it a look yourself it is on ubuntu@horsea:/mnt/nvme/trunk.vmtest-multipath and the logfiles of my runs are in home.
I imported your LP id to ubuntu@

Revision history for this message
Scott Moser (smoser) wrote :

On Fri, 10 Jun 2016, ChristianEhrhardt wrote:

> Review: Needs Fixing
>
> Hi Ryan,
> nice work on multipath testing!
>
> I have found nothing severe but a collection of things that could be more clear, more polished or just were unclear at least to me.
>
> Do you think it would make sense to make this a parameter maybe from cls.multipath.num_parallel or so?
> Effectively what you did is already so great, I don't see why it has to be always 2.
> That way you could do some sort of limit testing by setting it to (48*2)*(96*2) which would be the system z max.
> Not really that number :-), but driving the test with 2,16,64 could be a great check!
>
> General question: Is there a limit on qemu (commandline) that we have to be scared of?

Probably not too much to worry about. I'm pretty sure that its total of
command line + environment < 128k.

I just tried:
  $ ./foo.sh
  128000
  129000
  130000
  131000
  /tmp/foo.sh: 8: /tmp/foo.sh: /bin/true: Argument list too long
  i=131072 2
  $ cat foo.sh
  #!/bin/sh
  b=""; i=0
  while i=$(($i+1)) && b="$b."; do
      [ $i -lt 128000 ] && continue
      [ $(($i%1000)) -eq 0 ] && echo $i
      /bin/true "$b" || { ret=$?; break; }
  done
  echo i=$i $ret

Revision history for this message
Ryan Harper (raharper) wrote :
Download full text (16.9 KiB)

> Hi Ryan,
> nice work on multipath testing!
>
> I have found nothing severe but a collection of things that could be more clear, more polished or just were unclear at least to me.
>

Thanks for the review Christian. Picking up most of your suggestions.
A few things will need to put off for now.

> > === modified file 'curtin/block/__init__.py'
> > --- curtin/block/__init__.py 2016-04-22 16:24:00 +0000
> > +++ curtin/block/__init__.py 2016-06-09 21:47:02 +0000
> > @@ -356,6 +356,7 @@
> > cmd.append('--replace-whitespace')
> > try:
> > (out, err) = util.subp(cmd, capture=True)
> > + LOG.debug("scsi_id output raw:\n%s", out)
>
> Since it is debug level anyway I'd think it would be nice to report the "err"
> as well. I mean there could be err output even without
> util.ProcessExecutionError in some cases - and especially those are the ones we
> will read the debug level info.
>

OK

> > scsi_wwid = out.rstrip('\n')
> > return scsi_wwid
> > except util.ProcessExecutionError as e:
> >
> > === modified file 'curtin/commands/block_meta.py'
> > --- curtin/commands/block_meta.py 2016-04-22 16:24:00 +0000
> > +++ curtin/commands/block_meta.py 2016-06-09 21:47:02 +0000
> > @@ -379,9 +379,14 @@
> > if vol.get('serial'):
> > volume_path = block.lookup_disk(vol.get('serial'))
> > elif vol.get('path'):
> > - volume_path = vol.get('path')
> > + # resolve any symlinks to the dev_kname so sys/class/block access
> > + # is valid. ie, there are no udev generated values in sysfs
> > + volume_path = os.path.realpath(vol.get('path'))
>
> I'm not sure so this is honestly just a question - could there be cases
> where os.path.realpath would throw some kind of OSError? Like on broken
> links or anything - and if so should we guard us against it?
> (same 4 lines below)

I'm sure os.path.realpath() throw and exception, however, I don't think there
is anything that we can do about that and still recover. That is, if
we fail to find the realpath to the device, we cannot fix that, and we'd exit.

Without catching the exception, we get the same semantics by allowing the
error to propigate upward.

> > === modified file 'curtin/commands/curthooks.py'
> > --- curtin/commands/curthooks.py 2016-05-17 21:14:36 +0000
> > +++ curtin/commands/curthooks.py 2016-06-09 21:47:02 +0000
> > @@ -638,6 +638,20 @@
> > LOG.info("Detected multipath devices. Installing support via %s", mppkgs)
> >
> > util.install_packages(mppkgs, target=target)
> > + replace_spaces = True
> > + try:
> > + # check in-target version
> > + pkg_ver = util.get_package_version('multipath-tools', target)
> > + upstream = pkg_ver.split('-')[0]
> > + major, minor, micro = upstream.split(".", 2)
> > + val = 1000 * int(major) + 100 * int(minor)
>
> Maybe moving the splitting into util as well (or an extra .py).
> This is very format depending, but I'd think there are only three or four kinds in Ubunutu.
> It would be nice for re-usability if you would define that as util for this format.
> Whoever needs another ...

393. By Ryan Harper

Only use the filename of the output disk, not the whole path.

394. By Ryan Harper

Add error output along side scsi_id debug output.

395. By Ryan Harper

Not all vmtests use storage config, fail gracefully

396. By Ryan Harper

Move version parsing into utility method, return version dictionary for callers

397. By Ryan Harper

Use disk_wwns to match disk_serials

398. By Ryan Harper

Replace hardcoded number of paths for multipath to class variable, cls.multipath_num_paths; default to 2

399. By Ryan Harper

Replace single character temp variable in disk parameter construction; update formatting.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

I approve of this branch.
We actually deployed a power8 system with multipath for xenial with it at revno 399.
I had conversation with Ryan in irc, and asked that we improve the get_package_version to do the multiplication of major/minor/micro centrally. something like this: http://paste.ubuntu.com/17806224/

i'd like that fixed, and then please merge. whoowho!

review: Approve
400. By Ryan Harper

merge from trunk

401. By Ryan Harper

Update get_package_version to move sematic_version calculation internally.

402. By Ryan Harper

fixes from diglett run

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches