61 Commits

Author SHA1 Message Date
Chris Roberts
74b4a2b1f5 Adjust installation for unknown default architecture
When the reported architecture is unknown and the provider is listed as
the default architecture, add the box without architecture information
so it is installed without architecture information on the path within
the collection.
2023-09-26 16:20:37 -07:00
Chris Roberts
c8a7989b88 Adjust internal layout to allow downgrading
With the initial layout of `provider/architecture`, after installing a
box with architecture support downgrading Vagrant would result in it
being unable to process the box collection. Swapping the layout to be
`architecture/provider` allows downgrades to still properly process the
box collection.
2023-09-25 15:09:29 -07:00
Chris Roberts
9ef5c49598 Use api endpoint for expanded urls
When expanding the box url, prefer the API endpoint which is updated to
include provider architecture information. Test the API endpoint and the
legacy endpoint and use which ever is valid, with the API taking
precedence. This allows Vagrant to continue with non Vagrant Cloud
servers that do not implement the API endpoint.
2023-09-15 17:30:32 -07:00
Chris Roberts
6e13612111 Add test coverage for architecture support 2023-09-14 16:15:03 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
d83bfc0d40 Perform best effort ssl revocation check on Windows
When performing a request via curl on Windows using schannel, ssl
certificate revocation checks does not handle verification failures
gracefully when an error is encountered that is unrelated to the actual
revocation of a certificate.

A new option is available to perform best effort revocation checks on
curl, so this is enabled by default on the Windows platform. A new
config option (`box_download_disable_ssl_revoke_best_effort`) has also
been added which can be optionally enabled to restore previous behavior
which results in a hard error if any error is encountered.
2023-06-20 16:37:00 -07:00
sophia
4551b8b2ad Use file locks to avoid file existance checking race conditions 2023-02-22 14:28:00 -08:00
sophia
f153996b2d Add tests for mutex util module 2023-01-13 14:08:27 -08:00
sophia
83efa09dfa Test box download mutex 2023-01-12 16:30:05 -08:00
sophia
df94a36568 Patch fake_ftp for determining the size of files 2022-08-01 11:30:29 -05:00
Chris Roberts
3d0d0148e9 Update tests to use real UI instance
Replaces use of UI doubles within tests to use actual UI instance
    to ensure calls are passing parameters correctly.
