[PATCH] miscellaneous patches
Douglas Bagnall
douglas.bagnall at catalyst.net.nz
Fri May 4 02:37:34 UTC 2018
On 04/05/18 14:21, Gary Lockyer via samba-technical wrote:
> Indeed it was
> RB+
Aha! That was the gateway drug. Try some more!
These are the tiniest bit more exciting.
Douglas
> Gary
>
> On 04/05/18 14:14, Douglas Bagnall via samba-technical wrote:
>> Easy to review!
>>
>> Douglas
>>
>
-------------- next part --------------
From a90bf5fb9bf6b46d21f35fde90b9960637a6e87a Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 24 Aug 2017 15:02:43 +1200
Subject: [PATCH 1/7] perftest: ad_dc_medley failing base search failed to
catch exception
This meant it only happened once.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
source4/dsdb/tests/python/ad_dc_medley_performance.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/source4/dsdb/tests/python/ad_dc_medley_performance.py b/source4/dsdb/tests/python/ad_dc_medley_performance.py
index f49563c7f6c..8ac0a62ebdc 100644
--- a/source4/dsdb/tests/python/ad_dc_medley_performance.py
+++ b/source4/dsdb/tests/python/ad_dc_medley_performance.py
@@ -228,9 +228,13 @@ class UserTests(samba.tests.TestCase):
def _test_base_search_failing(self):
pattern = 'missing%d' + self.ou
for i in range(4000):
- self.ldb.search(pattern % i,
- scope=SCOPE_BASE,
- attrs=['cn'])
+ try:
+ self.ldb.search(pattern % i,
+ scope=SCOPE_BASE,
+ attrs=['cn'])
+ except LdbError as (num, msg):
+ if num != 32:
+ raise
def search_expression_list(self, expressions, rounds,
attrs=['cn'],
--
2.14.1
From 6e1aed474a415d8b633cda1a8c3cefcff31022f2 Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 10 Aug 2017 11:59:44 +1200
Subject: [PATCH 2/7] gitignore .gdb_history anywhere in the tree
For when you run gdb in places like lib/ldb/ and it decides to leave
behind a history file.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 1f064939de2..9e99c10de77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,7 +64,7 @@ semantic.cache
/bin/.confcache/*/*
/bin/.conf_check_*/*
/.emacs.desktop*
-/.gdb_history
+.gdb_history
.clang-format
# generated by configure
--
2.14.1
From 5bfa08ac40309ca54a225070340e9e8091a9c7bb Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 10 Aug 2017 12:00:45 +1200
Subject: [PATCH 3/7] .gitignore .agignore
.agingore is used by "the silver searcher", ag, which is a form of
grep with more useful defaults and prettier colours for searching
source trees.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 9e99c10de77..ac05c21ddc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,6 +66,6 @@ semantic.cache
/.emacs.desktop*
.gdb_history
.clang-format
-
+.agignore
# generated by configure
python/samba/provision/kerberos_implementation.py
--
2.14.1
From 8a715c7d7580e03b814ffa8885fa019c415a882b Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Fri, 9 Mar 2018 15:20:53 +1300
Subject: [PATCH 4/7] sambatool tests: make assertMatch use assertIn
With a note to tidy this up at some point
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
python/samba/tests/samba_tool/base.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/samba/tests/samba_tool/base.py b/python/samba/tests/samba_tool/base.py
index de257e3db09..89a09225e64 100644
--- a/python/samba/tests/samba_tool/base.py
+++ b/python/samba/tests/samba_tool/base.py
@@ -96,10 +96,11 @@ class SambaToolCmdTest(samba.tests.BlackboxTestCase):
self.assertIsNotNone(val, msg)
def assertMatch(self, base, string, msg=None):
+ # Note: we should stop doing this and just use self.assertIn()
if msg is None:
msg = "%r is not in %r" % (truncate_string(string),
truncate_string(base))
- self.assertTrue(string in base, msg)
+ self.assertIn(string, base, msg)
def randomName(self, count=8):
"""Create a random name, cap letters and numbers, and always starting with a letter"""
--
2.14.1
From cbf7fe7756b0725ccd2108b76fb2ddfa3f7117ed Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 15 Mar 2018 11:55:40 +1300
Subject: [PATCH 5/7] samba_kcc: remove an unused variable
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
python/samba/kcc/__init__.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py
index be1c4d82968..fae9dbd13d3 100644
--- a/python/samba/kcc/__init__.py
+++ b/python/samba/kcc/__init__.py
@@ -858,8 +858,6 @@ class KCC(object):
:param current_dsa: optional DSA on whose behalf we are acting.
:return: None
"""
- count = 0
-
ro = False
if current_dsa is None:
current_dsa = self.my_dsa
--
2.14.1
From 92ad2e75d91908e297f1b099c71ddcfd15a4b3c6 Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Fri, 23 Mar 2018 11:24:16 +1300
Subject: [PATCH 6/7] autobuild: do not try to send email to no recipient
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
script/autobuild.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/script/autobuild.py b/script/autobuild.py
index 0ac65f138f1..a443c1f4b0e 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -692,6 +692,11 @@ parser.add_option("", "--restrict-tests", help="run as make test with this TESTS
default='')
def send_email(subject, text, log_tar):
+ if options.email is None:
+ do_print("not sending email because the recipient is not set")
+ do_print("the text content would have been:\n\nSubject: %s\n\nTs" %
+ (subject, text))
+ return
outer = MIMEMultipart()
outer['Subject'] = subject
outer['To'] = options.email
--
2.14.1
From 9a7605489f77b99e0f5d840f4e55707cf515dd00 Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 19 Apr 2018 14:13:47 +1200
Subject: [PATCH 7/7] traffic: ensure we are using the same division in py 2
and 3
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
python/samba/emulate/traffic.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py
index 9d95e3a14d5..afb57da36f0 100644
--- a/python/samba/emulate/traffic.py
+++ b/python/samba/emulate/traffic.py
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from __future__ import print_function
+from __future__ import print_function, division
import time
import os
--
2.14.1
More information about the samba-technical
mailing list