ntlm_auth autobuild failures on the Catalyst Cloud after XFILE

Jeremy Allison jra at samba.org
Fri Jan 6 16:54:46 UTC 2017


On Fri, Jan 06, 2017 at 10:36:02PM +1300, Andrew Bartlett wrote:
> On Fri, 2017-01-06 at 10:01 +0100, Volker Lendecke wrote:
> > On Fri, Jan 06, 2017 at 09:33:50PM +1300, Andrew Bartlett wrote:
> > > 
> > > (resend from correct account)
> > > 
> > > I'm sorry to add to this debate around flapping tests, but at the
> > > same
> > > time I don't want to miss out a possibly important data point.
> > > 
> > > Since around the time of the XFILE -> FILE conversion (13 Dec), the
> > > builds that my team at Catalyst have been doing on the Catalyst
> > > cloud
> > > have been failing with the attached.  (We also see the ctdb errors
> > > that
> > > martin has been fixing).
> > > 
> > > These builds are on Ubuntu 14.04 x86_64, so I'm surprised that it
> > > works
> > > on the sn-devel host, but as we know our test suite is a fickle
> > > thing. 
> > > 
> > > Attached is the output from autobuild.  
> > > 
> > > (If it doesn't reproduce locally, then access to such cloud hosts
> > > can
> > > be arranged for team members.)
> > > 
> > > Any assistance understanding what is going on would be most
> > > valued. 
> > > 
> > > Perhaps it is a semantics difference around (flushing) FILE
> > > buffers?
> > 
> > Another set of reverts coming in. I'll work on that. 
> > 
> > Apologies,
> 
> To be clear, I specifically didn't request that.

Yes, let's not do that.

> Jeremy: Can you remind Bob (CCed) how you debugged the original issues
> with the XFILE conversion?.  He should have some time next week to look
> into this and those clues could be quite helpful.

Hi Bob,

Certainly ! The attached patch, clumsy though it is, helped
me find and fix an area where we were currupting the stdout
stream with an error message that should have gone to stderr.

It instruments all the communication points between the
python calls to ntlm_auth and then dumps them as text
into a file /tmp/pylog.

Apply, and then run the flakey test and everything you
need should be in /tmp/pylog. It uses append mode so
remember to remove /tmp/pylog manually between runs.

Cheers,

	Jeremy.
-------------- next part --------------
diff --git a/source3/torture/test_ntlm_auth.py b/source3/torture/test_ntlm_auth.py
index fffeb26..9ab98f4 100755
--- a/source3/torture/test_ntlm_auth.py
+++ b/source3/torture/test_ntlm_auth.py
@@ -26,10 +26,28 @@ import os
 import sys
 from optparse import OptionParser
 
+def dbg_buf(hdr, str):
+    file = open("/tmp/pylog", "a", 0666)
+    file.write(hdr);
+    file.write(":|")
+    file.write(str)
+    file.write("|\n")
+    file.close()
+    return
+
+def dbg(str):
+    file = open("/tmp/pylog", "a", 0666)
+    file.write(str)
+    file.write("\n")
+    file.close()
+    return
+
 class ReadChildError(Exception):
+    dbg("ReadChildError")
     pass
 
 class WriteChildError(Exception):
+    dbg("WriteChildError")
     pass
 
 def readLine(pipe):
@@ -40,6 +58,8 @@ def readLine(pipe):
     buf = os.read(pipe, 2047)
     newline = buf.find('\n')
     if newline == -1:
+        dbg("JRA: Missing newline")
+        dbg("JRA: in string |%s|" % buf)
         raise ReadChildError()
     return buf[:newline]
 
@@ -50,6 +70,7 @@ def writeLine(pipe, buf):
     """
     written = os.write(pipe, buf)
     if written != len(buf):
+        print "JRA: write error\n"
         raise WriteChildError()
     os.write(pipe, "\n")
 
@@ -108,9 +129,11 @@ def parseCommandLine():
 
     (opts, args) = parser.parse_args()
     if len(args) != 1:
+        dbg("Invalid args")
         parser.error("Invalid number of arguments.")
 
     if not os.access(args[0], os.X_OK):
+        dbg("Not exec")
         parser.error("%s is not executable." % args[0])
 
     return (opts, args[0])
@@ -123,6 +146,9 @@ def main():
     """
     (opts, ntlm_auth_path) = parseCommandLine()
 
