summaryrefslogtreecommitdiff
path: root/testprogs
Commit message (Collapse)AuthorAgeFilesLines
* blackbox tests: add timestamps for subunit testsDouglas Bagnall2016-08-311-0/+11
| | | | | | | | | | | | | | | There is the icky thing with sed because some kinds of `date` don't have sub-second resolution, which we really want. Another way to do it would be: python -c "import datetime; print datetime.datetime.utcnow().strftime('time: %Y-%m-%d %H:%M:%S.%fZ')" which should be universal, but is a little slower. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dbcheck: Abandon dbcheck if we get an error during a transactionAndrew Bartlett2016-08-291-0/+10
| | | | | | | | | | | | | | | | Otherwise, anything that the transaction has already done to the DB will be left in the DB even despite the failure. For example, if a fix wrote to the DB, but then failed a post-write check, then the fix will not be unrolled. This is because we do not have nested transactions in TDB. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12178 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): Mon Aug 29 12:46:21 CEST 2016 on sn-devel-144
* selftest: skip client_etypes tests if tshark or sha1sum is not installedUri Simchoni2016-08-251-7/+12
| | | | | | | | | | | That was the original plan - not to fail existing envs, but for subunit not to fail, it is not sufficient to just return 0 from the script. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Thu Aug 25 09:39:43 CEST 2016 on sn-devel-144
* selftest: tests for kerberos encryption typesUri Simchoni2016-08-091-0/+58
| | | | | | | | | | | | This test uses tshark and cwrap's packet capturing capability to observe the Kerberos handshakes and ensure the correct encryption types are being used. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 9 07:43:52 CEST 2016 on sn-devel-144
* testprogs/blackbox: add test_pkinit_pac_heimdal.shStefan Metzmacher2016-07-221-0/+53
| | | | | | | | This verifies that we have a PAC_CREDENTIAL_INFO element in the PAC when using pkinit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* test_pkinit_heimdal.sh: add some more tests regarding the ↵Stefan Metzmacher2016-07-221-9/+104
| | | | | | | | | UF_SMARTCARD_REQUIRED behavior BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbcheck/release-4-1-0rc3: Add a check regarding replica locationsGarming Sam2016-07-211-0/+13
| | | | | | | | | | | | This DC has repsFrom for the DNS partitions, but not the corresponding link. This ensures that dbcheck has fixed them up. This will currently fail without the actual changes to dbcheck coming in the following commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9200 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbcheck: Replica locations can now be leftoverGarming Sam2016-07-211-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=9200 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* renamedc: Make a more targeted dbcheckGarming Sam2016-07-151-1/+3
| | | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Fri Jul 15 13:40:40 CEST 2016 on sn-devel-144
* dbcheck.sh: Remove all the plausible stale linksGarming Sam2016-07-151-0/+6
| | | | | | | | | | This ensures the subsequent dbcheck doesn't fail. The reason these stale links occur is because they are effectively one-way links at this point we have no efficient method of checking the opposite end of a one-way link (without doing a full traversal). Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbcheck.sh: Fix the arguments supplied as $@Garming Sam2016-07-151-6/+7
| | | | | Signed-off-by: Garming Sam <garming@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/dbcheck: One way links are expected to be staleGarming Sam2016-07-151-0/+6
| | | | | | | Run a targeted dbcheck to fix only the one way links. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbcheck linked attribute tests: save environment with bad linksDouglas Bagnall2016-07-151-0/+8
| | | | | | | | | We save a database snapshot that contains linked attributes that should have been deleted, and make sure dbcheck fixes those links without ruining anything else. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* blackbox/dbcheck-oldrelease: more accurate temp filenameDouglas Bagnall2016-07-151-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbcheck: check for linked atributes that should not existDouglas Bagnall2016-07-151-0/+5
| | | | | | | | | | | | | In order to do this we need to use the reveal internals control, which breaks the comparison against extended DNs. So we compare the components instead. Because this patch makes our code notice and fix stale one-way-links (eg, after a rename) now, the renamedc test needs to be adjusted to match. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* testprogs: Do not use the deprecated samba-tool user addAndreas Schneider2016-07-071-1/+1
| | | | | | | | 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): Thu Jul 7 02:15:16 CEST 2016 on sn-devel-144
* testprogs/blackbox: Improve the net ads dns register tests.Richard Sharpe2016-07-031-1/+18
| | | | | | | | | | | | More tests are added that add an unprivileged user, enable their account, and then test that they can add IP addressed but that they cannot modify other user's IP addresses. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Richard Sharpe <sharpe@samba.org> Autobuild-Date(master): Sun Jul 3 14:24:59 CEST 2016 on sn-devel-144
* selftest: Add test for domain join + kerberos-only authUri Simchoni2016-07-011-0/+8
| | | | | | | | | | | | | | | | | Add "net ads join/leave -k" tests to the net_ads test suite. Shift the test suite from ad_member env to ad_dc env, because: 1. Seems more appropriate (the member server plays no role in this test) 2. The -k test breaks against the ntvfs file server for some reason, when trying to open the netlogon named pipe after having established the session with Kerberos (the create fails). Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 1 15:36:37 CEST 2016 on sn-devel-144
* test_pkinit_heimdal.sh: add a FILE: prefix to the KRB5CCNAME variableStefan Metzmacher2016-06-301-2/+4
| | | | | | | | | This makes the tests more robust. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* test_pkinit_heimdal.sh: add a helper VARIABLE to store the certificate pathsStefan Metzmacher2016-06-301-3/+5
| | | | | | | | | | We also don't need the separation of admincert.pem and admincertupn.pem anymore. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/selftests: test net ads dns register/unregister.Richard Sharpe2016-06-281-0/+81
| | | | | | | | | | | | Add a new test for the net ads dns commands and the needed self test setup. Currently tests that we can register a name and that it turns up. Also, tests that we can register with -P. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Jun 28 22:35:35 CEST 2016 on sn-devel-144
* selftest: Do not scan the full DB to confirm a specific DN in dbcheckAndrew Bartlett2016-06-071-1/+1
| | | | | | | | This avoids a full DB scan and therefore reduces the test time taken when we just modified the cn=administrator record. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dbcheck: Find and fix a missing Deleted Objects containerAndrew Bartlett2016-06-061-0/+46
| | | | | | | | | | | | | | | Older Samba versions could delete this. This patch tries very hard to put back the original object, with the original GUID, so that if another replica has the correct container, that we just merge rather than conflict. The existing "wrong dn" check can then put any deleted objects under this container correctly. Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selfttest: add common_test_fns.incRichard Sharpe2016-04-288-162/+84
| | | | | | | | | | | | | Create an include file of common functions used by several of the blackbox tests in testprogs and then make all the users of test_smbclient include that file so we can eliminate duplicate code. We pass the UNC to the test_smbclient function. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Apr 28 16:50:35 CEST 2016 on sn-devel-144
* selftest/samba4.blackbox.export.keytab: check AS-REQ with SPNRalph Boehme2016-04-251-0/+4
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/samba4.blackbox.export.keytab: check exported keytabsRalph Boehme2016-04-251-0/+30
| | | | | | | | Now that we have a usable ktutil, actually verify that the exported keytabs contains the keys we expect. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/samba4.blackbox.export.keytab: use spn based on fqdnRalph Boehme2016-04-251-2/+4
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2016-2112: s4:selftest: run some ldap test against ad_dc_ntvfs, ↵Stefan Metzmacher2016-04-121-0/+41
| | | | | | | | | | | | fl2008r2dc and fl2003dc We want to test against all "ldap server require strong auth" combinations. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11644 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* selftest: add some test cases to net ads joinUri Simchoni2016-03-101-2/+5
| | | | | | | | | | | | Perform a testjoin between steps to verify join status Perform most testjoins with machine account because that's the more common case. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Thu Mar 10 14:41:13 CET 2016 on sn-devel-144
* selftest: run net ads join test in a private client envUri Simchoni2016-03-101-3/+22
| | | | | | | | | | | | net ads join command changes machine password, thus affecting the test environment beyond the thing we want to test. This cange runs the test in a private client env, with its own hostname, newly-generated machine SID, and a separate secrets.tdb, thus not affecting the running AD member server, Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4-selftest: Make export keytab test heimdal specificAndreas Schneider2016-03-101-0/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: Avoid sorting issues on Ubuntu 10.04 vs 14.04Andrew Bartlett2016-03-091-1/+1
| | | | | | | | The unimportant lines starting with # sorted differently between these two platforms. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dbcheck: Check for and remove duplicate values in attributesAndrew Bartlett2016-03-081-0/+36
| | | | | | | | This can happen with three DCs and custom schema, but we test it by just forcing the values directly into the backing tdb. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dbcheck: Fix incorrect/duplicate attrid in replPropertMetaDataAndrew Bartlett2016-03-081-4/+42
| | | | | | | | | If custom schema is used in a replicated DC environment, these are created as soon as an attribute is modified on more than one DC. We have to remove these. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* testprogs/blackbox/subunit: Fix testokChristof Schmitt2016-02-201-2/+0
| | | | | | | | | | | The fail count is always in the second parameter. Omit the shift operations, so that the value can be read correctly from $2. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Feb 20 03:58:01 CET 2016 on sn-devel-144
* tests: Rename heimdal blackbox testsAndreas Schneider2016-01-223-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* selftest: more dfree command and smbclient disk usage testsUri Simchoni2016-01-061-1/+7
| | | | | | | | | | | | | Add tests that cover disk usage printing by smbclient, as well as passing directory info to the "dfree command" script. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11662 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 6 03:58:59 CET 2016 on sn-devel-144
* pdb: add a blackbox test for setting password with hashGarming Sam2015-11-301-0/+7
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix various spelling errorsMathieu Parent2015-11-062-3/+3
| | | | | | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Nov 6 13:43:45 CET 2015 on sn-devel-104
* tests: Add tests for net ads (join|leave)Andreas Schneider2015-11-041-0/+35
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Wed Nov 4 15:35:57 CET 2015 on sn-devel-104
* selftest: Confirm a demote of a real network worksAndrew Bartlett2015-10-261-0/+67
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Oct 26 08:17:47 CET 2015 on sn-devel-104
* selftest: Add assertion that we actually fix the replPropertyMetaData sort orderAndrew Bartlett2015-08-251-1/+46
| | | | | | | | | | | | This ensures that the dbcheck rule fixes the sort order (and only fixes the sort order). BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 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): Tue Aug 25 02:45:58 CEST 2015 on sn-devel-104
* lib/tls: Change default supported TLS versions.Andrew Bartlett2015-07-201-0/+3
| | | | | | | | | The new default is to disable SSLv3, as this is no longer considered secure after CVE-2014-3566. Newer GnuTLS versions already disable SSLv3. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz>
* selftest: Add test for the dfree commandAndreas Schneider2015-07-171-0/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 17 22:09:34 CEST 2015 on sn-devel-104
* testprogs/blackbox: add test_trust_utils.shStefan Metzmacher2015-07-081-0/+138
| | | | | | | This tests 'samba-tool domain trust *' commands. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs/blackbox: let test_kinit_trusts.sh verify that setpassword (via ↵Stefan Metzmacher2015-07-081-0/+2
| | | | | | | LDAP) is rejected Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs/blackbox: let test_kinit_trusts.sh test a enterprise upn from the ↵Stefan Metzmacher2015-07-081-0/+5
| | | | | | | other foreset Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs/blackbox: add test_kinit_trusts.shStefan Metzmacher2015-07-081-0/+98
| | | | | | | | | | That verifies kinit and smbclient work across trusts. It also tests a trust password change and a following access. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* midltests: add valid/midltests_DRS_EXTENSIONS.*Stefan Metzmacher2015-07-032-0/+107
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* selftest: make blackbox.pkinit test independent of test environment.Michael Adam2015-03-161-3/+3
| | | | | | | | This lets the test not clutter the main selftest prefix directory with temporary data. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>