Skip to content

Instantly share code, notes, and snippets.

@kjhenner
Created July 19, 2016 19:37
Show Gist options
  • Save kjhenner/5ef20b3e2cc9d448db69c711909da206 to your computer and use it in GitHub Desktop.
Save kjhenner/5ef20b3e2cc9d448db69c711909da206 to your computer and use it in GitHub Desktop.
require 'highline/import'
require 'net/ssh'
RSpec.configure do |c|
c.before(:example, :host => :hello) do
set :backend, 'ssh'
set :host, 'hello.learning.puppetlabs.vm'
options = {password: "puppet", user: "root"}
set :ssh_options, options
end
c.before(:example, :host => :master) do
set :backend, 'exec'
set :host, 'localhost'
end
end
describe "Task 1:", host: :hello do
set :backend, 'ssh'
set :host, 'hello.learning.puppetlabs.vm'
options = {password: "puppet", user: "root"}
set :ssh_options, options
it 'Use puppet -V to check the puppet version' do
file('/tmp/test')
.should be_file
end
end
describe "Task 2:", host: :master do
set :backend, 'exec'
set :host, 'localhost'
it 'View the options for the quest tool' do
file('/root/.bash_history')
.content
.should match /quest\s+(-h|--help)/
end
end
describe "Task 3:", host: :master do
it 'Check the quest status' do
file('/root/.bash_history')
.content
.should match /quest\s+status/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment