From 60ea31903c4ba5606dc649f17e15b0aae1bfb8d1 Mon Sep 17 00:00:00 2001 From: Sarp Centel Date: Wed, 9 Oct 2024 14:12:34 +0300 Subject: [PATCH] update fixture --- .../fixtures/handshake/with_peer_check | 19 ++++--- internal/test_helpers/fixtures/pass_all | 50 +++++++++++-------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/internal/test_helpers/fixtures/handshake/with_peer_check b/internal/test_helpers/fixtures/handshake/with_peer_check index 363a81e..9508633 100644 --- a/internal/test_helpers/fixtures/handshake/with_peer_check +++ b/internal/test_helpers/fixtures/handshake/with_peer_check @@ -1,10 +1,15 @@ [stage-9] Running tests for Stage #9: ca4 -[stage-9] Running ./your_bittorrent.sh handshake /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1690285242/test.torrent 127.0.0.1:53062 +[stage-9] Running ./your_bittorrent.sh handshake /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2924496160/test.torrent 127.0.0.1:61762 +[stage-9] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-9] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] Peer ID: ee8f5140bfc195c36b0567cd055ac9839e682ab0 [stage-9] Test passed. [stage-8] Running tests for Stage #8: fi9 -[stage-8] Running ./your_bittorrent.sh peers /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2522557980/test.torrent +[stage-8] Running ./your_bittorrent.sh peers /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents631871142/test.torrent +[stage-8] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-8] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-8] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] 188.119.61.177:6881 [your_program] 71.224.0.29:51414 [your_program] 62.153.208.98:3652 @@ -17,7 +22,7 @@ [stage-8] Test passed. [stage-7] Running tests for Stage #7: bf7 -[stage-7] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1851434758/test.torrent +[stage-7] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3457398432/test.torrent [your_program] Tracker URL: http://bttracker.debian.org:6969/announce [your_program] Length: 1835008 [your_program] Info Hash: 1840a71323682db707d1e8c9761049e875c03656 @@ -33,7 +38,7 @@ [stage-7] Test passed. [stage-6] Running tests for Stage #6: rb2 -[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1117024266/itsworking.gif.torrent +[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3166593543/itsworking.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 2549700 [your_program] Info Hash: 70edcac2611a8829ebf467a6849f5d8408d9d8f4 @@ -49,7 +54,7 @@ [your_program] 272a8ff8fc865b053d974a78681414b38077d7b1 [your_program] b07128d3a6018062bfe779db96d3a93c05fb81d4 [your_program] 7affc94f0985b985eb888a36ec92652821a21be4 -[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1117024266/congratulations.gif.torrent +[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3166593543/congratulations.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 820892 [your_program] Info Hash: 1cad4a486798d952614c394eb15e75bec587fd08 @@ -59,7 +64,7 @@ [your_program] 69f885b3988a52ffb03591985402b6d5285940ab [your_program] 76869e6c9c1f101f94f39de153e468be6a638f4f [your_program] bded68d02de011a2b687f75b5833f46cce8e3e9c -[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1117024266/codercat.gif.torrent +[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3166593543/codercat.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 2994120 [your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db @@ -80,7 +85,7 @@ [stage-6] Test passed. [stage-5] Running tests for Stage #5: ow9 -[stage-5] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1671383996/codercat.gif.torrent +[stage-5] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1440811684/codercat.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 2994120 [your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db diff --git a/internal/test_helpers/fixtures/pass_all b/internal/test_helpers/fixtures/pass_all index 05c7e2d..7e07791 100644 --- a/internal/test_helpers/fixtures/pass_all +++ b/internal/test_helpers/fixtures/pass_all @@ -1,5 +1,5 @@ [stage-19] Running tests for Stage #19: dv7 -[stage-19] Running ./your_bittorrent.sh magnet_download -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1734244054/magnet1.gif "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2Fbittorrent-test-tracker.codecrafters.io%2Fannounce" +[stage-19] Running ./your_bittorrent.sh magnet_download -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents253494597/magnet1.gif "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2Fbittorrent-test-tracker.codecrafters.io%2Fannounce" [your_program] Peer ID: 2d524e302e302e302d4d3da0d6e8da27b42c4da7 [your_program] Peer Metadata Extension ID: 1 [your_program] extended message payload d8:msg_typei0e5:piecei0ee @@ -9,13 +9,13 @@ [stage-19] Test passed. [stage-18] Running tests for Stage #18: qv6 -[stage-18] Running ./your_bittorrent.sh magnet_download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents4129657590/piece-1 "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2Fbittorrent-test-tracker.codecrafters.io%2Fannounce" 1 +[stage-18] Running ./your_bittorrent.sh magnet_download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3086825556/piece-1 "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2Fbittorrent-test-tracker.codecrafters.io%2Fannounce" 1 [your_program] Peer ID: 2d524e302e302e302d4d3da0d6e8da27b42c4da7 [your_program] Peer Metadata Extension ID: 1 [your_program] extended message payload d8:msg_typei0e5:piecei0ee [stage-18] ✓ Piece size is correct. [stage-18] ✓ Piece SHA-1 is correct. -[stage-18] Running ./your_bittorrent.sh magnet_download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents4129657590/piece-2 "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2Fbittorrent-test-tracker.codecrafters.io%2Fannounce" 2 +[stage-18] Running ./your_bittorrent.sh magnet_download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3086825556/piece-2 "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2Fbittorrent-test-tracker.codecrafters.io%2Fannounce" 2 [your_program] Peer ID: 2d524e302e302e302d4d3da0d6e8da27b42c4da7 [your_program] Peer Metadata Extension ID: 1 [your_program] extended message payload d8:msg_typei0e5:piecei0ee @@ -24,11 +24,13 @@ [stage-18] Test passed. [stage-17] Running tests for Stage #17: zh1 -[stage-17] Running ./your_bittorrent.sh magnet_info "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:64908%2Fannounce" +[stage-17] Running ./your_bittorrent.sh magnet_info "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:61792%2Fannounce" +[stage-17] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-17] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] Peer ID: c36b0567cd055ac9839e682ab0c3683bb691fa14 [your_program] Peer Metadata Extension ID: 224 [your_program] extended message payload àd8:msg_typei0e5:piecei0ee -[your_program] Tracker URL: http://127.0.0.1:64908/announce +[your_program] Tracker URL: http://127.0.0.1:61792/announce [your_program] Length: 636505 [your_program] Info Hash: ad42ce8109f54c99613ce38f9b4d87e70f24a165 [your_program] Piece Length: 262144 @@ -44,11 +46,13 @@ [stage-17] Test passed. [stage-16] Running tests for Stage #16: ns5 -[stage-16] Running ./your_bittorrent.sh magnet_info "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:64912%2Fannounce" +[stage-16] Running ./your_bittorrent.sh magnet_info "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:61796%2Fannounce" +[stage-16] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-16] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] Peer ID: c36b0567cd055ac9839e682ab0c3683bb691fa14 [your_program] Peer Metadata Extension ID: 224 [your_program] extended message payload àd8:msg_typei0e5:piecei0ee -[your_program] Tracker URL: http://127.0.0.1:64912/announce +[your_program] Tracker URL: http://127.0.0.1:61796/announce [your_program] Length: 636505 [your_program] Info Hash: ad42ce8109f54c99613ce38f9b4d87e70f24a165 [your_program] Piece Length: 262144 @@ -59,7 +63,9 @@ [stage-16] Test passed. [stage-15] Running tests for Stage #15: jk6 -[stage-15] Running ./your_bittorrent.sh magnet_handshake "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:64916%2Fannounce" +[stage-15] Running ./your_bittorrent.sh magnet_handshake "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:61800%2Fannounce" +[stage-15] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-15] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] Peer ID: c36b0567cd055ac9839e682ab0c3683bb691fa14 [your_program] Peer Metadata Extension ID: 224 [stage-15] ✓ Peer ID is correct. @@ -67,13 +73,17 @@ [stage-15] Test passed. [stage-14] Running tests for Stage #14: xi4 -[stage-14] Running ./your_bittorrent.sh magnet_handshake "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:64920%2Fannounce" +[stage-14] Running ./your_bittorrent.sh magnet_handshake "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:61804%2Fannounce" +[stage-14] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-14] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] Peer ID: c36b0567cd055ac9839e682ab0c3683bb691fa14 [your_program] Peer Metadata Extension ID: 224 [stage-14] Test passed. [stage-13] Running tests for Stage #13: pk2 -[stage-13] Running ./your_bittorrent.sh magnet_handshake "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:64924%2Fannounce" +[stage-13] Running ./your_bittorrent.sh magnet_handshake "magnet:?xt=urn:btih:ad42ce8109f54c99613ce38f9b4d87e70f24a165&dn=magnet1.gif&tr=http%3A%2F%2F127.0.0.1:61808%2Fannounce" +[stage-13] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. +[stage-13] WARNING: Common peer_ids like 00112233445566778899 are prone to collisions with other clients. Peers may only accept one connection per peer_id, increasing the chance of seeing 'Connection reset by peer' errors. Use a random peer_id instead. [your_program] Peer ID: c36b0567cd055ac9839e682ab0c3683bb691fa14 [your_program] Peer Metadata Extension ID: 224 [stage-13] Test passed. @@ -87,21 +97,21 @@ [stage-12] Test passed. [stage-11] Running tests for Stage #11: jv8 -[stage-11] Running ./your_bittorrent.sh download -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2204793881/codercat.gif /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2204793881/codercat.gif.torrent +[stage-11] Running ./your_bittorrent.sh download -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2331119924/codercat.gif /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2331119924/codercat.gif.torrent [stage-11] Test passed. [stage-10] Running tests for Stage #10: nd2 -[stage-10] Running ./your_bittorrent.sh download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3521740990/piece-2 /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3521740990/congratulations.gif.torrent 2 -[stage-10] Running ./your_bittorrent.sh download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3521740990/piece-3 /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3521740990/congratulations.gif.torrent 3 +[stage-10] Running ./your_bittorrent.sh download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2318167381/piece-2 /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2318167381/congratulations.gif.torrent 2 +[stage-10] Running ./your_bittorrent.sh download_piece -o /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2318167381/piece-3 /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2318167381/congratulations.gif.torrent 3 [stage-10] Test passed. [stage-9] Running tests for Stage #9: ca4 -[stage-9] Running ./your_bittorrent.sh handshake /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2307620495/test.torrent 127.0.0.1:64935 +[stage-9] Running ./your_bittorrent.sh handshake /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents685343119/test.torrent 127.0.0.1:61821 [your_program] Peer ID: ee8f5140bfc195c36b0567cd055ac9839e682ab0 [stage-9] Test passed. [stage-8] Running tests for Stage #8: fi9 -[stage-8] Running ./your_bittorrent.sh peers /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents113451208/test.torrent +[stage-8] Running ./your_bittorrent.sh peers /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents811895615/test.torrent [your_program] 188.119.61.177:6881 [your_program] 71.224.0.29:51414 [your_program] 62.153.208.98:3652 @@ -114,7 +124,7 @@ [stage-8] Test passed. [stage-7] Running tests for Stage #7: bf7 -[stage-7] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3782572238/test.torrent +[stage-7] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents983222841/test.torrent [your_program] Tracker URL: http://bttracker.debian.org:6969/announce [your_program] Length: 1835008 [your_program] Info Hash: 1840a71323682db707d1e8c9761049e875c03656 @@ -130,7 +140,7 @@ [stage-7] Test passed. [stage-6] Running tests for Stage #6: rb2 -[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2031322021/itsworking.gif.torrent +[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3395636425/itsworking.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 2549700 [your_program] Info Hash: 70edcac2611a8829ebf467a6849f5d8408d9d8f4 @@ -146,7 +156,7 @@ [your_program] 272a8ff8fc865b053d974a78681414b38077d7b1 [your_program] b07128d3a6018062bfe779db96d3a93c05fb81d4 [your_program] 7affc94f0985b985eb888a36ec92652821a21be4 -[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2031322021/congratulations.gif.torrent +[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3395636425/congratulations.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 820892 [your_program] Info Hash: 1cad4a486798d952614c394eb15e75bec587fd08 @@ -156,7 +166,7 @@ [your_program] 69f885b3988a52ffb03591985402b6d5285940ab [your_program] 76869e6c9c1f101f94f39de153e468be6a638f4f [your_program] bded68d02de011a2b687f75b5833f46cce8e3e9c -[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2031322021/codercat.gif.torrent +[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3395636425/codercat.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 2994120 [your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db @@ -177,7 +187,7 @@ [stage-6] Test passed. [stage-5] Running tests for Stage #5: ow9 -[stage-5] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2866522347/codercat.gif.torrent +[stage-5] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents2707272028/codercat.gif.torrent [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce [your_program] Length: 2994120 [your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db