Merge "Bugfix: heat conext of test case yamls jinja2 bypass sriov type"
[yardstick.git] / yardstick / tests / unit / common / test_ansible_common.py
index b01195f..48d8a60 100644 (file)
@@ -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