rubyipmi 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/Gemfile +5 -3
- data/README.md +24 -14
- data/Rakefile +82 -4
- data/VERSION +1 -1
- data/lib/rubyipmi.rb +36 -14
- data/lib/rubyipmi/commands/basecommand.rb +57 -119
- data/lib/rubyipmi/freeipmi/commands/basecommand.rb +29 -25
- data/lib/rubyipmi/freeipmi/commands/bmc.rb +3 -3
- data/lib/rubyipmi/freeipmi/commands/bmcconfig.rb +6 -6
- data/lib/rubyipmi/freeipmi/commands/bmcinfo.rb +3 -23
- data/lib/rubyipmi/freeipmi/commands/fru.rb +117 -23
- data/lib/rubyipmi/freeipmi/commands/lan.rb +32 -37
- data/lib/rubyipmi/freeipmi/commands/power.rb +1 -1
- data/lib/rubyipmi/freeipmi/commands/sensors.rb +53 -50
- data/lib/rubyipmi/freeipmi/connection.rb +16 -2
- data/lib/rubyipmi/freeipmi/errorcodes.rb +25 -2
- data/lib/rubyipmi/ipmitool/commands/basecommand.rb +20 -37
- data/lib/rubyipmi/ipmitool/commands/bmc.rb +1 -24
- data/lib/rubyipmi/ipmitool/commands/chassis.rb +1 -0
- data/lib/rubyipmi/ipmitool/commands/fru.rb +112 -30
- data/lib/rubyipmi/ipmitool/commands/lan.rb +55 -77
- data/lib/rubyipmi/ipmitool/commands/power.rb +10 -4
- data/lib/rubyipmi/ipmitool/commands/sensors.rb +53 -80
- data/lib/rubyipmi/ipmitool/connection.rb +19 -3
- data/lib/rubyipmi/ipmitool/errorcodes.rb +51 -3
- data/rubyipmi.gemspec +73 -33
- data/spec/Vagrantfile +45 -0
- data/spec/fixtures/freeipmi/bmc_config.txt +317 -0
- data/spec/fixtures/freeipmi/bmc_config_lan_conf.txt +19 -0
- data/spec/fixtures/freeipmi/bmc_info.txt +32 -0
- data/spec/fixtures/freeipmi/errors.txt +3 -0
- data/spec/fixtures/freeipmi/fru.txt +13 -0
- data/spec/fixtures/freeipmi/sensors.txt +29 -0
- data/spec/fixtures/ipmitool/bmc_info.txt +20 -0
- data/spec/fixtures/ipmitool/errors.txt +10 -0
- data/spec/fixtures/ipmitool/fru.txt +96 -0
- data/spec/fixtures/ipmitool/lan.txt +17 -0
- data/spec/fixtures/ipmitool/sensors.txt +105 -0
- data/spec/integration/bmc_spec.rb +49 -0
- data/spec/{chassis_config_spec.rb → integration/chassis_config_spec.rb} +6 -6
- data/spec/integration/chassis_spec.rb +26 -0
- data/spec/integration/connection_spec.rb +35 -0
- data/spec/{fru_spec.rb → integration/fru_spec.rb} +11 -10
- data/spec/{lan_spec.rb → integration/lan_spec.rb} +9 -7
- data/spec/integration/power_spec.rb +40 -0
- data/spec/{rubyipmi_spec.rb → integration/rubyipmi_spec.rb} +7 -10
- data/spec/{sensor_spec.rb → integration/sensor_spec.rb} +5 -20
- data/spec/manifests/default.pp +50 -0
- data/spec/puppetmodules/archive/LICENSE-2.0.txt +202 -0
- data/spec/puppetmodules/archive/Modulefile +8 -0
- data/spec/puppetmodules/archive/README.md +40 -0
- data/spec/puppetmodules/archive/manifests/download.pp +157 -0
- data/spec/puppetmodules/archive/manifests/extract.pp +81 -0
- data/spec/puppetmodules/archive/manifests/init.pp +70 -0
- data/spec/puppetmodules/archive/manifests/tar-gz.pp +7 -0
- data/spec/puppetmodules/archive/manifests/zip.pp +7 -0
- data/spec/puppetmodules/archive/metadata.json +26 -0
- data/spec/spec_helper.rb +35 -3
- data/spec/unit/freeipmi/bmc-info_spec.rb +42 -0
- data/spec/unit/freeipmi/bmc_spec.rb +44 -0
- data/spec/unit/freeipmi/connection_spec.rb +56 -0
- data/spec/unit/freeipmi/errorcodes_spec.rb +34 -0
- data/spec/unit/freeipmi/fru_spec.rb +77 -0
- data/spec/unit/freeipmi/lan_spec.rb +0 -0
- data/spec/unit/freeipmi/sensors_spec.rb +83 -0
- data/spec/unit/ipmitool/bmc_spec.rb +78 -0
- data/spec/unit/ipmitool/connection_spec.rb +58 -0
- data/spec/unit/ipmitool/errorcodes_spec.rb +34 -0
- data/spec/unit/ipmitool/fru_spec.rb +77 -0
- data/spec/unit/ipmitool/lan_spec.rb +93 -0
- data/spec/unit/ipmitool/sensors_spec.rb +95 -0
- data/spec/unit/rubyipmi_spec.rb +31 -0
- data/spec/vagrant +27 -0
- data/spec/vagrant.pub +1 -0
- metadata +157 -106
- data/.document +0 -5
- data/.rspec +0 -1
- data/Gemfile.lock +0 -33
- data/spec/bmc_spec.rb +0 -46
- data/spec/chassis_spec.rb +0 -26
- data/spec/connection_spec.rb +0 -31
- data/spec/power_spec.rb +0 -42
data/.document
DELETED
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
|
data/spec/connection_spec.rb
DELETED
@@ -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
|