Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9e9a155f
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9e9a155f
编写于
2月 09, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 09, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7065 Add XTS for lstat and symlink interfaces of mod_fs
Merge pull request !7065 from futurezhou/lstat
上级
3bbc0f53
5885e7d0
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
1900 addition
and
1 deletion
+1900
-1
storage/storagefileiov9jstest/src/main/js/test/List.test.js
storage/storagefileiov9jstest/src/main/js/test/List.test.js
+9
-1
storage/storagefileiov9jstest/src/main/js/test/members/lstat.test.js
...ragefileiov9jstest/src/main/js/test/members/lstat.test.js
+1707
-0
storage/storagefileiov9jstest/src/main/js/test/members/symlink.test.js
...gefileiov9jstest/src/main/js/test/members/symlink.test.js
+184
-0
未找到文件。
storage/storagefileiov9jstest/src/main/js/test/List.test.js
浏览文件 @
9e9a155f
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -13,15 +13,23 @@
* limitations under the License.
*/
import
fileIOFdatasync
from
'
./members/fdatasync.test.js
'
import
fileIOFsync
from
'
./members/fsync.test.js
'
import
fileIOLstat
from
'
./members/lstat.test.js
'
import
fileIOOpen
from
'
./members/open.test.js
'
import
fileIORead
from
'
./members/read.test.js
'
import
fileIOStat
from
'
./members/stat.test.js
'
import
fileIOSymlink
from
'
./members/symlink.test.js
'
import
fileIOTruncate
from
'
./members/truncate.test.js
'
import
fileIOWrite
from
'
./members/write.test.js
'
export
default
function
testsuite
()
{
fileIOFdatasync
()
fileIOFsync
()
fileIOLstat
()
fileIOOpen
()
fileIORead
()
fileIOStat
()
fileIOSymlink
()
fileIOTruncate
()
fileIOWrite
()
}
storage/storagefileiov9jstest/src/main/js/test/members/lstat.test.js
0 → 100644
浏览文件 @
9e9a155f
此差异已折叠。
点击以展开。
storage/storagefileiov9jstest/src/main/js/test/members/symlink.test.js
0 → 100644
浏览文件 @
9e9a155f
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
fileIO
,
FILE_CONTENT
,
prepareFile
,
nextFileName
,
describe
,
it
,
expect
,
}
from
'
../Common
'
;
export
default
function
fileIOSymlink
()
{
describe
(
'
fileIO_fs_symlink
'
,
function
()
{
/**
* @tc.number SUB_DF_FILEIO_SYMLINK_SYNC_0000
* @tc.name fileIO_test_symlink_sync_000
* @tc.desc Test symlinkSync() interfaces.
* Create a symbolic link to verify normal function.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_symlink_sync_000
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_symlink_sync_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileIO
.
symlinkSync
(
fpath
,
fpath
+
'
link0
'
);
expect
(
fileIO
.
accessSync
(
fpath
+
'
link0
'
)).
assertTrue
();
fileIO
.
unlinkSync
(
fpath
);
fileIO
.
unlinkSync
(
fpath
+
'
link0
'
);
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_symlink_sync_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_SYMLINK_SYNC_0100
* @tc.name fileIO_test_symlink_sync_001
* @tc.desc Test symlinkSync() interfaces.
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_symlink_sync_001
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_symlink_sync_001
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileIO
.
symlinkSync
(
fpath
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
fileIO
.
unlinkSync
(
fpath
);
console
.
log
(
'
fileIO_test_symlink_sync_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_SYMLINK_ASYNC_0000
* @tc.name fileIO_test_symlink_async_000
* @tc.desc Test SymlinkAsync interfaces. Promise.then().catch()
* Create a symbolic link to verify normal function.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_symlink_async_000
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_symlink_async_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileIO
.
symlink
(
fpath
,
fpath
+
'
link3
'
).
then
(()
=>
{
expect
(
fileIO
.
accessSync
(
fpath
+
'
link3
'
)).
assertTrue
();
fileIO
.
unlinkSync
(
fpath
);
fileIO
.
unlinkSync
(
fpath
+
'
link3
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
fileIO_test_symlink_async_000 error package:
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_symlink_async_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_SYMLINK_ASYNC_0100
* @tc.name fileIO_test_symlink_async_001
* @tc.desc Test SymlinkAsync interfaces. await Promise.
* Create a symbolic link to verify normal function.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_symlink_async_001
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_symlink_async_001
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
await
fileIO
.
symlink
(
fpath
,
fpath
+
'
link4
'
);
expect
(
fileIO
.
accessSync
(
fpath
+
'
link4
'
)).
assertTrue
();
fileIO
.
unlinkSync
(
fpath
);
fileIO
.
unlinkSync
(
fpath
+
'
link4
'
);
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_symlink_async_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_SYMLINK_ASYNC_0200
* @tc.name fileIO_test_symlink_async_002
* @tc.desc Test SymlinkAsync interfaces. Promise.
* Create a symbolic link to verify normal function.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_symlink_async_002
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_symlink_async_002
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileIO
.
symlink
(
fpath
,
fpath
+
'
link5
'
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
fileIO_test_symlink_async_002 error package:
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
}
expect
(
fileIO
.
accessSync
(
fpath
+
'
link5
'
)).
assertTrue
();
fileIO
.
unlinkSync
(
fpath
);
fileIO
.
unlinkSync
(
fpath
+
'
link5
'
);
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_symlink_async_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_SYMLINK_ASYNC_0300
* @tc.name fileIO_test_symlink_async_003
* @tc.desc Test SymlinkAsync interfaces. Promise.
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_symlink_async_003
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_symlink_async_003
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
await
fileIO
.
symlink
(
fpath
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
fileIO
.
unlinkSync
(
fpath
);
console
.
log
(
'
fileIO_test_symlink_async_003 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
done
();
}
});
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录