[Yum-devel] [UG] Failing mirror tests for ftp
Paul Nasrat
pnasrat at redhat.com
Wed Nov 1 15:17:29 UTC 2006
Whilst debugging an installer issue we noticed some inconsistencies
between ftp/http mirror handling - if you do the following
diff -u -u -r1.8 base_test_code.py
--- base_test_code.py 25 Feb 2005 00:00:36 -0000 1.8
+++ base_test_code.py 1 Nov 2006 15:12:12 -0000
@@ -19,7 +19,7 @@
ref_404 = base_http + 'nonexistent_file'
ref_403 = base_http + 'mirror/broken/'
-base_mirror_url = base_http + 'mirror/'
+base_mirror_url = base_ftp + 'mirror/'
good_mirrors = ['m1', 'm2', 'm3']
mirror_files = ['test1.txt', 'test2.txt']
bad_mirrors = ['broken']
and run the test_mirror.py we get the following (note runs clean with
default settings and also test_grabber is clean).
python test_mirror.py
mirror.py tests
ActionTests
test the effects of a callback-returned action ... ok
test default action policy ... ok
test the effects of passed-in default_action ... ok
test the effects of method-level default_action ... ok
BadMirrorTests
test that a bad mirror raises URLGrabError ... FAIL
BasicTests
MirrorGroup.urlgrab ... ok
MirrorGroup.urlopen ... ok
MirrorGroup.urlread ... ok
CallbackTests
test that the callback can correctly re-raise the exception ... FAIL
test that MG executes the failure callback correctly ... ERROR
FailoverTests
test that a the MG fails over past a bad mirror ... FAIL
SubclassTests
MGRandomOrder.urlgrab ... ok
MGRandomStart.urlgrab ... ok
===============================================================================
ERROR: test that MG executes the failure callback correctly
-------------------------------------------------------------------------------
Traceback (most recent call last):
File "test_mirror.py", line 119, in test_failure_callback
self.assertEquals(tricky_list[0][:25],
IndexError: list index out of range
===============================================================================
FAIL: test that a bad mirror raises URLGrabError
-------------------------------------------------------------------------------
Traceback (most recent call last):
File "test_mirror.py", line 138, in test_simple_grab
self.assertRaises(URLGrabError, self.mg.urlgrab, url, filename)
File "/home/pauln/scm/duke/urlgrabber/test/munittest.py", line 389, in failUnlessRaises
raise self.failureException, excName
AssertionError: URLGrabError
===============================================================================
FAIL: test that the callback can correctly re-raise the exception
-------------------------------------------------------------------------------
Traceback (most recent call last):
File "test_mirror.py", line 126, in test_callback_reraise
self.assertRaises(URLGrabError, self.mg.urlread, 'reference')
File "/home/pauln/scm/duke/urlgrabber/test/munittest.py", line 389, in failUnlessRaises
raise self.failureException, excName
AssertionError: URLGrabError
===============================================================================
FAIL: test that a the MG fails over past a bad mirror
-------------------------------------------------------------------------------
Traceback (most recent call last):
File "test_mirror.py", line 161, in test_simple_grab
self.assertEqual(len(elist), 1)
File "/home/pauln/scm/duke/urlgrabber/test/munittest.py", line 396, in failUnlessEqual
raise self.failureException, \
AssertionError: 0 != 1
-------------------------------------------------------------------------------
Ran 13 tests in 0.312s
FAILED (failures=3, errors=1)
More information about the Yum-devel
mailing list