test_spec.rb 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 port(10000) do
  18. it { should be_listening.with('udp6') }
  19. end
  20. describe port(10001) do
  21. it { should be_listening.with('udp6') }
  22. end
  23. describe package('rng-tools') do
  24. it { should be_installed }
  25. end
  26. describe file('/etc/default/rng-tools') do
  27. it { should exist }
  28. its(:content) { should match /HRNGDEVICE=\/dev\/urandom/ }
  29. end
  30. describe user('fastd') do
  31. it { should exist }
  32. it { should have_login_shell '/bin/false' }
  33. end
  34. describe package('batctl') do
  35. it {should be_installed }
  36. end
  37. describe kernel_module('batman_adv') do
  38. it { should be_loaded }
  39. end
  40. describe package('bird') do
  41. it { should be_installed }
  42. end
  43. describe file('/etc/bird/bird.conf') do
  44. it { should exist }
  45. its(:content) { should contain 'router id 10.233.8.1;' }
  46. end
  47. describe file('/etc/bird/bird6.conf') do
  48. it { should exist }
  49. its(:content) { should contain 'router id 10.233.8.1;' }
  50. end
  51. #describe service('bird') do
  52. # it { should be_running }
  53. # it { should be_enabled }
  54. #end
  55. #describe service('bird6') do
  56. # it { should be_running }
  57. # it { should be_enabled }
  58. #end
  59. describe interface('meshdummy0') do
  60. it { should exist }
  61. end