未验证 提交 cffbdfb7 编写于 作者: O openharmony_ci 提交者: Gitee

!4955 修改storage模块部件化

Merge pull request !4955 from raoxian/master
......@@ -21,8 +21,8 @@ ohos_js_hap_suite("storagefileioerror_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageFileIoErrorJsTest"
subsystem_name = "xts"
part_name = "xts_acts"
subsystem_name = "distributeddatamgr"
part_name = "distributedfilejs"
}
ohos_js_assets("storagefileioerror_js_assets") {
js2abc = true
......
......@@ -36,23 +36,24 @@ describe('FileIOError', function () {
/**
* @tc.number SUB_STORAGE_FileIo_test_error_0000
* @tc.name fileio_test_error_000
* @tc.desc Function of API, Delete directories with files
* @tc.desc Function of API, delete file
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it('fileio_test_error_000', 0, async function (done) {
let dpath = await fileName('fileio_test_error_000d');
let fpath = dpath + '/fileio_test_error_000f';
fileio.mkdirSync(dpath);
let fpath = await fileName('fileio_test_error_000f');
expect(prepareFile(fpath, 'hello')).assertTrue();
try {
let fd = fileio.openSync(dpath);
let fd = fileio.openSync(fpath);
expect(isIntNum(fd)).assertTrue();
fileio.rmdirSync(dpath);
fileio.rmdirSync(fpath);
}
catch (err) {
console.info('fileio_test_error_000 has failed for ' + err);
expect(isInclude(err.message, 'Directory not empty')).assertTrue();
expect(isInclude(err.message, 'Not a directory')).assertTrue();
fileio.unlinkSync(fpath);
fileio.rmdirSync(dpath);
done();
}
});
......@@ -60,38 +61,44 @@ describe('FileIOError', function () {
/**
* @tc.number SUB_STORAGE_FileIo_test_error_0100
* @tc.name fileio_test_error_001
* @tc.desc Function of API, delete file
* @tc.desc Function of API, flags=0o100. missing mode parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it('fileio_test_error_001', 0, async function (done) {
let fpath = await fileName('fileio_test_error_001f');
expect(prepareFile(fpath, 'hello')).assertTrue();
let fpath = await nextFileName('fileio_test_error_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
expect(isIntNum(fd)).assertTrue();
fileio.rmdirSync(fpath);
fileio.openSync(fpath, 0o100);
}
catch (err) {
console.info('fileio_test_error_001 has failed for ' + err);
expect(isInclude(err.message, 'Not a directory')).assertTrue();
expect(isInclude(err.message, 'called with O_CREAT/O_TMPFILE but no mode')).assertTrue();
fileio.unlinkSync(fpath);
done();
}
});
/**
* @tc.number SUB_STORAGE_FileIo_test_error_0200
* @tc.number SUB_STORAGE_FileIO_OpenSync_0200
* @tc.name fileio_test_error_002
* @tc.desc Function of API, flags=0o100. missing mode parameter.
* @tc.desc Function of API, flags=0o302. The test file is exist.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it('fileio_test_error_002', 0, async function (done) {
let fpath = await nextFileName('fileio_test_error_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o100);
fileio.openSync(fpath, 0o302, 0o666);
}
catch (err) {
console.info('fileio_test_error_002 has failed for ' + err);
expect(isInclude(err.message, 'called with O_CREAT/O_TMPFILE but no mode')).assertTrue();
expect(isInclude(err.message, 'File exists')).assertTrue();
fileio.unlinkSync(fpath);
done();
}
......@@ -100,29 +107,14 @@ describe('FileIOError', function () {
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_0300
* @tc.name fileio_test_error_003
* @tc.desc Function of API, flags=0o302. The test file is exist.
* @tc.desc Function of API, flags=0o400000. Symbolic link loop.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it('fileio_test_error_003', 0, async function (done) {
let fpath = await nextFileName('fileio_test_error_003');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o302, 0o666);
}
catch (err) {
console.info('fileio_test_error_003 has failed for ' + err);
expect(isInclude(err.message, 'File exists')).assertTrue();
fileio.unlinkSync(fpath);
done();
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_0400
* @tc.name fileio_test_error_004
* @tc.desc Function of API, flags=0o400000. Symbolic link loop.
*/
it('fileio_test_error_004', 0, async function (done) {
let fpath = await nextFileName('fileio_test_error_004');
let ffpath = fpath + 'aaaa';
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
......@@ -130,7 +122,7 @@ describe('FileIOError', function () {
fileio.openSync(ffpath, 0o400000);
}
catch (err) {
console.info('fileio_test_error_004 has failed for ' + err);
console.info('fileio_test_error_003 has failed for ' + err);
expect(isInclude(err.message, 'Symbolic link loop') ||
isInclude(err.message, 'Too many symbolic links encountered')).assertTrue();
fileio.unlinkSync(fpath);
......@@ -140,18 +132,22 @@ describe('FileIOError', function () {
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_0500
* @tc.name fileio_test_error_005
* @tc.number SUB_STORAGE_FileIO_OpenSync_0400
* @tc.name fileio_test_error_004
* @tc.desc Function of API, flags=0o200000. Not a directory.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it('fileio_test_error_005', 0, async function (done) {
let fpath = await nextFileName('fileio_test_error_005');
it('fileio_test_error_004', 0, async function (done) {
let fpath = await nextFileName('fileio_test_error_004');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o200000, 0o666);
}
catch (err) {
console.info('fileio_test_error_005 has failed for ' + err);
console.info('fileio_test_error_004 has failed for ' + err);
expect(isInclude(err.message, 'Not a directory')).assertTrue();
fileio.unlinkSync(fpath);
done();
......
......@@ -21,8 +21,8 @@ ohos_js_hap_suite("storagefileio_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageFileIoJSTest"
subsystem_name = "xts"
part_name = "xts_acts"
subsystem_name = "distributeddatamgr"
part_name = "distributedfilejs"
}
ohos_js_assets("storagefileio_js_assets") {
js2abc = true
......
......@@ -21,8 +21,8 @@ ohos_js_hap_suite("storagefile_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageFileJSTest"
subsystem_name = "xts"
part_name = "xts_acts"
subsystem_name = "distributeddatamgr"
part_name = "distributedfilejs"
}
ohos_js_assets("storagefile_js_assets") {
js2abc = true
......
......@@ -21,8 +21,8 @@ ohos_js_hap_suite("storagesecuritylabel_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageSecurityLabelJSTest"
subsystem_name = "xts"
part_name = "xts_acts"
subsystem_name = "distributeddatamgr"
part_name = "distributedfilejs"
}
ohos_js_assets("storagesecuritylabel_js_assets") {
js2abc = true
......
......@@ -21,8 +21,8 @@ ohos_js_hap_suite("storagestatfs_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageStatfsJsTest"
subsystem_name = "xts"
part_name = "xts_acts"
subsystem_name = "distributeddatamgr"
part_name = "distributedfilejs"
}
ohos_js_assets("storagestatfs_js_assets") {
js2abc = true
......
......@@ -23,8 +23,8 @@ ohos_js_hap_suite("storagestatistics_js_test") {
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsStorageStatisticsJsTest"
subsystem_name = "xts"
part_name = "xts_acts"
subsystem_name = "filemanagement"
part_name = "storage_service"
}
ohos_app_scope("storagestatistics_app_profile") {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册