summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-02 19:41:17 -0500
committerLuke Kanies <luke@madstop.com>2009-04-02 19:41:17 -0500
commita677e26eb1452c08d7724047a18e50f4a654d2cd (patch)
tree1a615f93e0504527db08ff29bd71e7d754228747
parente016307f00fe67dc53f8581f08c1dfb5ab7dfb3b (diff)
downloadpuppet-a677e26eb1452c08d7724047a18e50f4a654d2cd.tar.gz
puppet-a677e26eb1452c08d7724047a18e50f4a654d2cd.tar.xz
puppet-a677e26eb1452c08d7724047a18e50f4a654d2cd.zip
Fixing all tests that were apparently broken in the 0.24.x merge.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r--lib/puppet/parser/resource/reference.rb2
-rw-r--r--lib/puppet/util/selinux.rb2
-rwxr-xr-xspec/integration/bin/puppetmasterd.rb3
-rw-r--r--spec/unit/provider/augeas/augeas.rb1
-rwxr-xr-xspec/unit/transaction.rb2
-rwxr-xr-xspec/unit/type/tidy.rb11
-rw-r--r--spec/unit/util/selinux.rb5
-rwxr-xr-xtest/network/client/resource.rb5
8 files changed, 13 insertions, 18 deletions
diff --git a/lib/puppet/parser/resource/reference.rb b/lib/puppet/parser/resource/reference.rb
index cf7e997d8..0c28cf0df 100644
--- a/lib/puppet/parser/resource/reference.rb
+++ b/lib/puppet/parser/resource/reference.rb
@@ -1,5 +1,5 @@
# A reference to a resource. Mostly just the type and title.
-require 'puppet/resource_reference'
+require 'puppet/resource/reference'
require 'puppet/file_collection/lookup'
# A reference to a resource. Mostly just the type and title.
diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb
index cd3b2ac1a..f13600680 100644
--- a/lib/puppet/util/selinux.rb
+++ b/lib/puppet/util/selinux.rb
@@ -153,7 +153,7 @@ module Puppet::Util::SELinux
# Internal helper function to read and parse /proc/mounts
def read_mounts
begin
- mountfh = File.open("/proc/mounts", NONBLOCK)
+ mountfh = File.open("/proc/mounts", File::NONBLOCK)
mounts = mountfh.read
mountfh.close
rescue
diff --git a/spec/integration/bin/puppetmasterd.rb b/spec/integration/bin/puppetmasterd.rb
index 447344472..b5a3f96da 100755
--- a/spec/integration/bin/puppetmasterd.rb
+++ b/spec/integration/bin/puppetmasterd.rb
@@ -50,7 +50,8 @@ describe "puppetmasterd" do
args = arguments + addl_args
- output = %x{puppetmasterd #{args}}.chomp
+ bin = File.join(File.dirname(__FILE__), "..", "..", "..", "sbin", "puppetmasterd")
+ output = %x{#{bin} #{args}}.chomp
end
def stop
diff --git a/spec/unit/provider/augeas/augeas.rb b/spec/unit/provider/augeas/augeas.rb
index 284145657..43fca723c 100644
--- a/spec/unit/provider/augeas/augeas.rb
+++ b/spec/unit/provider/augeas/augeas.rb
@@ -209,6 +209,7 @@ describe provider_class do
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
augeas_stub.stubs("close")
provider = provider_class.new(resource)
+ provider.aug= augeas_stub
provider.stubs(:get_augeas_version).returns("0.3.5")
provider.need_to_run?.should == true
end
diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb
index efd071231..60705c7fb 100755
--- a/spec/unit/transaction.rb
+++ b/spec/unit/transaction.rb
@@ -6,7 +6,7 @@ require 'puppet/transaction'
describe Puppet::Transaction do
it "should match resources by name, not title, when prefetching" do
- @catalog = Puppet::Node::Catalog.new
+ @catalog = Puppet::Resource::Catalog.new
@transaction = Puppet::Transaction.new(@catalog)
# Have both a title and name
diff --git a/spec/unit/type/tidy.rb b/spec/unit/type/tidy.rb
index e17f65de4..cf244ca0e 100755
--- a/spec/unit/type/tidy.rb
+++ b/spec/unit/type/tidy.rb
@@ -10,19 +10,12 @@ describe tidy do
end
it "should use :lstat when stating a file" do
- tidy = Puppet::Type.type(:tidy).new :path => "/foo/bar", :age => "1d"
+ resource = tidy.new :path => "/foo/bar", :age => "1d"
stat = mock 'stat'
File.expects(:lstat).with("/foo/bar").returns stat
- tidy.stat("/foo/bar").should == stat
+ resource.stat("/foo/bar").should == stat
end
- it "should be in sync if the targeted file does not exist" do
- File.expects(:lstat).with("/tmp/foonesslaters").raises Errno::ENOENT
- @tidy = tidy.create :path => "/tmp/foonesslaters", :age => "100d"
-
- @tidy.property(:ensure).must be_insync({})
- end
-
[:age, :size, :path, :matches, :type, :recurse, :rmdirs].each do |param|
it "should have a %s parameter" % param do
Puppet::Type.type(:tidy).attrclass(param).ancestors.should be_include(Puppet::Parameter)
diff --git a/spec/unit/util/selinux.rb b/spec/unit/util/selinux.rb
index dacf9f503..db3ee413a 100644
--- a/spec/unit/util/selinux.rb
+++ b/spec/unit/util/selinux.rb
@@ -31,7 +31,10 @@ describe Puppet::Util::SELinux do
describe "filesystem detection" do
before :each do
- File.expects(:read).with("/proc/mounts").returns "rootfs / rootfs rw 0 0\n/dev/root / ext3 rw,relatime,errors=continue,user_xattr,acl,data=ordered 0 0\n/dev /dev tmpfs rw,relatime,mode=755 0 0\n/proc /proc proc rw,relatime 0 0\n/sys /sys sysfs rw,relatime 0 0\n192.168.1.1:/var/export /mnt/nfs nfs rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nointr,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.1,mountvers=3,mountproto=udp,addr=192.168.1.1 0 0\n"
+ fh = stub 'fh', :close => nil
+ File.stubs(:open).with("/proc/mounts", File::NONBLOCK).returns fh
+ fh.stubs(:read).returns "rootfs / rootfs rw 0 0\n/dev/root / ext3 rw,relatime,errors=continue,user_xattr,acl,data=ordered 0 0\n/dev /dev tmpfs rw,relatime,mode=755 0 0\n/proc /proc proc rw,relatime 0 0\n/sys /sys sysfs rw,relatime 0 0\n192.168.1.1:/var/export /mnt/nfs nfs rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nointr,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.1,mountvers=3,mountproto=udp,addr=192.168.1.1 0 0\n"
+ fh.stubs(:close)
end
it "should parse the contents of /proc/mounts" do
diff --git a/test/network/client/resource.rb b/test/network/client/resource.rb
index ba84fc27e..c73690170 100755
--- a/test/network/client/resource.rb
+++ b/test/network/client/resource.rb
@@ -42,10 +42,7 @@ class TestResourceClient < Test::Unit::TestCase
assert_instance_of(Puppet::TransObject, tresource)
resource = tresource.to_ral
- assert_events([], resource)
- File.unlink(file)
- assert_events([:file_created], resource)
- File.unlink(file)
+ assert_equal(File.stat(file).mode & 007777, resource[:mode], "Did not get mode")
# Now test applying
result = client.apply(tresource)