1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
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 ##############################################################################
13 from tests.functional import utils
16 class ScenarioTestCase(unittest.TestCase):
19 super(ScenarioTestCase, self).setUp()
20 self.yardstick = utils.Yardstick()
22 def test_scenario_list(self):
23 res = self.yardstick("scenario list")
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)
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)
37 def test_scenario_show_Perf(self):
38 res = self.yardstick("scenario show Perf")
39 perf = "Execute perf benchmark in a host" in res
42 def test_scenario_show_Fio(self):
43 res = self.yardstick("scenario show Fio")
44 fio = "Execute fio benchmark in a host" in res
47 def test_scenario_show_Ping(self):
48 res = self.yardstick("scenario show Ping")
49 ping = "Execute ping between two hosts" in res
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)
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)