test_spec.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_running }
  10. # it { should be_enabled }
  11. end
  12. # Detection of running service fails in Debian 7.8. Needs investigation.
  13. #describe service('rng-tools') do
  14. # it { should be_running }
  15. # it { should be_enabled }
  16. #end
  17. describe package('rng-tools') do
  18. it { should be_installed }
  19. end
  20. describe file('/etc/default/rng-tools') do
  21. it { should exist }
  22. its(:content) { should match /HRNGDEVICE=\/dev\/urandom/ }
  23. end
  24. describe user('fastd') do
  25. it { should exist }
  26. it { should have_login_shell '/bin/false' }
  27. end
  28. describe file('/etc/fastd/test') do
  29. it { should exist }
  30. it { should be_directory }
  31. end
  32. describe file('/etc/fastd/test/dummy') do
  33. it { should exist }
  34. it { should be_directory }
  35. end
  36. describe file('/etc/fastd/test/fastd.conf') do
  37. it { should exist }
  38. it { should be_file }
  39. end
  40. describe file('/etc/fastd/test/secret.conf') do
  41. it { should exist }
  42. it { should be_file }
  43. its(:content) { should contain 'secret "280088c4263359417e9f2daf1771db820ab79eb4f79e3718719b2a976e8a8b5e";' }
  44. end