summaryrefslogtreecommitdiff
path: root/python
Commit message (Collapse)AuthorAgeFilesLines
* Import UTC definition from utc8601 module.Jelmer Vernooij2015-03-062-24/+3
| | | | | | Change-Id: I3ccd81090c4721b161aff272100aa71bc2f17055 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Rename TestSkipped to Skiptest, consistent with Python 2.7.Jelmer Vernooij2015-03-064-13/+11
| | | | | | Change-Id: I023df54363328333f1cb6c3ae3c1a406befa8f7b Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Avoid importing TestCase and TestSkipped from testtools.Jelmer Vernooij2015-03-061-11/+8
| | | | | | Change-Id: I34488ddf253decd336a67a8634e7039096bdd160 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Set default testRunner rather than requiring the user pass it in.Jelmer Vernooij2015-03-061-2/+3
| | | | | | Change-Id: I8b5a5925030049975a83b090e5c7b76d5245c07d Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add RemoteTestCase and RemoteError to samba.subunit.Jelmer Vernooij2015-03-061-0/+59
| | | | | | Change-Id: Ib3946cf4eae69f53270a299660f6029290d3791a Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Use Samba-only subunit module in selftest/tests/.Jelmer Vernooij2015-03-062-19/+30
| | | | | | Change-Id: I48c61f975c1fa49f6e244ad39dd720fe507db45b Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix copyright headers for python/samba/subunit.Jelmer Vernooij2015-03-062-0/+22
| | | | | | Change-Id: I5b554051f23f31d20b4f4325debcd6717ba8369e Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* subunitrun: Use new samba.subunit.run module.Jelmer Vernooij2015-03-061-10/+2
| | | | | | Change-Id: I4a4d2237ec9ef090bf95a0ea57285610047451e5 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add simple subunit runner outputting subunit v1.Jelmer Vernooij2015-03-062-0/+750
| | | | | | | | | | This is a short module (< 1k lines) that removes the need to depend on subunit, testtools, extras and mimeparse. It is based on an extract from testtools and subunit. Change-Id: I0a4f3060b25f7bde602a07ed6bef71c8196fca64 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/devel: Add tool to roll over the krbtgt passwordAndrew Bartlett2015-02-251-0/+19
| | | | | | | | This may be handy if this key is compromised, or along with chgtdcpass to isolate test copies of production domains in such a way that they cannot mix. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* group.py: Fix wrong example option, remove wrong comment lineMarc Muehlfeld2015-02-171-2/+1
| | | | | | | | | Replaced "--gid" with the correct "--gid-number" in Example 3. Additionally removed the first comment line in group.py, which was wrong in that file. Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* rpc_talloc: Update instructions to use standard unittest runner.Jelmer Vernooij2015-02-171-1/+1
| | | | | | | Change-Id: Id90541b01073f1156ccba562ba750245aad091c2 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* samba-tool: Create NIS enabled users and unixHomeDirectory attributeMarc Muehlfeld2015-02-032-4/+39
| | | | | | | | | | | | | | | | | | | | Allow to create NIS enabled user accounts via 'samba-tool user add'. To create NIS enabled accounts, the parameters --uid-number=, --login-shell=, --unix-home=, --gid-number= are mandatory. Because we didn't had a parameter to set unixHomeDirectory yet, this patch also adds this feature. 'unixUserPassword: ABCD!efgh12345$67890' is added by default, when you enable NIS on an account in ADUC. The same we do in samba-tool. See: https://bugzilla.samba.org/show_bug.cgi?id=10909 Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Marc Muehlfeld <mmuehlfeld@samba.org> Autobuild-Date(master): Tue Feb 3 17:18:32 CET 2015 on sn-devel-104
* s4-dsdb-test: Implement samdb_connect_env() to rely solely on environmentKamen Mazdrashki2015-02-031-0/+21
| | | | | | | | | | | | | | | | | | | this is to help me port Python tests to be more Unit test alike and remove all global handling Starting from a new test suite - tombstone_reanimation.py Andrew Bartlett rose his concerns that passing parameters through environment may make tests hard to trace for failures. However, passing parameters on command line is not Unit test alike either. After discussing this with him offline, we agreed to continue this approach, but prefix environment variables with "TEST_". So that an env var should not be used by coincidence. Change-Id: I29445c42cdcafede3897c8dd1f1529222a74afc9 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-dsdb: Tests for security checks on undelete operationNadezhda Ivanova2015-02-031-4/+4
| | | | | | | | | | | Implemented according to MS-ADTS 3.1.1.5.3.7.1. Unfortunately it appears LC is also necessary, and it is not granted by default to anyone but System and Administrator, so tests had to be done negatively Signed-off-by: Nadezhda Ivanova <nivanova@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Change-Id: Ic03b8fc4e222e7842ec8a9645a1bb33e7df9c438
* s4-tests: Print out what the error is in delete_force()Kamen Mazdrashki2015-02-031-2/+2
| | | | | | | Change-Id: Iaa631179dc79fa756416be8eaf8c55e3b0c1a29f Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* python/samba/tests: don't lower case path names in connect_samdb()Stefan Metzmacher2015-02-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We should not lower case file names, because we may get a path to sam.ldb. Now we only lower case ldap urls. For a long time I got failing private autobuild like this: [1623(9233)/1718 at 1h28m9s] samba4.urgent_replication.python(dc)(dc:local) Failed to connect to ldap URL 'ldap:///memdisk/metze/w/b12985/samba/bin/ab/dc/private/sam.ldb' - LDAP client internal error: NT_STATUS_NO_MEMORY Failed to connect to 'ldap:///memdisk/metze/w/b12985/samba/bin/ab/dc/private/sam.ldb' with backend 'ldap': (null) UNEXPECTED(error): samba4.urgent_replication.python(dc).__main__.UrgentReplicationTests.test_attributeSchema_object(dc:local) REASON: _StringException: _StringException: Content-Type: text/x-traceback;charset=utf8,language=python traceback 322 The problem is that /memdisk/metze/W/ is my test directory instead of /memdisk/metze/w/. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* samba3.py: Correctly initialize cache directory for passdb testChristof Schmitt2015-01-161-0/+1
| | | | | | | | | | | | | | Running 'make test TESTS=tests.samba3' succeeds, but the log shows that it tried to open the gencache tdb in the wrong directory: Unable to create directory /usr/local/samba/var/cache for file gencache.tdb. Error was No such file or directory Fix this by correctly initializing the cache directory. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Jan 16 02:36:39 CET 2015 on sn-devel-104
* dns.py: Always remove the test zone in tearDown()Andrew Bartlett2014-12-221-0/+8
| | | | | | | | | | Change-Id: Ic6d6c51579f8859b4e396179123974382c253bf7 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Mon Dec 22 08:21:22 CET 2014 on sn-devel-104
* dns.py: Test dns server reload zones from DSDB when are created or deletedSamuel Cabrero2014-12-221-0/+78
| | | | | | | Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATHKamen Mazdrashki2014-12-081-1/+1
| | | | | | | | | | | A bit more specific for the caller to "know" that env key is missing Change-Id: I4d4c2121af868d79f46f865f420336222bc67347 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date(master): Mon Dec 8 05:27:34 CET 2014 on sn-devel-104
* Minor spelling correction in samba-tool domainDaniel Cotton2014-12-021-1/+1
| | | | | | | | | Signed-Off-By: Daniel Cotton <danielcotton.patches at gmail.com> Reviewed-By: Michael Adam <obnox@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Tue Dec 2 01:18:53 CET 2014 on sn-devel-104
* Reduce number of places where sys.path is (possibly) updated for external ↵Jelmer Vernooij2014-11-302-3/+3
| | | | | | | | | | | | module paths. Change-Id: I69d060f27ea090d14405e884d1ce271975358c56 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Sun Nov 30 20:54:04 CET 2014 on sn-devel-104
* samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"Guenter Kukkukk2014-11-261-5/+8
| | | | | | | | | | | | | Avoid hardcoded IP-strings, use standard python IP functions to format IPv4 and IPv6 addresses correctly. I have removed the display of the port number. MS-DNSP 2.2.3.2.2.1 DNS_ADDR: (from May 15, 2014) Port Number (2bytes): Senders MUST set this to zero, and receivers MUST ignore it. Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* samba-tool: Fix enum values in dns.pyGuenter Kukkukk2014-11-261-1/+1
| | | | | | | DNS_ZONE_UPDATE_SECURE was used twice, DNS_ZONE_UPDATE_UNSECURE was missing. Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* sec_descriptor test: Simplify, use samba.tests.subunitrun module.Jelmer Vernooij2014-11-221-0/+0
| | | | | | Change-Id: I4ffda49cf3e209eaa28fc83f6fd9ded47f0ad7ee Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Move option handling into samba.tests.subunitrun.Jelmer Vernooij2014-11-221-3/+8
| | | | | | Change-Id: I65a73b74854af636413f4f284147f3bcf28b6f82 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Move option parsing to samba.tests.subunitrun.Jelmer Vernooij2014-11-221-8/+19
| | | | | | Change-Id: I2939c1b6ebb9739530efa9bc4667668cff7a7aeb Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add convenience class for old-style Samba subunit python tests.Jelmer Vernooij2014-11-221-0/+59
| | | | | | Change-Id: I84a97cc71cfa99c14e0c93ec19ff9eea6149bb5a Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add samba.ensure_third_party_module() function, loading external python ↵Jelmer Vernooij2014-11-121-5/+30
| | | | | | | modules from third_party/ if the system doesn't provide them. Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-dns: Add support for BIND 9.10Amitay Isaacs2014-10-251-1/+5
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Sat Oct 25 05:42:19 CEST 2014 on sn-devel-104
* s4-dns: Update template variables, change BIND98 --> BIND9_8Amitay Isaacs2014-10-251-6/+6
| | | | | | | This makes it easier to add suport for BIND 9.10. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net>
* samba-tool group add: Add option --nis-domain and --gidMarc Muehlfeld2014-10-232-3/+25
| | | | | | | | | | This allows creating RFC2307 enabled groups via samba-tool Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Oct 23 18:19:35 CEST 2014 on sn-devel-104
* samba-tool: Add exception when trying to add/remove none existent users from ↵Marc Muehlfeld2014-10-231-1/+1
| | | | | | | | | | | | | a group. This allows a better scripting around samba-tool for adding/removing users to/from groups. Before the output and the return code had indicated that everything was successul. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10871 Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Add missing parameters to drs_Replicate in rodc.pyMichael Brown2014-10-231-1/+3
| | | | | | | | | | | | | * rodc.py: destination_dsa_guid parameter was neglected in drs_Replicate call * rodc.py: cancel the local_samdb transaction on error Change-Id: I962315a26ec48dc8774bb41db760387a3469c919 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Thu Oct 23 03:05:00 CEST 2014 on sn-devel-104
* tests: Allow "max open files" to differ from the documentationAndrew Bartlett2014-10-171-1/+2
| | | | | | | | | | It is system-dependent. Andrew Bartlett Change-Id: Icf21476c00295a428ad808bc56ab8153f109627f Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* urgent_replication: Use subunit reporting, remove allow_empty_output.Jelmer Vernooij2014-10-141-2/+5
| | | | | | Change-Id: I6d479b218eff6c4292fbb99e4760bbd62ce1f380 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba.tests.unicodenames: Fix docstring formatting so pydoctor understands it.Jelmer Vernooij2014-10-141-3/+2
| | | | | | Change-Id: I8983cd4483c380fd0c9e4da843eb70750450a0fa Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba_tool_drs: Fix docstring formatting so pydoctor groks it.Jelmer Vernooij2014-10-141-23/+28
| | | | | | Change-Id: I827044ef876118935b0f91e318d3c815326a2f01 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba.tests.source: Fix lint.Jelmer Vernooij2014-10-141-2/+2
| | | | | | Change-Id: I3dc614c34aa2c4fca6f2ca68196e71b9129b5b76 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Remove obsolete pep8 test.Jelmer Vernooij2014-10-141-54/+0
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I7f6634a035e9c93820cd4eef0261ecd5dd3865ab
* Fix more pep8 issues in code I touched recently.Jelmer Vernooij2014-10-146-27/+41
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I35f3204bdf5d00b3280d703427ded2fa2163a6f7
* Remove last instances of pep8 error E602 (old style exceptions).Jelmer Vernooij2014-10-141-3/+3
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: If709757643e6eed8cffa8950170c337f51edb9d9
* Remove last instance of pep8 error E701 (more statements on one line).Jelmer Vernooij2014-10-141-1/+2
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I419f0536b43d98ce6bb52c5907413a02ea1a6937
* Remove remaining instance of pep8 E211 (too many spaces before operator).Jelmer Vernooij2014-10-144-19/+19
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I9af3bf582bba8fc1094addb12cd0a5ce04406b5b
* tests: Pass the test context as lp_ctx for messaging testsMatthieu Patou2014-10-081-1/+2
| | | | | Change-Id: I1acf5c42b21465a8c45549039f0054414b8f31d1 Signed-off-by: Matthieu Patou <mat@matws.net>
* provision: Change the default functional level of new Samba domains to 2008R2.Andrew Bartlett2014-09-302-3/+3
| | | | | | | Windows 2003 is going out of support shortly, and we want users to have AES by default Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* provision: explain why this is requiredAndrew Bartlett2014-09-271-0/+8
| | | | | | Change-Id: Iaf8b13010b52e03db2eefe1ad565d7ca768ffb48 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* samba-tool: fix reply when zero day pwd expiry is setBjörn Jacke2014-09-081-4/+4
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10318 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Mon Sep 8 14:15:51 CEST 2014 on sn-devel-104
* join.py: Set NT ACL on crossRef object for new partitionAndrew Bartlett2014-09-022-4/+14
| | | | | | | | | | Change-Id: Icb1b00697cc5641481370ded26f2f0551a5b2a97 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 2 14:15:54 CEST 2014 on sn-devel-104