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 ##############################################################################
13 from yardstick.benchmark.scenarios import base
14 from experimental_framework import api as api
16 LOG = logging.getLogger(__name__)
19 class VtcThroughput(base.Scenario):
20 """Execute Instantiation Validation TC on the vTC
22 __scenario_type__ = "vtc_throughput"
24 def __init__(self, scenario_cfg, context_cfg):
25 self.scenario_cfg = scenario_cfg
26 self.context_cfg = context_cfg
28 self.setup_done = False
33 self.options = self.scenario_cfg['options']
34 self.setup_done = True
36 def run(self, result):
39 if not self.setup_done:
42 heat_template = 'vTC.yaml'
45 openstack_credentials = {
46 'ip_controller': '0.0.0.0',
48 'auth_uri': os.environ.get('OS_AUTH_URL'),
49 'user': os.environ.get('OS_USERNAME'),
50 'password': os.environ.get('OS_PASSWORD'),
51 'project': os.environ.get('OS_TENANT_NAME')
53 heat_template_parameters = {
54 'default_net': self.options['default_net_name'],
55 'default_subnet': self.options['default_subnet_name'],
56 'source_net': self.options['vlan_net_1_name'],
57 'source_subnet': self.options['vlan_subnet_1_name'],
58 'destination_net': self.options['vlan_net_2_name'],
59 'destination_subnet': self.options['vlan_subnet_2_name']
61 deployment_configuration = {
62 'vnic_type': [self.options['vnic_type']],
63 'vtc_flavor': [self.options['vtc_flavor']]
67 test_case['name'] = 'rfc2544_throughput_benchmark.' \
68 'RFC2544ThroughputBenchmark'
69 test_case['params'] = dict()
70 test_case['params']['packet_size'] = str(self.options['packet_size'])
71 test_case['params']['vlan_sender'] = str(self.options['vlan_sender'])
72 test_case['params']['vlan_receiver'] = \
73 str(self.options['vlan_receiver'])
77 res = api.FrameworkApi.execute_framework(
81 heat_template_parameters,
82 deployment_configuration,
83 openstack_credentials)
84 except Exception as e:
85 LOG.info('Exception: {}'.format(e.message))
86 LOG.info('Got output: {}'.format(res))