[Pkg-puppet-devel] [facter] 48/352: (#20994) add rspec tests for memoryfree and memorysize on AIX using svmon

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 9faf2c5875c25865b03a96f0016b04ff170a8fa9
Author: Aran Cox <aran.cox at act.org>
Date:   Sun Jun 2 10:59:29 2013 -0500

    (#20994) add rspec tests for memoryfree and memorysize on AIX using svmon
---
 spec/unit/memory_spec.rb | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/spec/unit/memory_spec.rb b/spec/unit/memory_spec.rb
index d249d5b..311a742 100755
--- a/spec/unit/memory_spec.rb
+++ b/spec/unit/memory_spec.rb
@@ -156,6 +156,20 @@ SWAP
 
       Facter::Util::Resolution.stubs(:exec).with('swap -l 2>/dev/null').returns(swapusage)
 
+      svmon = <<SVMON
+Unit: KB
+--------------------------------------------------------------------------------------
+               size       inuse        free         pin     virtual  available   mmode
+memory     32768000     9948408    22819592     2432080     4448928   27231828     Ded
+pg space   34078720       15000
+
+               work        pers        clnt       other
+pin         1478228           0           0      953852
+in use      4448928           0     5499480
+SVMON
+
+      Facter::Util::Resolution.stubs(:exec).with('/usr/bin/svmon -O unit=KB').returns(svmon)
+
       Facter.collection.internal_loader.load(:memory)
     end
 
@@ -190,6 +204,15 @@ SWAP
         Facter.fact(:swapfree_mb).value.should == "508.00"
       end
     end
+
+    it "should return the current memory free in MB" do
+      Facter.fact(:memoryfree_mb).value.should == "22284.76"
+    end
+
+    it "should return the current memory size in MB" do
+      Facter.fact(:memorysize_mb).value.should == "32000.00"
+    end
+
   end
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list