fix volume test

This commit is contained in:
Girish Ramakrishnan
2021-05-17 16:23:24 -07:00
parent 124954d490
commit c7474511aa
3 changed files with 12 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ exports = module.exports = {
const assert = require('assert'),
BoxError = require('./boxerror.js'),
constants = require('./constants.js'),
ejs = require('ejs'),
fs = require('fs'),
path = require('path'),
@@ -48,6 +49,8 @@ function validateMountOptions(type, options) {
async function writeMountFile(volume) {
assert.strictEqual(typeof volume, 'object');
if (constants.TEST) return;
const {name, hostPath, mountType, mountOptions} = volume;
let options, what, type;
@@ -80,6 +83,8 @@ async function writeMountFile(volume) {
async function removeMountFile(hostPath) {
assert.strictEqual(typeof hostPath, 'string');
if (constants.TEST) return;
await safe(shell.promises.sudo('generateMountFile', [ RM_MOUNT_CMD, hostPath ], {})); // ignore any error
}