diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-01 20:16:22 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-01 20:16:22 +0000 |
commit | 0eae739fd34ff297b7468cfa8b729c213568c30f (patch) | |
tree | d3e12171a560431b1435eb6ccef04b887d7879e7 | |
parent | 48d7fd66a28157c81cce756e93d97139c3cc061b (diff) | |
download | puppet-0eae739fd34ff297b7468cfa8b729c213568c30f.tar.gz puppet-0eae739fd34ff297b7468cfa8b729c213568c30f.tar.xz puppet-0eae739fd34ff297b7468cfa8b729c213568c30f.zip |
renaming filesystem to mount
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1049 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-x | lib/puppet/type/parsedtype/mount.rb (renamed from lib/puppet/type/parsedtype/filesystem.rb) | 32 | ||||
-rwxr-xr-x | test/types/mount.rb (renamed from test/types/filesystem.rb) | 100 |
2 files changed, 66 insertions, 66 deletions
diff --git a/lib/puppet/type/parsedtype/filesystem.rb b/lib/puppet/type/parsedtype/mount.rb index 65b1832d3..08f797f72 100755 --- a/lib/puppet/type/parsedtype/filesystem.rb +++ b/lib/puppet/type/parsedtype/mount.rb @@ -4,7 +4,7 @@ require 'puppet/type/parsedtype' require 'puppet/type/state' module Puppet - newtype(:filesystem, Puppet::Type::ParsedType) do + newtype(:mount, Puppet::Type::ParsedType) do ensurable do newvalue(:present) do @@ -18,7 +18,7 @@ module Puppet @parent.unmount end - :filesystem_removed + :mount_removed end newvalue(:mounted) do @@ -28,13 +28,13 @@ module Puppet @parent.mount - :filesystem_mounted + :mount_mounted end end newstate(:device) do - desc "The device providing the filesystem. This can be whatever - device is supporting by the filesystem, including network + desc "The device providing the mount. This can be whatever + device is supporting by the mount, including network devices or devices specified by UUID rather than device path, depending on the operating system." end @@ -61,37 +61,37 @@ module Puppet end newstate(:fstype) do - desc "The filesystem type. Valid values depend on the + desc "The mount type. Valid values depend on the operating system." end newstate(:options) do - desc "Mount options for the filesystems, as they would + desc "Mount options for the mounts, as they would appear in the fstab." end newstate(:pass) do - desc "The pass in which the filesystem is checked." + desc "The pass in which the mount is checked." end newstate(:atboot) do - desc "Whether to mount the filesystem at boot. Not all platforms + desc "Whether to mount the mount at boot. Not all platforms support this." end newstate(:dump) do - desc "Whether to dump the filesystem. Not all platforms + desc "Whether to dump the mount. Not all platforms support this." end newparam(:path) do - desc "The mount path for the filesystem." + desc "The mount path for the mount." isnamevar end - @doc = "Manages mounted filesystems, including putting mount - information into the filesystem table." + @doc = "Manages mounted mounts, including putting mount + information into the mount table." @instances = [] @@ -107,10 +107,10 @@ module Puppet @filetype = Puppet::FileType.filetype(:flat) - # Parse a filesystem tab. + # Parse a mount tab. # # This method also stores existing comments, and it stores all - # filesystems in order, mostly so that comments are retained in the + # mounts in order, mostly so that comments are retained in the # order they were written and in proximity to the same fses. def self.parse(text) count = 0 @@ -156,7 +156,7 @@ module Puppet end end - # Is the filesystem currently mounted? + # Is the mount currently mounted? def mounted? %x{df}.split("\n").find do |line| fs = line.split(/\s+/)[-1] diff --git a/test/types/filesystem.rb b/test/types/mount.rb index 189430784..7641fd2cb 100755 --- a/test/types/filesystem.rb +++ b/test/types/mount.rb @@ -8,20 +8,20 @@ end require 'puppettest' require 'puppet' -require 'puppet/type/parsedtype/filesystem' +require 'puppet/type/parsedtype/mount' require 'test/unit' require 'facter' -class TestFilesystem < Test::Unit::TestCase +class TestMounts < Test::Unit::TestCase include TestPuppet def setup super - @filesystemtype = Puppet.type(:filesystem) - @oldfiletype = @filesystemtype.filetype + @mounttype = Puppet.type(:mount) + @oldfiletype = @mounttype.filetype end def teardown - @filesystemtype.filetype = @oldfiletype + @mounttype.filetype = @oldfiletype Puppet.type(:file).clear super end @@ -30,20 +30,20 @@ class TestFilesystem < Test::Unit::TestCase # but does not modify our actual system. def mkfaketype pfile = tempfile() - old = @filesystemtype.path - @filesystemtype.path = pfile + old = @mounttype.path + @mounttype.path = pfile cleanup do - @filesystemtype.path = old - @filesystemtype.fileobj = nil + @mounttype.path = old + @mounttype.fileobj = nil end # Reset this, just in case - @filesystemtype.fileobj = nil + @mounttype.fileobj = nil end - def mkfilesystem - filesystem = nil + def mkmount + mount = nil if defined? @pcount @pcount += 1 @@ -55,60 +55,60 @@ class TestFilesystem < Test::Unit::TestCase :device => "/dev/dsk%s" % @pcount, } - Puppet.type(:filesystem).fields.each do |field| + Puppet.type(:mount).fields.each do |field| unless args.include? field args[field] = "fake%s" % @pcount end end assert_nothing_raised { - filesystem = Puppet.type(:filesystem).create(args) + mount = Puppet.type(:mount).create(args) } - return filesystem + return mount end - def test_simplefilesystem + def test_simplemount mkfaketype host = nil assert_nothing_raised { - assert_nil(Puppet.type(:filesystem).retrieve) + assert_nil(Puppet.type(:mount).retrieve) } - filesystem = mkfilesystem + mount = mkmount assert_nothing_raised { - Puppet.type(:filesystem).store + Puppet.type(:mount).store } assert_nothing_raised { assert( - Puppet.type(:filesystem).to_file.include?( - Puppet.type(:filesystem).fileobj.read + Puppet.type(:mount).to_file.include?( + Puppet.type(:mount).fileobj.read ), "File does not include all of our objects" ) } end - def test_filesystemsparse + def test_mountsparse assert_nothing_raised { - @filesystemtype.retrieve + @mounttype.retrieve } - # Now just make we've got some filesystems we know will be there - root = @filesystemtype["/"] - assert(root, "Could not retrieve root filesystem") + # Now just make we've got some mounts we know will be there + root = @mounttype["/"] + assert(root, "Could not retrieve root mount") end def test_rootfs fs = nil assert_nothing_raised { - Puppet.type(:filesystem).retrieve + Puppet.type(:mount).retrieve } assert_nothing_raised { - fs = Puppet.type(:filesystem)["/"] + fs = Puppet.type(:mount)["/"] } assert(fs, "Could not retrieve root fs") @@ -120,34 +120,34 @@ class TestFilesystem < Test::Unit::TestCase # Make sure it reads and writes correctly. def test_readwrite assert_nothing_raised { - Puppet::Type.type(:filesystem).retrieve + Puppet::Type.type(:mount).retrieve } # Now switch to storing in ram mkfaketype - fs = mkfilesystem + fs = mkmount - assert(Puppet::Type.type(:filesystem).path != "/etc/fstab") + assert(Puppet::Type.type(:mount).path != "/etc/fstab") - assert_events([:filesystem_created], fs) + assert_events([:mount_created], fs) - text = Puppet::Type.type(:filesystem).fileobj.read + text = Puppet::Type.type(:mount).fileobj.read assert(text =~ /#{fs[:path]}/, "Text did not include new fs") fs[:ensure] = :absent - assert_events([:filesystem_removed], fs) - text = Puppet::Type.type(:filesystem).fileobj.read + assert_events([:mount_removed], fs) + text = Puppet::Type.type(:mount).fileobj.read assert(text !~ /#{fs[:path]}/, "Text still includes new fs") fs[:ensure] = :present - assert_events([:filesystem_created], fs) + assert_events([:mount_created], fs) - text = Puppet::Type.type(:filesystem).fileobj.read + text = Puppet::Type.type(:mount).fileobj.read assert(text =~ /#{fs[:path]}/, "Text did not include new fs") end @@ -158,22 +158,22 @@ class TestFilesystem < Test::Unit::TestCase case Facter["hostname"].value when "culain": fs = "/ubuntu" else - $stderr.puts "No filesystem for mount testing; skipping" + $stderr.puts "No mount for mount testing; skipping" return end backup = tempfile() - FileUtils.cp(Puppet::Type.type(:filesystem).path, backup) + FileUtils.cp(Puppet::Type.type(:mount).path, backup) # Make sure the original gets reinstalled. cleanup do - FileUtils.cp(backup, Puppet::Type.type(:filesystem).path) + FileUtils.cp(backup, Puppet::Type.type(:mount).path) end - Puppet.type(:filesystem).retrieve + Puppet.type(:mount).retrieve - obj = Puppet.type(:filesystem)[fs] + obj = Puppet.type(:mount)[fs] assert(obj, "Could not retrieve %s object" % fs) @@ -203,22 +203,22 @@ class TestFilesystem < Test::Unit::TestCase state.should = state.is end - # Verify we can remove the filesystem + # Verify we can remove the mount assert_nothing_raised { obj[:ensure] = :absent } - assert_events([:filesystem_removed], obj) + assert_events([:mount_removed], obj) # And verify it's gone assert(!obj.mounted?, "Object is mounted after being removed") - text = Puppet.type(:filesystem).fileobj.read + text = Puppet.type(:mount).fileobj.read assert(text !~ /#{fs}/, "Fstab still contains %s" % fs) - assert_raise(Puppet::Error, "Removed filesystem did not throw an error") { + assert_raise(Puppet::Error, "Removed mount did not throw an error") { obj.mount } @@ -226,9 +226,9 @@ class TestFilesystem < Test::Unit::TestCase obj[:ensure] = :present } - assert_events([:filesystem_created], obj) + assert_events([:mount_created], obj) - assert(File.read(Puppet.type(:filesystem).path) =~ /#{fs}/, + assert(File.read(Puppet.type(:mount).path) =~ /#{fs}/, "Fstab does not contain %s" % fs) assert(! obj.mounted?, "Object is mounted incorrectly") @@ -237,9 +237,9 @@ class TestFilesystem < Test::Unit::TestCase obj[:ensure] = :mounted } - assert_events([:filesystem_mounted], obj) + assert_events([:mount_mounted], obj) - assert(File.read(Puppet.type(:filesystem).path) =~ /#{fs}/, + assert(File.read(Puppet.type(:mount).path) =~ /#{fs}/, "Fstab does not contain %s" % fs) assert(obj.mounted?, "Object is not mounted") |