kanrisuru 0.3.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +13 -0
- data/lib/kanrisuru/command.rb +8 -3
- data/lib/kanrisuru/core.rb +6 -0
- data/lib/kanrisuru/core/apt.rb +6 -6
- data/lib/kanrisuru/core/dmi.rb +533 -0
- data/lib/kanrisuru/core/path.rb +0 -1
- data/lib/kanrisuru/core/socket.rb +16 -16
- data/lib/kanrisuru/core/system.rb +80 -0
- data/lib/kanrisuru/core/yum.rb +8 -8
- data/lib/kanrisuru/core/zypper.rb +1094 -0
- data/lib/kanrisuru/remote/cpu.rb +4 -0
- data/lib/kanrisuru/remote/fstab.rb +3 -3
- data/lib/kanrisuru/remote/host.rb +2 -2
- data/lib/kanrisuru/util.rb +1 -0
- data/lib/kanrisuru/util/bits.rb +3 -3
- data/lib/kanrisuru/util/dmi_type.rb +1366 -0
- data/lib/kanrisuru/util/os_family.rb +1 -1
- data/lib/kanrisuru/util/signal.rb +1 -1
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/core/apt_spec.rb +97 -158
- data/spec/functional/core/dmi_spec.rb +37 -0
- data/spec/functional/core/file_spec.rb +5 -12
- data/spec/functional/core/system_spec.rb +21 -0
- data/spec/functional/core/yum_spec.rb +38 -80
- data/spec/functional/core/zypper_spec.rb +193 -0
- data/spec/functional/remote/fstab_spec.rb +1 -1
- data/spec/functional/remote/os_spec.rb +1 -1
- data/spec/helper/test_hosts.rb +7 -1
- data/spec/unit/core/dmi_spec.rb +271 -0
- data/spec/unit/core/zypper_spec.rb +121 -0
- data/spec/unit/util_spec.rb +224 -0
- metadata +9 -2
@@ -0,0 +1,121 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Zypper do
|
6
|
+
it 'responds to zypper fields' do
|
7
|
+
expect(Kanrisuru::Core::Zypper::PACKAGE_TYPES).to(
|
8
|
+
eq(%w[package patch pattern product srcpackage application])
|
9
|
+
)
|
10
|
+
|
11
|
+
expect(Kanrisuru::Core::Zypper::PATCH_CATEGORIES).to(
|
12
|
+
eq(%w[security recommended optional feature document yast])
|
13
|
+
)
|
14
|
+
|
15
|
+
expect(Kanrisuru::Core::Zypper::PATCH_SEVERITIES).to(
|
16
|
+
eq(%w[critical important moderate low unspecified])
|
17
|
+
)
|
18
|
+
|
19
|
+
expect(Kanrisuru::Core::Zypper::SOLVER_FOCUS_MODES).to(
|
20
|
+
eq(%w[job installed update])
|
21
|
+
)
|
22
|
+
|
23
|
+
expect(Kanrisuru::Core::Zypper::MEDIUM_TYPES).to(
|
24
|
+
eq(%w[dir file cd dvd nfs iso http https ftp cifs smb hd])
|
25
|
+
)
|
26
|
+
|
27
|
+
expect(Kanrisuru::Core::Zypper::EXIT_INF_UPDATE_NEEDED).to(
|
28
|
+
eq(100)
|
29
|
+
)
|
30
|
+
|
31
|
+
expect(Kanrisuru::Core::Zypper::EXIT_INF_SEC_UPDATE_NEEDED).to(
|
32
|
+
eq(101)
|
33
|
+
)
|
34
|
+
|
35
|
+
expect(Kanrisuru::Core::Zypper::EXIT_INF_REBOOT_NEEDED).to(
|
36
|
+
eq(102)
|
37
|
+
)
|
38
|
+
|
39
|
+
expect(Kanrisuru::Core::Zypper::EXIT_INF_RESTART_NEEDED).to(
|
40
|
+
eq(103)
|
41
|
+
)
|
42
|
+
|
43
|
+
expect(Kanrisuru::Core::Zypper::EXIT_INF_CAP_NOT_FOUND).to(
|
44
|
+
eq(104)
|
45
|
+
)
|
46
|
+
|
47
|
+
expect(Kanrisuru::Core::Zypper::Repo.new).to respond_to(
|
48
|
+
:number,
|
49
|
+
:alias,
|
50
|
+
:name,
|
51
|
+
:enabled,
|
52
|
+
:gpg_check,
|
53
|
+
:refresh,
|
54
|
+
:priority,
|
55
|
+
:type,
|
56
|
+
:uri,
|
57
|
+
:service
|
58
|
+
)
|
59
|
+
expect(Kanrisuru::Core::Zypper::Service.new).to respond_to(
|
60
|
+
:number,
|
61
|
+
:alias,
|
62
|
+
:name,
|
63
|
+
:enabled,
|
64
|
+
:gpg_check,
|
65
|
+
:refresh,
|
66
|
+
:priority,
|
67
|
+
:type,
|
68
|
+
:uri
|
69
|
+
)
|
70
|
+
expect(Kanrisuru::Core::Zypper::SearchResult.new).to respond_to(
|
71
|
+
:repository,
|
72
|
+
:package,
|
73
|
+
:status,
|
74
|
+
:type,
|
75
|
+
:version,
|
76
|
+
:architecture
|
77
|
+
)
|
78
|
+
expect(Kanrisuru::Core::Zypper::PackageDetail.new).to respond_to(
|
79
|
+
:repository,
|
80
|
+
:package,
|
81
|
+
:version,
|
82
|
+
:architecture,
|
83
|
+
:vendor,
|
84
|
+
:support_level,
|
85
|
+
:install_size,
|
86
|
+
:installed,
|
87
|
+
:status,
|
88
|
+
:source_package,
|
89
|
+
:summary,
|
90
|
+
:description
|
91
|
+
)
|
92
|
+
expect(Kanrisuru::Core::Zypper::PackageUpdate.new).to respond_to(
|
93
|
+
:repository,
|
94
|
+
:package,
|
95
|
+
:current_version,
|
96
|
+
:available_version,
|
97
|
+
:architecture
|
98
|
+
)
|
99
|
+
expect(Kanrisuru::Core::Zypper::PatchUpdate.new).to respond_to(
|
100
|
+
:repository,
|
101
|
+
:patch,
|
102
|
+
:category,
|
103
|
+
:severity,
|
104
|
+
:interactive,
|
105
|
+
:status,
|
106
|
+
:summary
|
107
|
+
)
|
108
|
+
expect(Kanrisuru::Core::Zypper::PatchCount.new).to respond_to(
|
109
|
+
:category,
|
110
|
+
:updatestack,
|
111
|
+
:patches
|
112
|
+
)
|
113
|
+
expect(Kanrisuru::Core::Zypper::Lock.new).to respond_to(
|
114
|
+
:number,
|
115
|
+
:name,
|
116
|
+
:matches,
|
117
|
+
:type,
|
118
|
+
:repository
|
119
|
+
)
|
120
|
+
end
|
121
|
+
end
|
data/spec/unit/util_spec.rb
CHANGED
@@ -84,6 +84,230 @@ RSpec.describe Kanrisuru::Util do
|
|
84
84
|
expect { Kanrisuru::Util::Bits.convert_bytes(100, :kilobytee, :kilobit) }.to raise_error(ArgumentError)
|
85
85
|
end
|
86
86
|
|
87
|
+
it 'translates signal from string to numeric' do
|
88
|
+
expect(Kanrisuru::Util::Signal['HUP']).to eq(1)
|
89
|
+
expect(Kanrisuru::Util::Signal['INT']).to eq(2)
|
90
|
+
expect(Kanrisuru::Util::Signal['QUIT']).to eq(3)
|
91
|
+
expect(Kanrisuru::Util::Signal['ILL']).to eq(4)
|
92
|
+
expect(Kanrisuru::Util::Signal['TRAP']).to eq(5)
|
93
|
+
expect(Kanrisuru::Util::Signal['ABRT']).to eq(6)
|
94
|
+
expect(Kanrisuru::Util::Signal['BUS']).to eq(7)
|
95
|
+
expect(Kanrisuru::Util::Signal['FPE']).to eq(8)
|
96
|
+
expect(Kanrisuru::Util::Signal['KILL']).to eq(9)
|
97
|
+
expect(Kanrisuru::Util::Signal['USR1']).to eq(10)
|
98
|
+
expect(Kanrisuru::Util::Signal['SEGV']).to eq(11)
|
99
|
+
expect(Kanrisuru::Util::Signal['USR2']).to eq(12)
|
100
|
+
expect(Kanrisuru::Util::Signal['PIPE']).to eq(13)
|
101
|
+
expect(Kanrisuru::Util::Signal['ALRM']).to eq(14)
|
102
|
+
expect(Kanrisuru::Util::Signal['TERM']).to eq(15)
|
103
|
+
expect(Kanrisuru::Util::Signal['STKFLT']).to eq(16)
|
104
|
+
expect(Kanrisuru::Util::Signal['CHLD']).to eq(17)
|
105
|
+
expect(Kanrisuru::Util::Signal['CONT']).to eq(18)
|
106
|
+
expect(Kanrisuru::Util::Signal['STOP']).to eq(19)
|
107
|
+
expect(Kanrisuru::Util::Signal['TSTP']).to eq(20)
|
108
|
+
expect(Kanrisuru::Util::Signal['TTIN']).to eq(21)
|
109
|
+
expect(Kanrisuru::Util::Signal['TTOU']).to eq(22)
|
110
|
+
expect(Kanrisuru::Util::Signal['URG']).to eq(23)
|
111
|
+
expect(Kanrisuru::Util::Signal['XCPU']).to eq(24)
|
112
|
+
expect(Kanrisuru::Util::Signal['XFSZ']).to eq(25)
|
113
|
+
expect(Kanrisuru::Util::Signal['VTALRM']).to eq(26)
|
114
|
+
expect(Kanrisuru::Util::Signal['PROF']).to eq(27)
|
115
|
+
expect(Kanrisuru::Util::Signal['WINCH']).to eq(28)
|
116
|
+
expect(Kanrisuru::Util::Signal['IO']).to eq(29)
|
117
|
+
expect(Kanrisuru::Util::Signal['PWR']).to eq(30)
|
118
|
+
expect(Kanrisuru::Util::Signal['SYS']).to eq(31)
|
119
|
+
expect(Kanrisuru::Util::Signal['RTMIN']).to eq(34)
|
120
|
+
expect(Kanrisuru::Util::Signal['RTMIN+1']).to eq(35)
|
121
|
+
expect(Kanrisuru::Util::Signal['RTMIN+2']).to eq(36)
|
122
|
+
expect(Kanrisuru::Util::Signal['RTMIN+3']).to eq(37)
|
123
|
+
expect(Kanrisuru::Util::Signal['RTMIN+4']).to eq(38)
|
124
|
+
expect(Kanrisuru::Util::Signal['RTMIN+5']).to eq(39)
|
125
|
+
expect(Kanrisuru::Util::Signal['RTMIN+6']).to eq(40)
|
126
|
+
expect(Kanrisuru::Util::Signal['RTMIN+7']).to eq(41)
|
127
|
+
expect(Kanrisuru::Util::Signal['RTMIN+8']).to eq(42)
|
128
|
+
expect(Kanrisuru::Util::Signal['RTMIN+9']).to eq(43)
|
129
|
+
expect(Kanrisuru::Util::Signal['RTMIN+10']).to eq(44)
|
130
|
+
expect(Kanrisuru::Util::Signal['RTMIN+11']).to eq(45)
|
131
|
+
expect(Kanrisuru::Util::Signal['RTMIN+12']).to eq(46)
|
132
|
+
expect(Kanrisuru::Util::Signal['RTMIN+13']).to eq(47)
|
133
|
+
expect(Kanrisuru::Util::Signal['RTMIN+14']).to eq(48)
|
134
|
+
expect(Kanrisuru::Util::Signal['RTMIN+15']).to eq(49)
|
135
|
+
expect(Kanrisuru::Util::Signal['RTMAX-14']).to eq(50)
|
136
|
+
expect(Kanrisuru::Util::Signal['RTMAX-13']).to eq(51)
|
137
|
+
expect(Kanrisuru::Util::Signal['RTMAX-12']).to eq(52)
|
138
|
+
expect(Kanrisuru::Util::Signal['RTMAX-11']).to eq(53)
|
139
|
+
expect(Kanrisuru::Util::Signal['RTMAX-10']).to eq(54)
|
140
|
+
expect(Kanrisuru::Util::Signal['RTMAX-9']).to eq(55)
|
141
|
+
expect(Kanrisuru::Util::Signal['RTMAX-8']).to eq(56)
|
142
|
+
expect(Kanrisuru::Util::Signal['RTMAX-7']).to eq(57)
|
143
|
+
expect(Kanrisuru::Util::Signal['RTMAX-6']).to eq(58)
|
144
|
+
expect(Kanrisuru::Util::Signal['RTMAX-5']).to eq(59)
|
145
|
+
expect(Kanrisuru::Util::Signal['RTMAX-4']).to eq(60)
|
146
|
+
expect(Kanrisuru::Util::Signal['RTMAX-3']).to eq(61)
|
147
|
+
expect(Kanrisuru::Util::Signal['RTMAX-2']).to eq(62)
|
148
|
+
expect(Kanrisuru::Util::Signal['RTMAX-1']).to eq(63)
|
149
|
+
expect(Kanrisuru::Util::Signal['RTMAX']).to eq(64)
|
150
|
+
end
|
151
|
+
|
152
|
+
it 'translates signal from numeric to string' do
|
153
|
+
expect(Kanrisuru::Util::Signal[1]).to eq('HUP')
|
154
|
+
expect(Kanrisuru::Util::Signal[2]).to eq('INT')
|
155
|
+
expect(Kanrisuru::Util::Signal[3]).to eq('QUIT')
|
156
|
+
expect(Kanrisuru::Util::Signal[4]).to eq('ILL')
|
157
|
+
expect(Kanrisuru::Util::Signal[5]).to eq('TRAP')
|
158
|
+
expect(Kanrisuru::Util::Signal[6]).to eq('ABRT')
|
159
|
+
expect(Kanrisuru::Util::Signal[7]).to eq('BUS')
|
160
|
+
expect(Kanrisuru::Util::Signal[8]).to eq('FPE')
|
161
|
+
expect(Kanrisuru::Util::Signal[9]).to eq('KILL')
|
162
|
+
expect(Kanrisuru::Util::Signal[10]).to eq('USR1')
|
163
|
+
expect(Kanrisuru::Util::Signal[11]).to eq('SEGV')
|
164
|
+
expect(Kanrisuru::Util::Signal[12]).to eq('USR2')
|
165
|
+
expect(Kanrisuru::Util::Signal[13]).to eq('PIPE')
|
166
|
+
expect(Kanrisuru::Util::Signal[14]).to eq('ALRM')
|
167
|
+
expect(Kanrisuru::Util::Signal[15]).to eq('TERM')
|
168
|
+
expect(Kanrisuru::Util::Signal[16]).to eq('STKFLT')
|
169
|
+
expect(Kanrisuru::Util::Signal[17]).to eq('CHLD')
|
170
|
+
expect(Kanrisuru::Util::Signal[18]).to eq('CONT')
|
171
|
+
expect(Kanrisuru::Util::Signal[19]).to eq('STOP')
|
172
|
+
expect(Kanrisuru::Util::Signal[20]).to eq('TSTP')
|
173
|
+
expect(Kanrisuru::Util::Signal[21]).to eq('TTIN')
|
174
|
+
expect(Kanrisuru::Util::Signal[22]).to eq('TTOU')
|
175
|
+
expect(Kanrisuru::Util::Signal[23]).to eq('URG')
|
176
|
+
expect(Kanrisuru::Util::Signal[24]).to eq('XCPU')
|
177
|
+
expect(Kanrisuru::Util::Signal[25]).to eq('XFSZ')
|
178
|
+
expect(Kanrisuru::Util::Signal[26]).to eq('VTALRM')
|
179
|
+
expect(Kanrisuru::Util::Signal[27]).to eq('PROF')
|
180
|
+
expect(Kanrisuru::Util::Signal[28]).to eq('WINCH')
|
181
|
+
expect(Kanrisuru::Util::Signal[29]).to eq('IO')
|
182
|
+
expect(Kanrisuru::Util::Signal[30]).to eq('PWR')
|
183
|
+
expect(Kanrisuru::Util::Signal[31]).to eq('SYS')
|
184
|
+
expect(Kanrisuru::Util::Signal[34]).to eq('RTMIN')
|
185
|
+
expect(Kanrisuru::Util::Signal[35]).to eq('RTMIN+1')
|
186
|
+
expect(Kanrisuru::Util::Signal[36]).to eq('RTMIN+2')
|
187
|
+
expect(Kanrisuru::Util::Signal[37]).to eq('RTMIN+3')
|
188
|
+
expect(Kanrisuru::Util::Signal[38]).to eq('RTMIN+4')
|
189
|
+
expect(Kanrisuru::Util::Signal[39]).to eq('RTMIN+5')
|
190
|
+
expect(Kanrisuru::Util::Signal[40]).to eq('RTMIN+6')
|
191
|
+
expect(Kanrisuru::Util::Signal[41]).to eq('RTMIN+7')
|
192
|
+
expect(Kanrisuru::Util::Signal[42]).to eq('RTMIN+8')
|
193
|
+
expect(Kanrisuru::Util::Signal[43]).to eq('RTMIN+9')
|
194
|
+
expect(Kanrisuru::Util::Signal[44]).to eq('RTMIN+10')
|
195
|
+
expect(Kanrisuru::Util::Signal[45]).to eq('RTMIN+11')
|
196
|
+
expect(Kanrisuru::Util::Signal[46]).to eq('RTMIN+12')
|
197
|
+
expect(Kanrisuru::Util::Signal[47]).to eq('RTMIN+13')
|
198
|
+
expect(Kanrisuru::Util::Signal[48]).to eq('RTMIN+14')
|
199
|
+
expect(Kanrisuru::Util::Signal[49]).to eq('RTMIN+15')
|
200
|
+
expect(Kanrisuru::Util::Signal[50]).to eq('RTMAX-14')
|
201
|
+
expect(Kanrisuru::Util::Signal[51]).to eq('RTMAX-13')
|
202
|
+
expect(Kanrisuru::Util::Signal[52]).to eq('RTMAX-12')
|
203
|
+
expect(Kanrisuru::Util::Signal[53]).to eq('RTMAX-11')
|
204
|
+
expect(Kanrisuru::Util::Signal[54]).to eq('RTMAX-10')
|
205
|
+
expect(Kanrisuru::Util::Signal[55]).to eq('RTMAX-9')
|
206
|
+
expect(Kanrisuru::Util::Signal[56]).to eq('RTMAX-8')
|
207
|
+
expect(Kanrisuru::Util::Signal[57]).to eq('RTMAX-7')
|
208
|
+
expect(Kanrisuru::Util::Signal[58]).to eq('RTMAX-6')
|
209
|
+
expect(Kanrisuru::Util::Signal[59]).to eq('RTMAX-5')
|
210
|
+
expect(Kanrisuru::Util::Signal[60]).to eq('RTMAX-4')
|
211
|
+
expect(Kanrisuru::Util::Signal[61]).to eq('RTMAX-3')
|
212
|
+
expect(Kanrisuru::Util::Signal[62]).to eq('RTMAX-2')
|
213
|
+
expect(Kanrisuru::Util::Signal[63]).to eq('RTMAX-1')
|
214
|
+
expect(Kanrisuru::Util::Signal[64]).to eq('RTMAX')
|
215
|
+
end
|
216
|
+
|
217
|
+
it 'translates dmi types from string to integer' do
|
218
|
+
expect(Kanrisuru::Util::DmiType['BIOS']).to eq(0)
|
219
|
+
expect(Kanrisuru::Util::DmiType['System']).to eq(1)
|
220
|
+
expect(Kanrisuru::Util::DmiType['Baseboard']).to eq(2)
|
221
|
+
expect(Kanrisuru::Util::DmiType['Chassis']).to eq(3)
|
222
|
+
expect(Kanrisuru::Util::DmiType['Processor']).to eq(4)
|
223
|
+
expect(Kanrisuru::Util::DmiType['Memory Controller']).to eq(5)
|
224
|
+
expect(Kanrisuru::Util::DmiType['Memory Module']).to eq(6)
|
225
|
+
expect(Kanrisuru::Util::DmiType['Cache']).to eq(7)
|
226
|
+
expect(Kanrisuru::Util::DmiType['Port Connector']).to eq(8)
|
227
|
+
expect(Kanrisuru::Util::DmiType['System Slots']).to eq(9)
|
228
|
+
expect(Kanrisuru::Util::DmiType['On Board Devices']).to eq(10)
|
229
|
+
expect(Kanrisuru::Util::DmiType['OEM Strings']).to eq(11)
|
230
|
+
expect(Kanrisuru::Util::DmiType['System Configuration Options']).to eq(12)
|
231
|
+
expect(Kanrisuru::Util::DmiType['BIOS Language']).to eq(13)
|
232
|
+
expect(Kanrisuru::Util::DmiType['Group Associations']).to eq(14)
|
233
|
+
expect(Kanrisuru::Util::DmiType['System Event Log']).to eq(15)
|
234
|
+
expect(Kanrisuru::Util::DmiType['Physical Memory Array']).to eq(16)
|
235
|
+
expect(Kanrisuru::Util::DmiType['Memory Device']).to eq(17)
|
236
|
+
expect(Kanrisuru::Util::DmiType['32-bit Memory Error']).to eq(18)
|
237
|
+
expect(Kanrisuru::Util::DmiType['Memory Array Mapped Address']).to eq(19)
|
238
|
+
expect(Kanrisuru::Util::DmiType['Memory Device Mapped Address']).to eq(20)
|
239
|
+
expect(Kanrisuru::Util::DmiType['Built-in Pointing Device']).to eq(21)
|
240
|
+
expect(Kanrisuru::Util::DmiType['Portable Battery']).to eq(22)
|
241
|
+
expect(Kanrisuru::Util::DmiType['System Reset']).to eq(23)
|
242
|
+
expect(Kanrisuru::Util::DmiType['Hardware Security']).to eq(24)
|
243
|
+
expect(Kanrisuru::Util::DmiType['System Power Controls']).to eq(25)
|
244
|
+
expect(Kanrisuru::Util::DmiType['Voltage Probe']).to eq(26)
|
245
|
+
expect(Kanrisuru::Util::DmiType['Cooling Device']).to eq(27)
|
246
|
+
expect(Kanrisuru::Util::DmiType['Temperature Probe']).to eq(28)
|
247
|
+
expect(Kanrisuru::Util::DmiType['Electrical Current Probe']).to eq(29)
|
248
|
+
expect(Kanrisuru::Util::DmiType['Out-of-band Remote Access']).to eq(30)
|
249
|
+
expect(Kanrisuru::Util::DmiType['Boot Integrity Services']).to eq(31)
|
250
|
+
expect(Kanrisuru::Util::DmiType['System Boot']).to eq(32)
|
251
|
+
expect(Kanrisuru::Util::DmiType['64-bit Memory Error']).to eq(33)
|
252
|
+
expect(Kanrisuru::Util::DmiType['Management Device']).to eq(34)
|
253
|
+
expect(Kanrisuru::Util::DmiType['Management Device Component']).to eq(35)
|
254
|
+
expect(Kanrisuru::Util::DmiType['Management Device Threshold Data']).to eq(36)
|
255
|
+
expect(Kanrisuru::Util::DmiType['Memory Channel']).to eq(37)
|
256
|
+
expect(Kanrisuru::Util::DmiType['IPMI Device']).to eq(38)
|
257
|
+
expect(Kanrisuru::Util::DmiType['System Power Supply']).to eq(39)
|
258
|
+
expect(Kanrisuru::Util::DmiType['Additional Information']).to eq(40)
|
259
|
+
expect(Kanrisuru::Util::DmiType['Onboard Devices Extended Information']).to eq(41)
|
260
|
+
expect(Kanrisuru::Util::DmiType['Management Controller Host Interface']).to eq(42)
|
261
|
+
expect(Kanrisuru::Util::DmiType['TPM Device']).to eq(43)
|
262
|
+
end
|
263
|
+
|
264
|
+
it 'translates dmi types from integer to string' do
|
265
|
+
expect(Kanrisuru::Util::DmiType[0]).to eq('BIOS')
|
266
|
+
expect(Kanrisuru::Util::DmiType[1]).to eq('System')
|
267
|
+
expect(Kanrisuru::Util::DmiType[2]).to eq('Baseboard')
|
268
|
+
expect(Kanrisuru::Util::DmiType[3]).to eq('Chassis')
|
269
|
+
expect(Kanrisuru::Util::DmiType[4]).to eq('Processor')
|
270
|
+
expect(Kanrisuru::Util::DmiType[5]).to eq('Memory Controller')
|
271
|
+
expect(Kanrisuru::Util::DmiType[6]).to eq('Memory Module')
|
272
|
+
expect(Kanrisuru::Util::DmiType[7]).to eq('Cache')
|
273
|
+
expect(Kanrisuru::Util::DmiType[8]).to eq('Port Connector')
|
274
|
+
expect(Kanrisuru::Util::DmiType[9]).to eq('System Slots')
|
275
|
+
expect(Kanrisuru::Util::DmiType[10]).to eq('On Board Devices')
|
276
|
+
expect(Kanrisuru::Util::DmiType[11]).to eq('OEM Strings')
|
277
|
+
expect(Kanrisuru::Util::DmiType[12]).to eq('System Configuration Options')
|
278
|
+
expect(Kanrisuru::Util::DmiType[13]).to eq('BIOS Language')
|
279
|
+
expect(Kanrisuru::Util::DmiType[14]).to eq('Group Associations')
|
280
|
+
expect(Kanrisuru::Util::DmiType[15]).to eq('System Event Log')
|
281
|
+
expect(Kanrisuru::Util::DmiType[16]).to eq('Physical Memory Array')
|
282
|
+
expect(Kanrisuru::Util::DmiType[17]).to eq('Memory Device')
|
283
|
+
expect(Kanrisuru::Util::DmiType[18]).to eq('32-bit Memory Error')
|
284
|
+
expect(Kanrisuru::Util::DmiType[19]).to eq('Memory Array Mapped Address')
|
285
|
+
expect(Kanrisuru::Util::DmiType[20]).to eq('Memory Device Mapped Address')
|
286
|
+
expect(Kanrisuru::Util::DmiType[21]).to eq('Built-in Pointing Device')
|
287
|
+
expect(Kanrisuru::Util::DmiType[22]).to eq('Portable Battery')
|
288
|
+
expect(Kanrisuru::Util::DmiType[23]).to eq('System Reset')
|
289
|
+
expect(Kanrisuru::Util::DmiType[24]).to eq('Hardware Security')
|
290
|
+
expect(Kanrisuru::Util::DmiType[25]).to eq('System Power Controls')
|
291
|
+
expect(Kanrisuru::Util::DmiType[26]).to eq('Voltage Probe')
|
292
|
+
expect(Kanrisuru::Util::DmiType[27]).to eq('Cooling Device')
|
293
|
+
expect(Kanrisuru::Util::DmiType[28]).to eq('Temperature Probe')
|
294
|
+
expect(Kanrisuru::Util::DmiType[29]).to eq('Electrical Current Probe')
|
295
|
+
expect(Kanrisuru::Util::DmiType[30]).to eq('Out-of-band Remote Access')
|
296
|
+
expect(Kanrisuru::Util::DmiType[31]).to eq('Boot Integrity Services')
|
297
|
+
expect(Kanrisuru::Util::DmiType[32]).to eq('System Boot')
|
298
|
+
expect(Kanrisuru::Util::DmiType[33]).to eq('64-bit Memory Error')
|
299
|
+
expect(Kanrisuru::Util::DmiType[34]).to eq('Management Device')
|
300
|
+
expect(Kanrisuru::Util::DmiType[35]).to eq('Management Device Component')
|
301
|
+
expect(Kanrisuru::Util::DmiType[36]).to eq('Management Device Threshold Data')
|
302
|
+
expect(Kanrisuru::Util::DmiType[37]).to eq('Memory Channel')
|
303
|
+
expect(Kanrisuru::Util::DmiType[38]).to eq('IPMI Device')
|
304
|
+
expect(Kanrisuru::Util::DmiType[39]).to eq('System Power Supply')
|
305
|
+
expect(Kanrisuru::Util::DmiType[40]).to eq('Additional Information')
|
306
|
+
expect(Kanrisuru::Util::DmiType[41]).to eq('Onboard Devices Extended Information')
|
307
|
+
expect(Kanrisuru::Util::DmiType[42]).to eq('Management Controller Host Interface')
|
308
|
+
expect(Kanrisuru::Util::DmiType[43]).to eq('TPM Device')
|
309
|
+
end
|
310
|
+
|
87
311
|
it 'converts power' do
|
88
312
|
expect(Kanrisuru::Util::Bits.convert_power(:deca, :deca)).to eq(0)
|
89
313
|
expect(Kanrisuru::Util::Bits.convert_power(:deca, :kilo)).to eq(-1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanrisuru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mammina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/kanrisuru/core/apt.rb
|
135
135
|
- lib/kanrisuru/core/archive.rb
|
136
136
|
- lib/kanrisuru/core/disk.rb
|
137
|
+
- lib/kanrisuru/core/dmi.rb
|
137
138
|
- lib/kanrisuru/core/file.rb
|
138
139
|
- lib/kanrisuru/core/find.rb
|
139
140
|
- lib/kanrisuru/core/group.rb
|
@@ -147,6 +148,7 @@ files:
|
|
147
148
|
- lib/kanrisuru/core/transfer.rb
|
148
149
|
- lib/kanrisuru/core/user.rb
|
149
150
|
- lib/kanrisuru/core/yum.rb
|
151
|
+
- lib/kanrisuru/core/zypper.rb
|
150
152
|
- lib/kanrisuru/logger.rb
|
151
153
|
- lib/kanrisuru/mode.rb
|
152
154
|
- lib/kanrisuru/os_package.rb
|
@@ -163,6 +165,7 @@ files:
|
|
163
165
|
- lib/kanrisuru/template.rb
|
164
166
|
- lib/kanrisuru/util.rb
|
165
167
|
- lib/kanrisuru/util/bits.rb
|
168
|
+
- lib/kanrisuru/util/dmi_type.rb
|
166
169
|
- lib/kanrisuru/util/fs_mount_opts.rb
|
167
170
|
- lib/kanrisuru/util/os_family.rb
|
168
171
|
- lib/kanrisuru/util/signal.rb
|
@@ -170,6 +173,7 @@ files:
|
|
170
173
|
- spec/functional/core/apt_spec.rb
|
171
174
|
- spec/functional/core/archive_spec.rb
|
172
175
|
- spec/functional/core/disk_spec.rb
|
176
|
+
- spec/functional/core/dmi_spec.rb
|
173
177
|
- spec/functional/core/file_spec.rb
|
174
178
|
- spec/functional/core/find_spec.rb
|
175
179
|
- spec/functional/core/group_spec.rb
|
@@ -182,6 +186,7 @@ files:
|
|
182
186
|
- spec/functional/core/transfer_spec.rb
|
183
187
|
- spec/functional/core/user_spec.rb
|
184
188
|
- spec/functional/core/yum_spec.rb
|
189
|
+
- spec/functional/core/zypper_spec.rb
|
185
190
|
- spec/functional/os_package_spec.rb
|
186
191
|
- spec/functional/remote/cluster_spec.rb
|
187
192
|
- spec/functional/remote/cpu_spec.rb
|
@@ -194,6 +199,8 @@ files:
|
|
194
199
|
- spec/helper/test_hosts.rb
|
195
200
|
- spec/hosts.json
|
196
201
|
- spec/spec_helper.rb
|
202
|
+
- spec/unit/core/dmi_spec.rb
|
203
|
+
- spec/unit/core/zypper_spec.rb
|
197
204
|
- spec/unit/fstab_spec.rb
|
198
205
|
- spec/unit/kanrisuru_spec.rb
|
199
206
|
- spec/unit/mode_spec.rb
|