test_spec.rb 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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
  45. describe package('batctl') do
  46. it {should be_installed }
  47. end
  48. describe kernel_module('batman_adv') do
  49. it { should be_loaded }
  50. end
  51. describe package('bird') do
  52. it { should be_installed }
  53. end
  54. describe file('/etc/bird/bird.conf') do
  55. it { should exist }
  56. its(:content) { should contain 'router id 10.233.8.1;' }
  57. end
  58. describe file('/etc/bird/bird6.conf') do
  59. it { should exist }
  60. its(:content) { should contain 'router id 10.233.8.1;' }
  61. end
  62. #describe service('bird') do
  63. # it { should be_running }
  64. # it { should be_enabled }
  65. #end
  66. #describe service('bird6') do
  67. # it { should be_running }
  68. # it { should be_enabled }
  69. #end