summaryrefslogtreecommitdiff
path: root/testprogs
AgeCommit message (Collapse)AuthorFilesLines
2019-03-14dbcheck: don't check expired tombstone objects by default anymoreStefan Metzmacher1-1/+1
These will be removed anyway and any change on them risks to be an originating update that causes replication problems. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Mar 14 03:12:27 UTC 2019 on sn-devel-144
2019-03-14blackbox/dbcheck-links.sh: prepare regression test for skipping expired ↵Stefan Metzmacher1-0/+115
tombstones BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-14blackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheckStefan Metzmacher2-16/+16
These tests operate on provision dumps created long ago, they still want to run tests on deleted objects, when the next commits remove processing expired tombstone objects in dbcheck. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-14blackbox/dbcheck-links.sh: add regression test for lost deleted object repairStefan Metzmacher1-0/+100
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-14blackbox/dbcheck-links.sh: reproduce lost deleted object problemStefan Metzmacher1-0/+113
When a parent object is removed during the tombstone garbage collection before a child object and samba-tool dbcheck runs at the same time, the following can happen: - If the object child had DISALLOW_MOVE_ON_DELETE in systemFlags, samba-tool dbcheck moves the object under the LostAndFound[Config] object (as an originating update!) - The lastKnownParent attribute is removed (as an originating update!) These originating updates cause the object to have an extended time as tombstone. And these changes are replicated to other DCs, which very likely already removed the object completely! This means the destination DC of replication has no chance to handle the object it gets from the source DC with just 2 attributes (name, lastKnownParent). The destination logs something like: No objectClass found in replPropertyMetaData BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-14blackbox/*.sh: pass -u to 'diff'Stefan Metzmacher3-28/+28
This is what we work with every day... BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-11blackbox/dbcheck.sh: fix dbcheck_fix_one_way_links cleanupStefan Metzmacher1-1/+1
Commit 35bfc62a31c9ad73449594ddd48f76f50e0abade changed dbcheck to not regard old one-way-links as errors. At that time the relavant trigger changed from fix_all_string_dn_component_mismatch to fix_all_old_dn_string_component_mismatch. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10testprogs/blackbox: make sure samba-tool is called with correct pythonNoel Power1-2/+2
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-28CVE-2018-16853: Add a test to verify s4u2self doesn't crashIsaac Boukris1-0/+12
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13571 Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-11-28CVE-2018-16853: Fix kinit test on system lacking ldbsearchIsaac Boukris1-4/+4
By fixing bindir variable name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13571 Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-11-28CVE-2018-16841 selftest: Check for mismatching principal in certficate ↵Andrew Bartlett1-0/+8
compared with principal in AS-REQ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13628 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-21netcmd/ldapcmp: pass --skip-missing-dn to LDAPBaseJoe Guo3-3/+3
This option has default value False, and was actually not passed down from cli to LDAPBase. However, LDAPBase.__init__ has default value True for it. After the change, a few tests using ldapcmp are affected. Add --skip-missing-dn explicitly to keep the behavior consistent, otherwise test will fail. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-14testprogs/blackbox: PY3 bulk change for python scripts use correct pythonNoel Power15-96/+96
Change all instance where python scripts are called so that the correct python version as specified by $PYTHON is used Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-10-30dsdb: Add comments explaining the limitations of our current backlink behaviourAndrew Bartlett1-1/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13418 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Tim Beale <timbeale@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Oct 30 10:32:51 CET 2018 on sn-devel-144
2018-10-30blackbox/dbcheck-links: Test broken links with missing <SID=...> on linked ↵Stefan Metzmacher1-0/+110
attributes BUG: https://bugzilla.samba.org/show_bug.cgi?id=13418 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-10-30testprogs/blackbox: add samba4.blackbox.test_primary_group testStefan Metzmacher1-0/+86
This demonstrates the bug, that happens when the primaryGroupID of a user is changed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13418 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-10-23testprogs/blackbox: Use PYTHON env variable for calling python scriptsNoel Power4-18/+18
Ensure samba-tool is called with correct python that is defined by $PYTHON Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-10-23selftest: Add expected-value testing for userParametersAndrew Bartlett1-0/+13
This does not means that bugs like https://bugzilla.samba.org/show_bug.cgi?id=11881 are fixed, however we do not wish to cause further issues without noticing it, eg during python3 fixes for dbcheck. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-10-11selftest: test samba-tool ntacl get/set on AD member serverBjörn Baumbach1-0/+68
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
2018-09-26selftest: Change backup testenvs to use non-default siteTim Beale1-0/+3
Previously (i.e. up until the last patch) the backup/restore commands only worked if the Default-First-Site-Name site was present. If this site didn't exist, then the various restore testenvs would fail to start. This is now fixed, but this patch changes the backupfrom testenv so that it uses a non-default site. This will detect the problem if it is ever re-introduced. To do this we need to change provision_ad_dc() so the extra_provision_options can be specified as an argument. (Note that Perl treats undef the same as an empty array). By default, the restore will add the new DC into the Default-First-Site-Name site. This means the backupfromdc and restored testenvs will now have different sites, so we need to update the ldapcmp filters to exclude site-specific attributes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13621 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-07selftest: pass configfile to pdbeditRalph Boehme1-4/+4
This is needed otherwise pdbedit fails to initialize messaging in autobuild. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2018-09-05selftest/samba4.blackbox.export.keytab: Update to use a principal with SPN ↵Andrew Bartlett1-4/+11
as UPN The ability the kinit with an SPN (not also being a UPN) has gone away as windows doesn't offer this functionality. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-09-05selftest/samba4.blackbox.export.keytab: Remove stray exit 0 and so run cleanupAndrew Bartlett1-2/+0
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-09-05testprogs/blackbox: let test_trust_user_account.sh check the correct ↵Stefan Metzmacher1-0/+14
kerberos salt This demonstrates the bug we currently have. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13539 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05testprogs/blackbox: add testit[_expect_failure]_grep() to subunit.shStefan Metzmacher1-0/+50
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13539 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05s4:selftest: test kinit with the interdomain trust user accountAlexander Bokovoy1-0/+44
To test it, add a blackbox test that ensures we pass a keytab-based authentication with the trust user account for a trusted domain. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13539 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Alexander Bokovoy <ab@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-30s3:libads: Add net ads keep-account testJustin Stephenson1-0/+14
Add test for the new --keep-account net ads leave operation BUG: https://bugzilla.samba.org/show_bug.cgi?id=13498 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jul 30 10:22:59 CEST 2018 on sn-devel-144
2018-07-03tests: Add a sub-set of tests to show the restored DC is soundTim Beale2-0/+106
+ Add a new ldapcmp_restoredc.sh test that asserts that the original DC backed up (backupfromdc) matches the new restored DC. + Add a new join_ldapcmp.sh test that asserts we can join a given DC, and that the resulting DB matches the joined DC + Add a new login_basics.py test that sanity-checks Kerberos and NTLM user login works. (This reuses the password_lockout base code, without taking as long as the password_lockout tests do). Basic LDAP and SAMR connections are also tested as a side-effect. + run the netlogonsvc test against the restored DC to prove we can establish a netlogon connection. + run the same subset of rpc.echo tests that we do for RODC + run dbcheck over the new testenvs at the end of the test run Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-07-03dbchecker: Fixing up incorrect DNs wasn't workingTim Beale1-0/+65
dbcheck would fail to fix up attributes where the extended DN's GUID is correct, but the DN itself is incorrect. The code failed attempting to remove the old/incorrect DN, e.g. NOTE: old (due to rename or delete) DN string component for objectCategory in object CN=alice,CN=Users,DC=samba,DC=example,DC=com - <GUID=7bfdf9d8-62f9-420c-8a71-e3d3e931c91e>; CN=Person,CN=Schema,CN=Configuration,DC=samba,DC=bad,DC=com Change DN to <GUID=7bfdf9d8-62f9-420c-8a71-e3d3e931c91e>; CN=Person,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com? [y/N/all/none] y Failed to fix old DN string on attribute objectCategory : (16, "attribute 'objectCategory': no matching attribute value while deleting attribute on 'CN=alice,CN=Users,DC=samba,DC=example,DC=com'") The problem was the LDB message specified the value to delete with its full DN, including the GUID. The LDB code then helpfully corrected this value on the way through, so that the DN got updated to reflect the correct DN (i.e. 'DC=example,DC=com') of the object matching that GUID, rather than the incorrect DN (i.e. 'DC=bad,DC=com') that we were trying to remove. Because the requested value and the existing DB value didn't match, the operation failed. We can avoid this problem by passing down just the DN (not the extended DN) of the value we want to delete. Without the GUID portion of the DN, the LDB code will no longer try to correct it on the way through, and the dbcheck operation will succeed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13495 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
2018-05-17testprogs/blackbox: Add test to set and use password with non-asciiNoel Power1-0/+17
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-11netcmd: Split 'domain passwordsettings' into a super-commandTim Beale5-13/+13
The show and set options are not really related to each other at all, so it makes sense to split the code into 2 separate commands. We also want to add separate sub-commands for PSOs in a subsequent patch. Because of the way the sub-command was implemented previously, it meant that you could specify other command-line options before the 'set' or 'show' keyword, and the command would still be accepted. However, now that it's a super-command 'set'/'show' needs to be specified before any additional arguments, so we need to update the test code to reflect this. Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
2018-03-23selftest: Ensure tmpkpasswdscript is always under $PREFIXAndrew Bartlett1-2/+2
Otherwise it might not be removed at the end of the test Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-03-23selftest: Align cleanup of tmpkpasswdscript with scripts that use itAndrew Bartlett3-3/+3
Some scripts removed it without creating it and the others created it and did not remove it. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-03-19testprogs/blackbox: add test_trust_token.shStefan Metzmacher1-0/+93
This demonstrates, which SID we expect in a token of an user of a trusted domain. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13300 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-03testprogs: Return the correct error status codeAndreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
2018-03-02testprogs: 'net ads keytab create' expected failures should now passNoel Power1-1/+1
Following the commit to change the behaviour of 'net ads keytab create' some tests previously failing should now pass. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-02testprogs: Switch expected failure tests to expected passNoel Power1-4/+4
Following the commit to change the behaviour of 'net ads keytab add' and new 'keytab add_update_ads' some tests previously failing should now pass. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-02testprogs:: Add blackbox tests for 'net ads keytab add'Noel Power1-0/+78
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-02testprocs/blackbox: Add tests for net ads setspn (add|delete|list)Noel Power1-0/+20
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-02Fix autobuild for user names starting with cChristof Schmitt1-8/+8
This is similar to the fix from commit 0b1ba00: Now commit 475a7616 introduced tests that create user names in the form DOMAIN\USER and pass them through shell functions. There "echo" is used to print he username, resulting in /bin/dash on sn-devel to interpret e.g. \c which skips any further output. The result are test exceptions like: failure: samba4.blackbox.trust_ntlm.Test01 rpcclient lookupnames with LOCALADMEMBER\cs(ad_member:local) [ Exception: Exception: LOCALADMEMBER ] time: 2018-02-26 23:00:46.688800Z Fix this by replacing the echo with printf %s. This surfaced for test_rpcclient_grep, but apply the same change to all functions in common_test_fns.inc for consistency. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Mar 2 10:49:09 CET 2018 on sn-devel-144
2018-03-01Remove some bashisms from the test scriptsTimur I. Bakeyev1-3/+3
Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-01tests/dbcheck: Provision using the old schema and ignore displayNameGarming Sam1-2/+5
These tests are currently not run on Ubuntu due to bashisms in the test. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-02-21test_trust_ntlm.sh: add lookup name testsStefan Metzmacher1-18/+59
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13286 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-02-19Fix incorrect `ldbsearch` invocationTimur I. Bakeyev1-1/+1
Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Mon Feb 19 12:31:38 CET 2018 on sn-devel-144
2018-02-19Remove some bashisms from the test scriptsTimur I. Bakeyev1-2/+1
Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2018-02-05selftest/dbcheck: add a test for corrupt forward links restorationRalph Boehme1-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>
2018-01-22testprogs:blackbox: add regression test for unsorted links in ↵Stefan Metzmacher1-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>
2017-12-20upgradeprovision: Mark tests as passing again (using functional prep)Garming Sam1-0/+6
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-12-20functionalprep.sh: Add a test to show that functional prep works on old ↵Garming Sam1-0/+39
databases Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-12-20functionalprep.sh: New test for ensuring that the prep works correctlyGarming Sam1-0/+76
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>