summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2011-01-31 13:53:27 -0800
committerDaniel Pittman <daniel@rimspace.net>2011-01-31 13:53:27 -0800
commit2f74d83f22e05564a136c08dd0cc73dcd700f214 (patch)
treecb4a3a6324ea5bd5814175013718d8e7bdad53ca
parent8de9b9aeadcee490065aeb34663ca22c513fd2e4 (diff)
downloadpuppet-2f74d83f22e05564a136c08dd0cc73dcd700f214.tar.gz
puppet-2f74d83f22e05564a136c08dd0cc73dcd700f214.tar.xz
puppet-2f74d83f22e05564a136c08dd0cc73dcd700f214.zip
Spec for #5681 to allow parsing of AIX mount output in mount provider
This also adds a fixture file containing the AIX mount output as submitted by the ticket author.
-rw-r--r--spec/fixtures/unit/provider/mount/mount-output.aix.txt7
-rwxr-xr-xspec/unit/provider/mount_spec.rb8
2 files changed, 15 insertions, 0 deletions
diff --git a/spec/fixtures/unit/provider/mount/mount-output.aix.txt b/spec/fixtures/unit/provider/mount/mount-output.aix.txt
new file mode 100644
index 000000000..54edb9c1c
--- /dev/null
+++ b/spec/fixtures/unit/provider/mount/mount-output.aix.txt
@@ -0,0 +1,7 @@
+/dev/hd4 / jfs2 Nov 11 12:11 rw,log=/dev/hd8
+/dev/hd2 /usr jfs2 Nov 11 12:11 rw,log=/dev/hd8
+/dev/hd9var /var jfs2 Nov 11 12:11 rw,log=/dev/hd8
+/dev/hd3 /tmp jfs2 Nov 11 12:11 rw,log=/dev/hd8
+/dev/hd1 /home jfs2 Nov 11 12:11 rw,log=/dev/hd8
+/proc /proc procfs Nov 11 12:11 rw
+/dev/hd10opt /opt jfs2 Nov 11 12:11 rw,log=/dev/hd8
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index b034214ee..f567a4a40 100755
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -120,6 +120,14 @@ describe Puppet::Provider::Mount do
@mounter.should be_mounted
end
+ it "should match mounted devices if the operating system is AIX" do
+ Facter.stubs(:value).with("operatingsystem").returns("AIX")
+ mount_data = File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'unit', 'provider', 'mount', 'mount-output.aix.txt'))
+ @mounter.expects(:mountcmd).returns(mount_data)
+
+ @mounter.should be_mounted
+ end
+
it "should match ' on <name>' if the operating system is not Darwin, Solaris, or HP-UX" do
Facter.stubs(:value).with("operatingsystem").returns("Debian")
@mounter.expects(:mountcmd).returns("/dev/dsk/whatever on / and stuff\n/dev/other/disk on /var and stuff")