import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('parameters-*-buster64') def test_lua_ldap_pin_and_version(host): """ Tests if lua-ldap package is not pinned to the backports repository. """ pin_configuration_file = host.file("/etc/apt/preferences.d/lua-ldap") lua_ldap = host.package("lua-ldap") assert not pin_configuration_file.exists assert "bpo" not in lua_ldap.version