-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
122 changed files
with
11,335 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
{{ content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
layout: table_wrappers | ||
--- | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="{{ site.lang | default: 'en-US' }}"> | ||
{% assign version = page.version | default: 'latest' %} | ||
{% include nav.html pages=site.pages version=version %} | ||
{% include head.html %} | ||
|
||
<script src="https://polyfill.io/v3/polyfill.js?features=es6"> | ||
</script> | ||
|
||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> | ||
|
||
<body> | ||
<a class="skip-to-main" href="#main-content">Skip to main content</a> | ||
{% include icons/icons.html %} | ||
{% include components/sidebar.html %} | ||
<div class="main" id="top"> | ||
{% include components/header.html %} | ||
<div class="main-content-wrap"> | ||
{% include components/breadcrumbs.html %} | ||
<div id="main-content" class="main-content"> | ||
<main> | ||
{% if site.heading_anchors != false %} | ||
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 | ||
16\" aria-hidden=\"true\"> | ||
<use xlink:href=\"#svg-link\"></use> | ||
</svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %} | ||
{% else %} | ||
{{ content }} | ||
{% endif %} | ||
|
||
{% if page.has_children == true and page.has_toc != false %} | ||
{% include components/children_nav.html %} | ||
{% endif %} | ||
</main> | ||
{% include components/footer.html %} | ||
</div> | ||
</div> | ||
{% if site.search_enabled != false %} | ||
{% include components/search_footer.html %} | ||
{% endif %} | ||
</div> | ||
|
||
{% if site.mermaid %} | ||
{% include components/mermaid.html %} | ||
{% endif %} | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
{{ content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
layout: table_wrappers | ||
--- | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="{{ site.lang | default: 'en-US' }}"> | ||
{% include head.html %} | ||
<body> | ||
<a class="skip-to-main" href="#main-content">Skip to main content</a> | ||
{% include icons/icons.html %} | ||
<div class="main-content-wrap" id="top"> | ||
{% include components/breadcrumbs.html %} | ||
<div id="main-content" class="main-content" role="main"> | ||
{% if site.heading_anchors != false %} | ||
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %} | ||
{% else %} | ||
{{ content }} | ||
{% endif %} | ||
|
||
{% if page.has_children == true and page.has_toc != false %} | ||
{% include components/children_nav.html %} | ||
{% endif %} | ||
|
||
{% include components/footer.html %} | ||
|
||
</div> | ||
</div> | ||
|
||
{% if site.mermaid %} | ||
{% include components/mermaid.html %} | ||
{% endif %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
{{ content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
{{ content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
layout: vendor/compress | ||
--- | ||
|
||
{% assign content_ = content | replace: '<table', '<div class="table-wrapper"><table' %} | ||
{% assign content_ = content_ | replace: '</table>', '</table></div>' %} | ||
{{ content_ }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'additional storage configured', acceptance: true do | ||
include_context 'libvirt_acceptance' | ||
|
||
before do | ||
environment.skeleton('additional_storage') | ||
end | ||
|
||
after do | ||
assert_execute('vagrant', 'destroy', '--force') | ||
end | ||
|
||
it 'should succeed' do | ||
status('Test: machine is created successfully') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: additional storage configured') | ||
expect(result.stdout).to match(/\(vda\).*work_default.img/) | ||
expect(result.stdout).to match(/\(vdb\).*work_default-vdb\.qcow2/) | ||
|
||
status('Test: reload handles additional storage correctly') | ||
result = environment.execute('vagrant', 'reload') | ||
expect(result).to exit_with(0) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'package domain', acceptance: true do | ||
include_context 'libvirt_acceptance' | ||
|
||
before(:all) do | ||
expect(Vagrant::Util::Which.which('virsh')).to be_truthy, | ||
'networking tests require virsh, please install' | ||
expect(system('virsh --connect=qemu:///system uri >/dev/null')).to be_truthy, | ||
'network tests require access to qemu:///system context, please ensure test user has correct permissions' | ||
end | ||
|
||
after(:each) do | ||
assert_execute('vagrant', 'destroy', '--force') | ||
end | ||
|
||
before do | ||
environment.skeleton('network_no_autostart') | ||
end | ||
|
||
context 'when host is rebooted' do | ||
before do | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
result = environment.execute('vagrant', 'halt') | ||
expect(result).to exit_with(0) | ||
|
||
result = environment.execute('virsh', '--connect=qemu:///system', 'net-destroy', 'vagrant-libvirt-test') | ||
expect(result).to exit_with(0) | ||
end | ||
|
||
it 'should start networking on restart' do | ||
status('Test: machine restarts networking') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'package domain', acceptance: true do | ||
include_context 'libvirt_acceptance' | ||
|
||
before(:all) do | ||
expect(Vagrant::Util::Which.which('virt-sysprep')).to be_truthy, | ||
'packaging tests require virt-sysprep, please install' | ||
expect(Vagrant::Util::Which.which('virt-sparsify')).to be_truthy, | ||
'packaging tests require virt-sparsify, please install' | ||
|
||
result = (File.exist?('C:\\') ? `dir /-C #{Dir.tmpdir}` : `df #{Dir.tmpdir}`).split("\n").last | ||
expect(result.split[3].to_i).to be > 6 * 1024 * 1024, | ||
"packaging tests require more than 6GiB of space under #{Dir.tmpdir}" | ||
end | ||
|
||
after(:each) do | ||
assert_execute('vagrant', 'destroy', '--force') | ||
end | ||
|
||
let(:testbox_envvars) { { VAGRANT_VAGRANTFILE: 'Vagrantfile.testbox' } } | ||
|
||
context 'simple' do | ||
before do | ||
environment.skeleton('package_simple') | ||
end | ||
|
||
after do | ||
result = environment.execute('vagrant', 'destroy', '--force', extra_env: testbox_envvars) | ||
expect(result).to exit_with(0) | ||
|
||
assert_execute('vagrant', 'box', 'remove', '--force', 'test-package-simple-domain') | ||
end | ||
|
||
it 'should succeed' do | ||
status('Test: machine is created successfully') | ||
expect(environment.execute('vagrant', 'up')).to exit_with(0) | ||
|
||
status('Test: package machine successfully') | ||
expect(environment.execute('vagrant', 'package')).to exit_with(0) | ||
|
||
status('Test: add packaged box') | ||
expect(environment.execute( | ||
'vagrant', 'box', 'add', '--force', '--name', 'test-package-simple-domain', 'package.box' | ||
)).to exit_with(0) | ||
|
||
status('Test: machine from packaged box is created successfully') | ||
result = environment.execute('vagrant', 'up', extra_env: testbox_envvars) | ||
expect(result).to exit_with(0) | ||
expect(result.stdout).to match(/test-package-simple-domain/) | ||
end | ||
end | ||
|
||
context 'complex' do | ||
before do | ||
environment.skeleton('package_complex') | ||
extra_env.merge!( | ||
{ | ||
VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS: 'defaults,-ssh-userdir,customize', | ||
VAGRANT_LIBVIRT_VIRT_SYSPREP_OPTIONS: '--run $(pwd)/scripts/sysprep.sh', | ||
} | ||
) | ||
end | ||
|
||
after do | ||
expect(environment.execute('vagrant', 'destroy', '--force', extra_env: testbox_envvars)).to exit_with(0) | ||
assert_execute('vagrant', 'box', 'remove', '--force', 'test-package-complex-domain') | ||
end | ||
|
||
it 'should succeed' do | ||
status('Test: machine is created successfully') | ||
expect(environment.execute('vagrant', 'up')).to exit_with(0) | ||
|
||
status('Test: package machine successfully') | ||
expect(environment.execute('vagrant', 'package')).to exit_with(0) | ||
|
||
status('Test: add packaged box') | ||
expect(environment.execute( | ||
'vagrant', 'box', 'add', '--force', '--name', 'test-package-complex-domain', 'package.box' | ||
)).to exit_with(0) | ||
|
||
status('Test: machine from packaged box is created successfully') | ||
result = environment.execute('vagrant', 'up', extra_env: testbox_envvars) | ||
expect(result).to exit_with(0) | ||
expect(result.stdout).to match(/test-package-complex-domain/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'provider settings', acceptance: true do | ||
include_context 'libvirt_acceptance' | ||
|
||
after do | ||
assert_execute('vagrant', 'destroy', '--force') | ||
end | ||
|
||
context 'with defaults' do | ||
before do | ||
environment.skeleton('default_settings') | ||
end | ||
|
||
it 'should succeed' do | ||
status('Test: machine is created successfully') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: CPU matches default') | ||
expect(result.stdout).to match(/Cpus:\s+1$/) | ||
|
||
status('Test: memory matches default') | ||
expect(result.stdout).to match(/Memory:\s+512M/) | ||
|
||
status('Test: default prefix is used') | ||
expect(result.stdout).to match(/Name:\s+work_default$/) | ||
end | ||
end | ||
|
||
context 'with modified config' do | ||
before do | ||
environment.skeleton('adjusted_settings') | ||
end | ||
|
||
it 'should succeed' do | ||
status('Test: machine is created successfully') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: CPUs are changed') | ||
expect(result.stdout).to match(/Cpus:\s+2$/) | ||
|
||
status('Test: memory is changed') | ||
expect(result.stdout).to match(/Memory:\s+1000M$/) | ||
|
||
status('Test: default prefix is changed') | ||
expect(result.stdout).to match(/Name:\s+changed_default_prefixdefault$/) | ||
expect(result.stdout).to match(/\(vda\).*changed_default_prefixdefault\.img/) | ||
end | ||
end | ||
end |
Oops, something went wrong.