Made a lot of progress
This commit is contained in:
29
lib/test
Normal file
29
lib/test
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require './rubyqa'
|
||||
|
||||
include RubyQA
|
||||
$Manager = Manager.new
|
||||
|
||||
host = Host.new(
|
||||
:ip => '127.0.0.1',
|
||||
:user => 'tristan',
|
||||
:cluster => true
|
||||
)
|
||||
|
||||
Manager.new_test("hostname in /etc/hostname") {|host|
|
||||
hostname = host.exec('cat /etc/hostname').strip
|
||||
facts = host.resources['facts'].data
|
||||
facts['networking']['hostname'] == hostname
|
||||
}
|
||||
|
||||
Manager.new_test("hostname in /etc/hosts", :cluster => true ) {|host|
|
||||
facts = host.resources['facts'].data
|
||||
hostname = facts['networking']['hostname']
|
||||
hosts = host.exec('cat /etc/hosts')
|
||||
match_regex = /127\.0\.0\.1.+#{hostname.downcase}/
|
||||
hosts.match? match_regex
|
||||
}
|
||||
$Manager.add_host(host)
|
||||
$Manager.run_tests
|
||||
$Manager.report
|
Reference in New Issue
Block a user