1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

tighten up agent info mocks

This commit is contained in:
kfafel 2013-12-18 23:47:10 -06:00
parent 90bbc027ef
commit 976a1c8101
8 changed files with 70 additions and 126 deletions

View file

@ -29,27 +29,20 @@ module Fog
"name" => "cpu.0",
"vendor" => "AMD",
"model" => "Opteron",
"mhz" => Fog::Mock.random_numbers(4).to_s,
"idle" => Fog::Mock.random_numbers(10).to_s,
"irq" => Fog::Mock.random_numbers(5).to_s,
"soft_irq" => Fog::Mock.random_numbers(7).to_s,
"nice" => Fog::Mock.random_numbers(9).to_s,
"stolen" => Fog::Mock.random_numbers(7).to_s,
"sys" => Fog::Mock.random_numbers(7).to_s,
"user" => Fog::Mock.random_numbers(9).to_s,
"wait" => Fog::Mock.random_numbers(7).to_s,
"total" => Fog::Mock.random_numbers(11).to_s,
"mhz" => Fog::Mock.random_numbers(4).to_i,
"idle" => Fog::Mock.random_numbers(10).to_i,
"irq" => Fog::Mock.random_numbers(5).to_i,
"soft_irq" => Fog::Mock.random_numbers(7).to_i,
"nice" => Fog::Mock.random_numbers(9).to_i,
"stolen" => Fog::Mock.random_numbers(7).to_i,
"sys" => Fog::Mock.random_numbers(7).to_i,
"user" => Fog::Mock.random_numbers(9).to_i,
"wait" => Fog::Mock.random_numbers(7).to_i,
"total" => Fog::Mock.random_numbers(11).to_i,
"total_cores" => 1,
"total_sockets" => 1
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -26,23 +26,16 @@ module Fog
response.body = {
"info" => [
{
"read_bytes" => Fog::Mock.random_numbers(10).to_s,
"reads" => Fog::Mock.random_numbers(6).to_s,
"rtime" => Fog::Mock.random_numbers(6).to_s,
"write_bytes" => Fog::Mock.random_numbers(10).to_s,
"writes" => Fog::Mock.random_numbers(8).to_s,
"wtime" => Fog::Mock.random_numbers(9).to_s,
"time" => Fog::Mock.random_numbers(7).to_s,
"read_bytes" => Fog::Mock.random_numbers(10).to_i,
"reads" => Fog::Mock.random_numbers(6).to_i,
"rtime" => Fog::Mock.random_numbers(6).to_i,
"write_bytes" => Fog::Mock.random_numbers(10).to_i,
"writes" => Fog::Mock.random_numbers(8).to_i,
"wtime" => Fog::Mock.random_numbers(9).to_i,
"time" => Fog::Mock.random_numbers(7).to_i,
"name" => "/dev/xvda1"
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -30,12 +30,12 @@ module Fog
"dev_name" => "/dev/xvda1",
"sys_type_name" => "ext4",
"options" => "rw,noatime,acl,errors=remount-ro,barrier=0",
"free" => Fog::Mock.random_numbers(8).to_s,
"used" => Fog::Mock.random_numbers(5).to_s,
"avail" => Fog::Mock.random_numbers(7).to_s,
"total" => Fog::Mock.random_numbers(9).to_s,
"files" => Fog::Mock.random_numbers(6).to_s,
"free_files" => Fog::Mock.random_numbers(6).to_s,
"free" => Fog::Mock.random_numbers(8).to_i,
"used" => Fog::Mock.random_numbers(5).to_i,
"avail" => Fog::Mock.random_numbers(7).to_i,
"total" => Fog::Mock.random_numbers(9).to_i,
"files" => Fog::Mock.random_numbers(6).to_i,
"free_files" => Fog::Mock.random_numbers(6).to_i,
},
{
"dir_name" => "/proc",
@ -43,14 +43,7 @@ module Fog
"sys_type_name" => "ext4",
"options" => "rw",
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -37,14 +37,7 @@ module Fog
"time" => Time.now.to_i - 50,
"host" => "somehost2.company.local"
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -26,26 +26,19 @@ module Fog
response.body = {
"info" => [
{
"actual_free" => Fog::Mock.random_numbers(9).to_s,
"actual_used" => Fog::Mock.random_numbers(8).to_s,
"free" => Fog::Mock.random_numbers(7).to_s,
"used" => Fog::Mock.random_numbers(9).to_s,
"total" => Fog::Mock.random_numbers(10).to_s,
"ram" => Fog::Mock.random_numbers(4).to_s,
"swap_total" => Fog::Mock.random_numbers(10).to_s,
"swap_used" => Fog::Mock.random_numbers(8).to_s,
"swap_free" => Fog::Mock.random_numbers(10).to_s,
"swap_page_in" => Fog::Mock.random_numbers(3).to_s,
"swap_page_out" => Fog::Mock.random_numbers(3).to_s,
"actual_free" => Fog::Mock.random_numbers(9).to_i,
"actual_used" => Fog::Mock.random_numbers(8).to_i,
"free" => Fog::Mock.random_numbers(7).to_i,
"used" => Fog::Mock.random_numbers(9).to_i,
"total" => Fog::Mock.random_numbers(10).to_i,
"ram" => Fog::Mock.random_numbers(4).to_i,
"swap_total" => Fog::Mock.random_numbers(10).to_i,
"swap_used" => Fog::Mock.random_numbers(8).to_i,
"swap_free" => Fog::Mock.random_numbers(10).to_i,
"swap_page_in" => Fog::Mock.random_numbers(3).to_i,
"swap_page_out" => Fog::Mock.random_numbers(3).to_i,
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -33,12 +33,12 @@ module Fog
"address6" => "::1",
"broadcast" => "0.0.0.0.0",
"hwaddr" => "00:00:00:00:00:00",
"mtu" => Fog::Mock.random_numbers(4).to_s,
"rx_packets" => Fog::Mock.random_numbers(3).to_s,
"rx_bytes" => Fog::Mock.random_numbers(4).to_s,
"tx_packets" => Fog::Mock.random_numbers(3).to_s,
"tx_bytes" => Fog::Mock.random_numbers(4).to_s,
"flags" => Fog::Mock.random_numbers(2).to_s,
"mtu" => Fog::Mock.random_numbers(4).to_i,
"rx_packets" => Fog::Mock.random_numbers(3).to_i,
"rx_bytes" => Fog::Mock.random_numbers(4).to_i,
"tx_packets" => Fog::Mock.random_numbers(3).to_i,
"tx_bytes" => Fog::Mock.random_numbers(4).to_i,
"flags" => Fog::Mock.random_numbers(2).to_i,
},
{
"name" => "eth0",
@ -49,11 +49,11 @@ module Fog
"broadcast" => Fog::Mock.random_ip({:version => :v4}),
"hwaddr" => "A1:B2:C3:D4:E5:F6",
"mtu" => "1500",
"rx_packets" => Fog::Mock.random_numbers(7).to_s,
"rx_bytes" => Fog::Mock.random_numbers(9).to_s,
"tx_packets" => Fog::Mock.random_numbers(7).to_s,
"tx_bytes" => Fog::Mock.random_numbers(9).to_s,
"flags" => Fog::Mock.random_numbers(4).to_s,
"rx_packets" => Fog::Mock.random_numbers(7).to_i,
"rx_bytes" => Fog::Mock.random_numbers(9).to_i,
"tx_packets" => Fog::Mock.random_numbers(7).to_i,
"tx_bytes" => Fog::Mock.random_numbers(9).to_i,
"flags" => Fog::Mock.random_numbers(4).to_i,
},
{
"name" => "eth1",
@ -64,20 +64,13 @@ module Fog
"broadcast" => Fog::Mock.random_ip({:version => :v4}),
"hwaddr" => "A2:B3:C4:D5:E6:F7",
"mtu" => "1500",
"rx_packets" => Fog::Mock.random_numbers(7).to_s,
"rx_bytes" => Fog::Mock.random_numbers(9).to_s,
"tx_packets" => Fog::Mock.random_numbers(7).to_s,
"tx_bytes" => Fog::Mock.random_numbers(9).to_s,
"flags" => Fog::Mock.random_numbers(4).to_s,
"rx_packets" => Fog::Mock.random_numbers(7).to_i,
"rx_bytes" => Fog::Mock.random_numbers(9).to_i,
"tx_packets" => Fog::Mock.random_numbers(7).to_i,
"tx_bytes" => Fog::Mock.random_numbers(9).to_i,
"flags" => Fog::Mock.random_numbers(4).to_i,
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -29,35 +29,28 @@ module Fog
response.body = {
"info" => [
{
"pid" => Fog::Mock.random_numbers(4).to_s,
"pid" => Fog::Mock.random_numbers(4).to_i,
"exe_name" => "/usr/share/nova-agent/0.0.1.38/sbin/nova-agent",
"exe_cwd" => "/",
"exe_root" => "/",
"time_total" => Fog::Mock.random_numbers(3).to_s,
"time_sys" => Fog::Mock.random_numbers(2).to_s,
"time_user" => Fog::Mock.random_numbers(2).to_s,
"time_total" => Fog::Mock.random_numbers(3).to_i,
"time_sys" => Fog::Mock.random_numbers(2).to_i,
"time_user" => Fog::Mock.random_numbers(2).to_i,
"time_start_time" => Time.now.utc.to_i - 10000,
"state_name" => "nova-agent",
"state_ppid" => Fog::Mock.random_numbers(3).to_s,
"state_ppid" => Fog::Mock.random_numbers(3).to_i,
"state_priority" => "15",
"state_threads" => Fog::Mock.random_numbers(1).to_s,
"memory_size" => Fog::Mock.random_numbers(9).to_s,
"memory_resident" => Fog::Mock.random_numbers(7).to_s,
"memory_share" => Fog::Mock.random_numbers(6).to_s,
"memory_major_faults" => memory_major_faults.to_s,
"memory_minor_faults" => memory_minor_faults.to_s,
"memory_page_faults" => memory_page_faults.to_s,
"state_threads" => Fog::Mock.random_numbers(1).to_i,
"memory_size" => Fog::Mock.random_numbers(9).to_i,
"memory_resident" => Fog::Mock.random_numbers(7).to_i,
"memory_share" => Fog::Mock.random_numbers(6).to_i,
"memory_major_faults" => memory_major_faults.to_i,
"memory_minor_faults" => memory_minor_faults.to_i,
"memory_page_faults" => memory_page_faults.to_i,
"cred_user" => "root",
"cred_group" => "root"
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,

View file

@ -32,14 +32,7 @@ module Fog
"vendor" => "CentOS",
"vendor_version" => "5.10"
}
],
"metadata" => {
"count" => 1,
"limit" => 100,
"marker" => nil,
"next_marker" => nil,
"next_href" => nil
}
]
}
response.headers = {
"Date" => Time.now.utc.to_s,