debian_os = ['debian', 'ubuntu'] rhel_os = ['redhat', 'centos'] def test_repo_file(host): f = None if host.system_info.distribution.lower() in debian_os: f = host.file('/etc/apt/sources.list.d/powerdns-auth-41.list') if host.system_info.distribution.lower() in rhel_os: f = host.file('/etc/yum.repos.d/powerdns-auth-41.repo') assert f.exists assert f.user == 'root' assert f.group == 'root' def test_pdns_repo(host): f = None if host.system_info.distribution.lower() in debian_os: f = host.file('/etc/apt/sources.list.d/powerdns-auth-41.list') if host.system_info.distribution.lower() in rhel_os: f = host.file('/etc/yum.repos.d/powerdns-auth-41.repo') assert f.exists assert f.contains('auth-41') def test_pdns_version(host): cmd = host.run('/usr/sbin/pdns_server --version') assert 'PowerDNS Authoritative Server 4.1.' in cmd.stderr