Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
a1ec31a7
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1ec31a7
编写于
5月 12, 2020
作者:
W
WangFengTu
提交者:
lifeng68
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug of base64 encode and add testcase for pull image
Signed-off-by:
N
WangFengTu
<
wangfengtu@huawei.com
>
上级
54143137
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
73 addition
and
7 deletion
+73
-7
CI/test_cases/basic_cases/helpers.bash
CI/test_cases/basic_cases/helpers.bash
+1
-0
CI/test_cases/basic_cases/registry.bash
CI/test_cases/basic_cases/registry.bash
+50
-0
src/cutils/utils_base64.c
src/cutils/utils_base64.c
+21
-6
src/image/oci/registry/registry.c
src/image/oci/registry/registry.c
+1
-1
未找到文件。
CI/test_cases/basic_cases/helpers.bash
浏览文件 @
a1ec31a7
...
...
@@ -22,6 +22,7 @@ declare -a lines
# Root directory of integration tests.
INTEGRATION_ROOT
=
$(
dirname
"
$(
readlink
-f
"
$BASH_SOURCE
"
)
"
)
LCR_ROOT_PATH
=
"/var/lib/isulad/engines/lcr"
ISUALD_LOG
=
"/var/lib/isulad/isulad.log"
function
cut_output_lines
()
{
message
=
`
$@
2>&1
`
...
...
CI/test_cases/basic_cases/registry.bash
0 → 100755
浏览文件 @
a1ec31a7
#!/bin/bash
#
# attributes: isulad inheritance version
# concurrent: YES
# spend time: 1
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad licensed under the Mulan PSL v2.
# - You can use this software according to the terms and conditions of the Mulan PSL v2.
# - You may obtain a copy of Mulan PSL v2 at:
# - http://license.coscl.org.cn/MulanPSL2
# - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# - PURPOSE.
# - See the Mulan PSL v2 for more details.
##- @Description:CI
##- @Author: wangfengtu
##- @Create: 2020-05-12
#######################################################################
curr_path
=
$(
dirname
$(
readlink
-f
"
$0
"
))
data_path
=
$(
realpath
$curr_path
/../data
)
source
./helpers.bash
function
isula_pull
()
{
isula pull busybox
fn_check_eq
"
$?
"
"0"
"isula pull busybox"
isula inspect busybox
fn_check_eq
"
$?
"
"0"
"isula inspect busybox"
}
function
do_test_t
()
{
isula_pull
return
$TC_RET_T
}
ret
=
0
do_test_t
if
[
$?
-ne
0
]
;
then
cat
$ISUALD_LOG
let
"ret=
$ret
+ 1"
fi
show_result
$ret
"basic pull"
src/cutils/utils_base64.c
浏览文件 @
a1ec31a7
...
...
@@ -31,6 +31,8 @@ size_t util_base64_encode(unsigned char *bytes, size_t len, char *out, size_t ou
int
ret
=
0
;
int
bio_ret
=
0
;
BUF_MEM
*
pmem
=
NULL
;
size_t
i
=
0
;
size_t
count
=
0
;
if
(
bytes
==
NULL
||
len
==
0
||
out
==
NULL
||
out_len
<
util_base64_encode_len
(
len
))
{
ERROR
(
"Invalid param for encoding base64, input length %zu, out length %zu"
,
len
,
out_len
);
...
...
@@ -66,16 +68,29 @@ size_t util_base64_encode(unsigned char *bytes, size_t len, char *out, size_t ou
}
(
void
)
BIO_get_mem_ptr
(
io
,
&
pmem
);
if
(
pmem
->
length
>
out_len
)
{
// BIO_write append '\n' if every 76 chars have be output, so we need to strip them.
for
(
i
=
0
;
i
<
pmem
->
length
;
i
++
)
{
if
(
pmem
->
data
[
i
]
==
'\n'
)
{
continue
;
}
if
(
count
+
1
==
out_len
)
{
ERROR
(
"result length larger than output length, result length %zu, input length %zu, output length %zu"
,
pmem
->
length
,
len
,
out_len
);
ret
=
-
1
;
goto
out
;
}
out
[
count
]
=
pmem
->
data
[
i
];
count
++
;
}
if
(
count
==
0
)
{
ERROR
(
"Base64 encode failed, result count is zero"
);
ret
=
-
1
;
goto
out
;
}
(
void
)
memcpy
(
out
,
pmem
->
data
,
pmem
->
length
);
out
[
pmem
->
length
-
1
]
=
0
;
result_len
=
pmem
->
length
;
out
[
count
]
=
0
;
result_len
=
count
+
1
;
out:
...
...
src/image/oci/registry/registry.c
浏览文件 @
a1ec31a7
...
...
@@ -1192,7 +1192,7 @@ static int do_fetch(thread_fetch_info *info)
if
(
cache
==
NULL
)
{
ret
=
fetch_one_layer
(
info
);
if
(
ret
!=
0
)
{
ERROR
(
"failed to
start thread
to fetch layer %d"
,
(
int
)
info
->
index
);
ERROR
(
"failed to to fetch layer %d"
,
(
int
)
info
->
index
);
goto
out
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录