ssh-client-wrapper 2.2.6 → 2.2.8
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 +7 -7
- package/package.json +1 -1
- package/run_test_all.sh +25 -3
package/lib/util.js
CHANGED
|
@@ -41,8 +41,7 @@ const hostInfoSchema = {
|
|
|
41
41
|
retryMaxTimeout: { type: "number", minimum: 0 },
|
|
42
42
|
sshOpt: { type: "array", minItems: 1, items: { type: "string", pattern: "\\S+", transform: ["trim"] } }
|
|
43
43
|
},
|
|
44
|
-
required: ["host"]
|
|
45
|
-
additionalProperties: false
|
|
44
|
+
required: ["host"]
|
|
46
45
|
};
|
|
47
46
|
|
|
48
47
|
const stringOptions = [
|
|
@@ -74,10 +73,11 @@ const buff2String = (func, data) => {
|
|
|
74
73
|
*/
|
|
75
74
|
const sanityCheck = (hostInfo) => {
|
|
76
75
|
debug("sanityCheck called", hostInfo);
|
|
76
|
+
|
|
77
77
|
// keep password, passphrase, and masterPty before validate.
|
|
78
|
-
// these properties can have
|
|
79
|
-
//
|
|
80
|
-
|
|
78
|
+
// these properties can have a iellegal value as JSON data
|
|
79
|
+
// so we keep them before ajv validation and put them back
|
|
80
|
+
|
|
81
81
|
const { password, passphrase, masterPty } = hostInfo;
|
|
82
82
|
validate(hostInfo);
|
|
83
83
|
|
|
@@ -123,9 +123,9 @@ const sanityCheck = (hostInfo) => {
|
|
|
123
123
|
hostInfo.password = password;
|
|
124
124
|
}
|
|
125
125
|
if (["string", "function"].includes(typeof passphrase)) {
|
|
126
|
-
hostInfo.
|
|
126
|
+
hostInfo.passphrase = passphrase;
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
128
|
+
if (typeof masterPty !== "undefined") {
|
|
129
129
|
hostInfo.masterPty = masterPty;
|
|
130
130
|
}
|
|
131
131
|
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
|