test_spec.rb 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. require 'serverspec'
  2. # Required by serverspec
  3. set :backend, :exec
  4. describe package('fastd') do
  5. it { should be_installed }
  6. end
  7. # Ansible seems to have problems to enable a service. Needs investigation
  8. #describe service('fastd') do
  9. # it { should be_enabled }
  10. #end
  11. describe package('rng-tools') do
  12. it { should be_installed }
  13. end
  14. describe file('/etc/default/rng-tools') do
  15. it { should exist }
  16. its(:content) { should match /HRNGDEVICE=\/dev\/urandom/ }
  17. end
  18. describe user('fastd') do
  19. it { should exist }
  20. it { should have_login_shell '/bin/false' }
  21. end
  22. describe file('/etc/fastd/test') do
  23. it { should exist }
  24. it { should be_directory }
  25. end
  26. describe file('/etc/fastd/test/dummy') do
  27. it { should exist }
  28. it { should be_directory }
  29. end
  30. describe file('/etc/fastd/test/fastd.conf') do
  31. it { should exist }
  32. it { should be_file }
  33. end
  34. describe file('/etc/fastd/test/secret.conf') do
  35. it { should exist }
  36. it { should be_file }
  37. its(:content) { should contain 'secret "some secret";' }
  38. end