forked from ATIX-AG/foreman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #19328 - autosign tasks have correct wording
- Loading branch information
1 parent
edd5310
commit 006929d
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'test_helper' | ||
|
||
class PuppetCaOrchestrationTest < ActiveSupport::TestCase | ||
def setup | ||
User.current = users(:one) | ||
disable_orchestration | ||
SETTINGS[:locations_enabled] = false | ||
SETTINGS[:organizations_enabled] = false | ||
Setting[:manage_puppetca] = true | ||
skip_without_unattended | ||
end | ||
|
||
def teardown | ||
SETTINGS[:locations_enabled] = true | ||
SETTINGS[:organizations_enabled] = true | ||
User.current = nil | ||
end | ||
|
||
context 'a host with puppetca orchestration' do | ||
let(:host) { FactoryGirl.create(:host, :managed, :with_puppet_ca, :build => true) } | ||
|
||
test 'should queue puppetca update' do | ||
host.build = false | ||
assert_valid host | ||
tasks = host.queue.all.map(&:name) | ||
assert_includes tasks, "Delete PuppetCA autosign entry for #{host}" | ||
assert_equal 1, tasks.size | ||
end | ||
|
||
test 'should queue puppetca destroy' do | ||
host.send(:queue_puppetca_destroy) | ||
tasks = host.queue.all.map(&:name) | ||
assert_includes tasks, "Delete PuppetCA autosign entry for #{host}" | ||
assert_includes tasks, "Delete PuppetCA certificates for #{host}" | ||
assert_equal 2, tasks.size | ||
end | ||
end | ||
end |