From 3f60a9e995c851a1dff2439cb16407d86cde7754 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sun, 5 Apr 2020 19:18:09 +0200 Subject: tests: fix conflict between Cygwin/msys and Windows PIDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 65536 to Windows PIDs to allow Windows specific treatment by having disjunct ranges for Cygwin/msys and Windows PIDs. See also: - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ h=b5e1003722cb14235c4f166be72c09acdffc62ea - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ h=448cf5aa4b429d5a9cebf92a0da4ab4b5b6d23fe Replaces #5178 Closes #5188 --- tests/smbserver.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/smbserver.py') diff --git a/tests/smbserver.py b/tests/smbserver.py index d320fb21e..30caa04b7 100755 --- a/tests/smbserver.py +++ b/tests/smbserver.py @@ -61,8 +61,11 @@ def smbserver(options): """ if options.pidfile: pid = os.getpid() + # see tests/server/util.c function write_pidfile + if os.name == "nt": + pid += 65536 with open(options.pidfile, "w") as f: - f.write("{0}".format(pid)) + f.write(str(pid)) # Here we write a mini config for the server smb_config = configparser.ConfigParser() @@ -267,7 +270,11 @@ class TestSmbServer(imp_smbserver.SMBSERVER): if requested_filename == VERIFIED_REQ: log.debug("[SMB] Verifying server is alive") - contents = VERIFIED_RSP.format(pid=os.getpid()).encode('utf-8') + pid = os.getpid() + # see tests/server/util.c function write_pidfile + if os.name == "nt": + pid += 65536 + contents = VERIFIED_RSP.format(pid=pid).encode('utf-8') self.write_to_fid(fid, contents) return fid, filename -- cgit v1.2.3