Extend lmbench scenario to measure memory bandwidth
[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"
35         "or memory bandwidth benchmark in a host" in res
36         self.assertTrue(lmbench)
37
38     def test_scenario_show_Perf(self):
39         res = self.yardstick("scenario show Perf")
40         perf = "Execute perf benchmark in a host" in res
41         self.assertTrue(perf)
42
43     def test_scenario_show_Fio(self):
44         res = self.yardstick("scenario show Fio")
45         fio = "Execute fio benchmark in a host" in res
46         self.assertTrue(fio)
47
48     def test_scenario_show_Ping(self):
49         res = self.yardstick("scenario show Ping")
50         ping = "Execute ping between two hosts" in res
51         self.assertTrue(ping)
52
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)
57
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)
62