Repos with recipes to deploy some infrastructure services
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

44 wiersze
1.4 KiB

  1. debian_os = ['debian', 'ubuntu']
  2. rhel_os = ['redhat', 'centos']
  3. def test_package(host):
  4. p = host.package('pdns-backend-mysql')
  5. assert p.is_installed
  6. def test_config(host):
  7. with host.sudo():
  8. f = None
  9. if host.system_info.distribution.lower() in debian_os:
  10. f = host.file('/etc/powerdns/pdns.conf')
  11. if host.system_info.distribution.lower() in rhel_os:
  12. f = host.file('/etc/pdns/pdns.conf')
  13. dbname = host.check_output('hostname -s').replace('.', '_')
  14. assert f.exists
  15. assert 'launch+=gmysql' in f.content
  16. assert 'gmysql-host=mysql' in f.content
  17. assert 'gmysql-password=pdns' in f.content
  18. assert 'gmysql-dbname=' + dbname in f.content
  19. assert 'gmysql-user=pdns' in f.content
  20. def test_database_tables(host):
  21. dbname = host.check_output('hostname -s').replace('.', '_')
  22. cmd = host.run("mysql --user=\"pdns\" --password=\"pdns\" --host=\"mysql\" " +
  23. "--batch --skip-column-names " +
  24. "--execute=\"SELECT DISTINCT table_name FROM information_schema.columns WHERE table_schema = '%s'\"" % dbname)
  25. assert 'domains' in cmd.stdout
  26. assert 'records' in cmd.stdout
  27. assert 'supermasters' in cmd.stdout
  28. assert 'comments' in cmd.stdout
  29. assert 'domainmetadata' in cmd.stdout
  30. assert 'cryptokeys' in cmd.stdout
  31. assert 'tsigkeys' in cmd.stdout