[PATCH rhel7-branch] Remove an unused import.
by Chris Lumens
Related: rhbz#1253672
---
pyanaconda/ui/gui/spokes/user.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 35bdf2e..3c30ad3 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -34,7 +34,6 @@ from pyanaconda.ui.common import FirstbootSpokeMixIn
from pyanaconda.ui.helpers import InputCheck
from pyanaconda.ui.gui.helpers import GUISpokeInputCheckHandler, GUIDialogInputCheckHandler
-from pykickstart.constants import FIRSTBOOT_RECONFIG
from pyanaconda.constants import ANACONDA_ENVIRON, FIRSTBOOT_ENVIRON,\
PASSWORD_EMPTY_ERROR, PASSWORD_CONFIRM_ERROR_GUI, PASSWORD_STRENGTH_DESC,\
PASSWORD_WEAK, PASSWORD_WEAK_WITH_ERROR, PASSWORD_WEAK_CONFIRM,\
--
2.4.3
8 years, 8 months
New: [rhinstaller/anaconda/pulls/346 master] Enable storage tests
by dashea
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
8 years, 8 months
Updated: [rhinstaller/anaconda/pulls/314 master] Add test documentation
by dashea
This is the start of what is supposed to be a human readable test documentation of the Anaconda test suite. Filing here for comments.
I'd like to also include API docs for the Python files under tests/ but so far I'm having troubles building these. I will likely have to add __init__.py files to all directories that are missing them and fix the import failures from Sphinx (e.g. by altering PYTHONPATH if necessary).
Btw it looks like the generated HTML is under version control, not sure if that needs to be removed.
--
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/314
8 years, 8 months
[PATCH] Check for unsubstituted strings before running a test.
by David Shea
If the prepared kickstart still has any @STUFF@ substitution markers in
it, assume that something was missing while setting it up and fail the
test. Use a return code of 99 for setup failures in case we start doing
something with that.
---
tests/kickstart_tests/scripts/run_one_ks.sh | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/tests/kickstart_tests/scripts/run_one_ks.sh b/tests/kickstart_tests/scripts/run_one_ks.sh
index 1a5b44a..f0b43aa 100755
--- a/tests/kickstart_tests/scripts/run_one_ks.sh
+++ b/tests/kickstart_tests/scripts/run_one_ks.sh
@@ -21,8 +21,7 @@
# This script runs a single kickstart test on a single system. It takes
# command line arguments instead of environment variables because it is
# designed to be driven by run_kickstart_tests.sh via parallel. It is
-# not for direct use, though as long as you pass the right arguments there's
-# no reason it couldn't work.
+# not for direct use.
# Possible return values:
# 0 - Everything worked
@@ -75,9 +74,21 @@ runone() {
echo RESULT:${name}:FAILED:Test prep failed: ${ksfile}
cleanup ${tmpdir}
cleanup_tmp ${tmpdir}
- return 1
+ return 99
fi
+ # Check that the prepared kickstart is free of substitution markers. Normally
+ # the substitutions are run by run_kickstart_tests.sh, but prepare has a chance
+ # to run them too. If both of those left any @STUFF@ strings behind, fail.
+ unmatched="$(grep -o '@[^[:space:]]\+@' ${ks} | head -1)"
+ if [ -n "$unmatched" ]; then
+ echo "RESULT:${name}:FAILED:Unsubstituted pattern ${unmatched}"
+ cleanup ${tmpdir}
+ cleanup_tmp ${tmpdir}
+ return 99
+ fi
+
+
kargs=$(kernel_args)
if [[ "${kargs}" != "" ]]; then
kargs="--kernel-args \"$kargs\""
--
2.4.3
8 years, 8 months
[blivet][all branches] Reduce some of the overhead in blivet's logging (#1155984)
by Samantha N. Bueno
The primary issue these patches solve is to reduce the amount of wait
time between clicking "Create partitions" in the custom part spoke and
then seeing those results show up on the screen. With a higher number
of disks, e.g. 12, you could wait up to seven or eight seconds for the
GUI to refresh. I imagine that with more disks, the problem becomes even
more pronounced.
There's definitely more to do here, but it's tedious. The current set
reduces the amount of wait time from about seven seconds to about two.
Thanks to dlehman for combing over the logs with me and helping out
with identifying some problem areas.
8 years, 8 months
[blivet][all branches] Round device size down to nearest MiB. (#1257997)
by Samantha N. Bueno
Occasionally (eg on s390x) it happens that the number of blocks reported
by a disk * LINUX_SECTOR_SIZE (used to calculate size of disk in a more
human readable form) did not result in a perfectly round, non-decimal
value. (It seems that on x86_64 disks, the number of blocks was "just
so" that the size calculation did always end up being a non-decimal
value.)
Since this resulted in anaconda writing a ks.cfg with decimal values in
partitioning information, and since int values must be specified in ks,
the best "fix" here is to just round the calculated value.
Resolves: rhbz#1257997
---
blivet/devices/storage.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index add18e6..ad8d04d 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -572,7 +572,7 @@ class StorageDevice(Device):
blocks = int(util.get_sysfs_attr(self.sysfsPath, "size"))
size = Size(blocks * LINUX_SECTOR_SIZE)
- return size
+ return size.roundToNearest('MiB', 'ROUND_DOWN')
@property
def currentSize(self):
@@ -584,7 +584,7 @@ class StorageDevice(Device):
"""
if self._currentSize == Size(0):
self._currentSize = self.readCurrentSize()
- return self._currentSize
+ return self._currentSize.roundToNearest('MiB', 'ROUND_DOWN')
def updateSize(self):
""" Update size, currentSize, and targetSize to actual size. """
--
1.9.3
8 years, 8 months