mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-22 23:23:30 -06:00
a1f260d021
The dnssec and secrets subpackages and the p11helper module depend on ipaplatform. Move them to ipaserver as they are used only on the server. https://fedorahosted.org/freeipa/ticket/6474 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
42 lines
985 B
Python
42 lines
985 B
Python
#
|
|
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
|
|
#
|
|
"""
|
|
Test the `ipaserver/dnssec` package.
|
|
"""
|
|
import dns.name
|
|
|
|
from ipaserver.dnssec.odsmgr import ODSZoneListReader
|
|
|
|
|
|
ZONELIST_XML = """<?xml version="1.0" encoding="UTF-8"?>
|
|
<ZoneList>
|
|
<Zone name="ipa.example">
|
|
<Policy>default</Policy>
|
|
<Adapters>
|
|
<Input>
|
|
<Adapter type="File">/var/lib/ipa/dns/zone/entryUUID/12345</Adapter>
|
|
</Input>
|
|
<Output>
|
|
<Adapter type="File">/var/lib/ipa/dns/zone/entryUUID/12345</Adapter>
|
|
</Output>
|
|
</Adapters>
|
|
</Zone>
|
|
</ZoneList>
|
|
"""
|
|
|
|
|
|
def test_ods_zonelist_reader():
|
|
uuid = '12345'
|
|
name = dns.name.from_text('ipa.example.')
|
|
|
|
reader = ODSZoneListReader("<ZoneList/>")
|
|
assert reader.mapping == {}
|
|
assert reader.names == set()
|
|
assert reader.uuids == set()
|
|
|
|
reader = ODSZoneListReader(ZONELIST_XML)
|
|
assert reader.mapping == {uuid: name}
|
|
assert reader.names == {name}
|
|
assert reader.uuids == {uuid}
|