Index: third_party/psutil/test/_posix.py |
diff --git a/third_party/psutil/test/_posix.py b/third_party/psutil/test/_posix.py |
old mode 100644 |
new mode 100755 |
index ad0db64a003f8d621f0043f845257744f50e588f..532b6226259910c66a7aacbf3d79ebc9972191c2 |
--- a/third_party/psutil/test/_posix.py |
+++ b/third_party/psutil/test/_posix.py |
@@ -1,6 +1,6 @@ |
#!/usr/bin/env python |
# |
-# $Id: _posix.py 1142 2011-10-05 18:45:49Z g.rodola $ |
+# $Id: _posix.py 1204 2011-10-24 19:19:01Z g.rodola $ |
# |
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. |
# Use of this source code is governed by a BSD-style license that can be |
@@ -134,10 +134,26 @@ class PosixSpecificTestCase(unittest.TestCase): |
pids_ps.sort() |
pids_psutil.sort() |
+ # on OSX ps doesn't show pid 0 |
+ if OSX and 0 not in pids_ps: |
+ pids_ps.insert(0, 0) |
+ |
if pids_ps != pids_psutil: |
difference = [x for x in pids_psutil if x not in pids_ps] + \ |
[x for x in pids_ps if x not in pids_psutil] |
self.fail("difference: " + str(difference)) |
+ |
+ def test_nic_names(self): |
+ p = subprocess.Popen("ifconfig -a", shell=1, stdout=subprocess.PIPE) |
+ output = p.communicate()[0].strip() |
+ if sys.version_info >= (3,): |
+ output = str(output, sys.stdout.encoding) |
+ for nic in psutil.network_io_counters(pernic=True).keys(): |
+ for line in output.split(): |
+ if line.startswith(nic): |
+ break |
+ else: |
+ self.fail("couldn't find %s nic in 'ifconfig -a' output" % nic) |
if __name__ == '__main__': |