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 ##############################################################################
11 from __future__ import absolute_import
14 from tests.functional import utils
17 class ScenarioTestCase(unittest.TestCase):
20 super(ScenarioTestCase, self).setUp()
21 self.yardstick = utils.Yardstick()
23 def test_scenario_list(self):
24 res = self.yardstick("scenario list")
26 self.assertIn("Lmbench", res)
27 self.assertIn("Perf", res)
28 self.assertIn("Fio", res)
29 self.assertIn("Ping", res)
30 self.assertIn("Iperf3", res)
31 self.assertIn("Pktgen", res)
33 def test_scenario_show_Lmbench(self):
34 res = self.yardstick("scenario show Lmbench")
35 lmbench = "Execute lmbench memory read latency"
36 "or memory bandwidth benchmark in a host" in res
37 self.assertTrue(lmbench)
39 def test_scenario_show_Perf(self):
40 res = self.yardstick("scenario show Perf")
41 perf = "Execute perf benchmark in a host" in res
44 def test_scenario_show_Fio(self):
45 res = self.yardstick("scenario show Fio")
46 fio = "Execute fio benchmark in a host" in res
49 def test_scenario_show_Ping(self):
50 res = self.yardstick("scenario show Ping")
51 ping = "Execute ping between two hosts" in res
54 def test_scenario_show_Iperf3(self):
55 res = self.yardstick("scenario show Iperf3")
56 iperf3 = "Execute iperf3 between two hosts" in res
57 self.assertTrue(iperf3)
59 def test_scenario_show_Pktgen(self):
60 res = self.yardstick("scenario show Pktgen")
61 pktgen = "Execute pktgen between two hosts" in res
62 self.assertTrue(pktgen)