rubyipmi 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +5 -3
  3. data/README.md +24 -14
  4. data/Rakefile +82 -4
  5. data/VERSION +1 -1
  6. data/lib/rubyipmi.rb +36 -14
  7. data/lib/rubyipmi/commands/basecommand.rb +57 -119
  8. data/lib/rubyipmi/freeipmi/commands/basecommand.rb +29 -25
  9. data/lib/rubyipmi/freeipmi/commands/bmc.rb +3 -3
  10. data/lib/rubyipmi/freeipmi/commands/bmcconfig.rb +6 -6
  11. data/lib/rubyipmi/freeipmi/commands/bmcinfo.rb +3 -23
  12. data/lib/rubyipmi/freeipmi/commands/fru.rb +117 -23
  13. data/lib/rubyipmi/freeipmi/commands/lan.rb +32 -37
  14. data/lib/rubyipmi/freeipmi/commands/power.rb +1 -1
  15. data/lib/rubyipmi/freeipmi/commands/sensors.rb +53 -50
  16. data/lib/rubyipmi/freeipmi/connection.rb +16 -2
  17. data/lib/rubyipmi/freeipmi/errorcodes.rb +25 -2
  18. data/lib/rubyipmi/ipmitool/commands/basecommand.rb +20 -37
  19. data/lib/rubyipmi/ipmitool/commands/bmc.rb +1 -24
  20. data/lib/rubyipmi/ipmitool/commands/chassis.rb +1 -0
  21. data/lib/rubyipmi/ipmitool/commands/fru.rb +112 -30
  22. data/lib/rubyipmi/ipmitool/commands/lan.rb +55 -77
  23. data/lib/rubyipmi/ipmitool/commands/power.rb +10 -4
  24. data/lib/rubyipmi/ipmitool/commands/sensors.rb +53 -80
  25. data/lib/rubyipmi/ipmitool/connection.rb +19 -3
  26. data/lib/rubyipmi/ipmitool/errorcodes.rb +51 -3
  27. data/rubyipmi.gemspec +73 -33
  28. data/spec/Vagrantfile +45 -0
  29. data/spec/fixtures/freeipmi/bmc_config.txt +317 -0
  30. data/spec/fixtures/freeipmi/bmc_config_lan_conf.txt +19 -0
  31. data/spec/fixtures/freeipmi/bmc_info.txt +32 -0
  32. data/spec/fixtures/freeipmi/errors.txt +3 -0
  33. data/spec/fixtures/freeipmi/fru.txt +13 -0
  34. data/spec/fixtures/freeipmi/sensors.txt +29 -0
  35. data/spec/fixtures/ipmitool/bmc_info.txt +20 -0
  36. data/spec/fixtures/ipmitool/errors.txt +10 -0
  37. data/spec/fixtures/ipmitool/fru.txt +96 -0
  38. data/spec/fixtures/ipmitool/lan.txt +17 -0
  39. data/spec/fixtures/ipmitool/sensors.txt +105 -0
  40. data/spec/integration/bmc_spec.rb +49 -0
  41. data/spec/{chassis_config_spec.rb → integration/chassis_config_spec.rb} +6 -6
  42. data/spec/integration/chassis_spec.rb +26 -0
  43. data/spec/integration/connection_spec.rb +35 -0
  44. data/spec/{fru_spec.rb → integration/fru_spec.rb} +11 -10
  45. data/spec/{lan_spec.rb → integration/lan_spec.rb} +9 -7
  46. data/spec/integration/power_spec.rb +40 -0
  47. data/spec/{rubyipmi_spec.rb → integration/rubyipmi_spec.rb} +7 -10
  48. data/spec/{sensor_spec.rb → integration/sensor_spec.rb} +5 -20
  49. data/spec/manifests/default.pp +50 -0
  50. data/spec/puppetmodules/archive/LICENSE-2.0.txt +202 -0
  51. data/spec/puppetmodules/archive/Modulefile +8 -0
  52. data/spec/puppetmodules/archive/README.md +40 -0
  53. data/spec/puppetmodules/archive/manifests/download.pp +157 -0
  54. data/spec/puppetmodules/archive/manifests/extract.pp +81 -0
  55. data/spec/puppetmodules/archive/manifests/init.pp +70 -0
  56. data/spec/puppetmodules/archive/manifests/tar-gz.pp +7 -0
  57. data/spec/puppetmodules/archive/manifests/zip.pp +7 -0
  58. data/spec/puppetmodules/archive/metadata.json +26 -0
  59. data/spec/spec_helper.rb +35 -3
  60. data/spec/unit/freeipmi/bmc-info_spec.rb +42 -0
  61. data/spec/unit/freeipmi/bmc_spec.rb +44 -0
  62. data/spec/unit/freeipmi/connection_spec.rb +56 -0
  63. data/spec/unit/freeipmi/errorcodes_spec.rb +34 -0
  64. data/spec/unit/freeipmi/fru_spec.rb +77 -0
  65. data/spec/unit/freeipmi/lan_spec.rb +0 -0
  66. data/spec/unit/freeipmi/sensors_spec.rb +83 -0
  67. data/spec/unit/ipmitool/bmc_spec.rb +78 -0
  68. data/spec/unit/ipmitool/connection_spec.rb +58 -0
  69. data/spec/unit/ipmitool/errorcodes_spec.rb +34 -0
  70. data/spec/unit/ipmitool/fru_spec.rb +77 -0
  71. data/spec/unit/ipmitool/lan_spec.rb +93 -0
  72. data/spec/unit/ipmitool/sensors_spec.rb +95 -0
  73. data/spec/unit/rubyipmi_spec.rb +31 -0
  74. data/spec/vagrant +27 -0
  75. data/spec/vagrant.pub +1 -0
  76. metadata +157 -106
  77. data/.document +0 -5
  78. data/.rspec +0 -1
  79. data/Gemfile.lock +0 -33
  80. data/spec/bmc_spec.rb +0 -46
  81. data/spec/chassis_spec.rb +0 -26
  82. data/spec/connection_spec.rb +0 -31
  83. data/spec/power_spec.rb +0 -42
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/Gemfile.lock DELETED
@@ -1,33 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- diff-lcs (1.1.3)
5
- git (1.2.5)
6
- jeweler (1.8.4)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- rdoc
11
- json (1.7.4)
12
- rake (0.9.2.2)
13
- rcov (1.0.0)
14
- rdoc (3.12)
15
- json (~> 1.4)
16
- rspec (2.8.0)
17
- rspec-core (~> 2.8.0)
18
- rspec-expectations (~> 2.8.0)
19
- rspec-mocks (~> 2.8.0)
20
- rspec-core (2.8.0)
21
- rspec-expectations (2.8.0)
22
- diff-lcs (~> 1.1.2)
23
- rspec-mocks (2.8.0)
24
-
25
- PLATFORMS
26
- ruby
27
-
28
- DEPENDENCIES
29
- bundler (~> 1.1.5)
30
- jeweler (~> 1.8.4)
31
- rcov
32
- rdoc (~> 3.12)
33
- rspec (~> 2.8.0)
data/spec/bmc_spec.rb DELETED
@@ -1,46 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
- describe "Bmc" do
3
-
4
- before :each do
5
- user = ENV["ipmiuser"]
6
- pass = ENV["ipmipass"]
7
- host = ENV["ipmihost"]
8
- provider = ENV["ipmiprovider"]
9
- @conn = Rubyipmi.connect(user, pass, host, provider)
10
-
11
- end
12
-
13
- it "creates a bmc object" do
14
- @conn.bmc.should_not be_nil
15
-
16
- end
17
-
18
- #it "options should change after calling info" do
19
- # info = @conn.bmc.info
20
- # before = info.options.clone
21
- # @conn.bmc.info.retrieve
22
- # after = info.options.clone
23
- # before.length.should be < after.length
24
- #end
25
-
26
- it "should reset the bmc device" do
27
- @conn.bmc.reset('cold').should_not be_nil
28
- end
29
-
30
- it "should reset the bmc device warmly" do
31
- @conn.bmc.reset('warm').should_not be_nil
32
- end
33
-
34
- it "reset should fail when type is wrong" do
35
- @conn.bmc.reset('freezing').should_be nil
36
- end
37
-
38
- it "is able to retrieve the bmc info" do
39
- @conn.bmc.info.should_not be_nil
40
- end
41
-
42
- it "is able to retrieve the guid" do
43
- @conn.bmc.guid.should_not be_nil
44
- end
45
-
46
- end
data/spec/chassis_spec.rb DELETED
@@ -1,26 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "Chassis" do
4
-
5
- before :each do
6
- user = ENV["ipmiuser"]
7
- pass = ENV["ipmipass"]
8
- host = ENV["ipmihost"]
9
- provider = ENV["ipmiprovider"]
10
- @conn = Rubyipmi.connect(user, pass, host, provider)
11
-
12
- end
13
-
14
- it "test to turn uid light on for 10 seconds" do
15
- value = @conn.chassis.identify(true, 5)
16
- sleep(6)
17
- value.should == true
18
- end
19
-
20
- it "test to turn uid light on then off" do
21
- @conn.chassis.identify(true)
22
- sleep(2)
23
- @conn.chassis.identify(false).should == true
24
- end
25
-
26
- end
@@ -1,31 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
- describe "Connection" do
3
-
4
- before :each do
5
- user = ENV["ipmiuser"]
6
- pass = ENV["ipmipass"]
7
- host = ENV["ipmihost"]
8
- provider = ENV["ipmiprovider"]
9
- @conn = Rubyipmi.connect(user, pass, host, provider)
10
-
11
- end
12
-
13
- it "creates a new object" do
14
- @conn.should_not be_nil
15
-
16
- end
17
-
18
- it 'creates a bmc object' do
19
- @conn.bmc.should_not be_nil
20
- end
21
-
22
- it 'creates a chassis object' do
23
- @conn.chassis.should_not be_nil
24
- end
25
-
26
-
27
- end
28
- #it "raises an error if host is unreachable" do
29
- # conn = Freeipmi.connect("admin", "creative", "192.168.1.181")
30
- #
31
- #end
data/spec/power_spec.rb DELETED
@@ -1,42 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "Power" do
4
-
5
- before :each do
6
- user = ENV["ipmiuser"]
7
- pass = ENV["ipmipass"]
8
- host = ENV["ipmihost"]
9
- provider = ENV["ipmiprovider"]
10
- @conn = Rubyipmi.connect(user, pass, host, provider)
11
-
12
- end
13
-
14
- it "test to turn power on" do
15
- @conn.chassis.power.on.should == true
16
- end
17
-
18
- it "test to turn power off" do
19
- @conn.chassis.power.off.should == true
20
- end
21
-
22
- it "test power status" do
23
- @conn.chassis.power.status.should_not be nil
24
-
25
- end
26
-
27
- it "test to check that options automatically change" do
28
- before = @conn.chassis.power.options.clone
29
- @conn.chassis.power.off
30
- after = @conn.chassis.power.options.clone
31
- after.length.should be > before.length
32
- end
33
-
34
- it "test to check if power status if off" do
35
- before = @conn.chassis.power.options.clone
36
- @conn.chassis.power.off
37
- after = @conn.chassis.power.options.clone
38
- sleep(2)
39
- @conn.chassis.power.off?.should == true
40
- end
41
-
42
- end