test_spec.rb 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 package('rng-tools') do
  21. it { should be_installed }
  22. end
  23. describe file('/etc/default/rng-tools') do
  24. it { should exist }
  25. its(:content) { should match /HRNGDEVICE=\/dev\/urandom/ }
  26. end
  27. describe user('fastd') do
  28. it { should exist }
  29. it { should have_login_shell '/bin/false' }
  30. end
  31. describe file('/etc/fastd/test') do
  32. it { should exist }
  33. it { should be_directory }
  34. end
  35. describe file('/etc/fastd/test/dummy') do
  36. it { should exist }
  37. it { should be_directory }
  38. end
  39. describe file('/etc/fastd/test/fastd.conf') do
  40. it { should exist }
  41. it { should be_file }
  42. end
  43. describe file('/etc/fastd/test/secret.conf') do
  44. it { should exist }
  45. it { should be_file }
  46. its(:content) { should contain 'secret "280088c4263359417e9f2daf1771db820ab79eb4f79e3718719b2a976e8a8b5e";' }
  47. end
  48. describe package('batctl') do
  49. it {should be_installed }
  50. end
  51. describe kernel_module('batman_adv') do
  52. it { should be_loaded }
  53. end
  54. describe package('bird') do
  55. it { should be_installed }
  56. end
  57. describe file('/etc/bird/bird.conf') do
  58. it { should exist }
  59. its(:content) { should contain 'router id 10.233.8.1;' }
  60. end
  61. describe file('/etc/bird/bird6.conf') do
  62. it { should exist }
  63. its(:content) { should contain 'router id 10.233.8.1;' }
  64. end
  65. #describe service('bird') do
  66. # it { should be_running }
  67. # it { should be_enabled }
  68. #end
  69. #describe service('bird6') do
  70. # it { should be_running }
  71. # it { should be_enabled }
  72. #end
  73. describe interface('meshdummy0') do
  74. it { should exist }
  75. end