Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: third_party/psutil/test/_posix.py

Issue 8774018: Add psutil build step to fix pyauto media issues. Upgrade psutil to 0.4.0. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Mac builds. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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__':

Powered by Google App Engine
This is Rietveld 408576698