tests fail when run in chroot (during package building)

未关闭
#40 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
c, python

调研方向

先从 tests/test_ethtool.py 和 tests/test_scripts.py 开始,然后在干净的 chroot 中以非特权用户身份重现软件包测试命令。将权限、接口地址和 offload 相关的失败与测试假设进行比较。当测试在此打包环境中具有明确的结果且不再意外失败时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

help wanted

Helloes!
I'm currently pushing python-ethtool to Arch Linux's [community].
On Arch, packages are built in a clean chroot (to ensure package and dependency integrity). There however, the tests fail:

running test                                                                                                                                                                                                                                                          
running egg_info
creating ethtool.egg-info                     
writing ethtool.egg-info/PKG-INFO                                                        
writing dependency_links to ethtool.egg-info/dependency_links.txt
writing top-level names to ethtool.egg-info/top_level.txt                   
writing manifest file 'ethtool.egg-info/SOURCES.txt'            
reading manifest file 'ethtool.egg-info/SOURCES.txt'                  
reading manifest template 'MANIFEST.in'                         
writing manifest file 'ethtool.egg-info/SOURCES.txt'          
running build_ext                            
copying build/lib.linux-x86_64-3.6/ethtool.cpython-36m-x86_64-linux-gnu.so ->       
test_driver_eth (tests.test_scripts.ScriptsTests) ... ok
test_driver_lo (tests.test_scripts.ScriptsTests) ... ok                                                              
test_flags2str (tests.test_scripts.ScriptsTests) ... ok
test_show_coalesce_eth (tests.test_scripts.ScriptsTests) ... ok
test_show_coalesce_lo (tests.test_scripts.ScriptsTests) ... ok
test_show_offload_eth (tests.test_scripts.ScriptsTests) ... ok                                                                                                                                                                                                         
test_show_offload_lo (tests.test_scripts.ScriptsTests) ... FAIL
test_show_ring_eth (tests.test_scripts.ScriptsTests) ... ok
test_show_ring_lo (tests.test_scripts.ScriptsTests) ... ok
test_etherinfo_objects (tests.test_ethtool.EthtoolTests) ... FAIL
test_get_active_devices (tests.test_ethtool.EthtoolTests) ... ERROR            
test_get_interface_info_active (tests.test_ethtool.EthtoolTests) ... FAIL      
test_get_interface_info_all (tests.test_ethtool.EthtoolTests) ... FAIL
test_get_interface_info_invalid (tests.test_ethtool.EthtoolTests) ... ok        
test_invalid_devices (tests.test_ethtool.EthtoolTests) ... ok                                                                                                                                                                                                           
test_full (tests.parse_ifconfig.ParserTests) ... ok
test_local (tests.parse_ifconfig.ParserTests) ... ok
test_parse_ip4addr (tests.parse_ifconfig.ParserTests) ... ok                              
test_parsing_device_line (tests.parse_ifconfig.ParserTests) ... ok
test_parsing_flags_line (tests.parse_ifconfig.ParserTests) ... ok           
test_parsing_ip (tests.parse_ifconfig.ParserTests) ... ok       
                                                                      
======================================================================
ERROR: test_get_active_devices (tests.test_ethtool.EthtoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):                                                   
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 245, in test_get_active_devices
    self._functions_accepting_devnames(devname)                                                                       
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 147, in _functions_accepting_devnames
    self.assertIsInt(ethtool.get_ufo(devname))
PermissionError: [Errno 1] Operation not permitted           
                                                                                                                                                                                                                                                                        
======================================================================
FAIL: test_show_offload_lo (tests.test_scripts.ScriptsTests)
----------------------------------------------------------------------
Traceback (most recent call last):                       
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_scripts.py", line 80, in test_show_offload_lo
    '''                
AssertionError: 'scat[60 chars]ion offload: not supported\ngeneric segmentation offload: on\n' != 'scat[60 chars]ion offload: on\ngeneric segmentation offload: on\n'
  scatter-gather: on
  tcp segmentation offload: on
- udp fragmentation offload: not supported
?                             ------------                       
+ udp fragmentation offload: on                          
?                            +                      
  generic segmentation offload: on                  

======================================================================
FAIL: test_etherinfo_objects (tests.test_ethtool.EthtoolTests)                                                       
----------------------------------------------------------------------
Traceback (most recent call last):                             
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 251, in test_etherinfo_objects
    self._verify_etherinfo_object(ei)                                                                                                                                                                                                                                  
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 168, in _verify_etherinfo_object
    self.assertEqual(ei.ipv4_address, scraped.inet)        
AssertionError: '10.10.23.10' != '10.10.23.150'           
- 10.10.23.10                                                    
+ 10.10.23.150                                                                 
?           +                                                                  
                                                                      
                                                                                
======================================================================                                                                                                                                                                                                  
FAIL: test_get_interface_info_active (tests.test_ethtool.EthtoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):                                                        
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 233, in test_get_interface_info_active
    self._verify_etherinfo_object(ei)                                       
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 168, in _verify_etherinfo_object
    self.assertEqual(ei.ipv4_address, scraped.inet)                   
AssertionError: '10.10.23.10' != '10.10.23.150'                       
- 10.10.23.10                                                   
+ 10.10.23.150                                                        
?           +                                                                        
                                                                                                                  
                                                                                                                      
======================================================================                                                  
FAIL: test_get_interface_info_all (tests.test_ethtool.EthtoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):                                                                                                                                                                                                                                      
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 238, in test_get_interface_info_all
    self._verify_etherinfo_object(ei)                       
  File "/build/python-ethtool/src/python-ethtool-0.13/tests/test_ethtool.py", line 168, in _verify_etherinfo_object
    self.assertEqual(ei.ipv4_address, scraped.inet)      
AssertionError: '10.10.23.10' != '10.10.23.150'                                                               
- 10.10.23.10          
+ 10.10.23.150                                                                                                                                                       
?           +       
                              
                                          
----------------------------------------------------------------------
Ran 21 tests in 0.015s                                   
                                                    
FAILED (failures=4, errors=1)                       
Test failed: <unittest.runner.TextTestResult run=21 errors=1 failures=4>
Device(name='enp0s25', flagsint=4163, flagsstr='UP,BROADCAST,RUNNING,MULTICAST', mtu=1500)
Device(name='lo', flagsint=73, flagsstr='UP,LOOPBACK,RUNNING', mtu=65536)
Device(name='tap0', flagsint=4163, flagsstr='UP,BROADCAST,RUNNING,MULTICAST', mtu=1500)
Device(name='wlp3s0', flagsint=4099, flagsstr='UP,BROADCAST,MULTICAST', mtu=1500)
error: Test failed: <unittest.runner.TextTestResult run=21 errors=1 failures=4>

Within the chroot, the user, that's building the package is not allowed root privileges. This might lead to the tests failing, but maybe you can provide some more insight?
I'd like to be able to use the tests during packaging for python{2,3}.

主要语言
C
星标
16
派生
11
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fedora-python/python-ethtool 的其他 Issue

查看 fedora-python/python-ethtool 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。