univention.testing package

Subpackages

Submodules

univention.testing.codes module

Public interface for test resultes.

class univention.testing.codes.TestCodes[source]

Bases: object

Public interface for test resultes.

RESULT_OKAY = 0
RESULT_FAIL = 1
RESULT_SKIP = 77
MESSAGE = {130: 'Test failed', 131: 'Test skipped (wrong version)', 132: 'Test skipped (version too old)', 133: 'Test skipped (version too new)', 134: 'Test skipped (role mismatch)', 135: 'Test skipped (system not joined)', 136: 'Test skipped (system is joined)', 137: 'Test skipped (missing software)', 138: 'Test skipped (conflicting software)', 139: 'Test skipped (too dangerous)', 140: 'Test failed', 141: 'Test failed', 77: 'Test skipped', None: 'Test failed', 100: 'Test passed', 101: 'Test passed', 102: 'Test passed', 110: 'Test failed', 111: 'Test failed', 120: 'Test failed', 121: 'Test failed', 122: 'Test failed'}
COLOR = {130: 'RED', 131: 'BLUE', 132: 'BLUE', 133: 'BLUE', 134: 'BLUE', 135: 'BLUE', 136: 'BLUE', 137: 'BLUE', 138: 'BLUE', 139: 'BLUE', 140: 'RED', 141: 'RED', 77: 'BLUE', None: 'RED', 100: 'GREEN', 101: 'GREEN', 102: 'GREEN', 110: 'RED', 111: 'RED', 120: 'RED', 121: 'RED', 122: 'RED'}
EOFS = {0: 'O', 1: 'F', 130: 'S', 131: 'S', 132: 'S', 133: 'S', 134: 'S', 135: 'S', 136: 'S', 137: 'S', 138: 'S', 139: 'S', 140: 'E', 141: 'S', 77: 'S', None: 'E', 100: 'O', 101: 'O', 102: 'O', 110: 'F', 111: 'F', 120: 'F', 121: 'F', 122: 'E'}
MAX_MESSAGE_LEN = 35
REASON_ABORT = 141
REASON_DANGER = 139
REASON_FAIL = 110
REASON_FAIL_EXPECTED = 121
REASON_FAIL_TRANSIENT = 120
REASON_FAIL_UNEXPECTED = 111
REASON_FIXED_EXPECTED = 101
REASON_FIXED_UNEXPECTED = 102
REASON_IMMATURE = 130
REASON_INSTALL = 137
REASON_INSTALLED = 138
REASON_INTERNAL = 140
REASON_JOIN = 135
REASON_JOINED = 136
REASON_OKAY = 100
REASON_ROLE_MISMATCH = 134
REASON_SKIP = 77
REASON_UNAVAILABLE = 122
REASON_UNKNOWN = None
REASON_VERSION_MISMATCH = 131
REASON_VERSION_TOO_NEW = 133
REASON_VERSION_TOO_OLD = 132

univention.testing.connector_common module

univention.testing.coverage module

Code coverage measurement for ucs-test

class univention.testing.coverage.Coverage(options)[source]

Bases: object

COVERAGE_DEBUG = False
COVERAGE_DEBUG_PATH = '/tmp/ucs-test-coverage'
COVERAGE_PTH = '/usr/lib/python2.7/dist-packages/ucstest-coverage.pth'
COVERAGE_PTH_CONTENT = 'import univention.testing.coverage; univention.testing.coverage.Coverage.startup()'
coverage = None
classmethod debug_message(*messages)[source]
classmethod get_option_group(parser)[source]

The option group for ucs-test-framework

restart_python_services()[source]

Restart currently running python services, so that they start/stop measuring code

start()[source]

Start measuring of coverage. Only called by ucs-test-framework once. Sets up the configuration.

classmethod startup()[source]

Startup function which is invoked by every(!) python process during coverage measurement. If the process is relevant we start measuring coverage.

stop()[source]

