Commit b912c5a0 authored by R David Murray's avatar R David Murray

I was right, hardconding the localhost IP doesn't work in linux-vserver.

parent 38cfe896
...@@ -290,8 +290,7 @@ class DebuggingServerTests(unittest.TestCase): ...@@ -290,8 +290,7 @@ class DebuggingServerTests(unittest.TestCase):
self.serv_evt.wait() self.serv_evt.wait()
self.output.flush() self.output.flush()
# Add the X-Peer header that DebuggingServer adds # Add the X-Peer header that DebuggingServer adds
# XXX: I'm not sure hardcoding this IP will work on linux-vserver. m['X-Peer'] = socket.gethostbyname('localhost')
m['X-Peer'] = '127.0.0.1'
mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
self.assertEqual(self.output.getvalue(), mexpect) self.assertEqual(self.output.getvalue(), mexpect)
...@@ -311,8 +310,7 @@ class DebuggingServerTests(unittest.TestCase): ...@@ -311,8 +310,7 @@ class DebuggingServerTests(unittest.TestCase):
self.serv_evt.wait() self.serv_evt.wait()
self.output.flush() self.output.flush()
# Add the X-Peer header that DebuggingServer adds # Add the X-Peer header that DebuggingServer adds
# XXX: I'm not sure hardcoding this IP will work on linux-vserver. m['X-Peer'] = socket.gethostbyname('localhost')
m['X-Peer'] = '127.0.0.1'
# The Bcc header is deleted before serialization. # The Bcc header is deleted before serialization.
del m['Bcc'] del m['Bcc']
mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
...@@ -341,8 +339,7 @@ class DebuggingServerTests(unittest.TestCase): ...@@ -341,8 +339,7 @@ class DebuggingServerTests(unittest.TestCase):
self.serv_evt.wait() self.serv_evt.wait()
self.output.flush() self.output.flush()
# Add the X-Peer header that DebuggingServer adds # Add the X-Peer header that DebuggingServer adds
# XXX: I'm not sure hardcoding this IP will work on linux-vserver. m['X-Peer'] = socket.gethostbyname('localhost')
m['X-Peer'] = '127.0.0.1'
mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
self.assertEqual(self.output.getvalue(), mexpect) self.assertEqual(self.output.getvalue(), mexpect)
debugout = smtpd.DEBUGSTREAM.getvalue() debugout = smtpd.DEBUGSTREAM.getvalue()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment