forked from vagrant-libvirt/vagrant-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/vagrant-libvirt/vagrant-lib…
- Loading branch information
Showing
10 changed files
with
95 additions
and
17 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
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 |
---|---|---|
|
@@ -69,7 +69,7 @@ jobs: | |
- name: Deploy preview directory | ||
if: env.action == 'deploy' | ||
uses: JamesIves/[email protected].1 | ||
uses: JamesIves/[email protected].3 | ||
with: | ||
branch: ${{ env.preview_branch }} | ||
folder: jekyll-docs | ||
|
@@ -95,7 +95,7 @@ jobs: | |
|
||
- name: Remove preview directory | ||
if: env.action == 'remove' | ||
uses: JamesIves/[email protected].1 | ||
uses: JamesIves/[email protected].3 | ||
with: | ||
branch: ${{ env.preview_branch }} | ||
folder: ${{ env.emptydir }} | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
required: false | ||
type: string | ||
target-folder: | ||
require: false | ||
required: false | ||
type: string | ||
|
||
permissions: | ||
|
@@ -27,7 +27,7 @@ jobs: | |
extra-config: ${{ inputs.extra-config }} | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected].1 | ||
uses: JamesIves/[email protected].3 | ||
with: | ||
branch: gh-pages | ||
folder: build | ||
|
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
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
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
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
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
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,66 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'shutdown and halt', acceptance: true do | ||
include_context 'libvirt_acceptance' | ||
|
||
before do | ||
environment.skeleton('default_settings') | ||
end | ||
|
||
after do | ||
assert_execute('vagrant', 'destroy', '--force') | ||
end | ||
|
||
context 'when system accessible' do | ||
it 'graceful shutdown should succeed' do | ||
status('Test: machine is created successfully') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: Halt') | ||
result = environment.execute('vagrant', 'halt') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: validate output') | ||
expect(result.stdout).to match(/Attempting graceful shutdown of VM/) | ||
expect(result.stdout).to_not match(/Halting domain.../) | ||
end | ||
|
||
it 'forced halt should skip graceful and succeed' do | ||
status('Test: machine is created successfully') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: Halt') | ||
result = environment.execute('vagrant', 'halt', '-f') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: validate output') | ||
expect(result.stdout).to_not match(/Attempting graceful shutdown of VM/) | ||
expect(result.stdout).to match(/Halting domain.../) | ||
end | ||
end | ||
|
||
context 'when system hung' do | ||
it 'should call halt after failed graceful' do | ||
status('Test: machine is created successfully') | ||
result = environment.execute('vagrant', 'up') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: Trigger crash to prevent graceful halt working') | ||
result = environment.execute('vagrant', 'ssh', '-c', 'nohup sudo sh -c \'echo -n c > /proc/sysrq-trigger\' >/dev/null 2>&1 </dev/null', '--', '-f') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: Halt') | ||
result = environment.execute('vagrant', 'halt') | ||
expect(result).to exit_with(0) | ||
|
||
status('Test: validate output') | ||
expect(result.stdout).to match(/Attempting graceful shutdown of VM/) | ||
expect(result.stdout).to match(/Guest communication could not be established/) | ||
expect(result.stdout).to match(/Halting 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