[yum-git] Branch 'yum-3_2_X' - Makefile test/skipbroken-tests.py

Tim Lauridsen timlau at linux.duke.edu
Thu Aug 28 07:21:06 UTC 2008


 Makefile                 |    3 ++
 test/skipbroken-tests.py |   49 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 51 insertions(+), 1 deletion(-)

New commits:
commit 780fe2a6960b55d3316fb9f10907b12af9af0072
Author: Tim Lauridsen <tilau at tlaws.ibm.com>
Date:   Thu Aug 28 09:20:57 2008 +0200

    Added test-skipbroken make target and some extra testcases

diff --git a/Makefile b/Makefile
index f9e8d76..47b364a 100644
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,9 @@ test:
 	@nosetests -i ".*test" test
 	@test/check-po-yes-no.py
 
+test-skipbroken:
+	@nosetests -i ".*test" test/skipbroken-tests.py
+
 check: test
 
 changelog:
diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
index f308fdd..47480fe 100644
--- a/test/skipbroken-tests.py
+++ b/test/skipbroken-tests.py
@@ -358,7 +358,54 @@ class SkipBrokenTests(DepsolveTests):
         self.tsInfo.addUpdate(po2, oldpo=ipo2)
         self.assertEquals('empty', *self.resolveCode(skip=True))
         self.assertResult([ipo1,ipo2])
-        
+
+    def testInstReqOldVer1(self):
+    	""" 
+    	zap-2.0 updates zap-1.0, but zap-2.0 needs barlib-2.0 provided by
+    	bar-2.0, but the installed foo, needs barlib-1.0,  so it need to be updated to
+    	foo-2.0, that requires barlib-2.0
+    	But it only work if foo-1.0 -> foo-2.0 is added as an update, it is not 
+    	pulled in by it self.
+    	"""
+        ipo1 = self.instPackage('foo', '1')
+        ipo1.addRequires('barlib', 'EQ', ('0', '1', '0'))
+        ipo2 = self.instPackage('bar', '1')
+        ipo2.addProvides('barlib', 'EQ', ('0', '1', '0'))
+        ipo3 = self.instPackage('zap', '1')
+        po1 = self.repoPackage('foo', '2')
+        po1.addRequires('barlib', 'EQ', ('0', '2', '0'))
+        po2 = self.repoPackage('bar', '2')
+        po2.addProvides('barlib', 'EQ', ('0', '2', '0'))
+        po3 = self.repoPackage('zap', '2')
+        po3.addRequires('barlib', 'EQ', ('0', '2', '0'))
+        self.tsInfo.addUpdate(po1, oldpo=ipo1) # why is this needed, it should work without ?
+        self.tsInfo.addUpdate(po3, oldpo=ipo3)
+        self.assertEquals('ok', *self.resolveCode(skip=True))
+        self.assertResult([po1,po2,po3])               
+
+    def testInstReqOldVer2(self):
+    	""" 
+    	zap-2.0 updates zap-1.0, but zap-2.0 needs barlib-2.0 provided by
+    	bar-2.0, but the installed foo, needs barlib-1.0,  so it need to be updated to
+    	foo-2.0, that requires barlib-2.0
+    	But it only work if foo-1.0 -> foo-2.0 is added as an update, it is not 
+    	pulled in by it self.
+    	"""
+        ipo1 = self.instPackage('foo', '1')
+        ipo1.addRequires('barlib', 'EQ', ('0', '1', '0'))
+        ipo2 = self.instPackage('bar', '1')
+        ipo2.addProvides('barlib', 'EQ', ('0', '1', '0'))
+        ipo3 = self.instPackage('zap', '1')
+        po1 = self.repoPackage('foo', '2')
+        po1.addRequires('barlib', 'EQ', ('0', '2', '0'))
+        po2 = self.repoPackage('bar', '2')
+        po2.addProvides('barlib', 'EQ', ('0', '2', '0'))
+        po3 = self.repoPackage('zap', '2')
+        po3.addRequires('barlib', 'EQ', ('0', '2', '0'))
+        #self.tsInfo.addUpdate(po1, oldpo=ipo1) # why is this needed, it should work without ?
+        self.tsInfo.addUpdate(po3, oldpo=ipo3)
+        self.assertEquals('ok', *self.resolveCode(skip=True))
+        self.assertResult([po1,po2,po3])               
     
     def resolveCode(self,skip = False):
         solver = YumBase()



More information about the Yum-cvs-commits mailing list