made review changes for creating lstat test and property add on for interface.js

This commit is contained in:
Andrew Koung 2019-04-16 23:31:26 -04:00
parent fa0cd27cd2
commit 34434b0504
2 changed files with 29 additions and 13 deletions

View File

@ -340,7 +340,7 @@ function FileSystem(options, callback) {
{ name: 'ftruncate' },
{ name: 'futimes' },
{ name: 'getxattr', promises: true, absPathArgs: [0] },
{ name: 'lchown' },
{ name: 'lchown', promises:true },
{ name: 'link', promises: true, absPathArgs: [0, 1] },
{ name: 'lseek' },
{ name: 'lstat', promises: true },

View File

@ -135,18 +135,6 @@ describe('fs.chown, fs.fchown, fs.lchown', function() {
fs.stat('/file', function(err, stats) {
if(err) throw err;
expect(stats.uid).to.equal(500);
expect(stats.gid).to.equal(500);
//done();
});
});
fs.lchown('/file', 500, 500, function(err) {
if(err) throw err;
fs.lstat('/file', function(err, stats) {
if(err) throw err;
expect(stats.uid).to.equal(500);
expect(stats.gid).to.equal(500);
done();
@ -157,6 +145,34 @@ describe('fs.chown, fs.fchown, fs.lchown', function() {
});
});
});
it('should allow updating gid and uid for a symlink file', function(done) {
var fs = util.fs();
fs.open('/file', 'w', function(err, fd) {
if(err) throw err;
fs.symlink('/file', '/link', function(err) {
if(err) throw err;
fs.lchown('/link', 600, 600, function(err) {
if(err) throw err;
fs.lstat('/link', function(err, stats) {
if(err) throw err;
expect(stats.uid).to.equal(600);
expect(stats.gid).to.equal(600);
fs.close(fd, function(err) {
if(err) throw err;
done();
});
});
});
});
});
});
});