-
Notifications
You must be signed in to change notification settings - Fork 78
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
Vagrant: test_vagrant_root[box_url]
fails due to missing box (#274)
#275
Conversation
@@ -8,8 +8,8 @@ driver: | |||
platforms: | |||
- name: instance | |||
box: centos/stream9 | |||
box_url: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-Vagrant-9-20230704.1.x86_64.vagrant-libvirt.box" | |||
box_download_checksum: "8a9fe7e8083421047e5404131daa007b4c1bcc466f3d9b29d0e7c7e432891a0e" | |||
box_url: "https://cloud.centos.org/centos/8/vagrant/x86_64/images/CentOS-8-Vagrant-8.4.2105-20210603.0.x86_64.vagrant-libvirt.box" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the box: centos/stream9
but the box_url
points to an old Centos 8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, no vbox specific box please... well, one could argue that we're using libvirt box, breaking tests for vbox ...
I noticed this bug too and my idea was to do some ugly hack like using python httpserver to serve the testbox but -ENOTIME.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake, didn't realize it was a vagrant-virtualbox
, I just took one as an example.
https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-Vagrant-9-20240930.0.x86_64.vagrant-libvirt.box (https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-Vagrant-9-20240930.0.x86_64.vagrant-libvirt.box.SHA256SUM)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is this box will "expire" in less than a year, while the Centos-8 will be there "forever". There's 5 v8 libvirt boxes now, the oldest from 2019, but even if they decide to clean up at some point, there's a good chance they will keep the most recent one just for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
box: centos/stream9
but thebox_url
points to an old Centos 8.
Hm, missed that :)
Interestingly, I got a brand new centos/stream9
box in Vagrant storage, so it seems that when config.vm.box_url
is specified, config.vm.box
(normally used to identify boxes in Vagrant Cloud) will be retained to name the vm in local Vagrant repo.
I ran the test with box: centos/8-legacy
and sure enough I got a centos/8-legacy
in local storage.
The Vagrant documentation is unclear on this matter:
- config.vm.box (string) - This configures what box the machine will be brought up against. The value here should be the name of an installed box or a shorthand name of a box in HashiCorp's Vagrant Cloud.
- config.vm.box_url (string, array of strings) - The URL that the configured box can be found at. If config.vm.box is a shorthand to a box in HashiCorp's Vagrant Cloud then this value does not need to be specified. Otherwise, it should point to the proper place where the box can be found if it is not installed. This can also be an array of multiple URLs. The URLs will be tried in order.
So I can either:
- update the
box_url
entry to something likecentos/8-legacy
, or - update
box_url
,box_download_checksum
to latest Centos 9.
As you wish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote to update box_url
and box_download_checksum
to latest Centos 9, so we use current up-to-date images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to CentOS-Stream-Vagrant-9-20240930.0.x86_64.vagrant-libvirt.box
. Test passes (but see discussion below).
hm. test is still failing here with:
Not sure if it's a local issue but:
|
@apatard There is no reference in the plugin code to |
I don't need any workaround. What I did was:
So 1 test was still failing. Turns out it was box_url. So did :
At that point, noticed that it managed so create the box. Was happy to see the issue fixed. Then got the error:
This means that the test is still broken and I should not have to do some manual workaround to make the test pass. And any workaround like that should not be added to the test suite. |
@apatard I misread your initial comment, I though the problem was with the host you were running the tests on and suggested to apply the workaround on that, not in the test. I am not using tox, just running However, since there seems to be an issue, I went to Verified OS version:
The file
But I could run the test playbook successfully:
Note different python interpreter location. Also, I am on ansible 2.14.0. Not sure where to go from here. |
iirc, after a full
No idea what's exactly happening. Anyway, with your latest changes I've tested while having lunch are working fine. Thanks. I'm going to merge this PR. |
FWIW, I found that ansible 2.17 dropped support for python 3.6, which is "platform-python" for RHEL/CentOS 8, Ubuntu 18.04, and opensuse 15. Consequently, these platforms are supported only up to ansible 2.16. This is why the test was passing for me on CentOS 8 and ansible 2.14, and failing for you on (I presume) ansible 2.17+. |
Replacing obsolete box/checksum with
CentOS-8-Vagrant-8.4.2105-20210603.0.x86_64.vagrant-libvirt.box
/37cc017738bf12cafce3a97c4de73526452da6332cc5c0516723988644e62620
.With these values in
test/vagrant-plugin/scenarios/molecule/box_url/molecule.yml
the test passes.