From f27df5b8d58166b9f8cb24f266f3b7379df11826 Mon Sep 17 00:00:00 2001 From: rcooke-warwick Date: Thu, 10 Aug 2023 12:38:42 +0100 Subject: [PATCH 1/3] core: log ssh error command Change-type: patch Signed-off-by: Ryan Cooke --- core/lib/common/worker.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lib/common/worker.js b/core/lib/common/worker.js index 8576f1961..da718eebd 100644 --- a/core/lib/common/worker.js +++ b/core/lib/common/worker.js @@ -344,6 +344,7 @@ module.exports = class Worker { try { result = await utils.executeCommandOverSSH(command, config); } catch (err) { + console.log(`Failed to execute command: ${command}`) console.error(err.message); throw new Error(err); } From afa89a32475eedc479a9177d05f10b36abaa9904 Mon Sep 17 00:00:00 2001 From: rcooke-warwick Date: Thu, 10 Aug 2023 12:39:28 +0100 Subject: [PATCH 2/3] core: increase reboot delay to 5 Change-type: patch Signed-off-by: Ryan Cooke --- core/lib/common/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/common/worker.js b/core/lib/common/worker.js index da718eebd..b7a51ea63 100644 --- a/core/lib/common/worker.js +++ b/core/lib/common/worker.js @@ -649,7 +649,7 @@ module.exports = class Worker { async rebootDut(target) { this.logger.log(`Rebooting the DUT`); await this.executeCommandInHostOS( - `touch /tmp/reboot-check && systemd-run --on-active=2 reboot`, + `touch /tmp/reboot-check && systemd-run --on-active=5 reboot`, target, ); await this.executeCommandInHostOS( From ad8a07e671d9d3346676d9aea6588dd7a88ccc80 Mon Sep 17 00:00:00 2001 From: rcooke-warwick Date: Mon, 14 Aug 2023 12:14:25 +0100 Subject: [PATCH 3/3] log socat logs Change-type: patch Signed-off-by: Ryan Cooke --- core/lib/common/worker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/common/worker.js b/core/lib/common/worker.js index b7a51ea63..5d167be86 100644 --- a/core/lib/common/worker.js +++ b/core/lib/common/worker.js @@ -468,7 +468,7 @@ module.exports = class Worker { `tcp-listen:${workerPort},reuseaddr,fork "system:ssh ${ip} -p 22222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${this.dutSshKey} /usr/bin/nc localhost ${dutPort}"`, ]); - let tunnelProWorker = spawn(`ssh`, argsWorker); + let tunnelProWorker = spawn(`ssh`, argsWorker, {stdio: 'inherit'}); // setup a listener from this host to worker must be a sub process... // we must give map the same port on this host and the DUT - so the cli can use it @@ -478,7 +478,7 @@ module.exports = class Worker { `system:ssh ${this.workerUser}@${this.workerHost} -p ${this.workerPort} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${this.sshKey} ${this.sshPrefix}/usr/bin/nc localhost ${workerPort}`, ]; - let tunnelProcClient = spawn(`socat`, argsClient); + let tunnelProcClient = spawn(`socat`, argsClient, {stdio: 'inherit'}); } // create tunnels to relevant DUT ports to we can access them remotely @@ -649,7 +649,7 @@ module.exports = class Worker { async rebootDut(target) { this.logger.log(`Rebooting the DUT`); await this.executeCommandInHostOS( - `touch /tmp/reboot-check && systemd-run --on-active=5 reboot`, + `touch /tmp/reboot-check && systemd-run --on-active=2 reboot`, target, ); await this.executeCommandInHostOS(