Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pkg.latest integration test for non-LTS ubuntu #34518

Merged
merged 1 commit into from
Jul 7, 2016

Conversation

terminalmage
Copy link
Contributor

This test uses pkg.list_upgrades to find a package which it assumes is
installed, to test pkg.installed with only_upgrade=True. The
problem with that approach is that pkg.list_upgrades uses a dry-run
of an apt-get dist-upgrade to find the upgrades. On non-LTS Ubuntu
releases, a dist-upgrade results in upgrading to an entirely new
Ubuntu release, and new packages which would be installed by the
dist-upgrade (but are not currently installed) will be included in the
return data. This causes the test to fail when we attempt to run
pkg.latest with only_upgrade=True on a package which is not
already installed.

This commit fixes the test by ensuring that our target package is
already installed, and continuing to iterate through the return data
from pkg.list_upgrades until a currently-installed package is found.

This test uses ``pkg.list_upgrades`` to find a package which it assumes is
installed, to test ``pkg.installed`` with ``only_upgrade=True``. The
problem with that approach is that ``pkg.list_upgrades`` uses a dry-run
of an ``apt-get dist-upgrade`` to find the upgrades. On non-LTS Ubuntu
releases, a ``dist-upgrade`` results in upgrading to an entirely new
Ubuntu release, and new packages which would be installed by the
dist-upgrade (but are not currently installed) will be included in the
return data. This causes the test to fail when we attempt to run
``pkg.latest`` with ``only_upgrade=True`` on a package which is not
already installed.

This commit fixes the test by ensuring that our target package is
already installed, and continuing to iterate through the return data
from ``pkg.list_upgrades`` until a currently-installed package is found.
@cachedout cachedout merged commit 685df80 into saltstack:2015.8 Jul 7, 2016
@terminalmage terminalmage deleted the fix-pkg.latest-test branch July 7, 2016 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants