summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-02 00:32:52 -0500
committerLuke Kanies <luke@madstop.com>2008-07-02 00:32:52 -0500
commit8e4312ed249d83ece754b80e993fa0d86bd36d46 (patch)
tree8b6044079dbb05a1f84a09a2f8e99cf1b87a3e9e /spec/integration
parent49016bb29312bfeb6f41ce420159e6ffc477eebe (diff)
parentd3a81255245eec19ac21902ae3b877e00e620628 (diff)
downloadpuppet-8e4312ed249d83ece754b80e993fa0d86bd36d46.tar.gz
puppet-8e4312ed249d83ece754b80e993fa0d86bd36d46.tar.xz
puppet-8e4312ed249d83ece754b80e993fa0d86bd36d46.zip
Merge branch '0.24.x'
Conflicts: CHANGELOG spec/unit/node/catalog.rb spec/unit/type/package.rb spec/unit/type/schedule.rb spec/unit/type/service.rb spec/unit/util/settings.rb
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/indirector/node/ldap.rb22
-rwxr-xr-xspec/integration/provider/service/init.rb32
-rwxr-xr-xspec/integration/type/package.rb10
3 files changed, 58 insertions, 6 deletions
diff --git a/spec/integration/indirector/node/ldap.rb b/spec/integration/indirector/node/ldap.rb
new file mode 100755
index 000000000..34f4cb159
--- /dev/null
+++ b/spec/integration/indirector/node/ldap.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+require 'puppet/indirector/node/ldap'
+
+describe Puppet::Node::Ldap do
+ before do
+ Puppet[:node_terminus] = :ldap
+ Puppet::Node.stubs(:terminus_class).returns :ldap
+ end
+
+ after do
+ Puppet.settings.clear
+ end
+
+ it "should use a restrictive filter when searching for nodes in a class" do
+ Puppet::Node.indirection.terminus(:ldap).expects(:ldapsearch).with("(&(objectclass=puppetClient)(puppetclass=foo))")
+
+ Puppet::Node.search "eh", :class => "foo"
+ end
+end
diff --git a/spec/integration/provider/service/init.rb b/spec/integration/provider/service/init.rb
new file mode 100755
index 000000000..e185247cb
--- /dev/null
+++ b/spec/integration/provider/service/init.rb
@@ -0,0 +1,32 @@
+#!/usr/bin/env ruby
+
+# Find and load the spec file.
+Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+
+provider = Puppet::Type.type(:service).provider(:init)
+
+describe provider do
+ describe "when running on FreeBSD" do
+ confine "Not running on FreeBSD" => (Facter.value(:operatingsystem) == "FreeBSD")
+
+ it "should set its default path to include /etc/init.d and /usr/local/etc/init.d" do
+ provider.defpath.should == ["/etc/rc.d", "/usr/local/etc/rc.d"]
+ end
+ end
+
+ describe "when running on HP-UX" do
+ confine "Not running on HP-UX" => (Facter.value(:operatingsystem) == "HP-UX")
+
+ it "should set its default path to include /sbin/init.d" do
+ provider.defpath.should == "/sbin/init.d"
+ end
+ end
+
+ describe "when not running on FreeBSD or HP-UX" do
+ confine "Running on HP-UX or FreeBSD" => (! %w{HP-UX FreeBSD}.include?(Facter.value(:operatingsystem)))
+
+ it "should set its default path to include /etc/init.d" do
+ provider.defpath.should == "/etc/init.d"
+ end
+ end
+end
diff --git a/spec/integration/type/package.rb b/spec/integration/type/package.rb
index c244fa1cd..def44ad97 100755
--- a/spec/integration/type/package.rb
+++ b/spec/integration/type/package.rb
@@ -2,12 +2,10 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'puppet/type/package'
-
-describe Puppet::Type::Package, "when choosing a default package provider" do
+describe Puppet::Type.type(:package), "when choosing a default package provider" do
before do
# the default provider is cached.
- Puppet::Type::Package.defaultprovider = nil
+ Puppet::Type.type(:package).defaultprovider = nil
end
def provider_name(os)
@@ -15,10 +13,10 @@ describe Puppet::Type::Package, "when choosing a default package provider" do
end
it "should have a default provider" do
- Puppet::Type::Package.defaultprovider.should_not be_nil
+ Puppet::Type.type(:package).defaultprovider.should_not be_nil
end
it "should choose the correct provider each platform" do
- Puppet::Type::Package.defaultprovider.name.should == provider_name(Facter.value(:operatingsystem))
+ Puppet::Type.type(:package).defaultprovider.name.should == provider_name(Facter.value(:operatingsystem))
end
end