ssh-client-wrapper 2.2.7 → 2.2.9
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/util.js +6 -7
- package/package.json +1 -1
- package/run_test_all.sh +25 -3
package/lib/util.js
CHANGED
|
@@ -15,7 +15,6 @@ const Ajv = require("ajv");
|
|
|
15
15
|
|
|
16
16
|
const ajv = new Ajv({
|
|
17
17
|
allErrors: true,
|
|
18
|
-
removeAdditional: "all",
|
|
19
18
|
coerceTypes: true,
|
|
20
19
|
logger: {
|
|
21
20
|
log: debug,
|
|
@@ -41,8 +40,7 @@ const hostInfoSchema = {
|
|
|
41
40
|
retryMaxTimeout: { type: "number", minimum: 0 },
|
|
42
41
|
sshOpt: { type: "array", minItems: 1, items: { type: "string", pattern: "\\S+", transform: ["trim"] } }
|
|
43
42
|
},
|
|
44
|
-
required: ["host"]
|
|
45
|
-
additionalProperties: false
|
|
43
|
+
required: ["host"]
|
|
46
44
|
};
|
|
47
45
|
|
|
48
46
|
const stringOptions = [
|
|
@@ -74,10 +72,11 @@ const buff2String = (func, data) => {
|
|
|
74
72
|
*/
|
|
75
73
|
const sanityCheck = (hostInfo) => {
|
|
76
74
|
debug("sanityCheck called", hostInfo);
|
|
75
|
+
|
|
77
76
|
// keep password, passphrase, and masterPty before validate.
|
|
78
|
-
// these properties can have
|
|
79
|
-
//
|
|
80
|
-
|
|
77
|
+
// these properties can have a iellegal value as JSON data
|
|
78
|
+
// so we keep them before ajv validation and put them back
|
|
79
|
+
|
|
81
80
|
const { password, passphrase, masterPty } = hostInfo;
|
|
82
81
|
validate(hostInfo);
|
|
83
82
|
|
|
@@ -125,7 +124,7 @@ const sanityCheck = (hostInfo) => {
|
|
|
125
124
|
if (["string", "function"].includes(typeof passphrase)) {
|
|
126
125
|
hostInfo.passphrase = passphrase;
|
|
127
126
|
}
|
|
128
|
-
if (
|
|
127
|
+
if (typeof masterPty !== "undefined") {
|
|
129
128
|
hostInfo.masterPty = masterPty;
|
|
130
129
|
}
|
|
131
130
|
return hostInfo;
|
package/package.json
CHANGED
package/run_test_all.sh
CHANGED
|
@@ -4,8 +4,30 @@ export TEST_HOST=localhost
|
|
|
4
4
|
export TEST_USER=testuser
|
|
5
5
|
export TEST_PW=passw0rd
|
|
6
6
|
export TEST_PORT=4000
|
|
7
|
+
ssh-keygen -R '[localhost]:4000'
|
|
8
|
+
|
|
7
9
|
npm run test
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
if [ $? -ne 0 ];then
|
|
11
|
+
echo local test failed
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
docker-compose run --build --rm tester
|
|
16
|
+
if [ $? -ne 0 ];then
|
|
17
|
+
echo test on latest ubuntu failed
|
|
18
|
+
exit 2
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
docker-compose run --build --rm tester-bullseye
|
|
22
|
+
if [ $? -ne 0 ];then
|
|
23
|
+
echo test on bullseye failed
|
|
24
|
+
exit 3
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
docker-compose run --build --rm tester-buster
|
|
28
|
+
if [ $? -ne 0 ];then
|
|
29
|
+
echo test on buster failed
|
|
30
|
+
exit 4
|
|
31
|
+
fi
|
|
32
|
+
|
|
11
33
|
docker-compose rm --stop --force testbed
|