aad475970e6e2491cda45fb63217e2b57ac23291
[yardstick.git] / tests / functional / test_cli_scenario.py
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10
11 import unittest
12
13 from tests.functional import utils
14
15
16 class ScenarioTestCase(unittest.TestCase):
17
18     def setUp(self):
19         super(ScenarioTestCase, self).setUp()
20         self.yardstick = utils.Yardstick()
21
22     def test_scenario_list(self):
23         res = self.yardstick("scenario list")
24
25         self.assertIn("Lmbench", res)
26         self.assertIn("Perf", res)
27         self.assertIn("Fio", res)
28         self.assertIn("Ping", res)
29         self.assertIn("Iperf3", res)
30         self.assertIn("Pktgen", res)
31
32     def test_scenario_show_Lmbench(self):
33         res = self.yardstick("scenario show Lmbench")
34         lmbench = "Execute lmbench memory read latency benchmark in a host" in res
35         self.assertTrue(lmbench)
36
37     def test_scenario_show_Perf(self):
38         res = self.yardstick("scenario show Perf")
39         perf = "Execute perf benchmark in a host" in res
40         self.assertTrue(perf)
41
42     def test_scenario_show_Fio(self):
43         res = self.yardstick("scenario show Fio")
44         fio = "Execute fio benchmark in a host" in res
45         self.assertTrue(fio)
46
47     def test_scenario_show_Ping(self):
48         res = self.yardstick("scenario show Ping")
49         ping = "Execute ping between two hosts" in res
50         self.assertTrue(ping)
51
52     def test_scenario_show_Iperf3(self):
53         res = self.yardstick("scenario show Iperf3")
54         iperf3 = "Execute iperf3 between two hosts" in res
55         self.assertTrue(iperf3)
56
57     def test_scenario_show_Pktgen(self):
58         res = self.yardstick("scenario show Pktgen")
59         pktgen = "Execute pktgen between two hosts" in res
60         self.assertTrue(pktgen)
61