dhcpkit.tests.common.privileges.test_privileges module

Test whether the common privilege functions work as intended

class dhcpkit.tests.common.privileges.test_privileges.PrivilegeTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

static get_nobody() → pwd.struct_passwd[source]
static get_somebody() → pwd.struct_passwd[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_drop_privileges_not_necessary()[source]
test_drop_privileges_with_restore()[source]
test_restore_privileges_as_effective_other()[source]
test_restore_privileges_as_non_root()[source]
test_restore_privileges_as_root()[source]