@ -127,9 +127,19 @@ glibc.x86_64 2.17-157.el7_3.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
unwrapped_output_rhel7_obsoletes = unwrapped_output_rhel7 + wrapped_output_rhel7_obsoletes_postfix
unwrapped_output_rhel7_expected_pkgs = [ " NetworkManager-openvpn " , " NetworkManager-openvpn-gnome " , " cabal-install " ,
unwrapped_output_rhel7_expected_new_obsoletes_pkgs = [
" ddashboard " , " python-bugzilla " , " python2-futures " , " python2-pip " ,
" python2-pyxdg " , " python2-simplejson "
]
unwrapped_output_rhel7_expected_old_obsoletes_pkgs = [
" developerdashboard " , " python-bugzilla-develdashboardfixes " ,
" python-futures " , " python-pip " , " pyxdg " , " python-simplejson "
]
unwrapped_output_rhel7_expected_updated_pkgs = [
" NetworkManager-openvpn " , " NetworkManager-openvpn-gnome " , " cabal-install " ,
" cgit " , " python34-libs " , " python34-test " , " python34-tkinter " ,
" python34-tools " , " qgit " , " rdiff-backup " , " stoken-libs " , " xlockmore " ]
" python34-tools " , " qgit " , " rdiff-backup " , " stoken-libs " , " xlockmore "
]
class TestYumUpdateCheckParse ( unittest . TestCase ) :
@ -141,34 +151,34 @@ class TestYumUpdateCheckParse(unittest.TestCase):
self . assertIsInstance ( result , dict )
def test_empty_output ( self ) :
res = YumModule . parse_check_update ( " " )
res , obs = YumModule . parse_check_update ( " " )
expected_pkgs = [ ]
self . _assert_expected ( expected_pkgs , res )
def test_longname ( self ) :
res = YumModule . parse_check_update ( longname )
res , obs = YumModule . parse_check_update ( longname )
expected_pkgs = [ ' xxxxxxxxxxxxxxxxxxxxxxxxxx ' , ' glibc ' ]
self . _assert_expected ( expected_pkgs , res )
def test_plugin_load_error ( self ) :
res = YumModule . parse_check_update ( yum_plugin_load_error )
res , obs = YumModule . parse_check_update ( yum_plugin_load_error )
expected_pkgs = [ ]
self . _assert_expected ( expected_pkgs , res )
def test_wrapped_output_1 ( self ) :
res = YumModule . parse_check_update ( wrapped_output_1 )
res , obs = YumModule . parse_check_update ( wrapped_output_1 )
expected_pkgs = [ " vms-agent " ]
self . _assert_expected ( expected_pkgs , res )
def test_wrapped_output_2 ( self ) :
res = YumModule . parse_check_update ( wrapped_output_2 )
res , obs = YumModule . parse_check_update ( wrapped_output_2 )
expected_pkgs = [ " empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty-empty " ,
" libtiff " ]
self . _assert_expected ( expected_pkgs , res )
def test_wrapped_output_3 ( self ) :
res = YumModule . parse_check_update ( wrapped_output_3 )
res , obs = YumModule . parse_check_update ( wrapped_output_3 )
expected_pkgs = [ " ceph " , " ceph-base " , " ceph-common " , " ceph-mds " ,
" ceph-mon " , " ceph-osd " , " ceph-selinux " , " libcephfs1 " ,
" librados2 " , " libradosstriper1 " , " librbd1 " , " librgw2 " ,
@ -176,16 +186,20 @@ class TestYumUpdateCheckParse(unittest.TestCase):
self . _assert_expected ( expected_pkgs , res )
def test_wrapped_output_4 ( self ) :
res = YumModule . parse_check_update ( wrapped_output_4 )
res , obs = YumModule . parse_check_update ( wrapped_output_4 )
expected_pkgs = [ " ipxe-roms-qemu " , " quota " , " quota-nls " , " rdma " , " screen " ,
" sos " , " sssd-client " ]
self . _assert_expected ( expected_pkgs , res )
def test_wrapped_output_rhel7 ( self ) :
res = YumModule . parse_check_update ( unwrapped_output_rhel7 )
self . _assert_expected ( unwrapped_output_rhel7_expected_ pkgs, res )
res , obs = YumModule . parse_check_update ( unwrapped_output_rhel7 )
self . _assert_expected ( unwrapped_output_rhel7_expected_ updated_ pkgs, res )
def test_wrapped_output_rhel7_obsoletes ( self ) :
res = YumModule . parse_check_update ( unwrapped_output_rhel7_obsoletes )
self . _assert_expected ( unwrapped_output_rhel7_expected_pkgs , res )
res , obs = YumModule . parse_check_update ( unwrapped_output_rhel7_obsoletes )
self . _assert_expected (
unwrapped_output_rhel7_expected_updated_pkgs + unwrapped_output_rhel7_expected_new_obsoletes_pkgs ,
res
)
self . _assert_expected ( unwrapped_output_rhel7_expected_old_obsoletes_pkgs , obs )