[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:21 UTC 2009


The following commit has been merged in the master branch:
commit 85d3ae02fb4707f1dd566019221195e431365c2f
Author: Sean E. Millichamp <sean at bruenor.org>
Date:   Wed Oct 8 11:40:25 2008 -0400

    Cleanup selboolean and selmodule unit tests to pass on non-SELinux systems

diff --git a/spec/unit/provider/selboolean.rb b/spec/unit/provider/selboolean.rb
index 95d372e..4006df1 100755
--- a/spec/unit/provider/selboolean.rb
+++ b/spec/unit/provider/selboolean.rb
@@ -22,12 +22,14 @@ describe provider_class do
     end
 
     it "should call execpipe when updating boolean setting" do
+        @provider.expects(:command).with(:setsebool).returns "/usr/sbin/setsebool"
         @provider.expects(:execpipe).with("/usr/sbin/setsebool  foo off")
         @provider.value = :off
     end
      
     it "should call execpipe with -P when updating persistent boolean setting" do
         @resource.stubs(:[]).with(:persistent).returns :true
+        @provider.expects(:command).with(:setsebool).returns "/usr/sbin/setsebool"
         @provider.expects(:execpipe).with("/usr/sbin/setsebool -P foo off")
         @provider.value = :off
     end
diff --git a/spec/unit/provider/selmodule.rb b/spec/unit/provider/selmodule.rb
index 640e946..e92441d 100755
--- a/spec/unit/provider/selmodule.rb
+++ b/spec/unit/provider/selmodule.rb
@@ -18,16 +18,19 @@ describe provider_class do
 
     describe "exists? method" do 
         it "should find a module if it is already loaded" do
+            @provider.expects(:command).with(:semodule).returns "/usr/sbin/semodule"
             @provider.expects(:execpipe).with("/usr/sbin/semodule --list").yields ["bar\t1.2.3\n", "foo\t4.4.4\n", "bang\t1.0.0\n"]
             @provider.exists?.should == :true
         end
 
         it "should return nil if not loaded" do
+            @provider.expects(:command).with(:semodule).returns "/usr/sbin/semodule"
             @provider.expects(:execpipe).with("/usr/sbin/semodule --list").yields ["bar\t1.2.3\n", "bang\t1.0.0\n"]
             @provider.exists?.should be_nil
         end
 
         it "should return nil if no modules are loaded" do
+            @provider.expects(:command).with(:semodule).returns "/usr/sbin/semodule"
             @provider.expects(:execpipe).with("/usr/sbin/semodule --list").yields []
             @provider.exists?.should be_nil
         end
diff --git a/spec/unit/type/selboolean.rb b/spec/unit/type/selboolean.rb
index 80d6d64..14b3b72 100755
--- a/spec/unit/type/selboolean.rb
+++ b/spec/unit/type/selboolean.rb
@@ -10,14 +10,20 @@ describe Puppet::Type.type(:selboolean), "when validating attributes" do
     end
 
     it "should have a value property" do
-            Puppet::Type.type(:selboolean).attrtype(:value).should == :property
+        Puppet::Type.type(:selboolean).attrtype(:value).should == :property
     end
 end
 
 describe Puppet::Type.type(:selboolean), "when validating values" do
     before do
-        @provider = stub 'provider', :class => Puppet::Type.type(:selboolean).defaultprovider, :clear => nil
-        Puppet::Type.type(:selboolean).defaultprovider.expects(:new).returns(@provider)
+        @class = Puppet::Type.type(:selboolean)
+
+        @provider_class = stub 'provider_class', :name => "fake", :suitable? => true, :supports_parameter? => true
+        @class.stubs(:defaultprovider).returns(@provider_class)
+        @class.stubs(:provider).returns(@provider_class)
+
+        @provider = stub 'provider', :class => @provider_class, :clear => nil
+        @provider_class.stubs(:new).returns(@provider)
     end
 
     it "should support :on as a value to :value" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list