Repos with recipes to deploy some infrastructure services
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  1. debian_os = ['debian', 'ubuntu']
  2. rhel_os = ['redhat', 'centos']
  3. def test_distribution(host):
  4. assert host.system_info.distribution.lower() in debian_os + rhel_os
  5. def test_repo_pinning_file(host):
  6. if host.system_info.distribution.lower() in debian_os:
  7. f = host.file('/etc/apt/preferences.d/pdns')
  8. assert f.exists
  9. assert f.user == 'root'
  10. assert f.group == 'root'
  11. f.contains('Package: pdns-*')
  12. f.contains('Pin: origin repo.powerdns.com')
  13. f.contains('Pin-Priority: 600')
  14. def test_package(host):
  15. p = None
  16. if host.system_info.distribution.lower() in debian_os:
  17. p = host.package('pdns-server')
  18. if host.system_info.distribution.lower() in rhel_os:
  19. p = host.package('pdns')
  20. assert p.is_installed
  21. def test_service(host):
  22. # Using Ansible to mitigate some issues with the service test on debian-8
  23. s = host.ansible('service', 'name=pdns state=started enabled=yes')
  24. assert s["changed"] is False
  25. def systemd_override(host):
  26. smgr = host.ansible("setup")["ansible_facts"]["ansible_service_mgr"]
  27. if smgr == 'systemd':
  28. fname = '/etc/systemd/system/pdns.service.d/override.conf'
  29. f = host.file(fname)
  30. assert f.exists
  31. assert f.user == 'root'
  32. assert f.group == 'root'
  33. assert 'LimitCORE=infinity' in f.content