Revision 1a68aea8
Added by Greg Sutcliffe over 11 years ago
- ID 1a68aea83c59e95343fcdff3e3bae63f273a7c65
test/unit/orchestration/tftp_test.rb | ||
---|---|---|
end
|
||
end
|
||
|
||
def test_generate_pxe_template
|
||
def test_generate_pxe_template_for_build
|
||
if unattended?
|
||
h = hosts(:one)
|
||
h.setBuild
|
||
as_admin { h.update_attribute :operatingsystem, operatingsystems(:centos5_3) }
|
||
Setting[:foreman_url] = "ahost.com:3000"
|
||
|
||
template = h.send(:generate_pxe_template).split("~")
|
||
expected = File.open(Pathname.new(__FILE__).parent + "pxe_template").readlines.map(&:strip)
|
||
assert_equal template,expected
|
||
assert h.build
|
||
end
|
||
end
|
||
|
||
def test_generate_pxe_template_for_localboot
|
||
if unattended?
|
||
h = hosts(:one)
|
||
as_admin { h.update_attribute :operatingsystem, operatingsystems(:centos5_3) }
|
||
assert !h.build
|
||
|
||
template = h.send(:generate_pxe_template).split("~")
|
||
expected = File.open(Pathname.new(__FILE__).parent + "pxe_local_template").readlines.map(&:strip)
|
||
assert_equal template,expected
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #983 - implement 3 state boot