Skip to content

Commit

Permalink
Merge pull request #1290 from atsign-foundation/gkc/fix-1287
Browse files Browse the repository at this point in the history
  • Loading branch information
gkc authored Aug 23, 2024
2 parents 98e0ddf + 3e9b173 commit 689112f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
13 changes: 7 additions & 6 deletions packages/dart/noports_core/lib/src/npt/npt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract interface class Npt {
/// - Waits for success or error response, or time out after 10 secs
/// - Run local srv which will bind to some port and connect to the rvd
/// - Return the SocketConnector created by Npt
Future<SocketConnector> runInline();
Future<SocketConnector> runInline({int? localRvPort});

Future<void> close();

Expand Down Expand Up @@ -301,13 +301,13 @@ class _NptImpl extends NptBase
Future<int> run() async {
int localRvPort = await _preRun();

sendProgress('Creating connection to socket rendezvous');

/// Start srv
if (params.inline) {
// not detached
await runInline();
await runInline(localRvPort: localRvPort);
} else {
sendProgress('Creating connection to socket rendezvous');

await _srvdChannel.runSrv(
localRvPort: localRvPort,
sessionAESKeyString: sshnpdChannel.sessionAESKeyString,
Expand All @@ -323,8 +323,8 @@ class _NptImpl extends NptBase
}

@override
Future<SocketConnector> runInline() async {
int localRvPort = await _preRun();
Future<SocketConnector> runInline({int? localRvPort}) async {
localRvPort ??= await _preRun();
sendProgress('Creating connection to socket rendezvous');
if (!params.inline) {
logger.warning(
Expand All @@ -341,6 +341,7 @@ class _NptImpl extends NptBase
);

unawaited(sc.done.then((_) {
logger.info('SocketConnector done');
_completer.complete();
}));

Expand Down
2 changes: 1 addition & 1 deletion packages/dart/sshnoports/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: sshnoports
publish_to: none

version: 5.3.0
version: 5.6.1

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
11 changes: 9 additions & 2 deletions tests/e2e_all/scripts/tests/minus_s_flag
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ fi
daemonVersion="$1"
clientVersion="$2"

if [[ "$clientVersion" != "d:current" ]] || [[ "${daemonVersion:1}" != ":current" ]]; then
if [[ "$clientVersion" != "d:current" ]]; then
exit 50 # test rig interprets this exit status as 'test was not applicable'
fi

if [[ "${daemonVersion:0:1}" == "c" && $(versionIsLessThan "$clientVersion" "d:5.3.0") ]]; then
logInfo " N/A C daemon is not compatible with thi client"
logInfo " N/A C daemon is not compatible with this client"
exit 50
fi

# We will run with all daemons from v 5.1.0 onwards, as this test always needs to run
# before the 'npt_to_port_22' test
if [[ $(versionIsLessThan "$daemonVersion" "d:5.1.0") == "true" ]]; then
logInfo " N/A - we will only run this test for daemons v5.1.0 or greater"
exit 50 # test rig interprets this exit status as 'test was not applicable'
fi

# 1. Generate a new ssh key
generateNewSshKey

Expand Down

0 comments on commit 689112f

Please sign in to comment.