ssh-client-wrapper 2.2.10 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/fork.js +4 -1
- package/lib/rsyncExec.js +2 -2
- package/package.json +1 -1
- package/run_test_all.sh +12 -18
package/lib/fork.js
CHANGED
|
@@ -69,7 +69,7 @@ function createMasterPty (hostInfo) {
|
|
|
69
69
|
hostInfo.masterPty = ptyProcess;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
async function fork (hostInfo, cmd, args, timeout, outputCallback) {
|
|
72
|
+
async function fork (hostInfo, cmd, args, timeout, outputCallback, retryableExitCodes = []) {
|
|
73
73
|
return new Promise((resolve, reject) => {
|
|
74
74
|
debug(`cmd=${cmd}: args=${args}`);
|
|
75
75
|
const ptyProcess = spawn(cmd, args, nodePtyOpt);
|
|
@@ -119,6 +119,9 @@ async function fork (hostInfo, cmd, args, timeout, outputCallback) {
|
|
|
119
119
|
}
|
|
120
120
|
const err = new Error("exit with non-zero");
|
|
121
121
|
err.rt = exitCode;
|
|
122
|
+
if (retryableExitCodes.includes(exitCode)) {
|
|
123
|
+
err.retryable = true;
|
|
124
|
+
}
|
|
122
125
|
return reject(err);
|
|
123
126
|
});
|
|
124
127
|
});
|
package/lib/rsyncExec.js
CHANGED
|
@@ -79,7 +79,7 @@ async function send (hostInfo, argSrc, dst, rsyncOpt, timeout) {
|
|
|
79
79
|
}
|
|
80
80
|
debug(`send ${src} to ${hostInfo.host}:${dst}`);
|
|
81
81
|
debugVerbose(`send: ${rsyncCmd} ${args.join(" ")}`);
|
|
82
|
-
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout), hostInfo);
|
|
82
|
+
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null, [12]), hostInfo);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -119,7 +119,7 @@ async function recv (hostInfo, argSrc, dst, rsyncOpt, timeout) {
|
|
|
119
119
|
|
|
120
120
|
debug(`recv ${src} to ${dst}`);
|
|
121
121
|
debugVerbose(`recv: ${rsyncCmd} ${args.join(" ")}`);
|
|
122
|
-
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout), hostInfo);
|
|
122
|
+
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null, [12]), hostInfo);
|
|
123
123
|
}
|
|
124
124
|
module.exports = {
|
|
125
125
|
checkRsyncVersion,
|
package/package.json
CHANGED
package/run_test_all.sh
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
function cleanup(){
|
|
4
|
+
docker-compose rm --stop --force testbed
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
trap cleanup EXIT
|
|
8
|
+
set -e -o pipefail
|
|
9
|
+
|
|
2
10
|
docker-compose up testbed -d
|
|
3
11
|
export TEST_HOST=localhost
|
|
4
12
|
export TEST_USER=testuser
|
|
@@ -7,27 +15,13 @@ export TEST_PORT=4000
|
|
|
7
15
|
ssh-keygen -R '[localhost]:4000'
|
|
8
16
|
|
|
9
17
|
npm run test
|
|
10
|
-
|
|
11
|
-
echo local test failed
|
|
12
|
-
exit 1
|
|
13
|
-
fi
|
|
18
|
+
echo local test success
|
|
14
19
|
|
|
15
20
|
docker-compose run --build --rm tester
|
|
16
|
-
|
|
17
|
-
echo test on latest ubuntu failed
|
|
18
|
-
exit 2
|
|
19
|
-
fi
|
|
21
|
+
echo test on latest ubuntu success
|
|
20
22
|
|
|
21
23
|
docker-compose run --build --rm tester-bullseye
|
|
22
|
-
|
|
23
|
-
echo test on bullseye failed
|
|
24
|
-
exit 3
|
|
25
|
-
fi
|
|
24
|
+
echo test on bullseye success
|
|
26
25
|
|
|
27
26
|
docker-compose run --build --rm tester-buster
|
|
28
|
-
|
|
29
|
-
echo test on buster failed
|
|
30
|
-
exit 4
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
docker-compose rm --stop --force testbed
|
|
27
|
+
echo test on buster success
|