specinfra 2.37.2 → 2.37.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7f05059b7054bc5fcb9c5458ccc852b10e7fd9a
|
4
|
+
data.tar.gz: 7884725fe7da07f96078b4b6784bcb9f7647f14d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f62ce638f8898da682d2fe75eaaced5b5ee1de55eff032cc50c4dc97c78f253b0cb6fb3eaa3e222881dc97389129af01f12e192339e44fcd66a2db38e1986c3
|
7
|
+
data.tar.gz: 1b5417957402247b243ded63ea65c45d6fca86c6c5602cce47ad97d86ff23b2b326ccdab78104ed055b76ea1efe8f35d23e668558778f1903237fa687ee6e1ed
|
@@ -5,6 +5,7 @@ module Specinfra
|
|
5
5
|
res = {}
|
6
6
|
if backend.run_command('ls /.dockerinit').success?
|
7
7
|
res[:system] = 'docker'
|
8
|
+
return res
|
8
9
|
end
|
9
10
|
|
10
11
|
if backend.run_command('ls /usr/sbin/dmidecode').success?
|
@@ -19,6 +20,8 @@ module Specinfra
|
|
19
20
|
if ret.stdout =~ /Product Name: VirtualBox/
|
20
21
|
res[:system] = 'vbox'
|
21
22
|
end
|
23
|
+
when /Product Name: KVM/
|
24
|
+
res[:system] = 'kvm'
|
22
25
|
when /Product Name: OpenStack/
|
23
26
|
res[:system] = 'openstack'
|
24
27
|
else
|
data/lib/specinfra/version.rb
CHANGED
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
str = <<-EOH
|
4
|
+
# dmidecode 2.12
|
5
|
+
SMBIOS 2.4 present.
|
6
|
+
10 structures occupying 326 bytes.
|
7
|
+
Table at 0x000F1EF0.
|
8
|
+
|
9
|
+
Handle 0x0000, DMI type 0, 24 bytes
|
10
|
+
BIOS Information
|
11
|
+
Vendor: Seabios
|
12
|
+
Version: 0.5.1
|
13
|
+
Release Date: 01/01/2011
|
14
|
+
Address: 0xE8000
|
15
|
+
Runtime Size: 96 kB
|
16
|
+
ROM Size: 64 kB
|
17
|
+
Characteristics:
|
18
|
+
BIOS characteristics not supported
|
19
|
+
Targeted content distribution is supported
|
20
|
+
BIOS Revision: 1.0
|
21
|
+
|
22
|
+
Handle 0x0100, DMI type 1, 27 bytes
|
23
|
+
System Information
|
24
|
+
Manufacturer: Red Hat
|
25
|
+
Product Name: KVM
|
26
|
+
Version: RHEL 7.0.0 PC (i440FX + PIIX, 1996)
|
27
|
+
Serial Number: Not Specified
|
28
|
+
UUID: 5E317344-67C8-42D1-BD62-8587C8532251
|
29
|
+
Wake-up Type: Power Switch
|
30
|
+
SKU Number: Not Specified
|
31
|
+
Family: Red Hat Enterprise Linux
|
32
|
+
|
33
|
+
Handle 0x0300, DMI type 3, 20 bytes
|
34
|
+
Chassis Information
|
35
|
+
Manufacturer: Bochs
|
36
|
+
Type: Other
|
37
|
+
Lock: Not Present
|
38
|
+
Version: Not Specified
|
39
|
+
Serial Number: Not Specified
|
40
|
+
Asset Tag: Not Specified
|
41
|
+
Boot-up State: Safe
|
42
|
+
Power Supply State: Safe
|
43
|
+
Thermal State: Safe
|
44
|
+
Security Status: Unknown
|
45
|
+
OEM Information: 0x00000000
|
46
|
+
Height: Unspecified
|
47
|
+
Number Of Power Cords: Unspecified
|
48
|
+
|
49
|
+
Handle 0x0401, DMI type 4, 32 bytes
|
50
|
+
Processor Information
|
51
|
+
Socket Designation: CPU 1
|
52
|
+
Type: Central Processor
|
53
|
+
Family: Other
|
54
|
+
Manufacturer: Bochs
|
55
|
+
ID: D3 06 00 00 FD FB 8B 07
|
56
|
+
Version: Not Specified
|
57
|
+
Voltage: Unknown
|
58
|
+
External Clock: Unknown
|
59
|
+
Max Speed: 2000 MHz
|
60
|
+
Current Speed: 2000 MHz
|
61
|
+
Status: Populated, Enabled
|
62
|
+
Upgrade: Other
|
63
|
+
L1 Cache Handle: Not Provided
|
64
|
+
L2 Cache Handle: Not Provided
|
65
|
+
L3 Cache Handle: Not Provided
|
66
|
+
|
67
|
+
Handle 0x1000, DMI type 16, 15 bytes
|
68
|
+
Physical Memory Array
|
69
|
+
Location: Other
|
70
|
+
Use: System Memory
|
71
|
+
Error Correction Type: Multi-bit ECC
|
72
|
+
Maximum Capacity: 512 MB
|
73
|
+
Error Information Handle: Not Provided
|
74
|
+
Number Of Devices: 1
|
75
|
+
|
76
|
+
Handle 0x1100, DMI type 17, 21 bytes
|
77
|
+
Memory Device
|
78
|
+
Array Handle: 0x1000
|
79
|
+
Error Information Handle: 0x0000
|
80
|
+
Total Width: 64 bits
|
81
|
+
Data Width: 64 bits
|
82
|
+
Size: 512 MB
|
83
|
+
Form Factor: DIMM
|
84
|
+
Set: None
|
85
|
+
Locator: DIMM 0
|
86
|
+
Bank Locator: Not Specified
|
87
|
+
Type: RAM
|
88
|
+
Type Detail: None
|
89
|
+
|
90
|
+
Handle 0x1300, DMI type 19, 15 bytes
|
91
|
+
Memory Array Mapped Address
|
92
|
+
Starting Address: 0x00000000000
|
93
|
+
Ending Address: 0x0001FFFFFFF
|
94
|
+
Range Size: 512 MB
|
95
|
+
Physical Array Handle: 0x1000
|
96
|
+
Partition Width: 1
|
97
|
+
|
98
|
+
Handle 0x1400, DMI type 20, 19 bytes
|
99
|
+
Memory Device Mapped Address
|
100
|
+
Starting Address: 0x00000000000
|
101
|
+
Ending Address: 0x0001FFFFFFF
|
102
|
+
Range Size: 512 MB
|
103
|
+
Physical Device Handle: 0x1100
|
104
|
+
Memory Array Mapped Address Handle: 0x1300
|
105
|
+
Partition Row Position: 1
|
106
|
+
|
107
|
+
Handle 0x2000, DMI type 32, 11 bytes
|
108
|
+
System Boot Information
|
109
|
+
Status: No errors detected
|
110
|
+
|
111
|
+
Handle 0x7F00, DMI type 127, 4 bytes
|
112
|
+
End Of Table
|
113
|
+
EOH
|
114
|
+
|
115
|
+
describe Specinfra::HostInventory::Virtualization do
|
116
|
+
virt = Specinfra::HostInventory::Virtualization.new(host_inventory)
|
117
|
+
let(:host_inventory) { nil }
|
118
|
+
it 'Docker Image should return :system => "docker"' do
|
119
|
+
allow(virt.backend).to receive(:run_command).with('ls /.dockerinit') do
|
120
|
+
CommandResult.new(:stdout => '/.dockerinit', :exit_status => 0)
|
121
|
+
end
|
122
|
+
# although there is most likely no dmidecode on a docker image
|
123
|
+
# this is to make sure the code is only reporting docker
|
124
|
+
allow(virt.backend).to receive(:run_command).with('ls /usr/sbin/dmidecode') do
|
125
|
+
CommandResult.new(:stdout => '/usr/sbin/dmidecode', :exit_status => 0)
|
126
|
+
end
|
127
|
+
allow(virt.backend).to receive(:run_command).with('dmidecode') do
|
128
|
+
CommandResult.new(:stdout => str, :exit_status => 0)
|
129
|
+
end
|
130
|
+
expect(virt.get).to include(
|
131
|
+
:system => 'docker'
|
132
|
+
)
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
str = <<-EOH
|
4
|
+
# dmidecode 2.12
|
5
|
+
SMBIOS 2.4 present.
|
6
|
+
10 structures occupying 326 bytes.
|
7
|
+
Table at 0x000F1EF0.
|
8
|
+
|
9
|
+
Handle 0x0000, DMI type 0, 24 bytes
|
10
|
+
BIOS Information
|
11
|
+
Vendor: Seabios
|
12
|
+
Version: 0.5.1
|
13
|
+
Release Date: 01/01/2011
|
14
|
+
Address: 0xE8000
|
15
|
+
Runtime Size: 96 kB
|
16
|
+
ROM Size: 64 kB
|
17
|
+
Characteristics:
|
18
|
+
BIOS characteristics not supported
|
19
|
+
Targeted content distribution is supported
|
20
|
+
BIOS Revision: 1.0
|
21
|
+
|
22
|
+
Handle 0x0100, DMI type 1, 27 bytes
|
23
|
+
System Information
|
24
|
+
Manufacturer: Red Hat
|
25
|
+
Product Name: KVM
|
26
|
+
Version: RHEL 7.0.0 PC (i440FX + PIIX, 1996)
|
27
|
+
Serial Number: Not Specified
|
28
|
+
UUID: 5E317344-67C8-42D1-BD62-8587C8532251
|
29
|
+
Wake-up Type: Power Switch
|
30
|
+
SKU Number: Not Specified
|
31
|
+
Family: Red Hat Enterprise Linux
|
32
|
+
|
33
|
+
Handle 0x0300, DMI type 3, 20 bytes
|
34
|
+
Chassis Information
|
35
|
+
Manufacturer: Bochs
|
36
|
+
Type: Other
|
37
|
+
Lock: Not Present
|
38
|
+
Version: Not Specified
|
39
|
+
Serial Number: Not Specified
|
40
|
+
Asset Tag: Not Specified
|
41
|
+
Boot-up State: Safe
|
42
|
+
Power Supply State: Safe
|
43
|
+
Thermal State: Safe
|
44
|
+
Security Status: Unknown
|
45
|
+
OEM Information: 0x00000000
|
46
|
+
Height: Unspecified
|
47
|
+
Number Of Power Cords: Unspecified
|
48
|
+
|
49
|
+
Handle 0x0401, DMI type 4, 32 bytes
|
50
|
+
Processor Information
|
51
|
+
Socket Designation: CPU 1
|
52
|
+
Type: Central Processor
|
53
|
+
Family: Other
|
54
|
+
Manufacturer: Bochs
|
55
|
+
ID: D3 06 00 00 FD FB 8B 07
|
56
|
+
Version: Not Specified
|
57
|
+
Voltage: Unknown
|
58
|
+
External Clock: Unknown
|
59
|
+
Max Speed: 2000 MHz
|
60
|
+
Current Speed: 2000 MHz
|
61
|
+
Status: Populated, Enabled
|
62
|
+
Upgrade: Other
|
63
|
+
L1 Cache Handle: Not Provided
|
64
|
+
L2 Cache Handle: Not Provided
|
65
|
+
L3 Cache Handle: Not Provided
|
66
|
+
|
67
|
+
Handle 0x1000, DMI type 16, 15 bytes
|
68
|
+
Physical Memory Array
|
69
|
+
Location: Other
|
70
|
+
Use: System Memory
|
71
|
+
Error Correction Type: Multi-bit ECC
|
72
|
+
Maximum Capacity: 512 MB
|
73
|
+
Error Information Handle: Not Provided
|
74
|
+
Number Of Devices: 1
|
75
|
+
|
76
|
+
Handle 0x1100, DMI type 17, 21 bytes
|
77
|
+
Memory Device
|
78
|
+
Array Handle: 0x1000
|
79
|
+
Error Information Handle: 0x0000
|
80
|
+
Total Width: 64 bits
|
81
|
+
Data Width: 64 bits
|
82
|
+
Size: 512 MB
|
83
|
+
Form Factor: DIMM
|
84
|
+
Set: None
|
85
|
+
Locator: DIMM 0
|
86
|
+
Bank Locator: Not Specified
|
87
|
+
Type: RAM
|
88
|
+
Type Detail: None
|
89
|
+
|
90
|
+
Handle 0x1300, DMI type 19, 15 bytes
|
91
|
+
Memory Array Mapped Address
|
92
|
+
Starting Address: 0x00000000000
|
93
|
+
Ending Address: 0x0001FFFFFFF
|
94
|
+
Range Size: 512 MB
|
95
|
+
Physical Array Handle: 0x1000
|
96
|
+
Partition Width: 1
|
97
|
+
|
98
|
+
Handle 0x1400, DMI type 20, 19 bytes
|
99
|
+
Memory Device Mapped Address
|
100
|
+
Starting Address: 0x00000000000
|
101
|
+
Ending Address: 0x0001FFFFFFF
|
102
|
+
Range Size: 512 MB
|
103
|
+
Physical Device Handle: 0x1100
|
104
|
+
Memory Array Mapped Address Handle: 0x1300
|
105
|
+
Partition Row Position: 1
|
106
|
+
|
107
|
+
Handle 0x2000, DMI type 32, 11 bytes
|
108
|
+
System Boot Information
|
109
|
+
Status: No errors detected
|
110
|
+
|
111
|
+
Handle 0x7F00, DMI type 127, 4 bytes
|
112
|
+
End Of Table
|
113
|
+
EOH
|
114
|
+
|
115
|
+
describe Specinfra::HostInventory::Virtualization do
|
116
|
+
virt = Specinfra::HostInventory::Virtualization.new(host_inventory)
|
117
|
+
let(:host_inventory) { nil }
|
118
|
+
it 'Debian Jessie on KVM should return :system => "kvm"' do
|
119
|
+
allow(virt.backend).to receive(:run_command).with('ls /.dockerinit') do
|
120
|
+
CommandResult.new(:stdout => '', :exit_status => 2)
|
121
|
+
end
|
122
|
+
allow(virt.backend).to receive(:run_command).with('ls /usr/sbin/dmidecode') do
|
123
|
+
CommandResult.new(:stdout => '/usr/sbin/dmidecode', :exit_status => 0)
|
124
|
+
end
|
125
|
+
allow(virt.backend).to receive(:run_command).with('dmidecode') do
|
126
|
+
CommandResult.new(:stdout => str, :exit_status => 0)
|
127
|
+
end
|
128
|
+
expect(virt.get).to include(
|
129
|
+
:system => 'kvm'
|
130
|
+
)
|
131
|
+
end
|
132
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.37.
|
4
|
+
version: 2.37.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|
@@ -484,6 +484,8 @@ files:
|
|
484
484
|
- spec/host_inventory/linux/cpu_spec.rb
|
485
485
|
- spec/host_inventory/linux/filesystem_spec.rb
|
486
486
|
- spec/host_inventory/linux/memory_spec.rb
|
487
|
+
- spec/host_inventory/linux/virtualization_docker_spec.rb
|
488
|
+
- spec/host_inventory/linux/virtualization_kvm_spec.rb
|
487
489
|
- spec/host_inventory/openbsd/filesystem_spec.rb
|
488
490
|
- spec/host_inventory/solaris/filesystem_spec.rb
|
489
491
|
- spec/spec_helper.rb
|
@@ -565,7 +567,8 @@ test_files:
|
|
565
567
|
- spec/host_inventory/linux/cpu_spec.rb
|
566
568
|
- spec/host_inventory/linux/filesystem_spec.rb
|
567
569
|
- spec/host_inventory/linux/memory_spec.rb
|
570
|
+
- spec/host_inventory/linux/virtualization_docker_spec.rb
|
571
|
+
- spec/host_inventory/linux/virtualization_kvm_spec.rb
|
568
572
|
- spec/host_inventory/openbsd/filesystem_spec.rb
|
569
573
|
- spec/host_inventory/solaris/filesystem_spec.rb
|
570
574
|
- spec/spec_helper.rb
|
571
|
-
has_rdoc:
|