ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sumit Mohanty (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-10552) Several ambari-server python unit tests fail because OS type is not mocked
Date Thu, 16 Apr 2015 23:02:10 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-10552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14498931#comment-14498931
] 

Sumit Mohanty commented on AMBARI-10552:
----------------------------------------

The fix is to mock the OS to be linux so that the tests can run on non-linux flavors.

> Several ambari-server python unit tests fail because OS type is not mocked
> --------------------------------------------------------------------------
>
>                 Key: AMBARI-10552
>                 URL: https://issues.apache.org/jira/browse/AMBARI-10552
>             Project: Ambari
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.1.0
>            Reporter: Sumit Mohanty
>            Assignee: Sumit Mohanty
>             Fix For: 2.1.0
>
>
> 39 tests fail for similar reasons:
> {code}
> Failed tests:
> ERROR: test_configure_default (test_historyserver.TestHistoryServer)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-common/src/test/python/mock/mock.py",
line 1199, in patched
>     return func(*args, **keywargs)
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py",
line 38, in test_configure_default
>     target = RMFTestCase.TARGET_COMMON_SERVICES
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-server/src/test/python/stacks/utils/RMFTestCase.py",
line 118, in executeScript
>     script_class_inst = RMFTestCase._get_attr(script_module, classname)()
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-common/src/main/python/ambari_commons/os_family_impl.py",
line 59, in new
>     if OSCheck.get_os_family() in cls._impls:
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-common/src/main/python/ambari_commons/os_check.py",
line 215, in get_os_family
>     os_family = OSCheck.get_os_type()
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-common/src/main/python/ambari_commons/os_check.py",
line 189, in get_os_type
>     dist = OSCheck.os_distribution()
>   File "/Users/smohanty/enlistments/asf-ambari/ambari-common/src/main/python/ambari_commons/os_check.py",
line 169, in os_distribution
>     distribution = platform.linux_distribution()
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py",
line 329, in linux_distribution
>     return _dist_try_harder(distname,version,id)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py",
line 205, in _dist_try_harder
>     info = open('/var/adm/inst-log/info').readlines()
> IOError: [Errno 2] No such file or directory: '/var/adm/inst-log/info'
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message