summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc027.yaml3
-rw-r--r--tests/unit/cmd/commands/test_task.py14
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc027.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc027.yaml
index e360b4bd0..cf3afc866 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc027.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc027.yaml
@@ -24,6 +24,9 @@ scenarios:
max_rtt: 30
action: monitor
+precondition:
+ installer_type: compass
+ deploy_scenarios: os-nosdn
context:
type: Node
diff --git a/tests/unit/cmd/commands/test_task.py b/tests/unit/cmd/commands/test_task.py
index e785e99a9..5b404c48d 100644
--- a/tests/unit/cmd/commands/test_task.py
+++ b/tests/unit/cmd/commands/test_task.py
@@ -56,3 +56,17 @@ class TaskCommandsTestCase(unittest.TestCase):
mock_base_runner.Runner.get.return_value = runner
t._run([scenario], False, "yardstick.out")
self.assertTrue(runner.run.called)
+
+ @mock.patch('yardstick.cmd.commands.task.os')
+ def test_check_precondition(self, mock_os):
+ cfg = \
+ {'precondition':
+ {'installer_type': 'compass',
+ 'deploy_scenarios': 'os-nosdn'
+ }
+ }
+
+ t = task.TaskParser('/opt')
+ mock_os.environ.get.side_effect = ['compass', 'os-nosdn']
+ result = t._check_precondition(cfg)
+ self.assertTrue(result)