Project

General

Profile

Tâche #15980

Scénario #15859: Corriger les derniers problèmes CreoleLint et Creole sur EOLE 2.6

Creole : lancement test unitaire test_upgrade.py en erreur

Added by Fabrice Barconnière over 5 years ago. Updated over 5 years ago.

Status:
Fermé
Priority:
Normal
Start date:
04/25/2016
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:
Remaining (hours):
0.0

Description

root@amon:/usr/share/creole/tests# py.test test_upgrade.py 
=================================================================== test session starts ===================================================================
platform linux2 -- Python 2.7.11+, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: /usr/share/creole/tests, inifile: 
collected 11 items 

test_upgrade.py ........F.F

======================================================================== FAILURES =========================================================================
___________________________________________________________________ test_upgrade_amon23 ___________________________________________________________________

    def test_upgrade_amon23():
        """ 
        Valide que la migration des variables "etb1.amon" va à son terme #14589
        """ 
        if isfile('/usr/share/eole/creole/dicos/30_amon.xml'):
            config = creole_loader(force_configeol=_calc_config_file('amon23'))
>           assert config.impl_get_information('upgrade', False) == '2.3'
E           assert <bound method Config.impl_get_information of [creole]\n[containers]>('upgrade', False) == '2.3'
E            +  where <bound method Config.impl_get_information of [creole]\n[containers]> = [creole]\n[containers].impl_get_information

test_upgrade.py:127: AssertionError
_____________________________________________________________ test_upgrade_eth_name_eolebase ______________________________________________________________

    def test_upgrade_eth_name_eolebase():
        """ 
        Valide la migration des variables faisant référence aux noms des interfaces ethX sur eolebase
        """ 
        if isfile('/usr/share/eole/creole/dicos/02_advanced_network.xml'):
            config = creole_loader(force_configeol=_calc_config_file('upgrade_eth_name252'))
>           assert _get_value(config, 'route_int') == ['0', '1', '2', '3', '4']

test_upgrade.py:162: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_upgrade.py:21: in _get_value
    path = config.find_first(byname=variable, type_='path')
/usr/lib/python2.7/dist-packages/tiramisu/config.py:350: in find_first
    force_permissive=force_permissive)
/usr/lib/python2.7/dist-packages/tiramisu/config.py:417: in _find
    return self._find_return_results(find_results, raise_if_not_found)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = [creole]
[containers], find_results = [], raise_if_not_found = True

    def _find_return_results(self, find_results, raise_if_not_found):
        if find_results == []:  # pragma: optional cover
            if raise_if_not_found:
>               raise AttributeError(_("no option found in config" 
                                       " with these criteria"))
E               AttributeError: aucune option trouvée dans la config avec ces critères

/usr/lib/python2.7/dist-packages/tiramisu/config.py:422: AttributeError
=========================================================== 2 failed, 9 passed in 25.06 seconds ===========================================================

Associated revisions

Revision e805239f (diff)
Added by Emmanuel GARETTE over 5 years ago

correction du test unitaire d'upgrade des interface (test_upgrade_eth_name_eolebase) (ref #15980 @4)

History

#1 Updated by Scrum Master over 5 years ago

  • Status changed from Nouveau to En cours

#2 Updated by Scrum Master over 5 years ago

  • Assigned To set to Fabrice Barconnière

#3 Updated by Fabrice Barconnière over 5 years ago

  • % Done changed from 0 to 50
  • La valeur après upgrade peut être en dictionnaire.
    • comment savoir si ça devient un dictionnaire ou si ça reste une liste ?
  • Le test est en erreur sur le _get_value.
    • Même en enlevant les contriantes, toujours problème. Je pensais que, les contraintes ayant changées entre la version 2.5.2 et 2.6.0 (valeurs autorisées ["eth0", "eth1", ...] en 2.5.2 contre ["0", "1," ...] en 2.6.0, c'était la cause du problème.

#4 Updated by Fabrice Barconnière over 5 years ago

  • % Done changed from 50 to 100
  • Remaining (hours) changed from 1.0 to 0.25

#5 Updated by Scrum Master over 5 years ago

  • Status changed from En cours to Résolu

#6 Updated by Joël Cuissinat over 5 years ago

  • Status changed from Résolu to Fermé
  • Remaining (hours) changed from 0.25 to 0.0

Tous les tests passent :)

Also available in: Atom PDF