specinfra 2.88.1 → 2.88.2

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
  SHA256:
3
- metadata.gz: 2dff075bae4d6b20fa9332f60a6bd8e6da8d68dd7c6fb42e5d43d4a86f2d4b7d
4
- data.tar.gz: 7703a50eddfa431bc02f8b84e10dbf88bd6065b5f50b4c7264114da23e9a1d6f
3
+ metadata.gz: 48bd86bb191af636b611f48c76a248d5171bc0d54573fa7af8063ed6c43aa7ce
4
+ data.tar.gz: 249f7068c068d8ce33dea8388408e34eacafe48efe1c3df97392ba91b975ee62
5
5
  SHA512:
6
- metadata.gz: dfec33e4e99f8cd09444db43371ab805c50d588cd66787e3c37d8a2631d15141fd9fb91f9fde6b8a2a223374ab49d0bc4f3709b4d7a0f1059bd7005b134b1c63
7
- data.tar.gz: 1a23d2c920e4b8fd5f05826c8a80b3bb1c3053025c1d3e4d8d81500ebb4bb360037e0819bd9c81e037d360533dc97bdd9c7ae1a52fac3f9d3c71bec3d8ad93fd
6
+ metadata.gz: fd3e32a0d9f7157a131436dfb0d28f83cd4937ff01af7bde937c03ef11fe035af03f379d646f456810d5af2b7f404531e87c7a072fa1a06741624bd7b2e20f8d
7
+ data.tar.gz: c3daafc7d09fcdd4e665fc8c794a3e61b8267ca7a0b38edf1f6c34d290f80f23cdde69bd56dd49bbeab373e82880cfc40afd8459fe58f6fc33454cd16def6aef
@@ -17,8 +17,8 @@ module Specinfra
17
17
 
18
18
  cmd = backend.command.get(:get_inventory_system_product_name)
19
19
  ret = backend.run_command(cmd)
20
- if ret.exit_status == 0 and ret.stdout.length > 0
21
- res[:system] = parse_system_product_name(ret.stdout)
20
+ if ret.success? and (parsed = parse_system_product_name(ret.stdout))
21
+ res[:system] = parsed
22
22
  return res
23
23
  end
24
24
 
@@ -1,5 +1,5 @@
1
1
  module Specinfra
2
- VERSION = "2.88.1"
2
+ VERSION = "2.88.2"
3
3
 
4
4
  def self.ruby_is_older_than?(*version)
5
5
  (RUBY_VERSION.split('.').map(&:to_i) <=> version) < 0
@@ -25,6 +25,22 @@ describe Specinfra::HostInventory::Virtualization do
25
25
  expect(virt.get).to include(:system => 'openvz')
26
26
  end
27
27
 
28
+ it 'Debian on QEMU KVM should return :system => "kvm"' do
29
+ allow(virt.backend).to receive(:run_command).with('grep -Eqa \'docker(/|-[0-9a-f]+)\' /proc/1/cgroup||test -e /.dockerinit') do
30
+ CommandResult.new(:stdout => '', :exit_status => 1)
31
+ end
32
+ allow(virt.backend).to receive(:run_command).with('test -d /proc/vz -a ! -d /proc/bc') do
33
+ CommandResult.new(:stdout => '', :exit_status => 1)
34
+ end
35
+ allow(virt.backend).to receive(:run_command).with('dmidecode -s system-product-name') do
36
+ CommandResult.new(:stdout => "Standard PC (Q35 + ICH9, 2009)\n", :exit_status => 0)
37
+ end
38
+ allow(virt.backend).to receive(:run_command).with('systemd-detect-virt') do
39
+ CommandResult.new(:stdout => "kvm\n", :exit_status => 0)
40
+ end
41
+ expect(virt.get).to include(:system => 'kvm')
42
+ end
43
+
28
44
  let(:host_inventory) { nil }
29
45
  it 'Debian Jessie on KVM should return :system => "kvm"' do
30
46
  ret = virt.parse_system_product_name("KVM\n")
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.88.1
4
+ version: 2.88.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-10 00:00:00.000000000 Z
11
+ date: 2024-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp