Revision d4cac085
Added by Michael Moll over 9 years ago
test/unit/puppet_fact_parser_test.rb | ||
---|---|---|
refute @importer.operatingsystem.description
|
||
end
|
||
|
||
test "should set os.major and minor for from AIX facts" do
|
||
test "should set os.major and minor correctly from AIX facts" do
|
||
@importer = PuppetFactParser.new(aix_facts)
|
||
assert_equal 'AIX', @importer.operatingsystem.family
|
||
assert_equal '6100', @importer.operatingsystem.major
|
||
assert_equal '0604', @importer.operatingsystem.minor
|
||
end
|
||
|
||
test 'should handle FreeBSD rolling releases correctly' do
|
||
@importer = PuppetFactParser.new(freebsd_stable_facts)
|
||
assert_equal '10', @importer.operatingsystem.major
|
||
assert_equal '1', @importer.operatingsystem.minor
|
||
end
|
||
|
||
test 'should handle FreeBSD patch releases correctly' do
|
||
@importer = PuppetFactParser.new(freebsd_patch_facts)
|
||
assert_equal '10', @importer.operatingsystem.major
|
||
assert_equal '1', @importer.operatingsystem.minor
|
||
end
|
||
|
||
test "#get_interfaces" do
|
||
host = FactoryGirl.create(:host, :hostgroup => FactoryGirl.create(:hostgroup))
|
||
parser = get_parser(host.facts_hash)
|
||
... | ... | |
def aix_facts
|
||
JSON.parse(File.read(File.expand_path(File.dirname(__FILE__) + '/facts_aix.json')))['facts']
|
||
end
|
||
|
||
def freebsd_stable_facts
|
||
JSON.parse(File.read(File.expand_path(File.dirname(__FILE__) + '/facts_freebsd_stable.json')))['facts']
|
||
end
|
||
|
||
def freebsd_patch_facts
|
||
JSON.parse(File.read(File.expand_path(File.dirname(__FILE__) + '/facts_freebsd_patch.json')))['facts']
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #8993 - handle FreeBSD patch releases better