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 from __future__ import absolute_import
14 from yardstick.benchmark.scenarios import base
15 import experimental_framework.api as api
17 LOG = logging.getLogger(__name__)
20 class VtcInstantiationValidation(base.Scenario):
21 """Execute Instantiation Validation TC on the vTC
23 __scenario_type__ = "vtc_instantiation_validation"
25 def __init__(self, scenario_cfg, context_cfg):
26 self.scenario_cfg = scenario_cfg
27 self.context_cfg = context_cfg
29 self.setup_done = False
34 self.options = self.scenario_cfg['options']
35 self.setup_done = True
37 def run(self, result):
40 if not self.setup_done:
43 heat_template = 'vTC.yaml'
46 openstack_credentials = {
47 'ip_controller': '0.0.0.0',
49 'auth_uri': os.environ.get('OS_AUTH_URL'),
50 'user': os.environ.get('OS_USERNAME'),
51 'password': os.environ.get('OS_PASSWORD'),
52 'project': os.environ.get('OS_TENANT_NAME')
54 heat_template_parameters = {
55 'default_net': self.options['default_net_name'],
56 'default_subnet': self.options['default_subnet_name'],
57 'source_net': self.options['vlan_net_1_name'],
58 'source_subnet': self.options['vlan_subnet_1_name'],
59 'destination_net': self.options['vlan_net_2_name'],
60 'destination_subnet': self.options['vlan_subnet_2_name']
62 deployment_configuration = {
63 'vnic_type': [self.options['vnic_type']],
64 'vtc_flavor': [self.options['vtc_flavor']]
68 test_case['name'] = 'instantiation_validation_benchmark.' \
69 'InstantiationValidationBenchmark'
70 test_case['params'] = dict()
71 test_case['params']['throughput'] = '1'
72 test_case['params']['vlan_sender'] = str(self.options['vlan_sender'])
73 test_case['params']['vlan_receiver'] = \
74 str(self.options['vlan_receiver'])
78 res = api.FrameworkApi.execute_framework(
82 heat_template_parameters,
83 deployment_configuration,
84 openstack_credentials)
86 LOG.exception('Exception')
87 LOG.info('Got output: %s', res)