FTBFS in cosmic test_list_os

Bug #1796932 reported by Christian Ehrhardt 
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
virt-manager FTBFS in bionic due to the updated osinfo-db in -updates. It tickles a bug in a virt-manager test case.

[Test Case]
Rebuild virt-manager in bionic w/ -updates enabled.
On failure:
[...]
changing mode of build/scripts-2.7/virt-manager from 664 to 775
changing mode of build/scripts-2.7/virt-clone from 664 to 775
changing mode of build/scripts-2.7/virt-install from 664 to 775
changing mode of build/scripts-2.7/virt-convert from 664 to 775
changing mode of build/scripts-2.7/virt-xml from 664 to 775
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
python setup.py test
running test
.....................................................F........................................................................................................................................................................................................................s........................................................................................................................................................................
======================================================================
FAIL: test_list_os (tests.osdict.TestOSDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/osdict.py", line 85, in test_list_os
    assert found_fedora and found_rhel
AssertionError

----------------------------------------------------------------------
Ran 439 tests in 57.085s

FAILED (failures=1, skipped=1)
make[1]: *** [debian/rules:17: override_dh_auto_test] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------

[Regression Risk]
Fix is restricted to built-in test code, and this fix is already present in cosmic.

Related branches

summary: - FTBFS in cosmic
+ FTBFS in cosmic test_list_os
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

It actually was part of the FTBFS check
https://launchpadlibrarian.net/391461281/buildlog_ubuntu-cosmic-amd64.virt-manager_1%3A1.5.1-0ubuntu1_BUILDING.txt.gz

But being in universe it didn't bubble up yet :-/

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

Reproducible via
$ python setup.py test -v -d --testfile /root/virt-manager-1.5.1/tests/osdict.py

Debugging this I see that
  full_list = OSDB.list_os()
contains various fedora and rhel entries.

But:
  pref_list = OSDB.list_os(typename="linux", sortpref=["fedora", "rhel"])
Only has these three entries:
idx 0 osobj.name fedora-unknown
idx 1 osobj.name fedora28
idx 2 osobj.name silverblue28

Bionic is on the same version, that makes it easy to cross-check there.
The same test on the same source works there.

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

On Bionic it finds ~27 Fedoras and then also plenty of rhel entries.

In fact on cosmic there are a few more releases known (newer OSDB).
But I think I have spotted what breaks it.

Cosmic:
idx 116 osobj.name fedora-unknown
idx 117 osobj.name fedora28
idx 118 osobj.name silverblue28
idx 119 osobj.name fedora27
idx 120 osobj.name fedora26
idx 121 osobj.name fedora25

Bionic:
idx 36 osobj.name fedora-unknown
idx 37 osobj.name fedora26
idx 38 osobj.name fedora25
idx 39 osobj.name fedora24
idx 40 osobj.name fedora23
idx 41 osobj.name fedora22

Those are the full lists and the unsorted silverblue28 in there is odd.

The code expects to find a list sorted to only contain fedora* and rhel* entries.
It makes sure that the first non-fedora is rhel and that fails.

This call fails
pref_list = OSDB.list_os(typename="linux", sortpref=["fedora", "rhel"])
Due to the full_list not being ordered correctly in Cosmic.
The silverblue28 entrey is clearly not at the "s" place in an alphanumeric sort.

That is from:
from virtinst import OSDB
from
virtinst/osdict.py:129

sortpref is defined as
:param sortpref: Sort these OSes at the front of the list

The sort algorithm uses osinfo.urldistro to "clump" same distros together.

/usr/share/osinfo/os/fedoraproject.org/silverblue-28.xml of package osinfo-db lists it as fedora27 derived and that makes it clump with fedora.

Works:
osinfo-db 0.20180226-1
Fails:
osinfo-db 0.20180929-1

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

Latest git of virt-manager builds fine.
But that is due to [1] which is a nice development, but not ok as a "bugfix" for the current issue.

Furthermore there is no released version of virt-manager with that code yet, so it might be unverified and has some rough edges.
It is unlikely that we can jump onto this new "wagon" right now, more likely to happen with a release of virt-manager 1.6

The above explains why upstream virt-manager might not have seen it yet, but we need a fix for the sorting of silverblue28 breaking the test.
But the test might show a real issues and real functionality might be broken - therefore I'd not just want to disable the test either.

So we need a fix that fixed virt-manager 1.5.x stream and/or for now remove the bad osdb entry that exposes the issue.

[1]: https://github.com/virt-manager/virt-manager/commit/d52d9885c85623b8d924dbf0aceecb08b33e9122

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

For the sake of knowing the potential last resort actions - removing /usr/share/osinfo/os/fedoraproject.org/silverblue-28.xml makes it work as it did before.

But I'd prefer to have a valid fix in code instead if there is any.

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

TL;DR for now:
- new OSDB contains silverblue28
- silverblue28 is fedora based, so is its URI
- that makes OSDB code in virt-manager to "clump" it with Fedora
- That breaks the assumption in tests/osdict.py test_list_os will contain fedora* followed by rhel*
- new virt-mamager doesn't have the test anymore (majore rewrite of distro selection)
- new virt-manager code not released yet
- we need a fix for the existing virt-manager (1.5.1) with current osdb

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

The returned values are clumped/sorted by urldistro:
https://github.com/virt-manager/virt-manager/blob/v1.5-maint/virtinst/osdict.py#L90
https://github.com/virt-manager/virt-manager/blob/v1.5-maint/virtinst/osdict.py#L382
https://github.com/virt-manager/virt-manager/blob/v1.5-maint/virtinst/osdict.py#L97
https://github.com/virt-manager/virt-manager/blob/v1.5-maint/virtinst/osdict.py#L105

Therefore the test should not use name but urldistro as well.

I haven't found an issue in the real code yet (it will order silverblue in the midst of fedora, but that is ok) due to that, so lets fix the tests. Upstream review might uncover if there is more to mind that I missed.

Needed for 1.5.x maintenance tree at https://github.com/virt-manager/virt-manager/tree/v1.5-maint

Submitted in https://github.com/virt-manager/virt-manager/pull/35

Built fine with the fix in https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3461/+packages

I also extended the MP for the most current upload to include this
https://code.launchpad.net/~paelzer/ubuntu/+source/virt-manager/+git/virt-manager/+merge/356334

Changed in virt-manager (Ubuntu):
status: New → In Progress
Robie Basak (racb)
tags: added: ftbfs
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virt-manager - 1:1.5.1-0ubuntu2

---------------
virt-manager (1:1.5.1-0ubuntu2) cosmic; urgency=medium

  * d/p/lp-1794315-connection-avoid-failing-on-NoneType.patch: fix a race
    (worse on slow remote connections) that would break connecting to a
    remote (LP: #1794315)
  * d/p/lp-1796932-tests-osdict-fix-ordering-issue-with-new-osinfo.patch:
    fix FTBFS due to self-tests failing with new osinfo (LP: #1796932)

 -- Christian Ehrhardt <email address hidden> Tue, 09 Oct 2018 16:57:42 +0200

Changed in virt-manager (Ubuntu):
status: In Progress → Fix Released
dann frazier (dannf)
description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Christian, or anyone else affected,

Accepted virt-manager into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/virt-manager/1:1.5.1-0ubuntu1.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in virt-manager (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Build [1] completed, therefore setting verified as fixing FTBFS was the purpose of the fix.

[1]: https://launchpad.net/ubuntu/+source/virt-manager/1:1.5.1-0ubuntu1.2/+build/16437071

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virt-manager - 1:1.5.1-0ubuntu1.2

---------------
virt-manager (1:1.5.1-0ubuntu1.2) bionic; urgency=medium

  * d/p/lp-1796932-tests-osdict-fix-ordering-issue-with-new-osinfo.patch:
    fix FTBFS due to self-tests failing with new osinfo (LP: #1796932)

 -- dann frazier <email address hidden> Thu, 28 Feb 2019 19:09:11 +0000

Changed in virt-manager (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for virt-manager has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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