提交 535690af 编写于 作者: R raoxian

update fileio testcase

Signed-off-by: Nraoxian <raoxian@huawei.com>
上级 8660f2f2
...@@ -139,7 +139,7 @@ describe('fileio_fchown', async function () { ...@@ -139,7 +139,7 @@ describe('fileio_fchown', async function () {
await fileio.fchown(fd, null, stat.gid); await fileio.fchown(fd, null, stat.gid);
} catch (e) { } catch (e) {
console.info('fileio_test_fchown_async_004 has failed for ' + e); console.info('fileio_test_fchown_async_004 has failed for ' + e);
expect(e.message == "Operation not permitted").assertTrue(); expect(e.message == "Operation not permitted" || e.message == "Invalid owner").assertTrue();
fileio.unlinkSync(fpath); fileio.unlinkSync(fpath);
done(); done();
} }
...@@ -261,27 +261,4 @@ describe('fileio_fchown', async function () { ...@@ -261,27 +261,4 @@ describe('fileio_fchown', async function () {
fileio.unlinkSync(fpath); fileio.unlinkSync(fpath);
} }
}); });
/**
* @tc.number SUB_DF_FILEIO_FCHOWN_SYNC_0400
* @tc.name fileio_test_fchown_sync_004
* @tc.desc Test fchownSync() interface, wrong group. Test file modification failed.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileio_test_fchown_sync_004', 0, async function () {
let fpath = await nextFileName('fileio_test_fchown_sync_004');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
let stat = fileio.statSync(fpath);
fileio.fchownSync(fd, stat.uid, null);
} catch (e) {
console.info('fileio_test_fchown_sync_004 has failed for ' + e);
expect(e.message == "Operation not permitted").assertTrue();
fileio.unlinkSync(fpath);
}
});
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册