require 'spec_helper' describe F5::Icontrol::System::SystemInfo, :vcr do subject { described_class.new("10.198.4.135", "admin", "admin") } describe "#respond_to?" do it "supports get_version" do expect(subject.respond_to? :get_version).to be_truthy end it "supports get_uptime" do expect(subject.respond_to? :get_uptime).to be_truthy end it "does not support buy cisco" do expect(subject.respond_to? :buy_cisco).to be_falsey end end it "retrieves the version" do expect(subject.get_version).to eq "BIG-IP_v11.3.0" end it "retrieves the uptime" do expect(subject.get_uptime).to eq "425782" end it "retrieves something with a complex return type and input" do expect(subject.get_cpu_usage_extended_information(host_ids: { item: ["0-50-56-94-10-19.example.com"] } )).to eq(:"@s:type" => "iControl:System.CPUUsageExtendedInformation", :hosts => {:item=>{:host_id=>"0-50-56-94-10-19.example.com", :statistics=>{:item=>{:item=>[{:type=>"STATISTIC_CPU_INFO_CPU_ID", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_USER", :value=>{:high=>"0", :low=>"720687", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_NICED", :value=>{:high=>"0", :low=>"304036", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_SYSTEM", :value=>{:high=>"0", :low=>"200072", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_IDLE", :value=>{:high=>"0", :low=>"42375955", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_IRQ", :value=>{:high=>"0", :low=>"2153", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_SOFTIRQ", :value=>{:high=>"0", :low=>"3636", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_IOWAIT", :value=>{:high=>"0", :low=>"23673", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_STOLEN", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_USAGE_RATIO", :value=>{:high=>"0", :low=>"2", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_USER", :value=>{:high=>"0", :low=>"2", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_NICED", :value=>{:high=>"0", :low=>"1", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_SYSTEM", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_IDLE", :value=>{:high=>"0", :low=>"97", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_IRQ", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_SOFTIRQ", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_IOWAIT", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_STOLEN", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_SEC_AVG_USAGE_RATIO", :value=>{:high=>"0", :low=>"2", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_USER", :value=>{:high=>"0", :low=>"2", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_NICED", :value=>{:high=>"0", :low=>"1", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_SYSTEM", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_IDLE", :value=>{:high=>"0", :low=>"97", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_IRQ", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_SOFTIRQ", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_IOWAIT", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_STOLEN", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_ONE_MIN_AVG_USAGE_RATIO", :value=>{:high=>"0", :low=>"3", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_USER", :value=>{:high=>"0", :low=>"2", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_NICED", :value=>{:high=>"0", :low=>"1", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_SYSTEM", :value=>{:high=>"0", :low=>"1", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_IDLE", :value=>{:high=>"0", :low=>"97", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_IRQ", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_SOFTIRQ", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_IOWAIT", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_STOLEN", :value=>{:high=>"0", :low=>"0", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}, {:type=>"STATISTIC_CPU_INFO_FIVE_MIN_AVG_USAGE_RATIO", :value=>{:high=>"0", :low=>"3", :"@s:type"=>"iControl:Common.ULong64"}, :time_stamp=>"0"}], :"@a:array_type"=>"iControl:Common.Statistic[37]"}, :"@s:type"=>"A:Array", :"@a:array_type"=>"iControl:Common.Statistic[][1]"}}, :"@s:type"=>"A:Array", :"@a:array_type"=>"iControl:System.CPUUsageExtended[1]"}, :time_stamp => {:year=>"2014", :month=>"4", :day=>"9", :hour=>"18", :minute=>"38", :second=>"39", :"@s:type"=>"iControl:Common.TimeStamp"}) end end