From 13b623bc8178bc72d8136f57891fb74b431e1c4c Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni Date: Sat, 12 Sep 2020 11:45:53 +0900 Subject: [PATCH] interop fixes --- libp2p/daemon/daemonapi.nim | 6 ++++-- tests/pubsub/utils.nim | 4 +--- tests/testinterop.nim | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libp2p/daemon/daemonapi.nim b/libp2p/daemon/daemonapi.nim index 8aee77875..8784d9351 100644 --- a/libp2p/daemon/daemonapi.nim +++ b/libp2p/daemon/daemonapi.nim @@ -8,8 +8,8 @@ ## those terms. ## This module implementes API for `go-libp2p-daemon`. -import os, osproc, strutils, tables, strtabs -import chronos +import std/[os, osproc, strutils, tables, strtabs] +import chronos, chronicles import ../varint, ../multiaddress, ../multicodec, ../cid, ../peerid import ../wire, ../multihash, ../protobuf/minprotobuf import ../crypto/crypto @@ -737,10 +737,12 @@ proc newDaemonApi*(flags: set[P2PDaemonFlags] = {}, opt.add $address args.add(opt) args.add("-noise=true") + args.add("-quic=false") args.add("-listen=" & $api.address) # We are trying to get absolute daemon path. let cmd = findExe(daemon) + trace "p2pd cmd", cmd, args if len(cmd) == 0: raise newException(DaemonLocalError, "Could not find daemon executable!") diff --git a/tests/pubsub/utils.nim b/tests/pubsub/utils.nim index 35e9a53c3..75f6c8dc1 100644 --- a/tests/pubsub/utils.nim +++ b/tests/pubsub/utils.nim @@ -18,9 +18,7 @@ randomize() proc generateNodes*( num: Natural, secureManagers: openarray[SecureProtocol] = [ - # array cos order matters - SecureProtocol.Secio, - SecureProtocol.Noise, + SecureProtocol.Noise ], msgIdProvider: MsgIdProvider = nil, gossip: bool = false, diff --git a/tests/testinterop.nim b/tests/testinterop.nim index 1f9082b23..102b003d7 100644 --- a/tests/testinterop.nim +++ b/tests/testinterop.nim @@ -141,7 +141,7 @@ proc testPubSubNodePublish(gossip: bool = false, let daemonNode = await newDaemonApi(flags) let daemonPeer = await daemonNode.identity() let nativeNode = newStandardSwitch( - secureManagers = [SecureProtocol.Secio], + secureManagers = [SecureProtocol.Noise], outTimeout = 5.minutes) let pubsub = if gossip: @@ -206,6 +206,8 @@ suite "Interop": # # echo tracker.dump() # # check tracker.isLeaked() == false + # TODO: this test is failing sometimes on windows + # For some reason we receive EOF before test 4 sometimes test "native -> daemon multiple reads and writes": proc runTests(): Future[bool] {.async.} = var protos = @["/test-stream"] @@ -267,7 +269,7 @@ suite "Interop": copyMem(addr expect[0], addr buffer.buffer[0], len(expect)) let nativeNode = newStandardSwitch( - secureManagers = [SecureProtocol.Secio], + secureManagers = [SecureProtocol.Noise], outTimeout = 5.minutes) let awaiters = await nativeNode.start() @@ -361,7 +363,7 @@ suite "Interop": proto.codec = protos[0] # codec let nativeNode = newStandardSwitch( - secureManagers = [SecureProtocol.Secio], outTimeout = 5.minutes) + secureManagers = [SecureProtocol.Noise], outTimeout = 5.minutes) nativeNode.mount(proto)