summaryrefslogtreecommitdiff
path: root/testprogs
Commit message (Collapse)AuthorAgeFilesLines
* tests/dbcheck: Add a test for two live objects, with a dangling forward linkGarming Sam2017-02-231-0/+22
| | | | | | | | | | | Handling backlinks appears to be rather non-deterministic, so the forward link hangs off of the RODC replication group (which has no other valid forward links). In other situations, it either won't delete the memberOf, or the expected output order will vary. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12600
* tests/dbcheck: Add a test for two live objects, with a dangling backlinkGarming Sam2017-02-231-0/+15
| | | | | | | | Adds dbcheck 4.5.0pre1 to the knownfail, to be removed later. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12600
* dbcheck-links: Test that dbcheck against one-way links does not errorGarming Sam2017-02-131-0/+10
| | | | | | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12577 Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Feb 13 07:33:08 CET 2017 on sn-devel-144
* dbcheck: Do not regard old one-way-links as errorsAndrew Bartlett2017-02-131-2/+4
| | | | | | | | | | | | | | | | | Samba does not maintain one way links when the target is deleted or renamed so do not fail dbcheck because of such links, but allow them to be updated. This matters because administrators and make test expect that normal Samba operation do NOT cause the database to become corrupt, and any error from dbcheck tends to trigger alarms (or test failures). If an object pointed at by a one way link is renamed or deleted in normal operations (such as intersiteTopologyGenerator pointing at a demoted DC), or make test, then this could trigger. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12577
* selftest: Do not test for link ordering in tombstones_expunge testAndrew Bartlett2017-02-091-1/+1
| | | | | | | | | | | | | | By testing only for the DNs that are returned we do not change the strictness of the test, because it is a test of the match rule which applies to the whole object, not the returned values. However, when this code asserted the returned order of the links, it prevents us from changing this order. This order was not deterministic across DCs but as this test ran against an offline DB, it was able to assume a particular order. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* testprogs: Use better KRB5CCNAME in test_password_settings.shAndreas Schneider2016-12-211-0/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: Fix timestamps on FreeBSD 11Volker Lendecke2016-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | FreeBSD's date does not print the %, and \? does not catch that Tested this manually: $ echo 'time: 2016-11-23 12:52:19.123456Z'| sed 's/\..*NZ$/.000000Z/' time: 2016-11-23 12:52:19.123456Z $ echo 'time: 2016-11-23 12:52:19.%6NZ'| sed 's/\..*NZ$/.000000Z/' time: 2016-11-23 12:52:19.000000Z $ echo 'time: 2016-11-23 12:52:19.6NZ'| sed 's/\..*NZ$/.000000Z/' time: 2016-11-23 12:52:19.000000Z $ echo 'time: 2016-11-23 12:52:19.NZ'| sed 's/\..*NZ$/.000000Z/' time: 2016-11-23 12:52:19.000000Z $ Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Nov 24 00:42:55 CET 2016 on sn-devel-144
* selftest: Ensure we catch errors from samba-tool domain tombstones expungeAndrew Bartlett2016-11-221-1/+1
| | | | | | | | The previous code would overwrite $? before the return, so always returned 0 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297
* selftest: Add test for link and deleted link behaviour in dbcheckAndrew Bartlett2016-11-221-0/+188
| | | | | | | | | | The other dbcheck tests were getting over-complex, so we start a new test here based on tombestone-expunge.sh, as we are looking at very similar problems Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297
* tombstones-expunge: Add a test for deleting links to recycled objectsGarming Sam2016-11-021-0/+9
| | | | | | | | | | | | | Currently this fails because we rely on a GUID DN, which fails to resolve in the case that the GUID no longer exists in the database (i.e. when that object has been purged after 6 months). The tests use a made up extended DN built from fred where the GUID has been tweaked. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12385
* Add a blackbox tests for id & getent to test domain@realm type credentialsNoel Power2016-10-031-0/+27
| | | | | | | | | | | | | | Using domain@realm credentials has been problematic when global conf setting "winbind use default domain" is enabled, this patch creates a new s4member_dflt_domain environment (where "winbind use default domain" is enabled) and runs getent & id against the normal s4member & and new s4member_dflt_domain environments BUG: https://bugzilla.samba.org/show_bug.cgi?id=12298 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* testprogs: Use own credential cache for test_client_etypes.shAndreas Schneider2016-09-251-0/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use better KRB5CCNAME in test_password_settings.shAndreas Schneider2016-09-251-2/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Test only what the Heimdal kpasswd test should testAndreas Schneider2016-09-111-170/+122
| | | | | | | | | The test_password_settings.sh test does test using different password settings and is not specific to the kpasswd implementation. This test tests the kpasswd service. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Make test_passwords.sh a Heimdal kpasswd testAndreas Schneider2016-09-111-0/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Add a new test_password_settings.sh scriptAndreas Schneider2016-09-111-0/+211
| | | | | | | This test is not Kerberos implementation specific. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Add a common test_smbclient_expect_failure() functionAndreas Schneider2016-09-111-0/+18
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbcheck: assert uSNChanged values in release-4-5-0-pre1Garming Sam2016-09-081-1/+17
| | | | | | | | | | | This shows that dbcheck doesn't change the replPropertyMetadata when fixing the links on these objects. 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): Thu Sep 8 14:39:19 CEST 2016 on sn-devel-144
* dbcheck: Make it clearer about temporary outputGarming Sam2016-09-081-1/+1
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tombstone-expunge: Assert than an expunge does not bump the USNGarming Sam2016-09-081-0/+12
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: detect older tshark versionUri Simchoni2016-09-051-0/+12
| | | | | | | | | | | Detect older versions of tshark, which do not recognize the -Y option, and skip the kerberos enc type tests Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Sep 5 16:31:58 CEST 2016 on sn-devel-144
* lib/ldb-samba: Add test for DSDB_MATCH_FOR_EXPUNGE match ruleAndrew Bartlett2016-09-011-0/+50
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: Add test for 'samba-tool tombstones expunge'Andrew Bartlett2016-09-011-0/+144
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* 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>