dname does not work for partitions on trusty

Bug #1523037 reported by Scott Moser
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curtin
Confirmed
Medium
Unassigned

Bug Description

I'm not exactly sure what is going wrong here, but in my recent commit to trunk, I broke TrustyTestRaid5Bcache.
It will now reliably fail like this:
======================================================================
FAIL: test_dname (vmtests.test_raid5_bcache.TrustyTestRaid5Bcache)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/fast/curtin/fix-1514094-v1/tests/vmtests/__init__.py", line 577, in test_dname
    self.assertIn(link, contents)
AssertionError: 'sda-part2' not found in ['bcache0', 'md0']

The reason for that is not actually regression, but fix of the test. my change to tests/vmtests/__init__.py:
     def test_dname(self):
- if (os.path.exists(self.td.mnt + "ls_dname") and
- self.disk_to_check is not None):
- with open(os.path.join(self.td.mnt, "ls_dname"), "r") as fp:
+ fpath = os.path.join(self.td.collect, "ls_dname")
+ if (os.path.exists(fpath) and self.disk_to_check is not None):
+ with open(fpath, "r") as fp:
                 contents = fp.read().splitlines()
             for diskname, part in self.disk_to_check.items():
                 if part is not 0:

Previously the test was not actually doing anything as self.td.mnt did not have a trailing '/', resulting in os.path.exists always returning false. So this test would always pass but never did what was desired.

Tags: curtin-sru

Related branches

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

I've pushed a branch lp:~smoser/curtin/trunk.trusty-raid5bcache with a work around to let the test pass for the moment.

Scott Moser (smoser)
Changed in curtin:
status: New → Confirmed
importance: Undecided → Medium
Ryan Harper (raharper)
tags: added: maas-sru
Ryan Harper (raharper)
tags: added: curtin-sru
removed: maas-sru
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.