コード例 #1
0
 def testMySocketAppears(self):
     udpserv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     udpserv.bind(('', 0))
     connkey = Connection(local=udpserv.getsockname(), remote=("0.0.0.0", 0), family=udpserv.family, protocol=socket.IPPROTO_UDP)
     inode = map_netconn_to_inode()[connkey]
     procinfo = map_sockino_to_procinfo()[inode]
     self.assertEqual(os.getpid(), procinfo.pid)
     self.assertEqual(os.environ['LOGNAME'], procinfo.user)
     udpserv.close()
     self.assert_(connkey not in map_netconn_to_inode())
コード例 #2
0
 def testInodeCountSanity(self):
     self.assert_(len(map_sockino_to_procinfo()) > len(map_netconn_to_inode()))