Stop coverage measuring. Only called by ucs-test-framework once. Stores the results.

classmethod stop_measurement(start=False)[source]
write_config_file()[source]

Write a python .pth file which is invoked before any python process

class univention.testing.coverage.StopCoverageDecorator(method)[source]

Bases: object

inDecorator = False

univention.testing.data module

Test case, environment, result and related classes.

class univention.testing.data.TestEnvironment(interactive=True, logfile=None)[source]

Bases: object

Test environment for running test cases.

Handels system data, requirements checks, test output.

_load_apt()[source]

Load package informations.

_load_host()[source]

Load host system informations.

_load_join()[source]

Load join status.

_load_ucr()[source]

Load Univention Config Registry informations.

dump(stream=<open file '<stdout>', mode 'w'>)[source]

Dump environment informations.

logger = <celery.utils.log.ProcessAwareLogger object>
set_exposure(exposure)[source]

Set maximum allowed exposure level.

set_timeout(timeout)[source]

Set maximum allowed time for single test.

tag(require=set([]), ignore=set([]), prohibit=set([]))[source]

Update required, ignored, prohibited tags.

class univention.testing.data.TestCase[source]

Bases: object

Test case.

RE_NL = <_sre.SRE_Pattern object>
static _attach(result, part, content)[source]

Attach content.

_run_tee(proc, result, stdout=<open file '<stdout>', mode 'w'>, stderr=<open file '<stderr>', mode 'w'>)[source]

Run test collecting and passing through stdout, stderr:

static _terminate_proc(proc)[source]
_translate_result(result)[source]

Translate exit code into result.

check(environment)[source]

Check if the test case should run.

handle_shutdown(signal, _frame)[source]
load(filename)[source]

Load test case from stream.

logger = <celery.utils.log.ProcessAwareLogger object>
run(result)[source]

Run the test case and fill in result.

class univention.testing.data.TestResult(case, environment=None)[source]

Bases: object

Test result from running a test case.

attach(key, mime, content)[source]

Attach artifact ‘content’ of mime-type ‘mime’.

check()[source]

Test conditions to run test.

dump(stream=<open file '<stdout>', mode 'w'>)[source]

Dump test result data.

fail(reason=110)[source]

Mark result as failed.

run()[source]

Return test.

skip(reason=140)[source]

Mark result as skipped.

success(reason=100)[source]

Mark result as successful.

class univention.testing.data.TestFormatInterface(stream=<open file '<stdout>', mode 'w'>)[source]

Bases: object

Format UCS Test result.

begin_run(environment, count=1)[source]

Called before first test.

begin_section(section)[source]

Called before each section.

begin_test(case, prefix='')[source]

Called before each test.

end_run()[source]

Called after all test.

end_section()[source]

Called after each section.

end_test(result)[source]

Called after each test.

format(result)[source]

Format single test.

univention.testing.debian_package module

exception univention.testing.debian_package.BuildRuntimeError[source]

Bases: exceptions.RuntimeError

exception univention.testing.debian_package.InstallRuntimeError[source]

Bases: exceptions.RuntimeError

exception univention.testing.debian_package.UninstallRuntimeError[source]

Bases: exceptions.RuntimeError

class univention.testing.debian_package.DebianPackage(name='testdeb', version='1.0')[source]

Class to build simple debian packages

_create_debian_base_dir()[source]
get_package_name()[source]
get_temp_dir()[source]
get_binary_name()[source]
create_join_script_from_buffer(joinscript_name, joinscript_buffer)[source]
create_unjoin_script_from_buffer(unjoinscript_name, unjoinscript_buffer)[source]
create_usr_share_file_from_buffer(share_filename, schema_buffer)[source]
create_debian_file_from_buffer(debian_filename, debian_buffer)[source]
build()[source]
install()[source]
uninstall(purge=False)[source]
remove()[source]
_create_changelog()[source]
_create_control()[source]
_create_rules()[source]
_create_compat()[source]
_create_install()[source]
_DebianPackage__create_file_from_buffer(path, file_buffer)

