aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/common
diff options
context:
space:
mode:
authorJack Chan <chenjiankun1@huawei.com>2018-03-14 06:33:38 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-14 06:33:38 +0000
commit4b8b674b65830a24230faed71e8d9a1048139c89 (patch)
tree2ac900b54123ec14f36e4065275ba9b63b1f6988 /yardstick/tests/unit/common
parentbbd3b027bd132568c258f02e36d9cc78c4629dfd (diff)
parent862096b518ca09f22bff8a7564470195ee035378 (diff)
Merge "Get SUT information"
Diffstat (limited to 'yardstick/tests/unit/common')
-rw-r--r--yardstick/tests/unit/common/test_ansible_common.py16
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