summaryrefslogtreecommitdiff
path: root/testprogs
Commit message (Collapse)AuthorAgeFilesLines
* selftest/dbcheck: add a test for corrupt forward links restorationRalph Boehme2018-02-061-0/+78
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 52bd0b09804621e6de9ee0a377a442a42e07ee05)
* testprogs:blackbox: add regression test for unsorted links in ↵Stefan Metzmacher2018-01-251-0/+24
| | | | | | | | | | tombstones-expunge.sh BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit c34c2dd55545b99fba46cf374a1653bad96cea9e)
* testprogs: Test net ads keytab listNoel Power2017-12-051-0/+13
| | | | | | | | | | | Test that correct keytab is picked up. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13166 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 4be05c835e9d8b8f13856d592aaf42b40ce397c2)
* selftest: Add more corruption cases for runtime and dbcheckAndrew Bartlett2017-11-293-3/+86
| | | | | | | | | These tests now confirm we can handle these issues at runtime as well as at dbcheck Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 4815efc0e3f89079e7c9b868b7514ea7c49a807c)
* selftest: add dbcheck tests for duplicate linksStefan Metzmacher2017-11-291-0/+39
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13095 Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 70bf809e0cdf84029022ca95fb83d17a0d6e36c0)
* selftest: Additional check for a backlink pointing at a deleted objectAndrew Bartlett2017-11-292-0/+9
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit a784cc3a7f2043a5762d426e904a90e44b101ecd)
* selftest: Split out creation of complex (often invalid) linksAndrew Bartlett2017-11-292-199/+200
| | | | | | | | | This will allow us to test other run-time behaviour with broken databases. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 25ae8d72d66cbe7342b50254ede7e5890bc23b73)
* selftest: Split out dbcheck runs from dangling_multi_valued testAndrew Bartlett2017-11-291-3/+7
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit b99d2ee122991d0bf1742fa5665656bbbba44057)
* selftest: add more dbcheck testsAndrew Bartlett2017-11-291-12/+81
| | | | | | | | | This validates some more combinations and ensures that the changes in 962a1b32201fce0a49c6be55943d4fbb57ed781e are tested. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 7be38c605468786894a373e15068b8017323da78)
* selftest: sort dbcheck output to avoid sort order impacting resultsAndrew Bartlett2017-11-291-1/+3
| | | | | | | | The GUID index code will change the returned results order Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit da575f01313673fedfc7d15ec11ba6818dbd30d8)
* blackbox: Add test for 'net ads changetrustpw'Andreas Schneider2017-08-281-0/+4
| | | | | | | | | | | | BUG: BUG: https://bugzilla.samba.org/show_bug.cgi?id=12956 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Aug 11 22:09:27 CEST 2017 on sn-devel-144 (cherry picked from commit e2c0fd36ba54d984b554248aecffd3e4e7f43e1f)
* testprogs/blackbox: don't use hardcoded values in test_net_ads_dns.shStefan Metzmacher2017-06-131-3/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* testprogs: Add 'net rpc user' test against AD DCAndreas Schneider2017-05-111-0/+56
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Ignore escape characters when printing test nameChristof Schmitt2017-05-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Long story: This was triggered by the addition of the test_trust_ntlm.sh script in commits 3caca9b and 2de1994. test_trust_ntlm.sh creates a variable CREDS="$REALM\\$USERNAME%$PASSWORD" that is then used as part of the test name. subunit.sh uses echo to print the name that is then picked up by subunithelper.py. test_trust_ntlm.sh also uses /bin/sh as shell which can be a POSIX compliant shell like dash. This combination broke 'make test' for any username starting with the letter c. In this case CREDS contains the escape sequence \c that is defined to stop producing further output at this point. dash implements this feature and the echo in subunit.sh as a result skips the output after \c, including skipping the newline. This means that the data received by subunithelper.py contains the timestamp from the next line in the test name, which then breaks the testcase tracking. Fix this by replacing the echo in subunit.sh with a printf that does not trigger the special handling of escape characters. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri May 5 23:44:16 CEST 2017 on sn-devel-144
* testprogs: Add MIT Kerberos specific kpasswd blackbox testAndreas Schneider2017-04-291-0/+231
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Add test with exported keytab from samba-toolAndreas Schneider2017-04-291-0/+127
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Add a kinit trust test for MIT KDCAndreas Schneider2017-04-291-0/+139
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Add test_kinit_mit.sh testAndreas Schneider2017-04-291-0/+310
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Fix usage printout of bogus blackbox testAndreas Schneider2017-04-291-1/+1
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Fix test_chgdcpass blackbox test with MITAndreas Schneider2017-04-291-2/+14
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs: Add common kinit functionAndreas Schneider2017-04-291-0/+16
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: add a test for samba_runcmd_send()Ralph Boehme2017-04-201-0/+15
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* testprogs/blackbox: add test_trust_ntlm.shStefan Metzmacher2017-04-101-0/+164
| | | | | | | | | | | This verifies that various domain/realm and username combinations map to the correct user. BUG: https://bugzilla.samba.org/show_bug.cgi?id=2976 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12709 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs/blackbox: add test_rpcclient_*_grep helper functionsStefan Metzmacher2017-04-101-0/+52
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12709 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs/blackbox: use subunit_ helper functions in test_smbclient_*Stefan Metzmacher2017-04-101-8/+8
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12709 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs: Correctly expand shell parametersAndreas Schneider2017-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old behaviour is: for var in $* do echo "$var" done And you get this: $ sh test.sh 1 2 '3 4' 1 2 3 4 Changing it to: for var in "$@" do echo "$var" done will correctly expand to: $ sh test.sh 1 2 '3 4' 1 2 3 4 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Mar 15 05:26:17 CET 2017 on sn-devel-144
* testprogs: Test 'net ads join' with a dedicated keytabAndreas Schneider2017-03-141-0/+9
| | | | | | | | This checks that a 'net ads join' can create the keytab and make sure we will not regress in future. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* tests/dbcheck-links: remove spurious sleepingGarming Sam2017-03-131-1/+0
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbcheck: Improve dbcheck to find (and may fix) dangling msDS-RevealedUsersGarming Sam2017-03-131-0/+77
| | | | | | | | We cannot add missing backlinks because of the duplicate checking. There seems to be no trivial way to add the bypass. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs: Add kinit_trusts tests with smbclient4Andreas Schneider2017-03-101-0/+8
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use smbclient by default in test_kinit_trustsAndreas Schneider2017-03-101-1/+1
| | | | | | | | | This is the tool we use by default and we should test with it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* 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>