summaryrefslogtreecommitdiff
path: root/python/samba/tests/credentials.py
AgeCommit message (Collapse)AuthorFilesLines
2017-03-29pycredentials: Add bindings for get_ntlm_response()Andrew Bartlett1-0/+21
This should make testing of SamLogon from python practical Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2017-03-10python: samba.tests.credentials: Python 3 compatible testsLumir Balhar1-9/+17
Port test of pycredentials to Python 3 compatible form. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-12-20tests/credentials.py: demonstrate the last 'username' line of ↵Stefan Metzmacher1-0/+50
creds.parse_file() beats other lines Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20tests/credentials.py: verify the new cli_credentials_parse_file() 'username' ↵Stefan Metzmacher1-0/+49
parsing Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20tests/credentials.py: add tests to verify realm/principal behaviour of ↵Stefan Metzmacher1-1/+49
cli_credentials_parse_string() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20auth/credentials: let cli_credentials_parse_string() always reset username ↵Stefan Metzmacher1-4/+4
and domain If cli_credentials_parse_string() is used we should no longer use any guessed values and need to make sure username and domain are reset if principal and realm are set. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20tests/credentials.py: add tests with a realm from smb.confStefan Metzmacher1-1/+16
As we don't want to create a new smb.conf file we just simulate it with "creds.set_realm(realm, credentials.UNINITIALISED)". That's basically the same as the cli_credentials_set_conf() behaviour if a realm is specified in the configuration. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20auth/credentials: handle situations without a configured (default) realmStefan Metzmacher1-5/+14
We should not have cli_credentials_get_realm() return "" without a configured (default) realm in smb.conf. Note that the existing tests with creds.get_realm() == lp.get("realm") also work with "" as string. At the same time we should never let cli_credentials_get_principal() return "@REALM.EXAMPLE.COM" nor "username@". If cli_credentials_parse_string() gets "OTHERDOMAIN\username" we must not use cli_credentials_get_realm() to generate a principal unless cli_credentials_get_domain() returns also "OTHERDOMAIN". What we need to do is using username@OTHERDOMAIN as principal, whild we still use cli_credentials_get_realm to get a default kdc, (which may route us to the correct kdc with WRONG_REALM messages). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20tests/credentials.py: add very simple test for py_creds_parse_fileStefan Metzmacher1-1/+23
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20tests/credentials.py: verify the difference of parse_string("someone") and ↵Stefan Metzmacher1-0/+10
parse_string("someone%") Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-20tests/credentials.py: add test for ↵Stefan Metzmacher1-2/+14
cli_credentials_set_password_will_be_nt_hash() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-11-07credentials: Add test for credentials behaviourAndrew Bartlett1-4/+100
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Mon Nov 7 03:51:11 CET 2016 on sn-devel-144
2016-11-06python: samba.tests.credentials: Add testsLumir Balhar1-0/+17
Newly tested functions: - set_utf16_password - set_old_password - get_old_password - set_old_utf16_password Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-11-06python: samba.tests.credentials: Fix DeprecationWarningLumir Balhar1-15/+15
For historical reasons, TestCase methods have some aliases which are deprecated since Python 2.7. Change "assertEquals" to the preferred name, "assertEqual". Deprecation notice: https://docs.python.org/2/library/unittest.html#deprecated-aliases Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-02Move python modules from source4/scripting/python/ to python/.Jelmer Vernooij1-0/+98
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 03:57:34 CET 2013 on sn-devel-104