您的位置:首页 > 大数据 > 人工智能

编译curl 源码包出现"TESTFAIL: These test cases failed: 20 172 507 "等相关的错误

2014-10-23 15:11 344 查看
最近在编译centos6.5 的一些源码包,整个编译工作到了最后收尾的阶段,但是最后有个包curl-7.19.7-37.1.el6.src.rpm 总是编译出错,下面是出错信息:

        

TESTFAIL: These test cases failed: 20 172 507
TESTDONE: 546 tests were considered during 1593 seconds.
TESTINFO: 10 tests were skipped due to these restraints:
TESTINFO: "configured as DISABLED" 2 times (563, 564)
TESTINFO: "curl lacks netrc_debug support" 6 times (130, 131, 132, 133, 134, 257)
TESTINFO: "curl lacks OpenSSL support" 2 times (307, 308)


第一眼看上去出错应该是和test 相关,于是rpmbuild -bp curl.spec,在BUILD 目录下make了一下,编译通过,然后试了试了一下make test,这下出错了,出错的test 有3个,分别是test20,test172,test507 

   

注:这里编译的是curl-7.19.7-37.1.el6.src.rpm 这个版本,在centos6.5 或者centos7 源里的其他版本出错信息可能有差异,此文仅作参考

curl 的包里找到test20,test172,test507 这个三个文件,先看一下test20:

       

<testcase>
<info>
<keywords>
HTTP
FAILURE
non-existing host
</keywords>
</info>

# Server-side
<reply>
<data>
</data>
</reply>

# Client-side
<client>
<server>
none
</server>
<features>
http
</features>
<name>
attempt connect to non-existing host name
</name>
<command>
non-existing-host.haxx.se.
</command>
</client>

# Verify data after the test has been "shot"
<verify>
<errorcode>
6
</errorcode>
</verify>
</testcase>


然后看一下报错信息:



表面上能看出的是: 程序返回值应该是6,但返回的是0,所以出错

更深层次的原因网上找了找,资料不多,以下解释翻译自网络:

test20 以及test507 依赖一个不存在的hostname(主机名)---non-existing-host.haxx.se.
然后如果运行的ISP 是某个运营商的话就没法工作,并且登陆该hostname 的时候页面都会显示"What you're looking for doesn't exist"
看起来像是一头雾水,但没猜错的话出错原因应该就是该hostname 不能正常解析,导致test 出错,最后编译出错的

严格意义上来说,这不能算是一个bug,在本机上host 该DNS 也出错:

 


网上是这么分析的,但是没有给出相应的解决办法,于是根据test20 中的错误返回代码,将6改成0,和程序返回保持一致,test 507 修改方法一样

# Verify data after the test has been "shot"
<verify>
<errorcode>
0
</errorcode>
</verify>

然后make test , 这样就test 通过了,至于test 172 ,在centos6.5的Update 目录下的版本以及centos 7 中的版本已修复这个问题,详情见patch:

       


修改好之后,make test 通过.

三个test文件都改好之后,打上patch,Mock 环境中编译通过.

注:如果有更好的解决办法,欢迎贴出来,大家一起讨论.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