[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon Mar 5 00:34:02 UTC 2018


The branch, master has been updated
       via  ffcc367 tests/smbcontrol: reduce ping test false positive rate
      from  4c0c888 ldb_tdb: Add tests for truncated index keys

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ffcc3671cc238b19636e74d3e3ea71fa59a51b16
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Sun Mar 4 13:50:51 2018 +1300

    tests/smbcontrol: reduce ping test false positive rate
    
    The ping test was failing when a transient ldap_server process died
    between the time it was listed and the time it was pinged. We stop
    treating that as failure.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Mon Mar  5 01:33:46 CET 2018 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 python/samba/tests/blackbox/smbcontrol.py | 40 +++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/blackbox/smbcontrol.py b/python/samba/tests/blackbox/smbcontrol.py
index eca6cc5..37e0ab7 100644
--- a/python/samba/tests/blackbox/smbcontrol.py
+++ b/python/samba/tests/blackbox/smbcontrol.py
@@ -15,8 +15,8 @@
 # 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 samba.tests import BlackboxTestCase
+from __future__ import print_function
+from samba.tests import BlackboxTestCase, BlackboxProcessError
 from samba.messaging import Messaging
 
 COMMAND = "bin/smbcontrol"
@@ -44,8 +44,40 @@ class SmbcontrolBlockboxTests(BlackboxTestCase):
         """Test that all the samba processes can be pinged"""
 
         processes = self.msg_ctx.irpc_all_servers()
+
         for p in processes:
             for id in p.ids:
                 if p.name != "samba":
-                    self.check_run("%s %d %s" % (COMMAND, id.pid, PING),
-                                   msg="trying to ping %s" % p.name)
+                    try:
+                        self.check_run("%s %d %s" % (COMMAND, id.pid, PING),
+                                       msg="trying to ping %s" % p.name)
+                    except BlackboxProcessError as e:
+                        # This process could not be pinged, which is
+                        # expected (occasionally) if the ldap_server
+                        # is using the "standard process model" and
+                        # forking a short-lived child for each
+                        # connection. We don't care about this, so we
+                        # list the processes again and assume that
+                        # only those that remain are relevant to the
+                        # ping test. Additionally we ensure that at
+                        # least one process of each name remains -- in
+                        # the ldap_server case, we expect at least the
+                        # parent to be there.
+                        name_exists = False
+                        surviving_processes = self.msg_ctx.irpc_all_servers()
+                        for q in surviving_processes:
+                            if q.name == p.name:
+                                name_exists = True
+                                if id.pid in [x.pid for x in q.ids]:
+                                    # the unpingable server is still
+                                    # listed, meaning it is broken
+                                    raise
+
+                        if not name_exists:
+                            # it looks like the service genuinely died
+                            # just at this moment
+                            raise
+
+                        print("Ignoring error %s:" % e)
+                        print("the process probably died before our ping")
+                        continue


-- 
Samba Shared Repository



More information about the samba-cvs mailing list