fix volume test
This commit is contained in:
+2
-1
@@ -12,6 +12,7 @@ exports = module.exports = {
|
||||
const assert = require('assert'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
collectd = require('./collectd.js'),
|
||||
constants = require('./constants.js'),
|
||||
database = require('./database.js'),
|
||||
debug = require('debug')('box:volumes'),
|
||||
ejs = require('ejs'),
|
||||
@@ -59,7 +60,7 @@ function validateHostPath(hostPath, mountType) {
|
||||
|
||||
if (!allowedPaths.some(p => hostPath.startsWith(p))) return new BoxError(BoxError.BAD_FIELD, 'hostPath must be under /mnt, /media, /opt or /srv', { field: 'hostPath' });
|
||||
|
||||
if (mountType === 'noop') { // we expect user to have already mounted this
|
||||
if (!constants.TEST && mountType === 'noop') { // we expect user to have already mounted this
|
||||
const stat = safe.fs.lstatSync(hostPath);
|
||||
if (!stat) return new BoxError(BoxError.BAD_FIELD, 'hostPath does not exist. Please create it on the server first', { field: 'hostPath' });
|
||||
if (!stat.isDirectory()) return new BoxError(BoxError.BAD_FIELD, 'hostPath is not a directory', { field: 'hostPath' });
|
||||
|
||||
Reference in New Issue
Block a user