1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

210 Commits

Author SHA1 Message Date
Michael Adam
79b927ac9e selftest: modify python.samba.test.posixacl to cope with nss_winbind active
It was observed that adding libnss_winbind (via nss_wrapper) lets
the posix acl mapping come out slightly differently with respect
to the owner/domain admin who is not explicitly nailed down in
the original NT acl.

This patch extends the test to react to the presence of
nss_winbind in environment and adapts the expected results.
This in particular fixes the run of the test against the
(changed) plugin_s4_dc environment while keeping the possibility
to successfully run it against an env without nss_winbind.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
2015-03-12 14:35:06 +01:00
Andrew Bartlett
5b3c71cd9c provision: Give a more helpful message when find_provision_key_parameters() fails
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Mar  6 20:11:52 CET 2015 on sn-devel-104
2015-03-06 20:11:52 +01:00
Andrew Bartlett
63dbf4388a samba-tool: Add -P to options.CredentialsOptions
This matches our other binaries, and allows samba-tool commands to run with the machine account.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-03-06 17:39:58 +01:00
Jelmer Vernooij
7004ccc441 Implement TestCase.assertIsNotNone for python < 2.7.
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
2015-03-06 07:11:43 +01:00
Jelmer Vernooij
a6b2110abd Implement TestCase.assertIn for older versions of Python.
Change-Id: I17d855166b439c0bd9344a17a454ea5bc6e057aa
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:49 +01:00
Jelmer Vernooij
d459096e7c Implement assertIsNone for Python < 2.7.
Change-Id: I3937acb16ca0c5430b70f0af305997878da53c37
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:49 +01:00
Jelmer Vernooij
1988e11585 Handle skips when running on python2.6.
Change-Id: I8b0a15760a72f41800d23150232c2b0e59e32c32
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:49 +01:00
Jelmer Vernooij
b53a6df3d0 Run cleanup after tearDown, for consistency with Python >= 2.7.
Change-Id: Ic3ce975e3b2e4b30e07643efb4496ebf36a93284
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:49 +01:00
Jelmer Vernooij
0acb1d49a7 Use samba TestCase so we get all compatibility functions on Python < 2.7.
Change-Id: Iba87e3c8fa9331c4d5438ab60a8385379da634d7
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
fe231bedec Provide TestCase.assertIsInstance for python < 2.7.
Change-Id: Id6d3c8a7dc56cb560eccc3db897a83c638dec7a6
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
9a4a7b9d3e Add replacement addCleanup.
Change-Id: Ie85756effde344fc4cc9b693c4a28611ea091677
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
e3a9feb698 Add custom implementations of TestCase.assertIs and TestCase.assertIsNot, for Python2.6.
Change-Id: I3b806abdaf9540b7c39c961c179c2d2b15d327fe
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
85c1dc9908 Fix use of TestCase.skipTest on python2.6 now that we no longer use testtools.
Change-Id: I630e4073bf1553dfc77e9fe7e843ee8b71907683
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
b0cba7950a Drop support for failfast mode, rather than adding support for it everywhere.
Change-Id: I4d6070a0e3b89d5e390f84754dddba9ec17ddf21
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
2e2c05c1fe Remove 'external' python module support code - use the third_party directory instead.
Change-Id: I2f5053bc5a42d3dfe71f5bd027eb6ead7d1b9752
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
850b3938e1 Support using third party iso8601 module if system doesn't provide one.
Change-Id: I5d035738d244d66d33788636c8ee8b322c227a0e
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:48 +01:00
Jelmer Vernooij
039fa938b1 Import UTC definition from utc8601 module.
Change-Id: I3ccd81090c4721b161aff272100aa71bc2f17055
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:47 +01:00
Jelmer Vernooij
940c277d83 Rename TestSkipped to Skiptest, consistent with Python 2.7.
Change-Id: I023df54363328333f1cb6c3ae3c1a406befa8f7b
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:47 +01:00
Jelmer Vernooij
7cb7d4b53e Avoid importing TestCase and TestSkipped from testtools.
Change-Id: I34488ddf253decd336a67a8634e7039096bdd160
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:47 +01:00
Jelmer Vernooij
8bbc343b5c Set default testRunner rather than requiring the user pass it in.
Change-Id: I8b5a5925030049975a83b090e5c7b76d5245c07d
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:47 +01:00
Jelmer Vernooij
84922852c3 Add RemoteTestCase and RemoteError to samba.subunit.
Change-Id: Ib3946cf4eae69f53270a299660f6029290d3791a
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:47 +01:00
Jelmer Vernooij
8487f4afc1 Use Samba-only subunit module in selftest/tests/.
Change-Id: I48c61f975c1fa49f6e244ad39dd720fe507db45b
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:46 +01:00
Jelmer Vernooij
9a1a34451f Fix copyright headers for python/samba/subunit.
Change-Id: I5b554051f23f31d20b4f4325debcd6717ba8369e
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:46 +01:00
Jelmer Vernooij
44a561fa45 subunitrun: Use new samba.subunit.run module.
Change-Id: I4a4d2237ec9ef090bf95a0ea57285610047451e5
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:46 +01:00
Jelmer Vernooij
daf63fef10 Add simple subunit runner outputting subunit v1.
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>
2015-03-06 04:41:46 +01:00
Andrew Bartlett
e5f8b49e21 s4/scripting/devel: Add tool to roll over the krbtgt password
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>
2015-02-25 01:08:12 +01:00
Marc Muehlfeld
16a526be4f group.py: Fix wrong example option, remove wrong comment line
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>
2015-02-17 15:41:11 +01:00
Jelmer Vernooij
bee48acad0 rpc_talloc: Update instructions to use standard unittest runner.
Change-Id: Id90541b01073f1156ccba562ba750245aad091c2
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andreas Schneider <asn@samba.org>
2015-02-17 15:41:10 +01:00
Marc Muehlfeld
362cac25a7 samba-tool: Create NIS enabled users and unixHomeDirectory attribute
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
2015-02-03 17:18:32 +01:00
Kamen Mazdrashki
599187ead6 s4-dsdb-test: Implement samdb_connect_env() to rely solely on environment
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>
2015-02-03 05:02:11 +01:00
Nadezhda Ivanova
ac8b8e5539 s4-dsdb: Tests for security checks on undelete operation
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
2015-02-03 05:02:11 +01:00
Kamen Mazdrashki
e33c549143 s4-tests: Print out what the error is in delete_force()
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>
2015-02-03 05:02:11 +01:00
Stefan Metzmacher
0e37189dab python/samba/tests: don't lower case path names in connect_samdb()
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>
2015-02-01 22:42:07 +01:00
Christof Schmitt
c31f54112e samba3.py: Correctly initialize cache directory for passdb test
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
2015-01-16 02:36:39 +01:00
Andrew Bartlett
ad074795e3 dns.py: Always remove the test zone in tearDown()
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
2014-12-22 08:21:22 +01:00
Samuel Cabrero
336ffb29b5 dns.py: Test dns server reload zones from DSDB when are created or deleted
Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2014-12-22 05:57:08 +01:00
Kamen Mazdrashki
29732b0d42 s4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATH
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
2014-12-08 05:27:33 +01:00
Daniel Cotton
87d39a8204 Minor spelling correction in samba-tool domain
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
2014-12-02 01:18:53 +01:00
Jelmer Vernooij
7dbc58f524 Reduce number of places where sys.path is (possibly) updated for external 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
2014-11-30 20:54:03 +01:00
Guenter Kukkukk
d5af53c537 samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"
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>
2014-11-26 01:22:05 +01:00
Guenter Kukkukk
4bda589c8e samba-tool: Fix enum values in dns.py
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>
2014-11-26 01:22:05 +01:00
Jelmer Vernooij
21280da0d6 sec_descriptor test: Simplify, use samba.tests.subunitrun module.
Change-Id: I4ffda49cf3e209eaa28fc83f6fd9ded47f0ad7ee
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-22 02:23:10 +01:00
Jelmer Vernooij
ee281c61d0 Move option handling into samba.tests.subunitrun.
Change-Id: I65a73b74854af636413f4f284147f3bcf28b6f82
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-22 02:23:10 +01:00
Jelmer Vernooij
24035a6b3e Move option parsing to samba.tests.subunitrun.
Change-Id: I2939c1b6ebb9739530efa9bc4667668cff7a7aeb
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-22 02:23:10 +01:00
Jelmer Vernooij
8d8d800a0f Add convenience class for old-style Samba subunit python tests.
Change-Id: I84a97cc71cfa99c14e0c93ec19ff9eea6149bb5a
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-22 02:23:10 +01:00
Jelmer Vernooij
776424e991 Add samba.ensure_third_party_module() function, loading external python 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>
2014-11-12 20:21:09 +01:00
Amitay Isaacs
faa3423d1a s4-dns: Add support for BIND 9.10
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
2014-10-25 05:42:19 +02:00
Amitay Isaacs
58334eb58e s4-dns: Update template variables, change BIND98 --> BIND9_8
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>
2014-10-25 03:21:04 +02:00
Marc Muehlfeld
4bec186798 samba-tool group add: Add option --nis-domain and --gid
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
2014-10-23 18:19:35 +02:00
Marc Muehlfeld
4ab6df622c samba-tool: Add exception when trying to add/remove none existent users from 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>
2014-10-23 15:56:04 +02:00