summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-29 00:47:56 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-29 00:47:56 +0000
commit3aff4a0e9debfe22bd2a4b024b89410f481d09f7 (patch)
tree0ed07fa4b165118dd189cce04af4d0996c215f34 /test
parent1cc8ecb0640420d6eb7a66fcb0d282337a263b84 (diff)
downloadpuppet-3aff4a0e9debfe22bd2a4b024b89410f481d09f7.tar.gz
puppet-3aff4a0e9debfe22bd2a4b024b89410f481d09f7.tar.xz
puppet-3aff4a0e9debfe22bd2a4b024b89410f481d09f7.zip
Doing more work on #113. Mostly, just making sure remounts do not happen spuriously very often. They will still have extra remounts when changing the value of "ensure", but that is not currently avoidable (similar to #199).
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2109 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/providers/mount/parsed.rb6
-rwxr-xr-xtest/types/mount.rb19
2 files changed, 20 insertions, 5 deletions
diff --git a/test/providers/mount/parsed.rb b/test/providers/mount/parsed.rb
index 8c60c9626..c062960f3 100755
--- a/test/providers/mount/parsed.rb
+++ b/test/providers/mount/parsed.rb
@@ -147,7 +147,7 @@ class TestParsedMounts < Test::Unit::TestCase
end
end
- if Puppet::SUIDManager.uid == 0
+ if Puppet::SUIDManager.uid == 0 and Facter.value(:operatingsystem) != "Darwin"
def test_mountfs
fs = nil
case Facter.value(:hostname)
@@ -197,6 +197,10 @@ class TestParsedMounts < Test::Unit::TestCase
assert(obj.mounted?, "FS not mounted")
assert(obj.df().include?(fs), "%s is not listed in df" % fs)
+ # Now try remounting
+ assert_nothing_raised("Could not remount filesystem") do
+ obj.remount
+ end
end
end
diff --git a/test/types/mount.rb b/test/types/mount.rb
index df1a71d71..9bdf599cd 100755
--- a/test/types/mount.rb
+++ b/test/types/mount.rb
@@ -47,6 +47,9 @@ class TestMounts < Test::Unit::TestCase
@ensure = :mounted
end
+ def remount
+ end
+
def unmount
@ensure = :present
end
@@ -121,7 +124,7 @@ class TestMounts < Test::Unit::TestCase
mount[:dump] = 2
mount[:options] = "defaults,ro"
- assert_events([:mount_changed,:mount_changed], mount)
+ assert_events([:mount_changed,:mount_changed, :triggered], mount)
assert_equal(2, mount.provider.dump, "Changes did not get flushed")
assert_equal("defaults,ro", mount.provider.options, "Changes did not get flushed")
@@ -164,7 +167,7 @@ class TestMounts < Test::Unit::TestCase
obj[:ensure] = :present
}
- assert_events([:mount_created], obj)
+ assert_events([:mount_created, :triggered], obj)
assert_events([], obj)
assert(! obj.provider.mounted?, "Object is mounted incorrectly")
@@ -173,7 +176,7 @@ class TestMounts < Test::Unit::TestCase
obj[:ensure] = :mounted
}
- assert_events([:mount_mounted], obj)
+ assert_events([:mount_mounted, :triggered], obj)
assert_events([], obj)
obj.retrieve
@@ -235,7 +238,7 @@ class TestMounts < Test::Unit::TestCase
mount[:ensure] = :present
- assert_events([:mount_created], mount)
+ assert_events([:mount_created, :triggered], mount)
assert_events([], mount)
mount[:ensure] = :absent
@@ -285,6 +288,14 @@ class TestMounts < Test::Unit::TestCase
assert_apply(mount)
assert(remounted, "did not remount when mount changed")
+
+ # Now make sure it doesn't remount if the mount is just 'present'
+ mount[:ensure] = :present
+ mount[:device] = "/dev/funtest"
+ remounted = false
+ assert_apply(mount)
+
+ assert(! remounted, "remounted even though not supposed to be mounted")
end
end