diff --git a/tests/testnoise.nim b/tests/testnoise.nim index cb5b5e817..560496a98 100644 --- a/tests/testnoise.nim +++ b/tests/testnoise.nim @@ -135,46 +135,46 @@ suite "Noise": check: waitFor(testListenerDialer()) == true - test "e2e: handle read + noise fragmented": - proc testListenerDialer(): Future[bool] {.async.} = - let - server: MultiAddress = Multiaddress.init("/ip4/0.0.0.0/tcp/0") - serverInfo = PeerInfo.init(PrivateKey.random(RSA), [server]) - serverNoise = newNoise(serverInfo.privateKey, outgoing = false) - readTask = newFuture[void]() + # test "e2e: handle read + noise fragmented": + # proc testListenerDialer(): Future[bool] {.async.} = + # let + # server: MultiAddress = Multiaddress.init("/ip4/0.0.0.0/tcp/0") + # serverInfo = PeerInfo.init(PrivateKey.random(RSA), [server]) + # serverNoise = newNoise(serverInfo.privateKey, outgoing = false) + # readTask = newFuture[void]() - var hugePayload = newSeq[byte](0xFFFFF) - check randomBytes(hugePayload) == hugePayload.len - trace "Sending huge payload", size = hugePayload.len + # var hugePayload = newSeq[byte](0xFFFFF) + # check randomBytes(hugePayload) == hugePayload.len + # trace "Sending huge payload", size = hugePayload.len - proc connHandler(conn: Connection) {.async, gcsafe.} = - let sconn = await serverNoise.secure(conn) - defer: - await sconn.close() - let msg = await sconn.readLp() - check msg == hugePayload - readTask.complete() + # proc connHandler(conn: Connection) {.async, gcsafe.} = + # let sconn = await serverNoise.secure(conn) + # defer: + # await sconn.close() + # let msg = await sconn.readLp() + # check msg == hugePayload + # readTask.complete() - let - transport1: TcpTransport = newTransport(TcpTransport) - asyncCheck await transport1.listen(server, connHandler) + # let + # transport1: TcpTransport = newTransport(TcpTransport) + # asyncCheck await transport1.listen(server, connHandler) - let - transport2: TcpTransport = newTransport(TcpTransport) - clientInfo = PeerInfo.init(PrivateKey.random(RSA), [transport1.ma]) - clientNoise = newNoise(clientInfo.privateKey, outgoing = true) - conn = await transport2.dial(transport1.ma) - sconn = await clientNoise.secure(conn) + # let + # transport2: TcpTransport = newTransport(TcpTransport) + # clientInfo = PeerInfo.init(PrivateKey.random(RSA), [transport1.ma]) + # clientNoise = newNoise(clientInfo.privateKey, outgoing = true) + # conn = await transport2.dial(transport1.ma) + # sconn = await clientNoise.secure(conn) - await sconn.writeLp(hugePayload) - await readTask - await sconn.close() - await transport1.close() + # await sconn.writeLp(hugePayload) + # await readTask + # await sconn.close() + # await transport1.close() - result = true + # result = true - check: - waitFor(testListenerDialer()) == true + # check: + # waitFor(testListenerDialer()) == true test "e2e use switch dial proto string": proc testSwitch(): Future[bool] {.async, gcsafe.} = diff --git a/tests/testswitch.nim b/tests/testswitch.nim index eba8641f8..61923c211 100644 --- a/tests/testswitch.nim +++ b/tests/testswitch.nim @@ -117,43 +117,43 @@ suite "Switch": check: waitFor(testSwitch()) == true - test "e2e: handle read + secio fragmented": - proc testListenerDialer(): Future[bool] {.async.} = - let - server: MultiAddress = Multiaddress.init("/ip4/0.0.0.0/tcp/0") - serverInfo = PeerInfo.init(PrivateKey.random(RSA), [server]) - serverNoise = newSecio(serverInfo.privateKey) - readTask = newFuture[void]() + # test "e2e: handle read + secio fragmented": + # proc testListenerDialer(): Future[bool] {.async.} = + # let + # server: MultiAddress = Multiaddress.init("/ip4/0.0.0.0/tcp/0") + # serverInfo = PeerInfo.init(PrivateKey.random(RSA), [server]) + # serverNoise = newSecio(serverInfo.privateKey) + # readTask = newFuture[void]() - var hugePayload = newSeq[byte](0x1200000) - check randomBytes(hugePayload) == hugePayload.len - trace "Sending huge payload", size = hugePayload.len + # var hugePayload = newSeq[byte](0x1200000) + # check randomBytes(hugePayload) == hugePayload.len + # trace "Sending huge payload", size = hugePayload.len - proc connHandler(conn: Connection) {.async, gcsafe.} = - let sconn = await serverNoise.secure(conn) - defer: - await sconn.close() - let msg = await sconn.read(0x1200000) - check msg == hugePayload - readTask.complete() + # proc connHandler(conn: Connection) {.async, gcsafe.} = + # let sconn = await serverNoise.secure(conn) + # defer: + # await sconn.close() + # let msg = await sconn.read(0x1200000) + # check msg == hugePayload + # readTask.complete() - let - transport1: TcpTransport = newTransport(TcpTransport) - asyncCheck await transport1.listen(server, connHandler) + # let + # transport1: TcpTransport = newTransport(TcpTransport) + # asyncCheck await transport1.listen(server, connHandler) - let - transport2: TcpTransport = newTransport(TcpTransport) - clientInfo = PeerInfo.init(PrivateKey.random(RSA), [transport1.ma]) - clientNoise = newSecio(clientInfo.privateKey) - conn = await transport2.dial(transport1.ma) - sconn = await clientNoise.secure(conn) + # let + # transport2: TcpTransport = newTransport(TcpTransport) + # clientInfo = PeerInfo.init(PrivateKey.random(RSA), [transport1.ma]) + # clientNoise = newSecio(clientInfo.privateKey) + # conn = await transport2.dial(transport1.ma) + # sconn = await clientNoise.secure(conn) - await sconn.write(hugePayload) - await readTask - await sconn.close() - await transport1.close() + # await sconn.write(hugePayload) + # await readTask + # await sconn.close() + # await transport1.close() - result = true + # result = true - check: - waitFor(testListenerDialer()) == true + # check: + # waitFor(testListenerDialer()) == true