New: [rhinstaller/anaconda/pulls/346 master] Enable storage tests

atodorov installerbot-noreply at redhat.com
Fri Sep 4 12:28:59 UTC 2015


Filing this here for more comments. 

All the tests except LVM based ones work. 

Initially the LVM reuse test fails on tear down. Blivet calls kpartx -d -s on the device which fails with device busy. At the same time the VG "blivet" is still active. If I manually deactivate it from the shell and re-execute the kpartx command the all is fine.  This prompted the blockdev.lvm.vgdeactivate() changes in the code.

```
Test 1014545-BTRFSOnNonBTRFS succeeded
Test 1014545-RaidOnNonRaidMembers succeeded
Test 1014545-VolGroupOnNonPVs succeeded
Test 1014545 summary:
	Successes: 3
	Failures:  0

Test PartitionReuse-FirstPartitionAutopart succeeded
Test PartitionReuse-SecondPartitionAutopart succeeded
Test PartitionReuse summary:
	Successes: 2
	Failures:  0

Traceback (most recent call last):
  File "./storage/run_storage_tests.py", line 25, in <module>
    failures += obj.run()
  File "/home/atodorov/anaconda/tests/storage/cases/__init__.py", line 80, in run
    obj._run()
  File "/home/atodorov/anaconda/tests/storage/cases/__init__.py", line 234, in _run
    self.tearDownDisks()
  File "/home/atodorov/anaconda/tests/storage/cases/__init__.py", line 251, in tearDownDisks
    self._blivet.devicetree.teardownDiskImages()
  File "/usr/lib/python3.4/site-packages/blivet/devicetree.py", line 596, in teardownDiskImages
    self._populator.teardownDiskImages()
  File "/usr/lib/python3.4/site-packages/blivet/populator.py", line 1550, in teardownDiskImages
    dm_device.deactivate()
  File "/usr/lib/python3.4/site-packages/blivet/devices/dm.py", line 209, in deactivate
    StorageDevice.teardown(self, recursive=recursive)
  File "/usr/lib/python3.4/site-packages/blivet/devices/storage.py", line 429, in teardown
    self._teardown(recursive=recursive)
  File "/usr/lib/python3.4/site-packages/blivet/devices/dm.py", line 203, in _teardown
    self.teardownPartitions()
  File "/usr/lib/python3.4/site-packages/blivet/devices/dm.py", line 138, in teardownPartitions
    raise errors.DMError("partition deactivation failed for '%s'" % self.name)
blivet.errors.DMError: partition deactivation failed for 'lvm-autopart-disk1'
FAIL storage/run_storage_tests.py (exit status: 1)
```

Note: the additional blivet.reset() calls probably don't have any effect. 


Next with the VG deactivated the test passes on to the second stage, where it tries to create another LVM device on top of existing disk image. This also fails with another error:

```
Test 1014545-BTRFSOnNonBTRFS succeeded
Test 1014545-RaidOnNonRaidMembers succeeded
Test 1014545-VolGroupOnNonPVs succeeded
Test 1014545 summary:
	Successes: 3
	Failures:  0

Test LVMReuse-FirstLVMAutopart succeeded
Traceback (most recent call last):
  File "./storage/run_storage_tests.py", line 25, in <module>
    failures += obj.run()
  File "/home/atodorov/anaconda/tests/storage/cases/__init__.py", line 80, in run
    obj._run()
  File "/home/atodorov/anaconda/tests/storage/cases/__init__.py", line 214, in _run
    self._blivet.doIt()
  File "/usr/lib/python3.4/site-packages/blivet/blivet.py", line 164, in doIt
    self.devicetree.processActions(callbacks=callbacks)
  File "/usr/lib/python3.4/site-packages/blivet/devicetree.py", line 380, in processActions
    callbacks=callbacks)
  File "/usr/lib/python3.4/site-packages/blivet/actionlist.py", line 280, in process
    action.execute(callbacks)
  File "/usr/lib/python3.4/site-packages/blivet/deviceaction.py", line 590, in execute
    options=self.device.formatArgs)
  File "/usr/lib/python3.4/site-packages/blivet/formats/__init__.py", line 388, in create
    self._create(**kwargs)
  File "/usr/lib/python3.4/site-packages/blivet/formats/disklabel.py", line 240, in _create
    self.commit()
  File "/usr/lib/python3.4/site-packages/blivet/formats/disklabel.py", line 253, in commit
    self.partedDisk.commit()
  File "/usr/lib64/python3.4/site-packages/parted/decorators.py", line 42, in new
    ret = fn(*args, **kwds)
  File "/usr/lib64/python3.4/site-packages/parted/disk.py", line 212, in commit
    return self.__disk.commit()
_ped.IOException: Partition(s) 2 on /dev/mapper/lvm-autopart-disk1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
FAIL storage/run_storage_tests.py (exit status: 1)
```

This time however all DM devices are successfully removed (there is a try-finally). 

I'm not sure what is the problem and my blivet knowledge is limited to figure it out by myself so please comment on this.
-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/346


More information about the anaconda-patches mailing list