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"
35 "or memory bandwidth benchmark in a host" in res
36 self.assertTrue(lmbench)
38 def test_scenario_show_Perf(self):
39 res = self.yardstick("scenario show Perf")
40 perf = "Execute perf benchmark in a host" in res
43 def test_scenario_show_Fio(self):
44 res = self.yardstick("scenario show Fio")
45 fio = "Execute fio benchmark in a host" in res
48 def test_scenario_show_Ping(self):
49 res = self.yardstick("scenario show Ping")
50 ping = "Execute ping between two hosts" in res
53 def test_scenario_show_Iperf3(self):
54 res = self.yardstick("scenario show Iperf3")
55 iperf3 = "Execute iperf3 between two hosts" in res
56 self.assertTrue(iperf3)
58 def test_scenario_show_Pktgen(self):
59 res = self.yardstick("scenario show Pktgen")
60 pktgen = "Execute pktgen between two hosts" in res
61 self.assertTrue(pktgen)