[csw-devel] SF.net SVN: gar:[11228] csw/mgar/gar/v2/lib/python
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Sun Oct 10 22:40:44 CEST 2010
Revision: 11228
http://gar.svn.sourceforge.net/gar/?rev=11228&view=rev
Author: wahwah
Date: 2010-10-10 20:40:43 +0000 (Sun, 10 Oct 2010)
Log Message:
-----------
mGAR v2: Checking that the soname is a substring of file name.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/package_checks.py
csw/mgar/gar/v2/lib/python/package_checks_test.py
Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py 2010-10-10 20:40:16 UTC (rev 11227)
+++ csw/mgar/gar/v2/lib/python/package_checks.py 2010-10-10 20:40:43 UTC (rev 11228)
@@ -1109,11 +1109,23 @@
pass
-def SharedLibraryNameMustBeAsubstringOfSoname():
- pass
+def CheckSharedLibraryNameMustBeAsubstringOfSoname(
+ pkg_data, error_mgr, logger, messenger):
+ pkgname = pkg_data["basic_stats"]["pkgname"]
+ for binary_info in pkg_data["binaries_dump_info"]:
+ if "soname" in binary_info:
+ if binary_info["soname"] not in binary_info["base_name"]:
+ error_mgr.ReportError(
+ "soname-not-part-of-filename",
+ "soname=%s "
+ "filename=%s"
+ % (binary_info["soname"], binary_info["base_name"]))
-def SonameMustNotBeEqualToFileNameIfFilenameEndsWithSo():
+
+def CheckSonameMustNotBeEqualToFileNameIfFilenameEndsWithSo(
+ pkg_data, error_mgr, logger, messenger):
pass
-def LinkableSoFileMustBeAsymlink():
+def CheckLinkableSoFileMustBeAsymlink(
+ pkg_data, error_mgr, logger, messenger):
pass
Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py 2010-10-10 20:40:16 UTC (rev 11227)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py 2010-10-10 20:40:43 UTC (rev 11228)
@@ -1340,5 +1340,23 @@
'shared-lib-package-contains-so-symlink', 'file=/opt/csw/lib/sparcv9/libneon.so')
+class TestCheckSharedLibraryNameMustBeAsubstringOfSonameGood(
+ CheckpkgUnitTestHelper, unittest.TestCase):
+ FUNCTION_NAME = 'CheckSharedLibraryNameMustBeAsubstringOfSoname'
+ def CheckpkgTest(self):
+ self.pkg_data = neon_stats[0]
+
+
+class TestCheckSharedLibraryNameMustBeAsubstringOfSonameGood(
+ CheckpkgUnitTestHelper, unittest.TestCase):
+ FUNCTION_NAME = 'CheckSharedLibraryNameMustBeAsubstringOfSoname'
+ def CheckpkgTest(self):
+ self.pkg_data = copy.deepcopy(neon_stats[0])
+ self.pkg_data["binaries_dump_info"][3]["base_name"] = "foo.so.1"
+ self.error_mgr_mock.ReportError(
+ 'soname-not-part-of-filename',
+ 'soname=libneon.so.27 filename=foo.so.1')
+
+
if __name__ == '__main__':
unittest.main()
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