[
https://issues.apache.org/jira/browse/AMBARI-10552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14498950#comment-14498950
]
Siddharth Wagle commented on AMBARI-10552:
------------------------------------------
+1
> 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
>
> Attachments: AMBARI-10552.patch
>
>
> 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)