+    dbg(str(opts))
+    dbg(str(ntlm_auth_path))
+
     (client_in_r,  client_in_w)  = os.pipe()
     (client_out_r, client_out_w) = os.pipe()
 
@@ -155,6 +181,7 @@ def main():
         if opts.target_hostname:
             client_args.append("--target-hostname=%s" % opts.target_hostname)
 
+        dbg("JRA: executing %s %s\n" % (ntlm_auth_path, client_args))
         os.execv(ntlm_auth_path, client_args)
 
     client_in = client_in_r
@@ -188,6 +215,7 @@ def main():
             server_args.append("--password=%s" % opts.server_password)
             server_args.append("--domain=%s" % opts.server_domain)
             if opts.sid:
+        	dbg("No winbindd")
                 raise Exception("Server must be using winbindd for require-membership-of.")
         else:
             if opts.sid:
@@ -210,18 +238,21 @@ def main():
         buf = readLine(client_in)
 
         if buf.count("YR ", 0, 3) != 1:
+            dbg("Error #1")
             sys.exit(1)
 
         writeLine(server_out, buf)
         buf = readLine(server_in)
 
         if buf.count("TT ", 0, 3) != 1:
+            dbg("Error #2")
             sys.exit(2)
 
         writeLine(client_out, buf)
         buf = readLine(client_in)
 
         if buf.count("AF ", 0, 3) != 1:
+            dbg("Error #3")
             sys.exit(3)
 
         # Client sends 'AF <base64 blob>' but server expects 'KK <abse64 blob>'
@@ -231,6 +262,7 @@ def main():
         buf = readLine(server_in)
 
         if buf.count("AF ", 0, 3) != 1:
+            dbg("Error #4")
             sys.exit(4)
 
 
@@ -240,18 +272,21 @@ def main():
         buf = readLine(client_in)
 
         if buf.count("YR ", 0, 3) != 1:
+            dbg("Error #5")
             sys.exit(1)
 
         writeLine(server_out, buf)
         buf = readLine(server_in)
 
         if buf.count("TT ", 0, 3) != 1:
+            dbg("Error #6")
             sys.exit(2)
 
         writeLine(client_out, buf)
         buf = readLine(client_in)
 
         if buf.count("AF ", 0, 3) != 1:
+            dbg("Error #7")
             sys.exit(3)
 
         # Client sends 'AF <base64 blob>' but server expects 'KK <abse64 blob>'
@@ -261,6 +296,7 @@ def main():
         buf = readLine(server_in)
 
         if buf.count("AF * ", 0, 5) != 1:
+            dbg("Error #8")
             sys.exit(4)
 
 
@@ -268,22 +304,29 @@ def main():
         # We're in the parent
         writeLine(server_out, "YR")
         buf = readLine(server_in)
+        dbg_buf("In buf 1", buf)
 
         while True:
             if buf.count("AF ", 0, 3) != 1 and buf.count("TT ", 0, 3) != 1:
+                dbg("Error #9")
                 sys.exit(1)
 
+            dbg_buf("Out buf", buf)
+
             writeLine(client_out, buf)
             buf = readLine(client_in)
+            dbg_buf("In buf 2", buf)
 
             if buf.count("AF", 0, 2) == 1:
                 break
 
             if buf.count("AF ", 0, 5) != 1 and buf.count("KK ", 0, 3) != 1 and buf.count("TT ", 0, 3) != 1:
+                dbg("Error #10")
                 sys.exit(2)
 
             writeLine(server_out, buf)
             buf = readLine(server_in)
+            dbg_buf("In buf 3", buf)
 
             if buf.count("AF * ", 0, 5) == 1:
                 break
@@ -296,12 +339,14 @@ def main():
         buf = readLine(client_in)
 
         if buf.count("GK ", 0, 3) != 1:
+            dbg("Error #11")
             sys.exit(4)
 
         writeLine(client_out, "GF")
         buf = readLine(client_in)
 
         if buf.count("GF ", 0, 3) != 1:
+            dbg("Error #12")
             sys.exit(4)
 
     if opts.server_helper == "squid-2.5-ntlmssp":
@@ -309,12 +354,14 @@ def main():
         buf = readLine(server_in)
 
         if buf.count("GK ", 0, 3) != 1:
+            dbg("Error #13")
             sys.exit(4)
 
         writeLine(server_out, "GF")
         buf = readLine(server_in)
 
         if buf.count("GF ", 0, 3) != 1:
+            dbg("Error #14")
             sys.exit(4)
 
     os.close(server_in)


More information about the samba-technical mailing list