def test_some_groups3_uid(some_groups3): """Test "some" scope with group list and getpwuid""" ent.assert_each_passwd_by_uid({ 1001: dict(name="user1", uid=1001, shell="/bin/sh1"), 1002: dict(name="user2", uid=1002, shell="/bin/sh2"), 1003: dict(name="user3", uid=1003, shell="/bin/sh3"), 1004: dict(name="user4", uid=1004, shell=config.SESSION_RECORDING_SHELL), })
def test_some_groups_overridden4_uid(some_groups_overridden3): """ Test "some" scope with group list containing some overridden group, and users requested with getpwuid. """ ent.assert_each_passwd_by_uid({ 1001: dict(name="user1", uid=1001, shell=config.SESSION_RECORDING_SHELL), 1002: dict(name="user2", uid=1002, shell="/bin/sh2"), 1003: dict(name="user3", uid=1003, shell="/bin/sh3"), 1004: dict(name="user4", uid=1004, shell="/bin/sh4"), })
def test_all_uid(all): """Test "all" scope with getpwuid""" ent.assert_each_passwd_by_uid({ 1001: dict(name="user1", uid=1001, shell=config.SESSION_RECORDING_SHELL), 1002: dict(name="user2", uid=1002, shell=config.SESSION_RECORDING_SHELL), 1003: dict(name="user3", uid=1003, shell=config.SESSION_RECORDING_SHELL), 1004: dict(name="user4", uid=1004, shell=config.SESSION_RECORDING_SHELL), })
def test_some_groups4_uid(some_groups4): """Test "some" scope with group list and getpwuid""" ent.assert_each_passwd_by_uid({ 1001: dict(name="user1", uid=1001, shell=config.SESSION_RECORDING_SHELL), 1002: dict(name="user2", uid=1002, shell="/bin/sh2"), 1003: dict(name="user3", uid=1003, shell=config.SESSION_RECORDING_SHELL), 1004: dict(name="user4", uid=1004, shell="/bin/sh4"), })
def test_all_exclude_groups_uid(all_exclude_groups): """Test "all" scope with group list and getpwuid""" ent.assert_each_passwd_by_uid({ 1001: dict(name="user1", uid=1001, shell="/bin/sh1"), 1002: dict(name="user2", uid=1002, shell="/bin/sh2"), 1003: dict(name="user3", uid=1003, shell="/bin/sh3"), 1004: dict(name="user4", uid=1004, shell=config.SESSION_RECORDING_SHELL), })
def test_assert_each_passwd_by_uid(users_and_groups): ent.assert_each_passwd_by_uid({}) ent.assert_each_passwd_by_uid({1001: USER1}) ent.assert_each_passwd_by_uid(USER_UID_DICT) try: ent.assert_each_passwd_by_uid({1003: {}}) assert False except AssertionError as e: assert str(e) == "'getpwuid(): uid not found: 1003'" try: ent.assert_each_passwd_by_uid({1001: dict(uid=1002)}) assert False except AssertionError as e: assert str(e) == \ "user 1001 mismatch: 'uid' mismatch: 1002 != 1001"
def test_assert_each_passwd_by_uid(users_and_groups): ent.assert_each_passwd_by_uid({}) ent.assert_each_passwd_by_uid({1001:USER1}) ent.assert_each_passwd_by_uid(USER_UID_DICT) try: ent.assert_each_passwd_by_uid({1003:{}}) assert False except AssertionError, e: assert str(e) == "'getpwuid(): uid not found: 1003'"
def test_assert_each_passwd_by_uid(users_and_groups): ent.assert_each_passwd_by_uid({}) ent.assert_each_passwd_by_uid({1001: USER1}) ent.assert_each_passwd_by_uid(USER_UID_DICT) try: ent.assert_each_passwd_by_uid({1003: {}}) assert False except AssertionError, e: assert str(e) == "'getpwuid(): uid not found: 1003'"
assert False except AssertionError, e: assert str(e) == \ "user 'user1' mismatch: 'name' mismatch: 'user2' != 'user1'" def test_assert_each_passwd_by_uid(users_and_groups): ent.assert_each_passwd_by_uid({}) ent.assert_each_passwd_by_uid({1001:USER1}) ent.assert_each_passwd_by_uid(USER_UID_DICT) try: ent.assert_each_passwd_by_uid({1003:{}}) assert False except AssertionError, e: assert str(e) == "'getpwuid(): uid not found: 1003'" try: ent.assert_each_passwd_by_uid({1001:dict(uid=1002)}) assert False except AssertionError, e: assert str(e) == \ "user 1001 mismatch: 'uid' mismatch: 1002 != 1001" def test_assert_each_passwd_with_name(users_and_groups): ent.assert_each_passwd_with_name([]) ent.assert_each_passwd_with_name([USER1]) ent.assert_each_passwd_with_name(USER_LIST) try: ent.assert_each_passwd_with_name([dict(name="user3")]) assert False except AssertionError, e: assert str(e) == "'getpwnam(): name not found: user3'" try:
except AssertionError, e: assert str(e) == \ "user 'user1' mismatch: 'name' mismatch: 'user2' != 'user1'" def test_assert_each_passwd_by_uid(users_and_groups): ent.assert_each_passwd_by_uid({}) ent.assert_each_passwd_by_uid({1001: USER1}) ent.assert_each_passwd_by_uid(USER_UID_DICT) try: ent.assert_each_passwd_by_uid({1003: {}}) assert False except AssertionError, e: assert str(e) == "'getpwuid(): uid not found: 1003'" try: ent.assert_each_passwd_by_uid({1001: dict(uid=1002)}) assert False except AssertionError, e: assert str(e) == \ "user 1001 mismatch: 'uid' mismatch: 1002 != 1001" def test_assert_each_passwd_with_name(users_and_groups): ent.assert_each_passwd_with_name([]) ent.assert_each_passwd_with_name([USER1]) ent.assert_each_passwd_with_name(USER_LIST) try: ent.assert_each_passwd_with_name([dict(name="user3")]) assert False except AssertionError, e: assert str(e) == "'getpwnam(): name not found: user3'"