summaryrefslogtreecommitdiffstats
path: root/python/samba/tests
Commit message (Collapse)AuthorAgeFilesLines
* Implement TestCase.assertIsNotNone for python < 2.7.Jelmer Vernooij2015-03-061-6/+9
| | | | | | | | | Change-Id: Ieaefdc77495e27bad791075d985a70908e9be1ad Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Mar 6 07:11:43 CET 2015 on sn-devel-104
* Implement TestCase.assertIn for older versions of Python.Jelmer Vernooij2015-03-061-0/+3
| | | | | | Change-Id: I17d855166b439c0bd9344a17a454ea5bc6e057aa Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Implement assertIsNone for Python < 2.7.Jelmer Vernooij2015-03-061-0/+3
| | | | | | Change-Id: I3937acb16ca0c5430b70f0af305997878da53c37 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Handle skips when running on python2.6.Jelmer Vernooij2015-03-061-9/+57
| | | | | | Change-Id: I8b0a15760a72f41800d23150232c2b0e59e32c32 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Run cleanup after tearDown, for consistency with Python >= 2.7.Jelmer Vernooij2015-03-061-2/+3
| | | | | | Change-Id: Ic3ce975e3b2e4b30e07643efb4496ebf36a93284 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Use samba TestCase so we get all compatibility functions on Python < 2.7.Jelmer Vernooij2015-03-061-1/+1
| | | | | | Change-Id: Iba87e3c8fa9331c4d5438ab60a8385379da634d7 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Provide TestCase.assertIsInstance for python < 2.7.Jelmer Vernooij2015-03-061-0/+4
| | | | | | Change-Id: Id6d3c8a7dc56cb560eccc3db897a83c638dec7a6 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add replacement addCleanup.Jelmer Vernooij2015-03-061-0/+11
| | | | | | Change-Id: Ie85756effde344fc4cc9b693c4a28611ea091677 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add custom implementations of TestCase.assertIs and TestCase.assertIsNot, ↵Jelmer Vernooij2015-03-061-0/+8
| | | | | | | | for Python2.6. Change-Id: I3b806abdaf9540b7c39c961c179c2d2b15d327fe Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix use of TestCase.skipTest on python2.6 now that we no longer use testtools.Jelmer Vernooij2015-03-062-3/+7
| | | | | | Change-Id: I630e4073bf1553dfc77e9fe7e843ee8b71907683 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>
* Fix copyright headers for python/samba/subunit.Jelmer Vernooij2015-03-061-0/+4
| | | | | | 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>
* 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>
* 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-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
* 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
* 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>
* 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-143-18/+18
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I35f3204bdf5d00b3280d703427ded2fa2163a6f7
* 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-141-1/+1
| | | | | | 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>
* tests: dnsserver: Remove duplicate empty test functionAmitay Isaacs2014-07-301-4/+0
| | | | | | | | | | This test function is defined further in the file. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jul 30 07:00:57 CEST 2014 on sn-devel-104
* tests: dnsserver: Add a update test with name set to '.'Amitay Isaacs2014-07-291-1/+40
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jul 29 19:33:19 CEST 2014 on sn-devel-104
* param: Amend docs.py test to check dumping of flagged parametersGarming Sam2014-07-081-1/+70
| | | | | | | | | | | | | | | | | This test uses an empty smb.conf file to check if the resulting output from testparm is empty. It also sets a parameter as default in an smb.conf file and then sets the option on the command line to ensure they are displayed correctly. Change-Id: I48f05b6e3c9e5cd856e89b196e00ae35eb93bf9f Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jul 8 01:57:59 CEST 2014 on sn-devel-104
* param: remove idmap parameters as special cases in docs.pyGarming Sam2014-07-071-3/+0
| | | | | | | Change-Id: Ie2395ddbe9e055b9972fd859615a022d9f675014 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: handle smb_ports as a special handlerGarming Sam2014-07-071-2/+4
| | | | | | | | | | Avoids some problems with using str_list_make and str_list_make_v3 and tries to verify if the ports assignment is reasonable Change-Id: I441c4cca605c7548a5023b65994004fbac57d2df Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* tests: Add doc exception for spoolss: OSVERSION.Andreas Schneider2014-05-231-1/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri May 23 20:10:49 CEST 2014 on sn-devel-104
* provision: Correctly provision the SOA record minimum TTLKai Blin2014-05-211-0/+1
| | | | | | | | | | This fixes bug #10466 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Guenter Kukkukk <kukks@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Wed May 21 10:55:00 CEST 2014 on sn-devel-104
* bug #10609: CVE-2014-0239 Don't reply to repliesKai Blin2014-05-201-0/+29
| | | | | | | | | | | | | | | | Due to insufficient input checking, the DNS server will reply to a packet that has the "reply" bit set. Over UDP, this allows to send a packet with a spoofed sender address and have two servers DOS each other with circular replies. This patch fixes bug #10609 and adds a test to make sure we don't regress. CVE-2014-2039 has been assigned to this issue. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10609 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Tue May 20 04:15:44 CEST 2014 on sn-devel-104
* docs: enable checking of parametric options assignmentGarming Sam2014-05-071-4/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: correctly use param_table.c as a regular C fileGarming Sam2014-05-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* docs: add test to docs.py to set parameters to some arbitrary valueGarming Sam2014-05-071-10/+93
| | | | | | | | This does not currently test enums. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* docs: change docs.py to test the setting of parameters to defaultsGarming Sam2014-05-071-0/+39
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns.py: Use the python socket module.Andreas Schneider2014-04-171-1/+1
| | | | | | | We preload socket_wrapper, no need to use the special module. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>