[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at rimspace.net
Tue May 10 08:06:00 UTC 2011


The following commit has been merged in the experimental branch:
commit b4f1b9891fead7c79f13e639df433e65340c950b
Author: Daniel Pittman <daniel at rimspace.net>
Date:   Tue Mar 8 15:43:56 2011 -0800

    (#6641) fix mount provider tests broken in the 2.6 merge.
    
    A number of fixture-related changes were made in next, but not 2.6, which
    resulted in extra tests added during 2.6 being broken.  The main thrust of
    this change is to fix those tests by porting the fixture support code to the
    newer helpers.
    
    This also highlighted some shortfalls in our platform fixtures, which we
    extend to add a bunch of additional fixtures, and to uniformly walk those to
    perform fstab vs mount testing.

diff --git a/test/data/providers/mount/parsed/aix.mount b/spec/fixtures/unit/provider/mount/parsed/aix.mount
similarity index 100%
copy from test/data/providers/mount/parsed/aix.mount
copy to spec/fixtures/unit/provider/mount/parsed/aix.mount
diff --git a/test/data/providers/mount/parsed/darwin.mount b/spec/fixtures/unit/provider/mount/parsed/darwin.mount
similarity index 100%
copy from test/data/providers/mount/parsed/darwin.mount
copy to spec/fixtures/unit/provider/mount/parsed/darwin.mount
diff --git a/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab b/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
index a411042..41b749b 100644
--- a/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
+++ b/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
@@ -4,4 +4,5 @@
 /dev/ad0s1e             /tmp            ufs     rw              2       2
 /dev/ad0s1f             /usr            ufs     rw              2       2
 /dev/ad0s1d             /var            ufs     rw              2       2
+/dev/ad0s1g             /boot           ufs     rw              2       2
 /dev/acd0               /cdrom          cd9660  ro,noauto       0       0
diff --git a/spec/fixtures/unit/provider/mount/parsed/freebsd.mount b/spec/fixtures/unit/provider/mount/parsed/freebsd.mount
new file mode 100644
index 0000000..89c518c
--- /dev/null
+++ b/spec/fixtures/unit/provider/mount/parsed/freebsd.mount
@@ -0,0 +1,3 @@
+/dev/ad0s1a on / (ufs, local, soft-updates)
+/dev/ad0s1d on /ghost (ufs, local, soft-updates)
+devfs on /dev (devfs, local, multilabel)
diff --git a/test/data/providers/mount/parsed/hpux.mount b/spec/fixtures/unit/provider/mount/parsed/hpux.mount
similarity index 100%
copy from test/data/providers/mount/parsed/hpux.mount
copy to spec/fixtures/unit/provider/mount/parsed/hpux.mount
diff --git a/test/data/providers/mount/parsed/linux.mount b/spec/fixtures/unit/provider/mount/parsed/linux.mount
similarity index 100%
copy from test/data/providers/mount/parsed/linux.mount
copy to spec/fixtures/unit/provider/mount/parsed/linux.mount
diff --git a/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab b/spec/fixtures/unit/provider/mount/parsed/netbsd.fstab
similarity index 68%
copy from spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
copy to spec/fixtures/unit/provider/mount/parsed/netbsd.fstab
index a411042..ca3ca84 100644
--- a/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
+++ b/spec/fixtures/unit/provider/mount/parsed/netbsd.fstab
@@ -4,4 +4,6 @@
 /dev/ad0s1e             /tmp            ufs     rw              2       2
 /dev/ad0s1f             /usr            ufs     rw              2       2
 /dev/ad0s1d             /var            ufs     rw              2       2
-/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
+/dev/ad3s1b             none            swap    sw              0       0
+/dev/ad3s1e             /data           ufs     rw              2       2
+/dev/ad3s1g             /boot           ufs     rw              2       2
diff --git a/spec/fixtures/unit/provider/mount/parsed/netbsd.mount b/spec/fixtures/unit/provider/mount/parsed/netbsd.mount
new file mode 100644
index 0000000..dfdc26a
--- /dev/null
+++ b/spec/fixtures/unit/provider/mount/parsed/netbsd.mount
@@ -0,0 +1,8 @@
+/dev/ad0s1a on / (ufs, local)
+devfs on /dev (devfs, local)
+/dev/ad0s1e on /tmp (ufs, local, soft-updates)
+/dev/ad0s1f on /usr (ufs, local, soft-updates)
+/dev/ad0s1d on /var (ufs, local, soft-updates)
+/dev/ad3s1e on /data (ufs, local, soft-updates)
+/dev/ad3s1h on /ghost (ufs, local, soft-updates)
+devfs on /var/named/dev (devfs, local)
diff --git a/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab b/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab
new file mode 100644
index 0000000..44c83ee
--- /dev/null
+++ b/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab
@@ -0,0 +1,4 @@
+/dev/wd0a / ffs rw 1 1
+/dev/wd0e /home ffs rw,nodev,nosuid 1 2
+/dev/wd0d /usr ffs rw,nodev 1 2
+/dev/wd0f /boot ffs rw,nodev 1 2
diff --git a/spec/fixtures/unit/provider/mount/parsed/openbsd.mount b/spec/fixtures/unit/provider/mount/parsed/openbsd.mount
new file mode 100644
index 0000000..3674757
--- /dev/null
+++ b/spec/fixtures/unit/provider/mount/parsed/openbsd.mount
@@ -0,0 +1,4 @@
+/dev/wd0a on / type ffs (local)
+/dev/wd0e on /home type ffs (local, nodev, nosuid)
+/dev/wd0d on /usr type ffs (local, nodev)
+/dev/wd0g on /ghost type ffs (local, nodev)
diff --git a/test/data/providers/mount/parsed/solaris.mount b/spec/fixtures/unit/provider/mount/parsed/solaris.mount
similarity index 100%
copy from test/data/providers/mount/parsed/solaris.mount
copy to spec/fixtures/unit/provider/mount/parsed/solaris.mount
diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb
index 216680e..3bc5b98 100755
--- a/spec/unit/provider/mount/parsed_spec.rb
+++ b/spec/unit/provider/mount/parsed_spec.rb
@@ -111,9 +111,8 @@ FSTAB
 
   describe "mountinstances" do
     it "should get name from mountoutput found on Solaris" do
-      pending
       Facter.stubs(:value).with(:operatingsystem).returns 'Solaris'
-      @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+      @provider.stubs(:mountcmd).returns(File.read(my_fixture('solaris.mount')))
       mounts = @provider.mountinstances
       mounts.size.should == 6
       mounts[0].should == { :name => '/', :mounted => :yes }
@@ -125,9 +124,8 @@ FSTAB
     end
 
     it "should get name from mountoutput found on HP-UX" do
-      pending
       Facter.stubs(:value).with(:operatingsystem).returns 'HP-UX'
-      @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+      @provider.stubs(:mountcmd).returns(File.read(my_fixture('hpux.mount')))
       mounts = @provider.mountinstances
       mounts.size.should == 17
       mounts[0].should == { :name => '/', :mounted => :yes }
@@ -150,9 +148,8 @@ FSTAB
     end
 
     it "should get name from mountoutput found on Darwin" do
-      pending
       Facter.stubs(:value).with(:operatingsystem).returns 'Darwin'
-      @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+      @provider.stubs(:mountcmd).returns(File.read(my_fixture('darwin.mount')))
       mounts = @provider.mountinstances
       mounts.size.should == 6
       mounts[0].should == { :name => '/', :mounted => :yes }
@@ -164,9 +161,8 @@ FSTAB
     end
 
     it "should get name from mountoutput found on Linux" do
-      pending
       Facter.stubs(:value).with(:operatingsystem).returns 'Gentoo'
-      @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+      @provider.stubs(:mountcmd).returns(File.read(my_fixture('linux.mount')))
       mounts = @provider.mountinstances
       mounts[0].should == { :name => '/', :mounted => :yes }
       mounts[1].should == { :name => '/lib64/rc/init.d', :mounted => :yes }
@@ -176,9 +172,8 @@ FSTAB
     end
 
     it "should get name from mountoutput found on AIX" do
-      pending
       Facter.stubs(:value).with(:operatingsystem).returns 'AIX'
-      @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+      @provider.stubs(:mountcmd).returns(File.read(my_fixture('aix.mount')))
       mounts = @provider.mountinstances
       mounts[0].should == { :name => '/', :mounted => :yes }
       mounts[1].should == { :name => '/tmp', :mounted => :yes }
@@ -195,9 +190,12 @@ FSTAB
   end
 
   my_fixtures('*.fstab').each do |fstab|
-    describe "when prefetching #{fstab}" do
+    platform = File.basename(fstab, '.fstab')
+    describe "when prefetching on #{platform}" do
       before :each do
-        pending "need to rework how testing mount output works after this merge is complete"
+        pending "solaris seems ... odd" if platform == "solaris"
+        @platform = platform
+
         # Note: we have to stub default_target before creating resources
         # because it is used by Puppet::Type::Mount.new to populate the
         # :target property.
@@ -214,7 +212,7 @@ FSTAB
           @resource_hash[resource.name] = resource
         end
 
-        @provider.stubs(:mountcmd).returns File.read(fake_mountoutput)
+        @provider.stubs(:mountcmd).returns File.read(my_fixture(@platform + '.mount'))
       end
 
       it "should set :ensure to :unmounted if found in fstab but not mounted" do
@@ -222,12 +220,12 @@ FSTAB
         @res_unmounted.provider.get(:ensure).should == :unmounted
       end
 
-      it "should set :ensure to :mounted if found in fstab and mounted" do
+      it "should set :ensure to :ghost if not found in fstab but mounted" do
         @provider.prefetch(@resource_hash)
         @res_ghost.provider.get(:ensure).should == :ghost
       end
 
-      it "should set :ensure to :ghost if not found in fstab but mounted" do
+      it "should set :ensure to :mounted if found in fstab and mounted" do
         @provider.prefetch(@resource_hash)
         @res_mounted.provider.get(:ensure).should == :mounted
       end
@@ -238,5 +236,4 @@ FSTAB
       end
     end
   end
-
 end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list