summaryrefslogtreecommitdiffstats
path: root/tests/functional/test_cli_scenario.py
blob: 87797378353bf1d74ed7d6ffa9a702c080782e09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################


import unittest

from tests.functional import utils


class ScenarioTestCase(unittest.TestCase):

    def setUp(self):
        super(ScenarioTestCase, self).setUp()
        self.yardstick = utils.Yardstick()

    def test_scenario_list(self):
        res = self.yardstick("scenario list")

        self.assertIn("Lmbench", res)
        self.assertIn("Perf", res)
        self.assertIn("Fio", res)
        self.assertIn("Ping", res)
        self.assertIn("Iperf3", res)
        self.assertIn("Pktgen", res)

    def test_scenario_show_Lmbench(self):
        res = self.yardstick("scenario show Lmbench")
        lmbench = "Execute lmbench memory read latency"
        "or memory bandwidth benchmark in a host" in res
        self.assertTrue(lmbench)

    def test_scenario_show_Perf(self):
        res = self.yardstick("scenario show Perf")
        perf = "Execute perf benchmark in a host" in res
        self.assertTrue(perf)

    def test_scenario_show_Fio(self):
        res = self.yardstick("scenario show Fio")
        fio = "Execute fio benchmark in a host" in res
        self.assertTrue(fio)

    def test_scenario_show_Ping(self):
        res = self.yardstick("scenario show Ping")
        ping = "Execute ping between two hosts" in res
        self.assertTrue(ping)

    def test_scenario_show_Iperf3(self):
        res = self.yardstick("scenario show Iperf3")
        iperf3 = "Execute iperf3 between two hosts" in res
        self.assertTrue(iperf3)

    def test_scenario_show_Pktgen(self):
        res = self.yardstick("scenario show Pktgen")
        pktgen = "Execute pktgen between two hosts" in res
        self.assertTrue(pktgen)