summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-06 06:43:43 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-06 06:43:43 +0000
commitd10a6385287bbd28ad746db7bc63548fb4ad5575 (patch)
tree5a0cc28f8c74a5d71d51abc229962fcd6d988568
parent83d5236e096530bc7d2c50ad36f525ebfc0f6327 (diff)
downloadpuppet-d10a6385287bbd28ad746db7bc63548fb4ad5575.tar.gz
Committing an important fix to mounts; since i am sure no one has downloaded 0.15.3, i am just going to rerelease 0.15.3 with this fix in it
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1093 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-xlib/puppet/type/parsedtype/mount.rb9
-rwxr-xr-xtest/types/mount.rb9
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/puppet/type/parsedtype/mount.rb b/lib/puppet/type/parsedtype/mount.rb
index e1c6388bd..1e6bfdddb 100755
--- a/lib/puppet/type/parsedtype/mount.rb
+++ b/lib/puppet/type/parsedtype/mount.rb
@@ -32,6 +32,15 @@ module Puppet
:mount_mounted
end
+
+ def retrieve
+ if @parent.mounted?
+ @is = :mounted
+ else
+ val = super()
+ @is = val
+ end
+ end
end
newstate(:device) do
diff --git a/test/types/mount.rb b/test/types/mount.rb
index 9f236cfa6..0a6062ff7 100755
--- a/test/types/mount.rb
+++ b/test/types/mount.rb
@@ -154,6 +154,10 @@ class TestMounts < Test::Unit::TestCase
text = Puppet::Type.type(:mount).fileobj.read
assert(text =~ /#{fs[:path]}/, "Text did not include new fs")
+
+ fs[:options] = "rw,noauto"
+
+ assert_events([:mount_changed], fs)
end
if Process.uid == 0
@@ -162,6 +166,7 @@ class TestMounts < Test::Unit::TestCase
case Facter["hostname"].value
when "culain": fs = "/ubuntu"
when "atalanta": fs = "/mnt"
+ when "figurehead": fs = "/cg4/net/depts"
else
$stderr.puts "No mount for mount testing; skipping"
return
@@ -224,6 +229,7 @@ class TestMounts < Test::Unit::TestCase
}
assert_events([:mount_removed], obj)
+ assert_events([], obj)
# And verify it's gone
assert(!obj.mounted?, "Object is mounted after being removed")
@@ -238,6 +244,7 @@ class TestMounts < Test::Unit::TestCase
}
assert_events([:mount_created], obj)
+ assert_events([], obj)
text = Puppet::Type.type(:mount).fileobj.read
assert(text =~ /#{fs}/, "Fstab does not contain %s" % fs)
@@ -249,11 +256,13 @@ class TestMounts < Test::Unit::TestCase
}
assert_events([:mount_mounted], obj)
+ assert_events([], obj)
text = Puppet::Type.type(:mount).fileobj.read
assert(text =~ /#{fs}/,
"Fstab does not contain %s" % fs)
+ obj.retrieve
assert(obj.mounted?, "Object is not mounted")
unless current