changeset 69778:07613ea46dbc

Merge: I was right, hardconding the localhost IP doesn't work in linux-vserver.
author R David Murray <rdmurray@bitdance.com>
date Mon, 02 May 2011 08:48:00 -0400
parents 51fe7d3250a1 (current diff) 89b9b7094068 (diff)
children f587197864b0
files Lib/test/test_smtplib.py
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/test/test_smtplib.py	Mon May 02 13:18:21 2011 +0100
+++ b/Lib/test/test_smtplib.py	Mon May 02 08:48:00 2011 -0400
@@ -290,8 +290,7 @@
         self.serv_evt.wait()
         self.output.flush()
         # Add the X-Peer header that DebuggingServer adds
-        # XXX: I'm not sure hardcoding this IP will work on linux-vserver.
-        m['X-Peer'] = '127.0.0.1'
+        m['X-Peer'] = socket.gethostbyname('localhost')
         mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
         self.assertEqual(self.output.getvalue(), mexpect)
 
@@ -311,8 +310,7 @@
         self.serv_evt.wait()
         self.output.flush()
         # Add the X-Peer header that DebuggingServer adds
-        # XXX: I'm not sure hardcoding this IP will work on linux-vserver.
-        m['X-Peer'] = '127.0.0.1'
+        m['X-Peer'] = socket.gethostbyname('localhost')
         # The Bcc header is deleted before serialization.
         del m['Bcc']
         mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
@@ -341,8 +339,7 @@
         self.serv_evt.wait()
         self.output.flush()
         # Add the X-Peer header that DebuggingServer adds
-        # XXX: I'm not sure hardcoding this IP will work on linux-vserver.
-        m['X-Peer'] = '127.0.0.1'
+        m['X-Peer'] = socket.gethostbyname('localhost')
         mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
         self.assertEqual(self.output.getvalue(), mexpect)
         debugout = smtpd.DEBUGSTREAM.getvalue()