Advertisement
Guest User

Untitled

a guest
Jul 19th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. require 'highline/import'
  2. require 'net/ssh'
  3.  
  4. RSpec.configure do |c|
  5. c.before(:example, :host => :hello) do
  6. set :backend, 'ssh'
  7. set :host, 'hello.learning.puppetlabs.vm'
  8. options = {password: "puppet", user: "root"}
  9. set :ssh_options, options
  10. end
  11. c.before(:example, :host => :master) do
  12. set :backend, 'exec'
  13. set :host, 'localhost'
  14. end
  15. end
  16.  
  17. describe "Task 1:", host: :hello do
  18. set :backend, 'ssh'
  19. set :host, 'hello.learning.puppetlabs.vm'
  20. options = {password: "puppet", user: "root"}
  21. set :ssh_options, options
  22. it 'Use puppet -V to check the puppet version' do
  23. file('/tmp/test')
  24. .should be_file
  25. end
  26. end
  27.  
  28. describe "Task 2:", host: :master do
  29. set :backend, 'exec'
  30. set :host, 'localhost'
  31. it 'View the options for the quest tool' do
  32. file('/root/.bash_history')
  33. .content
  34. .should match /quest\s+(-h|--help)/
  35. end
  36. end
  37.  
  38. describe "Task 3:", host: :master do
  39. it 'Check the quest status' do
  40. file('/root/.bash_history')
  41. .content
  42. .should match /quest\s+status/
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement