aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/heat.py
AgeCommit message (Collapse)AuthorFilesLines
2019-04-08Merge "Update to support using external heat template"Volodymyr Mytnyk1-0/+8
2019-04-04Update to support using external heat templatetreyad1-0/+8
Modify the _get_server() function when using external heat template. The server attrs should be read from stack.outputs. JIRA: YARDSTICK-1453 Change-Id: I00eda7476e77fc0a5c15ef8db7d057fa1cf267e6 Signed-off-by: treyad <treyad@viosoft.com>
2019-02-28Support using existing private key when using external heat template filetreyad1-16/+43
Currently, the private key is auto-generated from Yardstick. This patch will allow user use their existing private key when they use external heat template file. JIRA: YARDSTICK-1447 Change-Id: I45a0ab4ac08e7ccedd770867ed43de92040b6a10 Signed-off-by: treyad <treyad@viosoft.com>
2018-12-11Pass the path of ssh public key to scenario methodcope.li1-1/+3
In our testcase, we need the key_file for our VM login. JIRA:YARDSTICK-1558 Change-Id: If99704c4f91c87d79e156f2dd73795a059b7ce6c Signed-off-by: cope.li <cope.li@huawei.com>
2018-08-20Make security group configurable - dovetailrexlee87761-1/+5
Make sercurity group can be configured via the context. The format would be: context: name: demo image: yardstick-image flavor: yardstick-flavor user: ubuntu security_group: rules: - remote_ip_prefix: "0.0.0.0/0" protocol: "tcp" port_range_min: 1 port_range_max: 65535 - remote_ip_prefix: "0.0.0.0/0" protocol: "udp" port_range_min: 1 port_range_max: 65535 - remote_ip_prefix: "0.0.0.0/0" protocol: "icmp" JIRA: YARDSTICK-1360 Change-Id: I00c45767ee2d70b790590e824599d5a4c274bced Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2018-07-05Make context types constantsRodolfo Alonso Hernandez1-1/+2
Make context types constants. These are the current context types: - Dummy - Heat - Kubernetes - Node - StandaloneOvsDpdk - StandaloneSriov Any reference to a context type should use the referred constant. JIRA: YARDSTICK-1292 Change-Id: I1ff0085161f88304d71e3ddad7975f9020e0fc20 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-26Extended Context class with get_physical_nodes functionalityChornyi, TarasX1-0/+42
JIRA: YARDSTICK-1255 Change-Id: I446d715dc6cf716a4fcbc1b809c1b1d6303071e0 Signed-off-by: Chornyi, TarasX <tarasx.chornyi@intel.com>
2018-05-21Add "host_name_separator" variable to Context classRodolfo Alonso Hernandez1-1/+1
This feature will provide Kubernetes context the ability to handle the context name inside the class itself, providing to the developer an abstraction of the possible naming limitations in Kubernetes. E.g.: "dot" character in Pod names is no allowed [1]. [1] https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter/issues/58 JIRA: YARDSTICK-1188 Change-Id: I82121f970b550170357a443b6340be7900602a57 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-05-03Add "os_cloud_config" as a new context flag parameterRodolfo Alonso Hernandez1-2/+4
This new parameter will contain the OpenStack cloud specific configuration used by Shade client. This new flag is used only in Heat context. By default, this new parameter (dict) will contain this content: 'os_cloud_config': {'verify': False} This field will be used by HeatStack [1] to create a Shade cloud. Shade retrieves, if not defined, the OpenStack configuration from "os_client_config". This configuration is used to generate the cloud configuration, which is the description of the OpenStackCloud returned. The default parameter defined, "verify", refers to the related bug. By default, in case of using SSL certificate it will not be verified. [1] https://github.com/opnfv/yardstick/blob/b338d3091bb0beb89d4ad9f7c144f43a31a19a74/yardstick/orchestrator/heat.py#L47 JIRA: YARDSTICK-1139 Change-Id: I875a7018401b84e51dab775b8194174645d27e06 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-04-25Fix "os.path" mock problems during testsRoss Brattain1-3/+0
This patch removes the global mocking applied on "os.path". Change-Id: Ia18d2c90195c5408a1852792bdf05b6f0c1ad21f Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-03-06Merge "Move SSH key generation from "init" to "deploy""Emma Foley1-11/+11
2018-03-06Move SSH key generation from "init" to "deploy"Rodolfo Alonso Hernandez1-11/+11
In [1], the Context SSH key generation was modified; the SSH now has a name matching the name context (which depends on the given name and the task ID). In a test suite, the task ID is the same for all test cases executed in the same batch. If the context name of different test cases is the same (there is no impediment, e.g.: "demo", "yardstick"), the SSH key filename will be the same. Currently the SSH key generation is done during the initialization process, at the begining of the test suite executing. If, by coincidence, two test cases have the same context name, the first one will remove the SSH key file during the "undeploy" process; then the second one will rise an exception because the SSH key file is deleted. This patch moves the SSH key file generation from the initialization process to the context deploy process: TEST SUITE: - init: parse all test cases - test case 1: - deploy (generate SSH keys) - run - undeploy (delete SSH keys) - test case 2: ... [1] Id175061d6cfe23a068bb3d12ce176c1f176e8236 JIRA: YARDSTICK-1045 Change-Id: I05dc46db20d2a0cba3092c415ce9b248513406fb Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-03-06Merge "Enable heat context to support existing network"Jack Chan1-7/+27
2018-03-02heat: replace neutronclient with shadeRoss Brattain1-7/+6
neutronclient is deprecated and also has bunches of issues with SSL and such. JIRA: YARDSTICK-890 JIRA: YARDSTICK-1032 Change-Id: I41c9aac0ea69e1307560a001f7dc34178fcd7e71 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2018-03-02Add yardstick.benchmark.contexts.heat.HeatContext._delete_key_file()Emma Foley1-6/+10
* Move logic for removing key file into its own method * Update the log message to be more useful JIRA: YARDSTICK-1026 Change-Id: I8c131720ed91c939698c41ad63d586396fcce1fe Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-01Add ability to reuse existing OpenStack set-upEmma Foley1-2/+17
This change adds two optional flags to the context configuration for heat: * no_setup -- to re-use an existing OpenStack deployment * no_teardown -- to skip undeploying the context, so it is available in other testcases In order to achieve this, resource naming had to be made more predictable. When no_setup or no_teardown are set: * Do not add a suffix to context name * When searching, try with and without a suffix to find a server by name All behaviors remain the same unless these values are set. NOTE: This feature doesn't work with the NSPerf scenario, because the interfaces in the VNFs are bound to DPDK after the first test, so the look-up for missing topology information fails in subsequent test runs, as the interfaces are not visable to the kernel. This can be addressed either by either unbinding the interfaces from DPDK at the end of each test, or modifying the look-up for the missing topology information to query DPDK as well. The change will be made in a future patch. JIRA: YARDSTICK-886 Change-Id: I6df5e86e419c283a2bee41917e4f62179aa9c31a Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-01Add methods to get an existing stackEmma Foley1-0/+9
* Add yardstick/orchestrator/heat.py:HeatStack.get * Add yardstick/benchmark/contexts/heay.py:HeatContext.retrieve_existing_stack JIRA: YARDSTICK-886 Change-Id: I6974b79a25f98066a49b1bc8ccd11383e7962091 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-01Use context name instead of key_uuidEmma Foley1-11/+14
context.key_uuid is only used as a suffix for the key files. There is already a unique ID associated with a the context; the context name includes a task ID, which is a UUID. This patch sets context.key_uuid to to context.name instead of generating a separate UUID As a result, get_short_key_uuid() is not needed. JIRA: YARDSTICK-1028 Change-Id: Id175061d6cfe23a068bb3d12ce176c1f176e8236 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-01Add _create_new_stack methodEmma Foley1-9/+13
The logic for creating a new stack in contexts/heat.py:HeatContext can added to a method to make the code eassier to read and test. This is in preparation for an update to deploy() that would allow an existing stack to be reused, or a new stack created. By having the create_new_stack logic in a new method, deploy() becomes easier to read and test. JIRA: YARDSTICK-886 Change-Id: I7af01e2209a3460658f8db0249b7c620743cced0 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-01Add qualified name to ContextEmma Foley1-5/+4
The context name depends on the defined name in the testcase input file, the task ID and the flags of the context. If the context is going to be undeployed at the end of the test, the task ID is suffixed to the name to avoid interferences with previous deployments. If the context needs to be deployed at the end of the test, the name assigned is kept. This patch makes base.Context use Flags when initialising contexts, this sets the name property based on the no_setup and no_teardown flags. Since base.Context is an abstract class, it cannot be instantiated. However, there are some non-abstract methods that need testing. Since DummyContext does not override any of these methods, it can be used for testing. JIRA: YARDSTICK-886 Change-Id: I1447fb5ed447691eaeb0a97f928c0b3333799d07 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-02-27Enable heat context to support existing networkrexlee87761-7/+27
JIRA: YARDSTICK-970 Change-Id: I593af4b3a30e52521e3d77fd84bec16ab4733483 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2018-02-23Bug Fix: Move heat_timeout variable higherDimitrios Markou1-2/+2
If a heat_template was used by a testcase the heat_timeout variable was not getting initialized and that caused errors in the Shade python module. JIRA: YARDSTICK-1027 Change-Id: Ic0bf15b13cc00595964a97f8150dc5e6f2b7e1d7 Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
2018-02-20Make files pep8 compliantEmma Foley1-1/+1
This change makes files pep8 compliant before adding the reuse context feature JIRA: YARDSTICK-886 Change-Id: Iae7daaa159a9ddbb5809a9a7ac74f8a53683089a Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2017-12-11heat: allow overriding Heat/Neutron private IP for DPDK testsRoss Brattain1-0/+1
For some L2/L3 DPDK testcases we need to use a custom IP address space different from what Heat provides. These testcases require port_security_enabled = False so Neutron should allow for unrestricted L2 traffic. This will work because we bind the ports to DPDK and thus don't need DHCP. vnf_0: floating_ip: true placement: "pgrp1" network_ports: mgmt: - mgmt uplink_0: - xe0: local_ip: 10.44.0.20 netmask: 255.255.255.0 downlink_0: - xe1: local_ip: 10.44.0.30 netmask: 255.255.255.0 Also fixup flake8 errors in unittests Change-Id: Id29dfffa692f16fb1f526d208db43e476e2f7830 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-10-05heat: add port name as portRoss Brattain1-0/+2
Change-Id: Ibd159359c6f57d573a909d6841c121c15bf692c1 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-20heat: fixup unittest block with pkeyRoss Brattain1-4/+4
get pkey after we have found the node Change-Id: I0e67834b87ed5ba268ea9cb5cffb6c214aedeebb Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-20Merge "Generate pod.yaml from current context"Ross Brattain1-0/+2
2017-09-18Heat: use pkey from string instead of key_filenameRoss Brattain1-3/+3
Instead of using a key_filename for Heat, we can read the key as a string directly using pkg_resources.resource_string() This will enable us to save Heat stacks as pod.yaml, because we can embedded the key into the pod.yaml directly. Change-Id: I16baaba17dab845ee0846f97678733bae33cb463 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-09-15Generate pod.yaml from current contextRoss Brattain1-0/+2
We want to generate pod.yaml from Heat contexts so we can re-use the context without destroying it. But we don't have node role information and it doesn't make sense in this case, so make the role optional. Since we changed Heat to use pkey instead of key_filename, we can embed the pkey into the pod.yaml, but we have to make sure to convert the pkey to string, in case it is a RSAKey object Change-Id: Ibefcfbd8236e68013a704c39964cb870da825da8 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-15Merge "NSB: fix port topology"Ross Brattain1-11/+21
2017-09-15Merge "improve logging, clear using print"Rex Lee1-4/+4
2017-09-14NSB: fix port topologyMartin Banszel1-11/+21
Add a new PortPair class to resolve the topology into list of public and private ports. Before we were calculating public/private in multiple locations and using different conventions. In addition for all the DPDK test we need to use the DPDK port number and no rely on interface ordering or interface naming conventions. We used to use xe0 -> 0, xe1 -> 1, etc. This is not the DPDK port number. Use the new dpdknicbind_helper class to parse the output of dpdk-devbind.py to find the actual DPDK port number at runtime. We then use this DPDK port number to correctly calculate the port_mask_hex. The port mask maps the DPDK port num (PMD ID) to the LINK ID used in the pipeline config We also need to make sure we only use the interfaces matched to the topology and not use all the interfaces, because in some cases we will have unused interfaces. In particular TRex always requires an even number of interfaces, so for single port TRex tests we have to create the second port and not use it. Thus we had to modify the traffic generator stats code to only dump stats for used ports and no unused ports. Ixia was using interface ordering to map to Ixia ports, instead we use the dpdk_port_num which must be hardcoded for Ixia. Renamed traffic_profile.execute to traffic_profile.execute_traffic so we can trace the code easier. We pass the port used by the traffic profile to generate_samples so we don't get stats for unused ports. Fixed up vPE config creation and bring up issues. Fixed up CGNAPT and UDP_Replay to work correctly. Tested with 4-port scale-out Change-Id: I2e4f328bff2904108081e92a4bf712333fa73869 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-09-13Heat: support non-mesh network toplogyRoss Brattain1-9/+16
Previsouly we added all servers to every network in Heat in a full mesh. To more closely replicate test topology and to limit then number of ports we need to all each server to specify which ports should be connected to each network. This should also allow for some kind of multiport setup. Add optional network_ports dict to each server with network to port_list mapping match inteface based on port name or vld_id replace vld_id matching with network name matching, since network_name == vld_id Change-Id: I5de46b8f673949e3c17d8df6fa96f055c43886ce Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-14improve logging, clear using printrexlee87761-4/+4
Change-Id: I744353f631cf1771d75f750543e8612f81be71ee Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-28DRAFT: model: remove vld_id not neededRoss Brattain1-1/+0
it seems vld_id is not needed now that we add it in _resolve_topology. Remove it from the model and Heat context first and see what happens Needs testing Change-Id: I30d13c80bd90246ee3be67a2bd3439db45e20bcd Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-28Kubernetes context adoption when run in CIchenjiankun1-2/+18
JIRA: YARDSTICK-801 We need kubernetes test case run in CI. We have one scenario k8-nosdb-lb-noha for kubernetes. But for now, we need to do some adoption in CI script. Also I move check OS_AUTH_URL in heat.py. Change-Id: Iff86caf77fd74e70469ad2dc43f2238097ce0001 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-25Enabling ACL test for provider network.Maciej Skrocki1-1/+2
Properly re-using network_type from model. Change-Id: I40180eb53080a360b4099c034038eac67716f8d1 Signed-off-by: Maciej Skrocki <maciej.skrocki@intel.com>
2017-08-08NSB updateDeepak S1-62/+65
Refactored main NSB VNF classes accroding to class diagram https://wiki.opnfv.org/display/yardstick/NSB+class+diagram All the SampleVNFs have been separated and placed under the SampleVNF class. Added AutoConnectSSH to automatically create SSH conneciton on demand. Added VnfdHelper class to wrap the VNFD dictionary in prepartion for class-based modeling. Extracted DpdkVnfSetupEnvHelper for DPDK based VNF setup. Extracted Stats and other client config to ResourceHelper Had to replace dict_key_flatten with deepgetitem due to Python 2.7 Jinja2 infinite recursion. Change-Id: Ia8840e9c44cdbdf39aab6b02e6d2176b31937dc9 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-07-19heat: port_security_enabled, allowed_address_pairs, disable gateway_ipRoss Brattain1-2/+5
xe0: cidr: '10.0.2.0/24' vld_id: public allowed_address_pairs: - ip_address: '0.0.0.0/0' xe1: cidr: '10.0.3.0/24' vld_id: private allowed_address_pairs: - ip_address: '0.0.0.0/0' We need to disable gateways on data plane interfaces With TGs and VFNs we probably don't need gateway on data interfaces Change-Id: I276a7d591a0a3ff03877c4f525303fc2874de683 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-07-13add network info to topologyRoss Brattain1-40/+101
we need to know which network each port is connected to so we can find VLAN or VXLAN ID. To do this we implement a new method for Contexts, Context.get_network(). This method is similar to Context.get_server(), it searches for a given network name in all the contexts. From this we generate a context_cfg["networks"] dict that stores all the network info for the nodes in the scenario. Then when we generate the topology for VNFD, we can lookup a given network by the vld_id and get the network_type, segmentation_id, etc. Then if we need to for example generated traffic on a given VLAN or VXLAN, we have this info available. Define default nd_route_tbl for ACL VNF we need default empty nd_route_tbl for IPv6 route. Change-Id: I9f9cfbd6acabeb4ae4675ca7354390efa57b29e7 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-07-04support segmentation_id for vlan provider networkJingLu51-1/+2
If a network specified in the test case is a vlan provider network, new attribute "segmentation_id" can be used to specify the desired vlan tag in the test case network section: networks: test-net: cidr: '192.168.1.0/24' provider: "vlan" physical_network: 'physnet1' segmentation_id: "1000" If the "segmentation_id" attribute is absent, a random vlan tag will be allocated to the network. Change-Id: Ic53852447a3c1bd8feb9ebd42d35f1ade3684be1 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-06-20Acquire NSB specific data from Heat.Edward MacGillivray1-19/+58
First we add mac_address, subnet_cidr to Heat template outputs Then we convert those into a form for NSB and add vld_id. NSB also requires PCI Bus ID, kernel driver and dpdk_port_num. We get this by ssh-ing into instance and dumping sysfs We also need to fix allow for ssh key auth, and implement relative path file loading so NSB can find all its YAML files JIRA: YARDSTICK-580 Change history: don't hide heat create tracebacks we need tracebacks for debug vnf_generic: add task_path to scenario so we can load relative paths for vnf_generic we want to be able to load yaml relative to the task path For example: traffic_profile: ../../traffic_profiles/fixed.yaml topology: ping_tg_topology.yaml # TODO: look in relative path where the tc.yaml is found These need to be relative to samples/vnf_samples/nsut/ping/tc_ping_heat_context.yaml Add a scenario["task_path"] entry heat: log actual exception vnf_generic: replace list with set and iterate over values() some general refactors to remove redundact lookups and type conversions heat: provide mac_address, device_id and network_id from outputs We may need more information to dynamically determine test topology. Towards this end return more info in the heat template. We can return mac_address, device_id and network_id. Once we have this info we can add it to the context_cfg as an interfaces dict. add sample vnf ping multi-network test this test requires 3 network, one for mgmt and the other two for NSB traffic tests We have to make sure we don't use DPDK on mgmt interface because DPDK unbinds the driver heat: convert networks to OrderedDict so we can lookups networks as well as iterate over them in consisitent order heat: and vld_id to networks for vnf_generic vnf_generic uses vld_id Virtual Link Descriptor ID to identify interfaces Add the key to the networks dict and store in Networks object implement relative path file loading in vnf_generic in multiple places we need to load a file relative to the task path, so add open_relative_file_path and modify load_vnf_model to include the scenario_cfg parameter so we have access to task_path DRAFT: heat timeout support Heat stack in CI job failed due to some Nova issue. But then apparently yardstick kept running and took 180mins to timeout https://build.opnfv.org/ci/view/bottlenecks/job/bottlenecks-compass-posca_stress_ping-baremetal-daily-master/16/console We can add a Heat create timeout and fail faster if there is an error. The question is how long should we wait for a Heat stack to deploy. We can set a default and allow override in the heat context config, if users make complicated stacks heat: get netmask and gateway from heat outputs we have do some tricky business with finding the subnet cidr and converting it into netmask vnf_generic: get vpci, driver and dpdk_port_num use a big old find command to dump all the sysfs netdev info nicely. This was re-used from autotest FCoE tests. r"""find /sys/devices/pci* -type d -name net -exec sh -c '{ grep -sH ^ \ +$1/ifindex $1/address $1/operstate $1/device/vendor $1/device/device \ +$1/device/subsystem_vendor $1/device/subsystem_device ; \ +printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \ +' sh \{\}/* \; This finds all PCI devices that are network devices, then dumps all the relevant info using /bin/sh. Then we parse this into a 'netdevs' dict inside the node_dict and also convert into VNF fields we need. vnf_generic: set node name for kpis node is a dict, so we have to use node_name vnfdgen: we CANNOT use TaskTemplate.render because it does not allow for missing variables, we need to allow password for key_filename to be undefined remove default ssh password hack, once rendering is fixed add new example tc_external_ping_heat_context Change-Id: If1fe0c1a2ab0a5be17e40790a66f28f706fa44d6 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-05-12Create flavor from heat contextDanielMartinBuckley1-2/+16
JIRA: YARDSTICK-582 Create a customizable flavor via heat context. All heat parameters are configurable including Core Affinity. The default flavor name is XXXX-flavor where XXXX is stackname. Flavor attributes are taken from the heat context file. If a flavor attribute is not used it takes default attribute value. If flavor name is not specified it uses the server name + "-flavor" or stack-name + "-flavor". Compute node specific attributes are configurable via "extra_specs" attribute. See https://docs.openstack.org/admin-guide/compute-flavors.html for details. Change-Id: If4015970b889b0b95bfa8eba9491ebf31e92f2c7 Signed-off-by: DanielMartinBuckley <daniel.m.buckley@intel.com>
2017-04-23Merge "Add SRIOV support"Kubi1-2/+5
2017-04-18Add SRIOV supportJing Zhang1-2/+5
A generic provider network solution is introduced. To identify whether a network specified in the test case is a provider network new attributes are introduced in the test case network section: networks: test-net: cidr: '192.168.1.0/24' provider: "sriov" physical_network: 'physnet1' If the "provider" attribute is present, the network is an existing provider network. If the value is "sriov", binding:vnic_type=direct is added to the interface in the heat deployment template. In orchestrator/heat.py, the interface creating functions are given a new parameter that tells if the network in use is a provider network. The benchmark/contexts/model.py is changed to store the value of the provider attribute from the test case and function calls to port creation is updated with the provider parameter. The same change is made in contexts/heat.py as well. Also calls for creating a new tenant network is replaced for creating a new provider network if the provider attribute is present. Update-1: Change test_model.py Update-2: Per comment, change comment style to """" Update-3: Change test_heat.py Update-4: Add unit test cases to pass coverage test Update-5: Add SRIOV provider network example in opnfv_yardstick_tc008.yaml Update-6: Per comment, remove empty line in orchestrator/test_heat.py Update-7: Per comment, change comment lines in orchestrator/test_heat.py Update-8: Add more unit test cases to pass coverage test Update-9: Change to create SRIOV provider network on the fly so as to support co-current test runs Update-10: Per comment, init physical_network to 'physnet1' Change-Id: I76004c4fcc9bffcfd8ed021fd647e0cecb346ef4 JIRA: YARDSTICK-612 Signed-off-by: Jing Zhang <jing.c.zhang@nokia.com>
2017-04-01Yardstick virtualenv supportchenjiankun1-1/+1
JIRA: YARDSTICK-620 Currently we recommend using docker to run yardstick. And it is hard to use virtualenv to install yardstick. So I modify install.sh in yardstick root path. It will support using virtualenv to install yardstick(including API) in linux. In this patch, I make yardstick support read yardstick configuration have priority over constants. Change-Id: I9ea1241b228532a6497451e6c8f232173ddb783e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-03-09Merge "move external_network auto-assign to Heat context"Rex Lee1-3/+14
2017-03-08Bugfix: yardstick will create stacks with the same name when run using API ↵chenjiankun1-0/+2
in parallel JIRA: YARDSTICK-575 Currently yardstick will create stacks with the same name when run using API in parallel. The reason is there is a global variable in context base and the core will always deploy the first context in Context.list. When run in parallel, it will run in the one process. So yardstick will deploy stacks with the same name. The solution is do not use Context.list in yardstick core. And using a local variable instead. BTW, if we use API to call yardstick core, we can not config the output way. So I parse yardstick.conf when task start. And I think we can include scenario_cfg, context_cfg, yardstick_cfg in one config object later so that we can get all config in one object. Change-Id: I1ada4ef486bd252e78c3a2e49c6a39b3f8f16a7c Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-02-28move external_network auto-assign to Heat contextRoss Brattain1-3/+14
if there are no external networks defined then assign the external network to the first network as determined by standard sorting Change-Id: I9d32eca258f8e7de3d44cec4124c0e8c020c0b85 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-02-26heat: replace dict key checking with .get()Ross Brattain1-9/+6
We init all the fields to None, so the default value is None, which is what .get() returns when the key is not present it the dictionary. Replace if key in dict: self.val = dict[key] with self.val = dict.get(key) This also has the added beneifit of re-initializing default values to None. In idiomatic Python we do not check a dictionary twice if we can avoid it. Either use dict.get() with a default value or catch the KeyError and do the correct thing. Change-Id: If8d1caeb7288f888f02622d62e8db9f59f50717a Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>