1
0
mirror of https://github.com/fuse-friends/fuse-native synced 2024-10-27 18:34:01 +00:00
fuse-friends_fuse-native/test/statfs.js

41 lines
918 B
JavaScript
Raw Permalink Normal View History

2019-11-15 10:31:18 +00:00
const { exec } = require('child_process')
2019-11-19 13:04:46 +00:00
const { unmount } = require('./helpers')
const tape = require('tape')
2019-11-15 10:31:18 +00:00
2019-11-19 13:04:46 +00:00
const Fuse = require('../')
2020-01-29 12:32:31 +00:00
const createMountpoint = require('./fixtures/mnt')
2019-11-15 10:31:18 +00:00
const stat = require('./fixtures/stat')
2020-01-29 12:32:31 +00:00
const mnt = createMountpoint()
2019-11-15 10:31:18 +00:00
tape('statfs', function (t) {
const ops = {
force: true,
statfs: function (path, cb) {
return cb(0, {
bsize: 1000000,
frsize: 1000000,
blocks: 1000000,
bfree: 1000000,
bavail: 1000000,
files: 1000000,
ffree: 1000000,
favail: 1000000,
fsid: 1000000,
flag: 1000000,
namemax: 1000000
})
},
}
const fuse = new Fuse(mnt, ops, { debug: true })
fuse.mount(function (err) {
t.error(err, 'no error')
exec(`df ${mnt}`, (err) => {
t.error(err, 'no error')
2019-11-19 13:04:46 +00:00
unmount(fuse, function () {
2019-11-15 10:31:18 +00:00
t.end()
})
})
})
})