Skip to content

Commit 25af7c3

Browse files
committed
factor #tftp_root out of spec/acceptance/netboot_spec.rb
As this lookup may have useful for other/future acceptance tests.
1 parent 41bbfba commit 25af7c3

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

spec/acceptance/netboot_spec.rb

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,7 @@
55

66
include_examples 'the example', 'tftp.pp'
77

8-
root = case host_inventory['facter']['os']['name']
9-
when 'Debian'
10-
'/srv/tftp'
11-
when 'Ubuntu'
12-
if host_inventory['facter']['os']['release']['major'].to_f >= 20.04
13-
'/srv/tftp'
14-
else
15-
'/var/lib/tftpboot'
16-
end
17-
else
18-
'/var/lib/tftpboot'
19-
end
20-
21-
describe file("#{root}/grub2/boot") do
8+
describe file("#{tftp_root}/grub2/boot") do
229
it { should be_symlink }
2310
it { should be_linked_to '../boot' }
2411
end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def tftp_root
2+
case host_inventory['facter']['os']['name']
3+
when 'Debian', 'Ubuntu'
4+
'/srv/tftp'
5+
else
6+
'/var/lib/tftpboot'
7+
end
8+
end

0 commit comments

Comments
 (0)