summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-05-16 14:57:52 -0700
committerNick Lewis <nick@puppetlabs.com>2011-05-16 14:57:52 -0700
commit83fa8cf03133174d7182adee6f34efc6ba15d6b3 (patch)
tree974e35f86578c1fd67454e14f989e235323f5544 /spec
parent2705a041f050a74cd7d11922c9b67ff747c1344f (diff)
parent0b8ebaccfef829856720c29c3bc00c042a515c71 (diff)
Merge branch 'ticket/2.7.x/7300' into 2.7.next
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/provider/mount/parsed_spec.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb
index 0293e0758..2e1e1e92e 100755
--- a/spec/unit/provider/mount/parsed_spec.rb
+++ b/spec/unit/provider/mount/parsed_spec.rb
@@ -193,6 +193,47 @@ FSTAB
my_fixtures('*.fstab').each do |fstab|
platform = File.basename(fstab, '.fstab')
+
+ describe "when calling instances on #{platform}" do
+ before :each do
+ if Facter[:operatingsystem] == "Solaris" then
+ platform == 'solaris' or
+ pending "We need to stub the operatingsystem fact at load time, but can't"
+ else
+ platform != 'solaris' or
+ pending "We need to stub the operatingsystem fact at load time, but can't"
+ end
+
+ # Stub the mount output to our fixture.
+ begin
+ mount = my_fixture(platform + '.mount')
+ @provider.stubs(:mountcmd).returns File.read(mount)
+ rescue
+ pending "is #{platform}.mount missing at this point?"
+ end
+
+ # Note: we have to stub default_target before creating resources
+ # because it is used by Puppet::Type::Mount.new to populate the
+ # :target property.
+ @provider.stubs(:default_target).returns fstab
+ @retrieve = @provider.instances.collect { |prov| {:name => prov.get(:name), :ensure => prov.get(:ensure)}}
+ end
+
+ # Following mountpoint are present in all fstabs/mountoutputs
+ it "should include unmounted resources" do
+ @retrieve.should include(:name => '/', :ensure => :mounted)
+ end
+
+ it "should include mounted resources" do
+ @retrieve.should include(:name => '/boot', :ensure => :unmounted)
+ end
+
+ it "should include ghost resources" do
+ @retrieve.should include(:name => '/ghost', :ensure => :ghost)
+ end
+
+ end
+
describe "when prefetching on #{platform}" do
before :each do
if Facter[:operatingsystem] == "Solaris" then