univention.testing.decorators module

class univention.testing.decorators.WaitForNonzeroResultOrTimeout(func, timeout=90)[source]

Bases: object

class univention.testing.decorators.SetTimeout(func, timeout=90)[source]

Bases: object

univention.testing.decorators.setTimeout(func, timeout=90)[source]

univention.testing.errors module

UCS Test errors.

exception univention.testing.errors.TestError[source]

Bases: exceptions.Exception

General test error.

exception univention.testing.errors.TestConditionError[source]

Bases: exceptions.Exception

Error during prepaation for test.

tests

Return failed tests.

univention.testing.internal module

Internal functions for test finding and setup.

univention.testing.internal.setup_environment()[source]

Setup runtime environemnt.

univention.testing.internal.setup_debug(level)[source]

Setup Python logging.

univention.testing.internal.strip_indent(text)[source]

Strip common indent.

univention.testing.internal.get_sections()[source]

Return dictionary section-name -> section-directory.

univention.testing.internal.get_tests(sections)[source]

Return dictionary of section -> [filenames].

class univention.testing.internal.UCSVersion(ver)[source]

Bases: object

UCS version.

RE_VERSION = <_sre.SRE_Pattern object>
_CONVERTER = {'': <function <lambda>>, None: <function <lambda>>}
classmethod _parse(ver, default_op='=')[source]

Parse UCS-version range and return two-tuple (operator, version) >>> UCSVersion._parse(‘11.22’) (<built-in function eq>, (11, 22, None, None)) >>> UCSVersion._parse(‘11.22-33’) (<built-in function eq>, (11, 22, 33, None)) >>> UCSVersion._parse(‘11.22-33-44’) (<built-in function eq>, (11, 22, 33, 44)) >>> UCSVersion._parse(‘<1.2-3’) (<built-in function lt>, (1, 2, 3, None)) >>> UCSVersion._parse(‘<<1.2-3’) (<built-in function lt>, (1, 2, 3, None)) >>> UCSVersion._parse(‘<=1.2-3’) (<built-in function le>, (1, 2, 3, None)) >>> UCSVersion._parse(‘=1.2-3’) (<built-in function eq>, (1, 2, 3, None)) >>> UCSVersion._parse(‘==1.2-3’) (<built-in function eq>, (1, 2, 3, None)) >>> UCSVersion._parse(‘>=1.2-3’) (<built-in function ge>, (1, 2, 3, None)) >>> UCSVersion._parse(‘>>1.2-3’) (<built-in function gt>, (1, 2, 3, None)) >>> UCSVersion._parse(‘>1.2-3’) (<built-in function gt>, (1, 2, 3, None))

match(other)[source]

Check if other matches the criterion. >>> UCSVersion(‘>1.2-3’).match(UCSVersion(‘1.2-4’)) True >>> UCSVersion(‘>1.2-3’).match(UCSVersion(‘1.2-3-4’)) False >>> UCSVersion(‘>1.2-3-5’).match(UCSVersion(‘1.2-3-4’)) False

univention.testing.ldif module

This program compares LDAP host entries with a local comparative ldif file. All differences will be displayed at the console.

exception univention.testing.ldif.LdifError[source]

Bases: exceptions.Exception

Error in input processing.

class univention.testing.ldif.LdifFile(filename)[source]

Bases: univention.testing.ldif.LdifSource

LDIF source from local file.

classmethod create(arg, options)[source]
start_reading()[source]

Start reading the LDIF data.

class univention.testing.ldif.LdifSlapcat[source]

Bases: univention.testing.ldif.LdifSource

LDIF source from local LDAP.

classmethod create(arg, options)[source]
run_command()[source]

Run command to dump LDIF.

start_reading()[source]

Start reading the LDIF data.

class univention.testing.ldif.LdifSource[source]

