[csw-devel] SF.net SVN: gar:[20100] csw/mgar/gar/v2/lib/python

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Jan 12 21:15:18 CET 2013


Revision: 20100
          http://gar.svn.sourceforge.net/gar/?rev=20100&view=rev
Author:   wahwah
Date:     2013-01-12 20:15:18 +0000 (Sat, 12 Jan 2013)
Log Message:
-----------
A unit test for the ldd_info bug

Context:

https://sourceforge.net/apps/trac/gar/changeset/20089
http://lists.opencsw.org/pipermail/maintainers/2013-January/017576.html
http://lists.opencsw.org/pipermail/devel/2013-January/025313.html

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/inspective_package_test.py
    csw/mgar/gar/v2/lib/python/package_stats.py

Modified: csw/mgar/gar/v2/lib/python/inspective_package_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package_test.py	2013-01-12 16:17:31 UTC (rev 20099)
+++ csw/mgar/gar/v2/lib/python/inspective_package_test.py	2013-01-12 20:15:18 UTC (rev 20100)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.6
+#!/opt/csw/bin/python2.6
 
 import unittest2 as unittest
 import inspective_package
@@ -147,7 +147,23 @@
 
     self.assertEqual(fake_binary_elfinfo, ip.GetBinaryElfInfo())
 
+  def testGetLddMinusRlines(self):
+    ip = inspective_package.InspectivePackage("/tmp/CSWfake")
+    self.mox.StubOutWithMock(ip, 'ListBinaries')
+    self.mox.StubOutWithMock(os, 'chmod')
+    self.mox.StubOutWithMock(os, 'uname')
+    os.chmod('/tmp/CSWfake/root/bin/foo', 0755)
+    os.uname().AndReturn('i86pc')
+    ip.ListBinaries().AndReturn(['bin/foo'])
+    self.mox.StubOutWithMock(inspective_package, 'ShellCommand')
+    inspective_package.ShellCommand(
+        ['ldd', '-Ur', '/tmp/CSWfake/root/bin/foo'],
+        timeout=10).AndReturn((0, "", ""))
+    self.mox.StubOutWithMock(ip, '_ParseLddDashRline')
+    self.mox.ReplayAll()
+    self.assertEqual({'bin/foo': []}, ip.GetLddMinusRlines())
 
+
 class PackageStatsUnitTest(unittest.TestCase):
 
   def setUp(self):

Modified: csw/mgar/gar/v2/lib/python/package_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_stats.py	2013-01-12 16:17:31 UTC (rev 20099)
+++ csw/mgar/gar/v2/lib/python/package_stats.py	2013-01-12 20:15:18 UTC (rev 20100)
@@ -337,15 +337,6 @@
     for override_dict in pkg_stats["overrides"]:
       o = m.CheckpkgOverride(srv4_file=db_pkg_stats,
                              **override_dict)
-    # The ldd -r reporting breaks on bigger packages during yaml saving.
-    # It might work when yaml is disabled
-    # self.DumpObject(self.GetLddMinusRlines(), "ldd_dash_r")
-    # This check is currently disabled, let's save time by not collecting
-    # these data.
-    # self.DumpObject(self.GetDefinedSymbols(), "defined_symbols")
-    # This one should be last, so that if the collection is interrupted
-    # in one of the previous runs, the basic_stats.pickle file is not there
-    # or not updated, and the collection is started again.
     return db_pkg_stats
 
   @classmethod

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list