1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB 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 ##############################################################################
10 """ Handler for yardstick command 'scenario' """
12 from yardstick.benchmark.scenarios.base import Scenario
13 from yardstick.common.utils import cliargs
14 from yardstick.cmd import print_hbar
17 class ScenarioCommands(object):
20 Set of commands to discover and display scenario types.
23 def do_list(self, args):
24 '''List existing scenario types'''
25 types = Scenario.get_types()
27 print("| %-16s | %-60s" % ("Type", "Description"))
30 print("| %-16s | %-60s" % (stype.__scenario_type__,
31 stype.__doc__.split("\n")[0]))
34 @cliargs("type", type=str, help="runner type", nargs=1)
35 def do_show(self, args):
36 '''Show details of a specific scenario type'''
37 stype = Scenario.get_cls(args.type[0])