Browse Source

test: Allow common.ddCommand to be run in presence of existing file

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
35d0df919a
  1. 5
      test/common.js

5
test/common.js

@ -54,6 +54,11 @@ exports.indirectInstanceOf = function(obj, cls) {
exports.ddCommand = function(filename, kilobytes) { exports.ddCommand = function(filename, kilobytes) {
if (process.platform == 'win32') { if (process.platform == 'win32') {
// 'fsutil file createnew' cannot be used on an existing file. If it
// already exists delete it.
if (require('path').existsSync(filename)) {
require('fs').unlinkSync(filename);
}
return 'fsutil.exe file createnew "' + filename + '" ' + (kilobytes * 1024); return 'fsutil.exe file createnew "' + filename + '" ' + (kilobytes * 1024);
} else { } else {
return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes;

Loading…
Cancel
Save