summaryrefslogtreecommitdiff
path: root/tests/negtelnetserver.py
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-04-05 19:18:09 +0200
committerMarc Hoersken <info@marc-hoersken.de>2020-04-11 23:44:52 +0200
commit3f60a9e995c851a1dff2439cb16407d86cde7754 (patch)
treec1c50276226963c95764ed1ed9a795b26b98b708 /tests/negtelnetserver.py
parent6d13ef532598e4fc54dbf03c1373b0a3c4c597f5 (diff)
downloadcurl-3f60a9e995c851a1dff2439cb16407d86cde7754.tar.gz
tests: fix conflict between Cygwin/msys and Windows PIDs
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
Diffstat (limited to 'tests/negtelnetserver.py')
-rwxr-xr-xtests/negtelnetserver.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/negtelnetserver.py b/tests/negtelnetserver.py
index 1efc64b56..7171092af 100755
--- a/tests/negtelnetserver.py
+++ b/tests/negtelnetserver.py
@@ -49,6 +49,9 @@ def telnetserver(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(str(pid))
@@ -86,7 +89,11 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
if VERIFIED_REQ.encode('utf-8') in data:
log.debug("Received verification request from test framework")
- response = VERIFIED_RSP.format(pid=os.getpid())
+ pid = os.getpid()
+ # see tests/server/util.c function write_pidfile
+ if os.name == "nt":
+ pid += 65536
+ response = VERIFIED_RSP.format(pid=pid)
response_data = response.encode('utf-8')
else:
log.debug("Received normal request - echoing back")