Skip to content

Commit

Permalink
Proper testing with tftp.socket service
Browse files Browse the repository at this point in the history
  • Loading branch information
dvo-rak authored Sep 21, 2023
1 parent 8030ed5 commit 64de477
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions spec/acceptance/tftp_port_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class { 'tftp':
it { is_expected.to be_running }
end

describe port(69), unless: service_name.end_with?('.socket') do
describe port(69) do
it { is_expected.not_to be_listening }
end

describe port(1234), unless: service_name.end_with?('.socket') do
it { is_expected.to be_listening.with('udp') }
describe port(1234) do
it { is_expected.to be_listening.with('udp').or be_listening.with('udp6') }
end

describe 'ensure tftp client is installed' do
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/tftp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class { 'tftp': }
it { is_expected.to be_running }
end

describe port(69), unless: service_name.end_with?('.socket') do
it { is_expected.to be_listening.with('udp') }
describe port(69) do
it { is_expected.to be_listening.with('udp').or be_listening.with('udp6') }
end

describe command("echo get /test /tmp/downloaded_file | tftp #{fact('fqdn')}") do
Expand Down
7 changes: 7 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
ensure => installed,
}
}

# without it "ss" command is not found and "port listening" tests fail
if $facts['os']['name'] == 'Fedora' {
package {'iproute':
ensure => installed,
}
}

0 comments on commit 64de477

Please sign in to comment.