File tree Expand file tree Collapse file tree 4 files changed +49
-16
lines changed
test/integration/share/libraries Expand file tree Collapse file tree 4 files changed +49
-16
lines changed Original file line number Diff line number Diff line change 1010# you will need to provide at least an empty dict in this file, e.g.
1111# osfingermap: {}
1212---
13- # # os: Debian
14- # Squeeze
15- Debian-6 :
16- libvirt_pkg : libvirt-bin
17- libvirt_service : libvirt-bin
18-
19- # Jessie
20- Debian-8 :
21- libvirt_pkg : libvirt-bin
22-
23-
2413# # os: Ubuntu
25- # Trusty
26- Ubuntu-14.04 :
27- libvirt_pkg : libvirt-bin
28- libvirt_service : libvirt-bin
2914# Xenial
3015Ubuntu-16.04 :
3116 libvirt_pkg : libvirt-bin
Original file line number Diff line number Diff line change @@ -32,6 +32,26 @@ def daemon_config_dir
3232 end
3333
3434 def daemon_config_file
35- inspec . file ( File . join ( daemon_config_dir , 'libvirtd' ) )
35+ inspec . file ( File . join ( daemon_config_dir , service_name ) )
36+ end
37+
38+ def service_name
39+ case inspec . os [ :name ]
40+ when 'ubuntu'
41+ service_name_ubuntu
42+
43+ else
44+ 'libvirtd'
45+ end
46+ end
47+
48+ def service_name_ubuntu
49+ case inspec . os [ :release ]
50+ when /^16/
51+ 'libvirt-bin'
52+
53+ else
54+ 'libvirtd'
55+ end
3656 end
3757end
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ def build_os_name_packages
5050 when 'centos'
5151 build_centos_packages
5252
53+ when 'ubuntu'
54+ build_ubuntu_packages
55+
5356 else
5457 { }
5558 end
@@ -115,4 +118,13 @@ def build_centos_packages
115118 { 'python' => [ 'python3-libvirt' ] }
116119 end
117120 end
121+
122+ def build_ubuntu_packages
123+ case inspec . os [ :release ]
124+ when /^16/
125+ { 'libvirt' => [ 'libvirt-bin' ] }
126+ else
127+ { }
128+ end
129+ end
118130end
Original file line number Diff line number Diff line change @@ -14,10 +14,26 @@ class LibvirtSocketAdminResource < Inspec.resource(1)
1414 supports platform_name : 'opensuse'
1515
1616 def initialize
17+ if skipped_platform?
18+ raise Inspec ::Exceptions ::ResourceSkipped , 'No admin socket on this platform'
19+ end
20+
1721 @file = inspec . file ( '/var/run/libvirt/libvirt-admin-sock' )
1822 @systemd_status = inspec . systemd_config ( 'libvirtd-admin.socket' )
1923 end
2024
25+ def skipped_platform?
26+ skipped_debian? || skipped_ubuntu?
27+ end
28+
29+ def skipped_debian?
30+ inspec . os [ :name ] == 'debian' && inspec . os [ :release ] . match ( /^8/ )
31+ end
32+
33+ def skipped_ubuntu?
34+ inspec . os [ :name ] == 'ubuntu' && inspec . os [ :release ] . match ( /^16/ )
35+ end
36+
2137 def config_owner
2238 if @systemd_status . active?
2339 @systemd_status . config ( 'SocketUser' ) || 'root'
You can’t perform that action at this time.
0 commit comments