Permalink
Browse files

Merge branch 'ticket/3.0.x/16698-enc-does-not-work-with-store-configs…

…' of git://github.com/zaphod42/puppet into 3.0.x

* 'ticket/3.0.x/16698-enc-does-not-work-with-store-configs' of git://github.com/zaphod42/puppet:
  (#16698) Add acceptance test for using store configs with an enc
  (#16698) Do not set Node cache_terminus for storedconfigs
  • Loading branch information...
joshcooper committed Oct 11, 2012
2 parents 9ee0578 + 5a7fd97 commit b9fd53e61e36280cbd52c7d4e18f8ab64ac17f82
@@ -0,0 +1,74 @@
test_name "ENC node information is used when store configs enabled (#16698)"
testdir = master.tmpdir('use_enc')
create_remote_file master, "#{testdir}/enc.rb", <<END
#!/usr/bin/env ruby
puts <<YAML
parameters:
data: "data from enc"
YAML
END
on master, "chmod 755 #{testdir}/enc.rb"
create_remote_file master, "#{testdir}/puppet.conf", <<END
[main]
node_terminus = exec
external_nodes = "#{testdir}/enc.rb"
storeconfigs = true
dbadapter = sqlite3
dblocation = #{testdir}/store_configs.sqlite3
manifest = "#{testdir}/site.pp"
END
create_remote_file(master, "#{testdir}/site.pp", 'notify { $data: }')
on master, "chown -R root:puppet #{testdir}"
on master, "chmod -R g+rwX #{testdir}"
create_remote_file master, "#{testdir}/setup.pp", <<END
package {
rubygems:
ensure => present;
activerecord:
ensure => '2.2.3',
provider => 'gem',
require => Package[rubygems]
}
if $osfamily == "Debian" {
package {
sqlite3:
ensure => present;
libsqlite3-ruby:
ensure => present,
require => Package[sqlite3]
}
} elsif $osfamily == "Redhat" {
package {
['sqlite', 'sqlite-devel', 'ruby-devel', 'gcc', 'make']:
ensure => present,
before => Package[sqlite3];
sqlite3:
ensure => present,
provider => 'gem',
require => Package[rubygems]
}
} else {
fail "Unknown OS $osfamily"
}
END
on master, puppet_apply("#{testdir}/setup.pp")
with_master_running_on(master, "--config #{testdir}/puppet.conf --daemonize --dns_alt_names=\"puppet,$(facter hostname),$(facter fqdn)\" --autosign true") do
agents.each do |agent|
run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose")
assert_match(/data from enc/, stdout)
end
end
on master, "rm -rf #{testdir}"
View
@@ -1465,7 +1465,6 @@ module Puppet
Puppet.settings[:catalog_cache_terminus] = :store_configs
end
Puppet::Node::Facts.indirection.cache_class = :store_configs
Puppet::Node.indirection.cache_class = :store_configs
Puppet::Resource.indirection.terminus_class = :store_configs
end
@@ -162,8 +162,8 @@
Puppet.settings[:storeconfigs] = true
end
it "should set the Node cache class to :store_configs" do
Puppet::Node.indirection.expects(:cache_class=).with(:store_configs)
it "does not change the Node cache" do
Puppet::Node.indirection.expects(:cache_class=).never
Puppet.settings[:storeconfigs] = true
end
end
@@ -191,8 +191,8 @@
Puppet.settings[:storeconfigs] = true
end
it "should set the Node cache class to :store_configs" do
Puppet::Node.indirection.expects(:cache_class=).with(:store_configs)
it "does not change the Node cache" do
Puppet::Node.indirection.expects(:cache_class=).never
Puppet.settings[:storeconfigs] = true
end
end

0 comments on commit b9fd53e

Please sign in to comment.