From 535690af1ecebebeacdad3b6a3761a1895cd3238 Mon Sep 17 00:00:00 2001 From: raoxian Date: Fri, 17 Jun 2022 15:46:00 +0800 Subject: [PATCH] update fileio testcase Signed-off-by: raoxian --- .../test/module_fileio/members/fchown.test.js | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/fchown.test.js b/storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/fchown.test.js index 8393c06cb..8f08c678d 100644 --- a/storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/fchown.test.js +++ b/storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/fchown.test.js @@ -139,7 +139,7 @@ describe('fileio_fchown', async function () { await fileio.fchown(fd, null, stat.gid); } catch (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); done(); } @@ -261,27 +261,4 @@ describe('fileio_fchown', async function () { 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); - } - }); }); -- GitLab