Bases: object

Abstract class for LDIF source.

OPERATIONAL = frozenset(['entryCSN', 'creatorsName', 'entryUUID', 'modifiersName', 'createTimestamp', 'structuralObjectClass', 'modifyTimestamp'])
RE = <_sre.SRE_Pattern object>
next_line()[source]

Return line iterator.

split(line)[source]

Split attribute and value. Options are stripped. Base64 encoded values are decoded.

Parameters:line (str) – The line to split.
Returns:A tuple (name, value).
Return type:tuple
>>> LdifSource().split('')
>>> LdifSource().split('a:')
('a', None)
>>> LdifSource().split('a: b')
('a', 'b')
>>> LdifSource().split('a:: YWFh')
('a', 'aaa')
>>> LdifSource().split('a;b:c')
('a', 'c')
>>> LdifSource().split('a;b;c::YWFh')
('a', 'aaa')
class univention.testing.ldif.LdifSsh(hostname, ssh='ssh')[source]

Bases: univention.testing.ldif.LdifSlapcat

LDIF source from remote LDAP.

classmethod create(hostname, options)[source]
start_reading()[source]

Start reading the LDIF data.

wait_for_data()[source]

Wait for the remote process to send data.

>>> x=LdifSsh('', 'echo');x.start_reading();x.wait_for_data()
>>> x=LdifSsh('', 'false');x.start_reading();x.wait_for_data()
Traceback (most recent call last):
...
SlapError: ('Error executing', ('false', '', 'slapcat', '-d0'), 1)
exception univention.testing.ldif.SlapError[source]

Bases: exceptions.Exception

Error in slapcat processing.

univention.testing.ldif.__test(_option, _opt_str, _value, _parser)[source]

Run internal test suite.

univention.testing.ldif.commandline()[source]

Parse command line arguments.

univention.testing.ldif.compare_keys(ldata, rdata)[source]

Compare and return attributes of two LDAP objects.

Parameters:
  • ldata (dict) – the first LDAP object.
  • rdata (dict) – the second LDAP object.
Returns:

an iterator of differences as 3-tuples (comparison, key, value).

>>> list(compare_keys({}, {}))
[]
>>> list(compare_keys({'a': [1]}, {}))
[(-1, 'a', 1)]
>>> list(compare_keys({}, {'a': [1]}))
[(1, 'a', 1)]
>>> list(compare_keys({'a': [1]}, {'a': [1]}))
[(0, 'a', 1)]
>>> list(compare_keys({'a': [1]}, {'a': [2]}))
[(1, 'a', 2), (-1, 'a', 1)]
univention.testing.ldif.compare_ldif(lldif, rldif, options)[source]

Compare two LDIF files.

Parameters:
  • ldif1 (LdifSource) – first LDIF to compare.
  • ldif2 (LdifSource) – second LDIF to compare.
  • options (Namespace) – command line options.
univention.testing.ldif.compare_values(attr, lvalues, rvalues)[source]

Compare and return values of two multi-valued LDAP attributes.

Parameters:
  • lvalues (list) – the first values.
  • rvalues (list) – the second values.
Returns:

an iterator of differences as 3-tuples (comparison, key, value), where comparison<0 if key is missing in lvalues, comparison>0 if key is missing in rvalues, otherwise 0.

>>> list(compare_values('attr', [], []))
[]
>>> list(compare_values('attr', [1, 2], [2, 3]))
[(1, 'attr', 3), (0, 'attr', 2), (-1, 'attr', 1)]
univention.testing.ldif.main()[source]

A main()-method with options.

univention.testing.ldif.run_compare(ldif1, ldif2, options)[source]

UNIX correct error handling. Termination by signal is propagaed as signal.

Parameters:
  • ldif1 (LdifSource) – first LDIF to compare.
  • ldif2 (LdifSource) – second LDIF to compare.
  • options (Namespace) – command line options.
univention.testing.ldif.sort_dn(dname)[source]

