summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Justice <jjustice6@bloomberg.net>2018-05-21 14:27:53 -0400
committerTim Smith <tsmith@chef.io>2018-06-04 14:20:24 -0700
commit7f390efe85ec5de635df333e7408813eef3b4d60 (patch)
treec5c4db2ab70285cb0a35e8fc6f5069d4eaf0b18f
parent462271b1e20a6984b1a09a8c578e42d5021dc6e9 (diff)
downloadohai-aix_filesystem.tar.gz
Fix an issue caused by using the wrong field in the AIX filesystem plugin.aix_filesystem
Also alters the test to reveal the exact nature of the issue. Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
-rw-r--r--lib/ohai/plugins/aix/filesystem.rb2
-rw-r--r--spec/unit/plugins/aix/filesystem_spec.rb20
2 files changed, 11 insertions, 11 deletions
diff --git a/lib/ohai/plugins/aix/filesystem.rb b/lib/ohai/plugins/aix/filesystem.rb
index 8f90921c..91f4fe85 100644
--- a/lib/ohai/plugins/aix/filesystem.rb
+++ b/lib/ohai/plugins/aix/filesystem.rb
@@ -59,7 +59,7 @@ Ohai.plugin(:Filesystem) do
else
key = fields[0] + ":" + fields[1]
oldie[key] ||= Mash.new
- oldie[key][:mount] = fields[1]
+ oldie[key][:mount] = fields[2]
oldie[key][:fs_type] = fields[3]
oldie[key][:mount_options] = fields[7].split(",")
end
diff --git a/spec/unit/plugins/aix/filesystem_spec.rb b/spec/unit/plugins/aix/filesystem_spec.rb
index 3ca3dcf8..481fe70a 100644
--- a/spec/unit/plugins/aix/filesystem_spec.rb
+++ b/spec/unit/plugins/aix/filesystem_spec.rb
@@ -69,7 +69,7 @@ DF_PK
/dev/hd11admin /admin jfs2 Jul 17 13:22 rw,log=/dev/hd8
/proc /proc procfs Jul 17 13:22 rw
/dev/hd10opt /opt jfs2 Jul 17 13:22 rw,log=/dev/hd8
-192.168.1.11 /stage/middleware /stage/middleware nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
+192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
MOUNT
@mount_wpar = <<-MOUNT
@@ -82,7 +82,7 @@ MOUNT
Global /tmp jfs2 Nov 23 21:03 rw,log=NULL
Global /usr jfs2 Nov 23 21:03 rw,log=NULL
Global /var jfs2 Nov 23 21:03 rw,log=NULL
-192.168.1.11 /stage/middleware /stage/middleware nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
+192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
MOUNT
@plugin = get_plugin("aix/filesystem")
@@ -134,19 +134,19 @@ MOUNT
expect(@plugin[:filesystem]["/dev/hd4"]["mount_options"]).to eq(["rw", "log=/dev/hd8"])
end
- # For entries like 192.168.1.11 /stage/middleware /stage/middleware nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
+ # For entries like 192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
context "having node values" do
it "returns the filesystem mount location" do
- expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware"]["mount"]).to eq("/stage/middleware")
+ expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware1"]["mount"]).to eq("/stage/middleware2")
end
it "returns the filesystem type" do
- expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware"]["fs_type"]).to eq("nfs3")
+ expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware1"]["fs_type"]).to eq("nfs3")
end
it "returns the filesystem mount options" do
- expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"])
+ expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware1"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"])
end
end
end
@@ -196,19 +196,19 @@ MOUNT
expect(@plugin[:filesystem]["Global:/"]["mount_options"]).to eq(["rw", "log=NULL"])
end
- # For entries like 192.168.1.11 /stage/middleware /stage/middleware nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
+ # For entries like 192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
context "having node values" do
it "returns the filesystem mount location" do
- expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware"]["mount"]).to eq("/stage/middleware")
+ expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware3"]["mount"]).to eq("/stage/middleware4")
end
it "returns the filesystem type" do
- expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware"]["fs_type"]).to eq("nfs3")
+ expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware3"]["fs_type"]).to eq("nfs3")
end
it "returns the filesystem mount options" do
- expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"])
+ expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware3"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"])
end
end
end