From ee13da77d35442b4f83068b24a2bc03f744177c5 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 9 Aug 2022 16:17:32 -0700 Subject: [PATCH] (TESTING) debian tftp path --- spec/acceptance/discovery_spec.rb | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/spec/acceptance/discovery_spec.rb b/spec/acceptance/discovery_spec.rb index d10d3ba2..5abaab87 100644 --- a/spec/acceptance/discovery_spec.rb +++ b/spec/acceptance/discovery_spec.rb @@ -1,6 +1,19 @@ require 'spec_helper_acceptance' describe 'Scenario: install foreman-proxy with discovery plugin' do + root = case host_inventory['facter']['os']['name'] + when 'Debian' + '/srv/tftp' + when 'Ubuntu' + if host_inventory['facter']['os']['release']['major'].to_f >= 20.04 + '/srv/tftp' + else + '/var/lib/tftpboot' + end + else + '/var/lib/tftpboot' + end + before(:context) { purge_foreman_proxy } context 'without params' do @@ -23,11 +36,11 @@ end %w[ - /var/lib/tftpboot/boot/fdi-image-latest.tar - /var/lib/tftpboot/boot/fdi-image/initrd0.img - /var/lib/tftpboot/boot/fdi-image/vmlinuz0 + /boot/fdi-image-latest.tar + /boot/fdi-image/initrd0.img + /boot/fdi-image/vmlinuz0 ].each do |f| - describe file(f) do + describe file(File.join(root, f)) do it { is_expected.to be_file } it { is_expected.to be_owned_by 'foreman-proxy' } it { is_expected.to be_grouped_into 'foreman-proxy' } @@ -35,7 +48,7 @@ end end - describe file('/var/lib/tftpboot/boot/fdi-image') do + describe file(File.join(root, '/boot/fdi-image')) do it { is_expected.to be_directory } it { is_expected.to be_owned_by 'foreman-proxy' } it { is_expected.to be_grouped_into 'foreman-proxy' }