diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2018-03-12 02:27:26 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2018-03-12 03:46:21 +0000 |
commit | 862096b518ca09f22bff8a7564470195ee035378 (patch) | |
tree | bc6268e73844ccac803b14a293b768c1a83b0315 /yardstick/tests | |
parent | f753fb86cc26e08dca168c0827d28a7b6f022d1f (diff) |
Get SUT information
JIRA: YARDSTICK-1063
We have the demand to get SUT information.
In this patch, we use ansible to get the SUT information.
Change-Id: I983675d6d367fa528f00c1b50bc6fa2a9cee03f7
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/tests')
-rw-r--r-- | yardstick/tests/unit/common/test_ansible_common.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/yardstick/tests/unit/common/test_ansible_common.py b/yardstick/tests/unit/common/test_ansible_common.py index b01195fcc..48d8a60c8 100644 --- a/yardstick/tests/unit/common/test_ansible_common.py +++ b/yardstick/tests/unit/common/test_ansible_common.py @@ -17,6 +17,7 @@ from __future__ import absolute_import import os import tempfile +import shutil from collections import defaultdict import mock @@ -246,3 +247,18 @@ class AnsibleCommonTestCase(unittest.TestCase): a.execute_ansible('', d, ansible_check=True, verbose=True) finally: os.rmdir(d) + + def test_get_sut_info(self): + d = tempfile.mkdtemp() + a = ansible_common.AnsibleCommon({}) + try: + a.get_sut_info(d) + finally: + shutil.rmtree(d) + + def test_get_sut_info_not_exist(self): + a = ansible_common.AnsibleCommon({}) + try: + a.get_sut_info('/hello/world') + except OSError: + pass |