tests: more common'ification

This commit is contained in:
Girish Ramakrishnan
2021-08-12 16:27:31 -07:00
parent 05576b5a91
commit ac5b7f8093
6 changed files with 588 additions and 896 deletions

View File

@@ -2,10 +2,12 @@
exports = module.exports = {
getRemoteSupport,
enableRemoteSupport
enableRemoteSupport,
_sshInfo: sshInfo
};
let assert = require('assert'),
const assert = require('assert'),
BoxError = require('./boxerror.js'),
constants = require('./constants.js'),
eventlog = require('./eventlog.js'),
@@ -54,7 +56,7 @@ function enableRemoteSupport(enable, auditSource, callback) {
assert.strictEqual(typeof auditSource, 'object');
assert.strictEqual(typeof callback, 'function');
let si = sshInfo();
const si = sshInfo();
shell.sudo('support', [ AUTHORIZED_KEYS_CMD, enable ? 'enable' : 'disable', si.filePath, si.user ], {}, function (error) {
if (error) callback(new BoxError(BoxError.FS_ERROR, error));