From: Tim Beale Date: Mon, 28 May 2018 22:46:50 +0000 (+1200) Subject: tests: Fix intermittent error in PSO test X-Git-Tag: ldb-1.4.0~13 X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=642dd37d51d8fb69b04ec444a590550b1807a0d8 tests: Fix intermittent error in PSO test Deleting a group fails if the primaryGroupID of a user is set to that of the group. This can happen in the PSO tests, as we don't clear the primaryGroupID before cleaning up. Normally it seems to work OK, but this is relying purely on the subtree delete order. Update the test to clear the primaryGroupID before the tearDown is called, to make things more robust. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13448 Signed-off-by: Tim Beale Reviewed-by: Garming Sam --- diff --git a/source4/dsdb/tests/python/password_settings.py b/source4/dsdb/tests/python/password_settings.py index a5de7fffd69..71ab74e6323 100644 --- a/source4/dsdb/tests/python/password_settings.py +++ b/source4/dsdb/tests/python/password_settings.py @@ -565,6 +565,9 @@ class PasswordSettingsTestCase(PasswordTestCase): admin_pso.apply_to(admin_users) self.assert_PSO_applied(user, admin_pso) + # restore the default primaryGroupID so we can safely delete the group + user.set_primary_group(domain_users) + def test_pso_none_applied(self): """Tests cases where no Resultant PSO should be returned"""