2021-06-23 14:04:48 -07:00
sophia
b480790a8d Add box directly with authed urls 2021-04-05 16:39:01 -05:00
Connor Martin
e041bc7998 add checksum test 2021-03-11 17:47:08 -06:00
sophia
4b67216d71 Raise error if downloading box metadata fails 2021-02-12 17:07:04 -06:00
sophia
fffc555faf Add tests for new hook 2020-08-21 10:54:43 -05:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Brian Cain
efd3a62ffe
Fixes #11207: Do not validate checksums if options are empty string
Prior to this commit, if Vagrant received checksum options from Vagrant
Cloud that were simply empty strings, it would try to validate its
checksum with those options. This commit fixes that by ignoring empty
string values.
2019-11-21 09:56:58 -08:00
Chris Roberts
5e0f64d654 Only run tests that require bsdtar if it is available 2019-06-19 15:29:55 -07:00
Brian Cain
bf4ea4e76c
Fix sticky Travis CI test
this commit removes the webserver block within the box add unit test.
It's not actually needed since the test is just ensuring that if a user
adds a box name as a URL it prints a warning to the user.
2018-01-09 16:05:07 -08:00
Brian Cain
8b1043c199 Remove stub methods and replace with allows for rpsec 3 2017-08-04 15:02:59 -07:00
Chris Roberts
1a62743bc5 Update rspec to recent version and fix deprecations 2017-08-03 17:54:07 -07:00
Chris Roberts
da1b5765c7 Prevent URI parse errors when checking box name
Fixes #8758
2017-07-07 11:43:16 -07:00
Brian Cain
f1d08aa629 (#7118) Handle box names that are URLs
Prior to this commit, if a user set a URL for the name of a box, vagrant
would not warn the user about using box_url instead. This would lead to
some difficult user experiences around the various box commands due to
the box name being a full URL. This commit introduces a warning to the
user and lets them know to instead use box_url.
2017-05-31 15:25:05 -07:00
Chris Roberts
a055978d74 Scrub credentials from box URLs 2017-01-12 13:24:46 -08:00
Seth Vargo
fb60d34236
Add unique names to all tmpdir and tempfile calls in tests + cleanup
This commit attempts to uniquely identify the temporary files and
directories that are created during test runs. Where it was a quick
fix, this commit also removes the temporary files and directories.

There are still a ton of temporary files due to calls to
.isolated_environment in the tests without an easy API an easy way
to provide a closer to that function.
2016-05-28 23:22:34 -04:00
Seth Vargo
4e21dd78e4 Ignore case when comparing checksums
Fixes GH-6648
2015-12-07 10:30:46 -05:00
Mitchell Hashimoto
9dc04b648c skip box add tests on Windows 2015-11-20 15:15:04 -08:00
Seth Vargo
c1623ee740 Fix port collision in tests 2015-11-18 18:47:19 -08:00
Mitchell Hashimoto
891c47c742 core: don't do HEAD request for box on non-HTTP [GH-5477] 2015-11-18 16:52:40 -08:00
Mitchell Hashimoto
a0be121f4f Revert "Merge pull request #5274 from mitchellh/sethvargo/atlas_api"
This reverts commit 7f19284ef4e8a67ffbcac98aa30db89ccd370d99, reversing
changes made to f0284d000be2480ae7a9d343bd54b6ef0d4d9e0a.
2015-02-03 06:39:28 +01:00
Seth Vargo
6fd685e96d Fix failing tests 2015-02-02 19:24:50 -05:00
Mitchell Hashimoto
4827469dee core: recognize more complex content types for json [GH-4525] 2014-10-23 11:26:56 -07:00
Franz Pletz
6def193567 Add config.vm.box_server_url setting
This commits adds a new config setting `config.vm.box_server_url` to set
the URL of a local VagrantCloud instance in the Vagrantfile. If the
environment variable `VAGRANT_SERVER_URL` is set, it will still be
preferred.
2014-08-01 14:38:55 +02:00
Mitchell Hashimoto
3aad85fa30 style 2014-04-11 09:56:35 -07:00
Mitchell Hashimoto
32d86ca42b core: don't allow version for old-style box [GH-3260] 2014-04-02 09:32:34 -07:00
Fabio Rehm
54656151cf Convert specs to RSpec 2.14.8 syntax with Transpec
This conversion is done by Transpec 1.10.2 with the following command:
    transpec test/unit/

* 507 conversions
    from: obj.should
      to: expect(obj).to

* 394 conversions
    from: == expected
      to: eq(expected)

* 260 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 85 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 25 conversions
    from: its(:attr) { }
      to: describe '#attr' do subject { super().attr }; it { } end

* 19 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 7 conversions
    from: obj.should_not_receive(:message)
      to: expect(obj).not_to receive(:message)

* 3 conversions
    from: Klass.any_instance.should_receive(:message)
      to: expect_any_instance_of(Klass).to receive(:message)
2014-03-14 12:02:07 -03:00
Mitchell Hashimoto
8634cc309b core: error earlier if adding a path that doesn't exist 2014-03-12 20:33:12 -07:00
Mitchell Hashimoto
ee23b87eb6 core: Private boxes authenticate metadata box URLs too 2014-03-09 19:24:54 -07:00
Mitchell Hashimoto
5018e4d8a4 core: checksums supported when adding box from metadata 2014-03-01 12:03:22 +01:00
Mitchell Hashimoto
ce350fe872 core: box checksums just work properly again for direct box adds 2014-03-01 11:54:37 +01:00
Mitchell Hashimoto
7926f7f051 core: box URLs can be authenticated by hooking 2014-03-01 11:38:04 +01:00
Mitchell Hashimoto
becc349846 core: handle native windows paths like 'c:\foo.box'
[GH-2081]
2014-02-05 21:20:35 -08:00
Mitchell Hashimoto
647563edaf core: shorthand boxes must be foo/bar formatted, better errors 2014-02-05 21:20:31 -08:00
Mitchell Hashimoto
b81686e2c9 core: BoxAdd adds the metadata URL 2014-02-05 21:20:08 -08:00
Mitchell Hashimoto
f0607c6df0 core: BoxAdd supports multiple URLs properly 2014-02-05 21:19:59 -08:00
Mitchell Hashimoto
38248c240c core: BoxAdd errors if name doesn't match metadata 2014-02-05 21:19:58 -08:00
Mitchell Hashimoto
a73ea6ab7a core: fix hang in test 2014-02-05 21:19:54 -08:00
Mitchell Hashimoto
d08866e9f3 core: nicer error if shorthand can't be found 2014-02-05 21:19:49 -08:00
Mitchell Hashimoto
5aba445cac core: shorthand box adds wor 2014-02-05 21:19:47 -08:00
Mitchell Hashimoto
f9c9559320 core: ask what provider to use if multiple providers 2014-02-05 21:19:38 -08:00