Sort by reversed dn.

Parameters:dname (str) – distinguished name.
Returns:tuple of relative distinguised names.
Return type:tuple(tuple[str])
>>> sort_dn('a=1')
(('a=1',),)
>>> sort_dn('b=1,a=1')
(('a=1',), ('b=1',))
>>> sort_dn('b=2+a=1')
(('a=1', 'b=2'),)
univention.testing.ldif.stream2object(ldif)[source]

Convert LDIF stream to dictionary of objects.

Parameters:ldif (LdifSource) – A LDIF stream.
Returns:A dictionary mapping distinguished names to a dictionary of key-values.
Return type:dict(str, dict(str, list[str])
>>> stream2object([{'dn': ['dc=test']}])
{'dc=test': {}}

univention.testing.license_client module

A tool to obtain licenses for the UCS test environments.

exception univention.testing.license_client.CredentialsMissing[source]

Bases: exceptions.Exception

A custom exception to be raised when a ‘license.secret’ file is not found

class univention.testing.license_client.TestLicenseClient(ArgParser=None)[source]

Bases: HTMLParser.HTMLParser

Class constructor for the test license client and HTMLParser

setup_logging()[source]

Creates and configues the logger with an INFO level

create_connection()[source]

Creates a HTTPS Connection instance on a default port (443) to the ‘self.license_server_url’

close_connection()[source]

Closes the license server connection if the connection instance was created

get_server_password(secret_file='/etc/license.secret')[source]

Opens and reads the ‘secret_file’. Saves the result to a ‘self.server_password’

Makes a POST request with ‘self.server_username’ and ‘self.server_password’ into login forms and saves the cookie from the response received.

make_post_request(url, body, headers)[source]

Makes a POST request with the given ‘url’, ‘body’, ‘headers’ and returns the response

make_get_request(url, headers)[source]

Makes a GET request with the given ‘url’, ‘headers’ and returns the response

handle_starttag(tag, attrs)[source]

Method is called every time a new start tag is found in the html feed. When the link tag with ‘orders/’ attribute is found, the attribute is saved to ‘self.link_to_license’

get_the_license(body)[source]

Processes the given ‘body’ with HTMLParser to find the link to a created license file and downloads the license after.

order_a_license()[source]

Makes a POST request with encoded ‘self.license_params’ as a body to oreder a new license. Returns the response body.

download_license_file()[source]

Downloads the license located at ‘self.link_to_license’ and saves it to the file with a ‘self.license_filename’

check_date_format()[source]

Checks if the ‘EndDate’ format is correct.

update_with_parsed_args(args)[source]

Updates the loglevel and license filename settings if given among the parsed arguments. Merges parsed data with default license parameters.

process_cmd_arguments()[source]

Populates self.Parser class with positional and optional arguments and processes the user input, checks the date format and than merges it with the default values in the ‘self.license_params’ dictionary

main(base_dn='', end_date='', server_url='', license_file='')[source]

A method to order and download a test license from the license server. ‘base_dn’ and ‘end_date’ should be provided if argument parser is not used. ‘server_url’ is an optional argument for the license shop server. ‘license_file’ is an optional argument for the license filename.

univention.testing.mail module

class univention.testing.mail.MailSinkGuard[source]

Bases: object

This class is a simple context manager that stops all attached mail sinks if the context is left.

with MaiLSinkGuard() as msg:
sink = MailSink(......) msg.add(sink) ....use sink....
add(sink)[source]
class univention.testing.mail.MailSink(address, port, filename=None, target_dir=None, fqdn=None)[source]

Bases: object

This class starts an SMTP sink on the specified address/port. Each incoming mail will be written to a single file if target_dir is used. To write all incoming mails into one file, use filename.

>>> ms = MailSink('127.0.0.1', 12345, target_dir='/tmp/')
>>> ms.start()
<do some stuff>
>>> ms.stop()
>>> ms = MailSink('127.0.0.1', 12345, filename='/tmp/sinkfile.eml')
>>> ms.start()
<do some stuff>
>>> ms.stop()
>>> with MailSink('127.0.0.1', 12345, filename='/tmp/sinkfile.eml') as ms:
>>>     <do some stuff>
start()[source]
stop()[source]

univention.testing.network module

Networking helper that may establish connection redirection for testing network connections/configuration of different programs (e.g. postfix).

WARNING: The networking helper will install special iptables rules that may completely break routing from/to the test system. Especially if the test script does not clean up in error cases!

exception univention.testing.network.UCSTestNetwork[source]

Bases: exceptions.Exception

exception univention.testing.network.UCSTestNetworkCannotDetermineExternalAddress[source]

Bases: univention.testing.network.UCSTestNetwork

exception univention.testing.network.UCSTestNetworkCmdFailed[source]

Bases: univention.testing.network.UCSTestNetwork

exception univention.testing.network.UCSTestNetworkUnknownLoop[source]

Bases: univention.testing.network.UCSTestNetwork

exception univention.testing.network.UCSTestNetworkUnknownRedirection[source]

Bases: univention.testing.network.UCSTestNetwork

exception univention.testing.network.UCSTestNetworkNoWithStatement[source]

Bases: univention.testing.network.UCSTestNetwork

message = 'NetworkRedirector has to be used via with statement!'
exception univention.testing.network.UCSTestNetworkOnlyOneLoopSupported[source]

Bases: univention.testing.network.UCSTestNetwork

message = 'NetworkRedirector does support only ONE loop at a time!'
class univention.testing.network.NetworkRedirector[source]

Bases: object

The NetworkRedirector is able to establish port/connection redirections via iptables. It has to be used via the with-statement.

>>> with NetworkRedirector() as nethelper:
>>> nethelper.add_loop('1.2.3.4', '4.3.2.1')
>>> nethelper.add_redirection('1.1.1.1', 25, 60025)
>>> ...
>>> # the following lines are optional! NetworkRedirector does automatic cleanup!
>>> nethelper.remove_loop('1.2.3.4', '4.3.2.1')
>>> nethelper.remove_redirection('1.1.1.1', 25, 60025)

It is also possible to redirect all traffic to a specific port. The trailing “/0” is important, otherwise the redirection won’t work!

>>> nethelper.add_redirection('0.0.0.0/0', 25, 60025)
BIN_IPTABLES = '/sbin/iptables'
CMD_LIST_LOOP = [['/sbin/iptables', '-t', 'mangle', '%(action)s', 'OUTPUT', '-d', '%(addr1)s', '-j', 'TOS', '--set-tos', '0x04'], ['/sbin/iptables', '-t', 'nat', '%(action)s', 'OUTPUT', '-d', '%(addr1)s', '-j', 'DNAT', '--to-destination', '%(local_external_addr)s'], ['/sbin/iptables', '-t', 'nat', '%(action)s', 'POSTROUTING', '-m', 'tos', '--tos', '0x04', '-j', 'SNAT', '--to-source', '%(addr2)s'], ['/sbin/iptables', '-t', 'mangle', '%(action)s', 'OUTPUT', '-d', '%(addr2)s', '-j', 'TOS', '--set-tos', '0x08'], ['/sbin/iptables', '-t', 'nat', '%(action)s', 'OUTPUT', '-d', '%(addr2)s', '-j', 'DNAT', '--to-destination', '%(local_external_addr)s'], ['/sbin/iptables', '-t', 'nat', '%(action)s', 'POSTROUTING', '-m', 'tos', '--tos', '0x08', '-j', 'SNAT', '--to-source', '%(addr1)s']]
CMD_LIST_REDIRECTION = [['/sbin/iptables', '-t', 'nat', '%(action)s', 'OUTPUT', '-p', 'tcp', '-d', '%(remote_addr)s', '--dport', '%(remote_port)s', '-j', 'DNAT', '--to-destination', '127.0.0.1:%(local_port)s']]
revert_network_settings()[source]
run_commands(cmdlist, argdict, ignore_errors=False)[source]

Start all commands in cmdlist and replace formatstrings with arguments in argdict.

>>> run_commands([['/bin/echo', '%(msg)s'], ['/bin/echo', 'World']], {'msg': 'Hello'})
add_loop(addr1, addr2)[source]

Add connection loop for addr1 and addr2. Outgoing connections to addr1 will be redirected back to localhost. The redirected connection will appear as it comes from addr2. All outgoing traffic to addr2 will be also redirected back to localhost and will appear as it comes from addr1.

HINT: only one loop may be established at a time!

remove_loop(addr1, addr2, ignore_errors=False)[source]

Remove previously defined connection loop.

add_redirection(remote_addr, remote_port, local_port)[source]

Add new connection redirection.

Outgoing connections to <remote_addr>:<remote_port> will be redirected back to localhost:<local_port>.

remove_redirection(remote_addr, remote_port, local_port, ignore_errors=False)[source]

Remove previously defined connection redirection.

univention.testing.strings module

univention.testing.strings.random_string(length=10, alpha=True, numeric=True, charset=None, encoding='utf-8')[source]

Get specified number of random characters (ALPHA, NUMERIC or ALPHANUMERIC). Default is an alphanumeric string of 10 characters length. A custom character set may be defined via “charset” as string. The default encoding is UTF-8. If length is 0 or negative, an empty string is returned.

univention.testing.strings.random_name(length=10)[source]

create random name (1 ALPHA, 8 ALPHANUM, 1 ALPHA)

univention.testing.strings.random_name_special_characters(length=10)[source]

create random name (1 UMLAUT, 2 ALPHA, 6 SPECIAL_CHARACTERS + UMLAUT, 1 UMLAUTNUM)

univention.testing.strings.random_username(length=10)[source]
univention.testing.strings.random_groupname(length=10)[source]
univention.testing.strings.random_int(bottom_end=0, top_end=9)[source]
univention.testing.strings.random_version(elements=3)[source]
univention.testing.strings.random_ucs_version(min_major=1, max_major=9, min_minor=0, max_minor=99, min_patchlevel=0, max_patchlevel=99)[source]
univention.testing.strings.random_mac()[source]
class univention.testing.strings.IP_Iter[source]

Bases: object

next()[source]
univention.testing.strings.random_ip(ip_iter=<univention.testing.strings.IP_Iter object>)[source]
univention.testing.strings.random_nameserver()[source]

univention.testing.ucr module

BETA VERSION

Wrapper around Univention Configuration Registry that is able to revert the UCR status after usage. For usage examples look at the end of this file.

WARNING: changes to the ConfigRegistry object will also trigger the evaluation of templates and therefore changes in configuration files created by UCR!

WARNING2: The API is currently under development and may change before next UCS release!

class univention.testing.ucr.UCSTestConfigRegistry(*args, **kwargs)[source]

Bases: univention.config_registry.backend.ConfigRegistry

Extension to ConfigRegistry to be able to clean up after several changes to UCR variables have been done.

initialise object

load()[source]

call load() of superclass and save original registry values

revert_to_original_registry()[source]

revert UCR values back to original state

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 34
_abc_registry = <_weakrefset.WeakSet object>

univention.testing.ucs_samba module

univention.testing.udm module

univention.testing.udm_extensions module

univention.testing.umc module

class univention.testing.umc.Client(hostname=None, username=None, password=None, language=None, timeout=None, automatic_reauthentication=False)[source]

Bases: univention.lib.umc.Client

print_response = True
print_request_data = True
classmethod get_test_connection(hostname=None, *args, **kwargs)[source]
umc_command(*args, **kwargs)[source]
request(method, path, data=None, headers=None)[source]

univention.testing.utils module