File tree Expand file tree Collapse file tree
lib/facter/resolvers/linux
spec/facter/resolvers/linux Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ def read_environ(fact_name)
5252 vm = 'podman'
5353 when 'crio'
5454 vm = 'crio'
55+ when 'oci'
56+ vm = 'oci'
5557 when 'zone'
5658 return nil
5759 when 'systemd-nspawn'
Original file line number Diff line number Diff line change 9292 end
9393 end
9494
95+ context 'when hypervisor is oci and it is discovered by environ' do
96+ let ( :cgroup_output ) { load_fixture ( 'cgroup_file' ) . read }
97+ let ( :environ_output ) { [ 'container=oci' ] }
98+ let ( :result ) { { oci : { } } }
99+
100+ it 'return oci for vm' do
101+ expect ( containers_resolver . resolve ( :vm ) ) . to eq ( 'oci' )
102+ end
103+
104+ it 'return oci info for hypervisor' do
105+ expect ( containers_resolver . resolve ( :hypervisor ) ) . to eq ( result )
106+ end
107+ end
108+
95109 context 'when hypervisor is illumos' do
96110 let ( :cgroup_output ) { nil }
97111 let ( :environ_output ) { [ 'container=zone' ] }
You can’t perform that action at this time.
0 commit comments