summaryrefslogtreecommitdiff
path: root/python/samba/tests/pso.py
AgeCommit message (Collapse)AuthorFilesLines
2018-09-21python tests: fix format() strings for Python 2.6Douglas Bagnall1-11/+11
Python 2.6 wants "{0}".format(x), not "{}".format(x). Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-15python/samba/netcmd: PY3 fix test samba.tests.samba_tool.passwordsettingsNoel Power1-1/+1
2018-08-17Fix PEP8 warning E501 line too longTim Beale1-9/+11
Mostly involves splitting up long strings or comments so that they span multiple lines. Some place-holder variables have been added in a few places to avoid exceeding 80 chars. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-17Fix PEP8 warning E302 expected 2 blank linesTim Beale1-0/+2
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-17Fix PEP8 warning F401 'blah' imported but unusedTim Beale1-4/+1
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-17Fix PEP8 warning E225 missing whitespace around operatorTim Beale1-6/+6
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-17python/pso tests: use string .format() style rather than C-style %s/%d.Tim Beale1-14/+14
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-05-11tests: Add tests for Password Settings ObjectsTim Beale1-0/+271
a.k.a Fine-Grained Password Policies These tests currently all run and pass gainst Windows, but fail against Samba. (Actually, the permissions test case passes against Samba, presumably because it's enforced by the Schema permissions). Two helper classes have been added: - PasswordSettings: creates a PSO object and tracks its values. - TestUser: creates a user and tracks its password history This allows other existing tests (e.g. password_lockout, password_hash) to easily be extended to also cover PSOs. Most test cases use assert_PSO_applied(), which asserts: - the correct msDS-ResultantPSO attribute is returned - the PSO's min-password-length, complexity, and password-history settings are correctly enforced (this has been temporarily been hobbled until the basic constructed-attribute support is working). Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>