-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: refactor common.ddCommand() #23411
Changes from 1 commit
edf1a7c
fd0eb95
74bc7df
d3d2bab
bf4f33c
c1f684d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ const assert = require('assert'); | |
const os = require('os'); | ||
const { exec, execSync, spawnSync } = require('child_process'); | ||
const util = require('util'); | ||
const { fixturesDir } = require('./fixtures'); | ||
const tmpdir = require('./tmpdir'); | ||
const { | ||
bits, | ||
|
@@ -174,13 +173,10 @@ function childShouldThrowAndAbort() { | |
}); | ||
} | ||
|
||
function ddCommand(filename, kilobytes) { | ||
if (isWindows) { | ||
const p = path.resolve(fixturesDir, 'create-file.js'); | ||
return `"${process.argv[0]}" "${p}" "${filename}" ${kilobytes * 1024}`; | ||
} else { | ||
return `dd if=/dev/zero of="${filename}" bs=1024 count=${kilobytes}`; | ||
} | ||
function ddCommand(filename) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then why not call it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I'm lazy? |
||
const fd = fs.openSync(filename, 'w'); | ||
fs.ftruncateSync(fd, 10240 * 1024); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should either be |
||
fs.closeSync(fd); | ||
} | ||
|
||
|
||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mb
->MB
to not be confused with megabit?