From: Cameron Dale Date: Sun, 13 Apr 2008 06:52:15 +0000 (-0700) Subject: Fix some tests and add some TODO items. X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=commitdiff_plain;h=bb608b26926f9a1db5f4c8583ed7a37e6f5a6b25 Fix some tests and add some TODO items. --- diff --git a/TODO b/TODO index 49a33d8..9f1e2f7 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,16 @@ +Retry when joining the DHT. + +If a join node can not be reached when the program is started, it will +currently give up and quit. Instead, it should try and join +periodically every few minutes until it is successful. + + +Add statistics gathering to the peer downloading. + +Statistics are needed of how much has been uploaded, downloaded from +peers, and downloaded from mirrors. + + Add all cache files to the database. All files in the cache should be added to the database, so that they can diff --git a/apt_p2p/HTTPServer.py b/apt_p2p/HTTPServer.py index cc6233b..7f74788 100644 --- a/apt_p2p/HTTPServer.py +++ b/apt_p2p/HTTPServer.py @@ -272,7 +272,7 @@ class TestTopLevel(unittest.TestCase): if hash == self.torrent_hash: return [{'pieces': self.torrent}] elif hash == self.file_hash: - return [{'path': FilePath('/boot/initrd')}] + return [{'path': FilePath('/boot/grub/stage2')}] else: return [] diff --git a/apt_p2p/PeerManager.py b/apt_p2p/PeerManager.py index 68a3c32..dd450ff 100644 --- a/apt_p2p/PeerManager.py +++ b/apt_p2p/PeerManager.py @@ -403,7 +403,7 @@ class FileDownload: **{'callbackArgs': (key, site), 'errbackArgs': (key, site)}) self.outstanding += 1 - if self.outstanding >= 3: + if self.outstanding >= 4: break log.msg('Done sending piece hash requests for now, %d outstanding' % self.outstanding) diff --git a/test.py b/test.py index f861b65..acbeeae 100755 --- a/test.py +++ b/test.py @@ -51,7 +51,6 @@ tests = {'1': ('Start a single bootstrap and downloader, test updating and downl (1, ['install', 'asis-doc']), (1, ['install', 'bison-doc']), (1, ['install', 'crash-whitepaper']), - (1, ['install', 'doc-iana']), ]), '2': ('Start a single bootstrap and 2 downloaders to test downloading from a peer.', @@ -86,35 +85,35 @@ tests = {'1': ('Start a single bootstrap and downloader, test updating and downl 5: {}, 6: {}}, [(1, ['update']), - (2, ['update']), - (3, ['update']), (1, ['install', 'aboot-base']), (1, ['install', 'ada-reference-manual']), (1, ['install', 'fop-doc']), - (1, ['install', 'doc-iana']), + (1, ['install', 'crash-whitepaper']), + (2, ['update']), (2, ['install', 'aboot-base']), (2, ['install', 'ada-reference-manual']), (2, ['install', 'fop-doc']), - (2, ['install', 'doc-iana']), + (2, ['install', 'crash-whitepaper']), + (3, ['update']), (3, ['install', 'aboot-base']), (3, ['install', 'ada-reference-manual']), (3, ['install', 'fop-doc']), - (3, ['install', 'doc-iana']), + (3, ['install', 'crash-whitepaper']), (4, ['update']), (4, ['install', 'aboot-base']), (4, ['install', 'ada-reference-manual']), (4, ['install', 'fop-doc']), - (4, ['install', 'doc-iana']), + (4, ['install', 'crash-whitepaper']), (5, ['update']), (5, ['install', 'aboot-base']), (5, ['install', 'ada-reference-manual']), (5, ['install', 'fop-doc']), - (5, ['install', 'doc-iana']), + (5, ['install', 'crash-whitepaper']), (6, ['update']), (6, ['install', 'aboot-base']), (6, ['install', 'ada-reference-manual']), (6, ['install', 'fop-doc']), - (6, ['install', 'doc-iana']), + (6, ['install', 'crash-whitepaper']), ]), '4': ('Start a single bootstrap and 1 downloader, requesting the same' + @@ -125,17 +124,17 @@ tests = {'1': ('Start a single bootstrap and downloader, test updating and downl (1, ['install', 'aboot-base']), (1, ['install', 'ada-reference-manual']), (1, ['install', 'fop-doc']), - (1, ['install', 'doc-iana']), + (1, ['install', 'crash-whitepaper']), (1, ['update']), (1, ['install', 'aboot-base']), (1, ['install', 'ada-reference-manual']), (1, ['install', 'fop-doc']), - (1, ['install', 'doc-iana']), + (1, ['install', 'crash-whitepaper']), (1, ['update']), (1, ['install', 'aboot-base']), (1, ['install', 'ada-reference-manual']), (1, ['install', 'fop-doc']), - (1, ['install', 'doc-iana']), + (1, ['install', 'crash-whitepaper']), ]), '5': ('Start a single bootstrap and 6 downloaders, update all to test' + @@ -169,12 +168,12 @@ tests = {'1': ('Start a single bootstrap and downloader, test updating and downl {1: {}}, [(1, ['update']), (1, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), ]), @@ -188,65 +187,65 @@ tests = {'1': ('Start a single bootstrap and downloader, test updating and downl 6: {}}, [(1, ['update']), (1, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), (2, ['update']), (2, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), (3, ['update']), (3, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), (4, ['update']), (4, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), (5, ['update']), (5, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), (6, ['update']), (6, ['install', 'aboot-base', 'aap-doc', 'ada-reference-manual', - 'aspectj-doc', 'fop-doc', 'jswat-doc', 'asis-doc', - 'bison-doc', 'crash-whitepaper', 'doc-iana', + 'aspectj-doc', 'fop-doc', 'asis-doc', + 'bison-doc', 'crash-whitepaper', 'bash-doc', 'apt-howto-common', 'autotools-dev', - 'aptitude-doc-en', 'armagetron-common', 'asr-manpages', - 'atomix-data', 'alcovebook-sgml-doc', 'alamin-doc', - 'aegis-doc', 'afbackup-common', 'airstrike-common', + 'aptitude-doc-en', 'asr-manpages', + 'atomix-data', 'alcovebook-sgml-doc', + 'afbackup-common', 'airstrike-common', ]), ]), '9': ('Start a single bootstrap and 6 downloaders and test downloading' + ' a very large file.', {1: {}}, - {1: {'clean': False}, - 2: {'clean': False}, + {1: {}, + 2: {}, 3: {}, 4: {}, 5: {},