spec/unit/plugins/aix/filesystem_spec.rb in ohai-14.5.4 vs spec/unit/plugins/aix/filesystem_spec.rb in ohai-14.6.2

- old
+ new

@@ -83,11 +83,11 @@ 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/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys MOUNT - @plugin = get_plugin("aix/filesystem") + @plugin = get_plugin("filesystem") allow(@plugin).to receive(:collect_os).and_return(:aix) @plugin[:filesystem] = Mash.new end context "when run within an LPAR" do @@ -99,56 +99,67 @@ describe "df -Pk" do it "returns the filesystem block size" do expect(@plugin[:filesystem]["/dev/hd4"]["kb_size"]).to eq("2097152") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["kb_size"]).to eq("2097152") end it "returns the filesystem used space in kb" do expect(@plugin[:filesystem]["/dev/hd4"]["kb_used"]).to eq("219796") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["kb_used"]).to eq("219796") end it "returns the filesystem available space in kb" do expect(@plugin[:filesystem]["/dev/hd4"]["kb_available"]).to eq("1877356") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["kb_available"]).to eq("1877356") end it "returns the filesystem capacity in percentage" do expect(@plugin[:filesystem]["/dev/hd4"]["percent_used"]).to eq("11%") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["percent_used"]).to eq("11%") end it "returns the filesystem mounted location" do expect(@plugin[:filesystem]["/dev/hd4"]["mount"]).to eq("/") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["mount"]).to eq("/") end end describe "mount" do it "returns the filesystem mount location" do expect(@plugin[:filesystem]["/dev/hd4"]["mount"]).to eq("/") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["mount"]).to eq("/") end it "returns the filesystem type" do expect(@plugin[:filesystem]["/dev/hd4"]["fs_type"]).to eq("jfs2") + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["fs_type"]).to eq("jfs2") end it "returns the filesystem mount options" do expect(@plugin[:filesystem]["/dev/hd4"]["mount_options"]).to eq(["rw", "log=/dev/hd8"]) + expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["mount_options"]).to eq(["rw", "log=/dev/hd8"]) end # 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/middleware1"]["mount"]).to eq("/stage/middleware2") + expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware1,/stage/middleware2"]["mount"]).to eq("/stage/middleware2") end it "returns the filesystem type" do expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware1"]["fs_type"]).to eq("nfs3") + expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware1,/stage/middleware2"]["fs_type"]).to eq("nfs3") end it "returns the filesystem mount options" do expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware1"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"]) + expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware1,/stage/middleware2"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"]) end end end end @@ -161,55 +172,66 @@ describe "df -Pk" do it "returns the filesystem block size" do expect(@plugin[:filesystem]["Global:/"]["kb_size"]).to eq("10485760") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["kb_size"]).to eq("10485760") end it "returns the filesystem used space in kb" do expect(@plugin[:filesystem]["Global:/"]["kb_used"]).to eq("130872") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["kb_used"]).to eq("130872") end it "returns the filesystem available space in kb" do expect(@plugin[:filesystem]["Global:/"]["kb_available"]).to eq("10354888") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["kb_available"]).to eq("10354888") end it "returns the filesystem capacity in percentage" do expect(@plugin[:filesystem]["Global:/"]["percent_used"]).to eq("2%") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["percent_used"]).to eq("2%") end it "returns the filesystem mounted location" do expect(@plugin[:filesystem]["Global:/"]["mount"]).to eq("/") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["mount"]).to eq("/") end end describe "mount" do it "returns the filesystem mount location" do expect(@plugin[:filesystem]["Global:/"]["mount"]).to eq("/") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["mount"]).to eq("/") end it "returns the filesystem type" do expect(@plugin[:filesystem]["Global:/"]["fs_type"]).to eq("jfs2") + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["fs_type"]).to eq("jfs2") end it "returns the filesystem mount options" do expect(@plugin[:filesystem]["Global:/"]["mount_options"]).to eq(["rw", "log=NULL"]) + expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["mount_options"]).to eq(["rw", "log=NULL"]) end # 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/middleware3"]["mount"]).to eq("/stage/middleware4") + expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware3,/stage/middleware4"]["mount"]).to eq("/stage/middleware4") end it "returns the filesystem type" do expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware3"]["fs_type"]).to eq("nfs3") + expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware3,/stage/middleware4"]["fs_type"]).to eq("nfs3") end it "returns the filesystem mount options" do expect(@plugin[:filesystem]["192.168.1.11:/stage/middleware3"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"]) + expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware3,/stage/middleware4"]["mount_options"]).to eq(["ro", "bg", "hard", "intr", "sec=sys"]) end end end end end