diff options
22 files changed, 574 insertions, 79 deletions
diff --git a/README.rst b/README.rst index d1e403a27..36d3d2563 100644 --- a/README.rst +++ b/README.rst @@ -86,10 +86,10 @@ Example setup known to work for development and test: Install dependencies: $ sudo apt-get install python-virtualenv python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev -$ sudo easy_install -U setuptools Create a virtual environment: $ virtualenv ~/yardstick_venv $ source ~/yardstick_venv/bin/activate +$ easy_install -U setuptools $ python setup.py develop diff --git a/ci/requirements.txt b/ci/requirements.txt index a92aabd52..4d1a16993 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -10,64 +10,66 @@ appdirs==1.4.0 Babel==2.2.0 backport-ipaddress==0.1 -cliff==1.16.0 +cliff==2.0.0 cmd2==0.6.8 coverage==4.1b2 debtcollector==1.3.0 ecdsa==0.13 extras==0.0.3 fixtures==1.4.0 -flake8==2.5.2 +flake8==2.5.4 funcsigs==0.4 functools32==3.2.3.post2 -futures==3.0.4 +futures==3.0.5 iso8601==0.1.11 Jinja2==2.8 -jsonpatch==1.12 +jsonpatch==1.13 jsonpointer==1.10 jsonschema==2.5.1 -keystoneauth1==2.2.0 +keystoneauth1==2.3.0 linecache2==1.0.0 lxml==3.5.0 MarkupSafe==0.23 mccabe==0.4.0 mock==1.3.0 -monotonic==0.6 +monotonic==1.0 msgpack-python==0.4.7 netaddr==0.7.18 netifaces==0.10.4 nose==1.3.7 -os-client-config==1.14.0 -oslo.config==3.5.0 -oslo.i18n==3.3.0 -oslo.serialization==2.3.0 -oslo.utils==3.5.0 +openstacksdk==0.8.1 +os-client-config==1.16.0 +oslo.config==3.9.0 +oslo.i18n==3.4.0 +oslo.serialization==2.4.0 +oslo.utils==3.7.0 paramiko==1.16.0 pbr==1.8.1 pep8==1.7.0 +positional==1.0.1 prettytable==0.7.2 pycrypto==2.6.1 pyflakes==1.0.0 pyparsing==2.1.0 pyrsistent==0.11.12 -python-cinderclient==1.5.0 -python-glanceclient==1.1.0 -python-heatclient==0.9.0 -python-keystoneclient==2.1.2 +python-cinderclient==1.6.0 +python-glanceclient==2.0.0 +python-heatclient==1.0.0 +python-keystoneclient==2.3.1 python-mimeparse==1.5.1 -python-neutronclient==4.0.0 -python-novaclient==3.2.0 -python-openstackclient==2.0.0 +python-neutronclient==4.1.1 +python-novaclient==3.3.0 +python-openstackclient==2.2.0 python-subunit==1.2.0 -python-swiftclient==2.7.0 +python-swiftclient==3.0.0 pytz==2015.7 PyYAML==3.11 requests==2.9.1 requestsexceptions==1.1.3 scp==0.10.2 -simplejson==3.8.1 +simplejson==3.8.2 six==1.10.0 -stevedore==1.11.0 +stevedore==1.12.0 testrepository==0.0.20 testtools==2.0.0 traceback2==1.4.0 diff --git a/ci/yardstick-verify b/ci/yardstick-verify index 875b01ff2..c7b1cefec 100755 --- a/ci/yardstick-verify +++ b/ci/yardstick-verify @@ -341,7 +341,7 @@ main() echo echo "Checking for External network:" - for net in $(neutron net-list --router:external -c name -f value); do + for net in $(neutron net-list --router:external True -c name -f value); do echo " external network: $net" done @@ -28,7 +28,7 @@ setup( "lxml", "PyYAML>=3.10", "pbr<2.0,>=1.3", - "python-openstackclient<=2.0.0", + "python-openstackclient>=2.1.0", "python-glanceclient>=0.12.0", "python-heatclient>=0.2.12", "python-keystoneclient>=0.11.1", diff --git a/yardstick/vTC/apexlake/apexlake.conf b/yardstick/vTC/apexlake/apexlake.conf index 9ebbc5d56..558bd63f3 100644 --- a/yardstick/vTC/apexlake/apexlake.conf +++ b/yardstick/vTC/apexlake/apexlake.conf @@ -1,3 +1,13 @@ +[General] +debug = true + + +[OpenStack] +#release = juno +#release = kilo +release = liberty + + [PacketGen] packet_generator = dpdk_pktgen pktgen_directory = /root/programs/Pktgen-DPDK/dpdk/examples/pktgen/ @@ -11,38 +21,7 @@ name_if_1 = p2p1 name_if_2 = p2p2 -[General] -## template_base is the name of the base template from which generate all the others -#template_base_name = vTC.yaml -## Benchmarks to be executed on the VNF under test (uncomment one of the following) -#benchmarks = instantiation_validation_benchmark.InstantiationValidationBenchmark -#benchmarks = instantiation_validation_noisy_neighbors_benchmark.InstantiationValidationNoisyNeighborsBenchmark -#benchmarks = rfc2544_throughput_benchmark.RFC2544ThroughputBenchmark -#benchmarks = multi_tenancy_throughput_benchmark.MultiTenancyThroughputBenchmark -## Number of iterations -#iterations = 1 -#debug = true - - -[OpenStack] -## ip_controller is the IP address of the OpenStack Controller -#ip_controller = 10.2.1.1 -## Heat URL is the URL for the Heat endpoint -#heat_url = http://IP_ADDRESS_CONTROLLER:8004/v1/TENANT_ID -## user is the OpenStack user name -#user = admin -## password is the OpenStack password -#password = password -## auth_uri is the authentication URI provided by keystone -#auth_uri = http://IP_ADDRESS_CONTROLLER:5000/v2.0 -## project is the name of the project on which create the VNF instances -#project = demo - - [Experiment-VNF] -## List of all the variables and the values that will be tested by the framework -#VNIC_TYPE = @string "direct", "normal" -#VTC_FLAVOR = @string "m1.small" "m1.medium" "m1.large" [InfluxDB] @@ -52,18 +31,7 @@ influxdb_db_name = database [Deployment-parameters] -#default_net = monitoring -#default_subnet = monitoring_subnet -#source_net = inbound_traffic_network -#source_subnet = inbound_traffic_subnet -#destination_net = destination_B_network -#destination_subnet = destination_B_subnet -#destination_subnet = destination_B_subnet -#key_name = destination_B_subnet [Testcase-parameters] -#packet_size = 1280 -#throughput = 1 -#vlan_sender = 1000 -#vlan_receiver = 1001
\ No newline at end of file + diff --git a/yardstick/vTC/apexlake/experimental_framework/api.py b/yardstick/vTC/apexlake/experimental_framework/api.py index 1851f1b09..e0209befd 100644 --- a/yardstick/vTC/apexlake/experimental_framework/api.py +++ b/yardstick/vTC/apexlake/experimental_framework/api.py @@ -118,6 +118,10 @@ class FrameworkApi(object): credentials = openstack_credentials msg = 'The provided heat_template does not exist' + if common.RELEASE == 'liberty': + heat_template = 'vTC_liberty.yaml' + else: + heat_template = 'vTC.yaml' template = "{}{}".format(common.get_template_dir(), heat_template) common.InputValidation.validate_file_exist(template, msg) diff --git a/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_benchmark.py b/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_benchmark.py index c85aff5a9..320becae5 100644 --- a/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_benchmark.py +++ b/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_benchmark.py @@ -179,7 +179,12 @@ class InstantiationValidationBenchmark(base.BenchmarkBaseClass): self.params[VLAN_RECEIVER] # An IP address is required for the interface to receive a multicast # flow. The specific address is not important - command += ' 10.254.254.254 up' + command += ' 10.254.254.254 up netmask 255.255.255.248' + common.run_command(command) + + command = "sudo ifconfig " + command += self.interface_name + "." + self.params[VLAN_RECEIVER] + command += " promisc" common.run_command(command) # configure smcroute @@ -193,6 +198,7 @@ class InstantiationValidationBenchmark(base.BenchmarkBaseClass): # run smcroute on the interface command = 'sudo smcroute -d' common.run_command(command) + time.sleep(3) # Start the packet checker current_dir = os.path.dirname(os.path.realpath(__file__)) diff --git a/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py b/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py index cbb4121bb..1eab70c67 100644 --- a/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py +++ b/yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py @@ -29,8 +29,14 @@ class InstantiationValidationNoisyNeighborsBenchmark( def __init__(self, name, params): base.InstantiationValidationBenchmark.__init__(self, name, params) + + if common.RELEASE == 'liberty': + temp_name = 'stress_workload_liberty.yaml' + else: + temp_name = 'stress_workload.yaml' + self.template_file = common.get_template_dir() + \ - 'stress_workload.yaml' + temp_name self.stack_name = 'neighbour' self.neighbor_stack_names = list() diff --git a/yardstick/vTC/apexlake/experimental_framework/benchmarks/multi_tenancy_throughput_benchmark.py b/yardstick/vTC/apexlake/experimental_framework/benchmarks/multi_tenancy_throughput_benchmark.py index ee02bcc93..f2a87b2b2 100644 --- a/yardstick/vTC/apexlake/experimental_framework/benchmarks/multi_tenancy_throughput_benchmark.py +++ b/yardstick/vTC/apexlake/experimental_framework/benchmarks/multi_tenancy_throughput_benchmark.py @@ -26,8 +26,14 @@ class MultiTenancyThroughputBenchmark(base.RFC2544ThroughputBenchmark): def __init__(self, name, params): base.RFC2544ThroughputBenchmark.__init__(self, name, params) + + if common.RELEASE == 'liberty': + temp_name = 'stress_workload_liberty.yaml' + else: + temp_name = 'stress_workload.yaml' + self.template_file = "{}{}".format(common.get_template_dir(), - 'stress_workload.yaml') + temp_name) self.stack_name = 'neighbour' self.neighbor_stack_names = list() diff --git a/yardstick/vTC/apexlake/experimental_framework/common.py b/yardstick/vTC/apexlake/experimental_framework/common.py index e86cc832c..4bacd38a6 100644 --- a/yardstick/vTC/apexlake/experimental_framework/common.py +++ b/yardstick/vTC/apexlake/experimental_framework/common.py @@ -25,10 +25,13 @@ from experimental_framework.constants import framework_parameters as fp # List of common variables # ------------------------------------------------------ +allowed_releases = ['liberty', 'kilo', 'juno'] + LOG = None CONF_FILE = None DEPLOYMENT_UNIT = None ITERATIONS = None +RELEASE = None BASE_DIR = None RESULT_DIR = None @@ -87,6 +90,7 @@ def init_general_vars(api=False): global TEMPLATE_DIR global RESULT_DIR global ITERATIONS + global RELEASE TEMPLATE_FILE_EXTENSION = '.yaml' @@ -97,6 +101,12 @@ def init_general_vars(api=False): "Section " + cf.CFS_GENERAL + "is not present in configuration file") + InputValidation.\ + validate_configuration_file_section( + cf.CFS_OPENSTACK, + "Section " + cf.CFS_OPENSTACK + + "is not present in configuration file") + TEMPLATE_DIR = '/tmp/apexlake/heat_templates/' # if not os.path.exists(TEMPLATE_DIR): # os.makedirs(TEMPLATE_DIR) @@ -121,6 +131,11 @@ def init_general_vars(api=False): if not os.path.isdir(RESULT_DIR): os.mkdir(RESULT_DIR) + if cf.CFSO_RELEASE in CONF_FILE.get_variable_list(cf.CFS_OPENSTACK): + RELEASE = CONF_FILE.get_variable(cf.CFS_OPENSTACK, cf.CFSO_RELEASE) + if RELEASE not in allowed_releases: + raise ValueError("Release {} is not supported".format(RELEASE)) + # Validate and assign Iterations if cf.CFSG_ITERATIONS in CONF_FILE.get_variable_list(cf.CFS_GENERAL): ITERATIONS = int(CONF_FILE.get_variable(cf.CFS_GENERAL, @@ -132,7 +147,11 @@ def init_general_vars(api=False): def init_log(): global LOG LOG = logging.getLogger() - LOG.setLevel(level=logging.INFO) + debug = CONF_FILE.get_variable(cf.CFS_GENERAL, cf.CFSG_DEBUG) + if debug == 'true' or debug == 'True': + LOG.setLevel(level=logging.DEBUG) + else: + LOG.setLevel(level=logging.INFO) log_formatter = logging.Formatter("%(asctime)s --- %(message)s") file_handler = logging.FileHandler("{0}/{1}.log".format("./", "benchmark")) file_handler.setFormatter(log_formatter) diff --git a/yardstick/vTC/apexlake/experimental_framework/constants/conf_file_sections.py b/yardstick/vTC/apexlake/experimental_framework/constants/conf_file_sections.py index f397984e9..ce46d800a 100644 --- a/yardstick/vTC/apexlake/experimental_framework/constants/conf_file_sections.py +++ b/yardstick/vTC/apexlake/experimental_framework/constants/conf_file_sections.py @@ -44,7 +44,8 @@ def get_sections_api(): return [ CFS_PKTGEN, CFS_GENERAL, - CFS_INFLUXDB + CFS_INFLUXDB, + CFS_OPENSTACK # Add here eventually new sections in configuration file ... ] @@ -98,3 +99,4 @@ CFSO_USER = 'user' CFSO_PASSWORD = 'password' CFSO_AUTH_URI = 'auth_uri' CFSO_PROJECT = 'project' +CFSO_RELEASE = 'release' diff --git a/yardstick/vTC/apexlake/experimental_framework/deployment_unit.py b/yardstick/vTC/apexlake/experimental_framework/deployment_unit.py index 596ee7a96..22fec1392 100644 --- a/yardstick/vTC/apexlake/experimental_framework/deployment_unit.py +++ b/yardstick/vTC/apexlake/experimental_framework/deployment_unit.py @@ -50,7 +50,8 @@ class DeploymentUnit: time.sleep(5) status = self.heat_manager.check_stack_status(stack_name) return True - except: + except Exception as e: + common.LOG.debug(e.message) return False def destroy_all_deployed_stacks(self): @@ -80,14 +81,16 @@ class DeploymentUnit: self.heat_manager.create_stack(template_file, stack_name, parameters) deployed = True - except: + except Exception as e: + common.LOG.debug(e.message) deployed = False if not deployed and 'COMPLETE' in \ self.heat_manager.check_stack_status(stack_name): try: self.destroy_heat_template(stack_name) - except: + except Exception as e: + common.LOG.debug(e.message) pass status = self.heat_manager.check_stack_status(stack_name) diff --git a/yardstick/vTC/apexlake/experimental_framework/heat_manager.py b/yardstick/vTC/apexlake/experimental_framework/heat_manager.py index ab3df5c38..7400ebd21 100644 --- a/yardstick/vTC/apexlake/experimental_framework/heat_manager.py +++ b/yardstick/vTC/apexlake/experimental_framework/heat_manager.py @@ -97,6 +97,7 @@ class HeatManager: if stack.stack_name == stack_name: self.heat.stacks.delete(stack.id) return True - except: + except Exception as e: + common.LOG.debug(e.message) pass return False diff --git a/yardstick/vTC/apexlake/heat_templates/stress_workload_liberty.yaml b/yardstick/vTC/apexlake/heat_templates/stress_workload_liberty.yaml new file mode 100644 index 000000000..bac57014b --- /dev/null +++ b/yardstick/vTC/apexlake/heat_templates/stress_workload_liberty.yaml @@ -0,0 +1,71 @@ +heat_template_version: 2014-10-16 +description: HOT template to create a DPI + +parameters: + name: + type: string + default: cpu_stress + cores: + type: string + memory: + type: string + network: + type: string + subnet: + type: string + +resources: + port: + type: OS::Neutron::Port + properties: + network: { get_param: network } + port_security_enabled: false + fixed_ips: + - subnet: { get_param: subnet } + + vm1: + type: OS::Nova::Server + properties: + name: traffic_vm1 + image: ubuntu1404 + user_data: + str_replace: + template: | + #!/bin/sh + echo "Creating custom user..." + useradd clouduser -g admin -s /bin/bash -m + echo clouduser:secrete | chpasswd + echo "Enabling ssh password login..." + sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config + service ssh restart + sleep 1 + + ifconfig eth1 up + dhclient eth1 + + sed -i 's/localhost/localhost traffic_vm1/g' /etc/hosts + touch /etc/resolvconf/resolv.conf.d/tail + echo 'nameserver 10.118.32.193' > /etc/resolvconf/resolv.conf.d/tail + resolvconf -u + echo 'nameserver 10.118.32.193' > /etc/resolv.conf + + + # Installation of stress + apt-get install -y stress + + cd /home/clouduser + + # workload setup + echo 'stress -c $CORES --vm-bytes $MEMORY' > ./stress.sh + chmod +x ./stress.sh + nohup ./stress.sh & + #nohup stress -c #CORES --vm-bytes #MEMORY + + params: + $NAME: { get_param: name } + $CORES: { get_param: cores } + $MEMORY: { get_param: memory } + + flavor: m1.small + networks: + - port: { get_resource: port } diff --git a/yardstick/vTC/apexlake/heat_templates/vTC.yaml b/yardstick/vTC/apexlake/heat_templates/vTC.yaml index 3bc4dcdfb..3493328fe 100644 --- a/yardstick/vTC/apexlake/heat_templates/vTC.yaml +++ b/yardstick/vTC/apexlake/heat_templates/vTC.yaml @@ -81,7 +81,18 @@ resources: ifconfig eth2 up dhclient eth1 dhclient eth2 + + # Fix Network Confiuration sed -i 's/localhost/localhost vtc/g' /etc/hosts + touch /etc/resolvconf/resolv.conf.d/tail + #echo 'nameserver 192.168.10.1' > /etc/resolvconf/resolv.conf.d/tail + #echo 'nameserver 10.20.0.2' > /etc/resolvconf/resolv.conf.d/tail + echo 'nameserver 10.118.32.193' > /etc/resolvconf/resolv.conf.d/tail + resolvconf -u + + + echo 'nameserver 10.118.32.193' > /etc/resolv.conf + # Install vTC Dependencies apt-get update diff --git a/yardstick/vTC/apexlake/heat_templates/vTC_liberty.yaml b/yardstick/vTC/apexlake/heat_templates/vTC_liberty.yaml new file mode 100644 index 000000000..9ae0c265b --- /dev/null +++ b/yardstick/vTC/apexlake/heat_templates/vTC_liberty.yaml @@ -0,0 +1,183 @@ +heat_template_version: 2014-10-16 +description: HOT template to deploy a virtual Traffic Classifier + +parameters: + default_net: + type: string + default_subnet: + type: string + source_net: + type: string + source_subnet: + type: string + destination_net: + type: string + destination_subnet: + type: string + timeout: + type: number + description: Timeout for WaitCondition, depends on your image and environment + default: 2000 + +resources: + wait_condition: + type: OS::Heat::WaitCondition + properties: + handle: {get_resource: wait_handle} + count: 1 + timeout: {get_param: timeout} + + wait_handle: + type: OS::Heat::WaitConditionHandle + + ### DEFAULT NETWORK FOR MNGM + port_1: + type: OS::Neutron::Port + properties: + network: { get_param: default_net } + binding:vnic_type: normal + port_security_enabled: true + fixed_ips: + - subnet: { get_param: default_subnet } + + ### NETWORK FOR RECEIVING TRAFFIC + port_2: + type: OS::Neutron::Port + properties: + network: { get_param: source_net } + binding:vnic_type: #vnic_type + port_security_enabled: false + fixed_ips: + - subnet: { get_param: source_subnet } + + ### NETWORK FOR SENDING TRAFFIC + port_3: + type: OS::Neutron::Port + properties: + network: { get_param: destination_net } + binding:vnic_type: #vnic_type + port_security_enabled: false + fixed_ips: + - subnet: { get_param: destination_subnet } + + server: + type: OS::Nova::Server + properties: + name: vTC + #key_name: { get_param: key_name } + image: ubuntu1404 + user_data: + str_replace: + template: | + #!/bin/sh + # Creation of a user + echo "Creating custom user..." + useradd clouduser -g admin -s /bin/bash -m + echo clouduser:yardstick | chpasswd + echo "Enabling ssh password login..." + sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config + service ssh restart + sleep 1 + + # wake up interfaces + ifconfig eth1 up + ifconfig eth2 up + dhclient eth1 + dhclient eth2 + ifconfig 10.254.254.253 up netmask 255.255.255.248 + + # Fix Network Confiuration + sed -i 's/localhost/localhost vtc/g' /etc/hosts + touch /etc/resolvconf/resolv.conf.d/tail + #echo 'nameserver 192.168.10.1' > /etc/resolvconf/resolv.conf.d/tail + #echo 'nameserver 10.20.0.2' > /etc/resolvconf/resolv.conf.d/tail + echo 'nameserver 10.118.32.193' > /etc/resolvconf/resolv.conf.d/tail + resolvconf -u + + + echo 'nameserver 10.118.32.193' > /etc/resolv.conf + + + # Install vTC Dependencies + apt-get update + apt-get install -y git build-essential gcc libnuma-dev bison flex byacc libjson0-dev libcurl4-gnutls-dev jq dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config + apt-get install -y byacc libtool libcurl4-openssl-dev + + cd /home/clouduser + + # Setup multicast + echo mgroup from eth1 group 224.192.16.1 > /etc/smcroute.conf + git clone https://github.com/troglobit/smcroute.git + cd smcroute + git reset --hard c3f5c56 + sed -i 's/aclocal-1.11/aclocal/g' ./autogen.sh + sed -i 's/automake-1.11/automake/g' ./autogen.sh + ./autogen.sh + ./configure + make + make install + cd .. + touch multicast.sh + echo "#!/bin/bash" > multicast.sh + echo "while [ true ]" >> multicast.sh + echo "do" >> multicast.sh + echo " smcroute -k" >> multicast.sh + echo " smcroute -d" >> multicast.sh + echo " sleep 50" >> multicast.sh + echo "done" >> multicast.sh + chmod +x multicast.sh + ./multicast.sh & + + rm resp.json + curl -X POST -u "mPkgwvJPsTFS8hYmHk:SDczcrK4cvnkMRWSEchB3ANcWbqFXqPx" https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token=38uFQuhEdPvCTbhc7k >> resp.json + access_token=`jq -r '.access_token' resp.json` + git clone https://x-token-auth:${access_token}@bitbucket.org/akiskourtis/vtc.git + cd vtc + git checkout -b stable + #Build nDPI library + cd nDPI + NDPI_DIR=$(pwd) + echo $NDPI_DIR + NDPI_INCLUDE=$(pwd)/src/include + echo $NDPI_INCLUDE + ./autogen.sh + ./configure + make + make install + + #Build PF_RING library + cd .. + cd PF_RING + make + #Build PF_RING examples, including the modified pfbridge, with nDPI integrated. + cd userland/examples/ + sed -i 's#EXTRA_LIBS =#EXTRA_LIBS='"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c#' ./Makefile + sed -i 's# -Ithird-party# -Ithird-party/ -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'#' ./Makefile + echo $NDPI_DIR + make + cd ../.. + cd .. + cd .. + + # To use PF_RING driver use the following + #sudo rmmod pf_ring + #insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=16384 enable_debug=1 quick_mode=1 enable_tx_capture=0 + #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 & + sleep 5 + + # To use the Linux kernel driver use the following + cd /home/clouduser/ + sudo nohup ./vtc/nDPI/example/ndpiReader -i eth1 -a eth2 & + sleep 5 + + curl --data-ascii "{\"classification_rules\":[{\"RuleId\":\"1\",\"ToS\":\"16\"}]}" http://localhost:9999/classifier/classification_rules/224.192.16.1 & + wc_notify --data-binary '{"status": "SUCCESS"}' + params: + wc_notify: { get_attr: ['wait_handle', 'curl_cli'] } + #$IP_FAMILY: { get_param: ip_family } + flavor: #vtc_flavor + networks: + - port: { get_resource: port_1 } + - port: { get_resource: port_2 } + - port: { get_resource: port_3 } +outputs: diff --git a/yardstick/vTC/apexlake/setup.py b/yardstick/vTC/apexlake/setup.py index aac363ea4..188a7f0c3 100644 --- a/yardstick/vTC/apexlake/setup.py +++ b/yardstick/vTC/apexlake/setup.py @@ -46,5 +46,9 @@ setup(name='apexlake', ('/tmp/apexlake/heat_templates/', ['heat_templates/vTC.yaml']), ('/tmp/apexlake/heat_templates/', - ['heat_templates/stress_workload.yaml']) + ['heat_templates/stress_workload.yaml']), + ('/tmp/apexlake/heat_templates/', + ['heat_templates/vTC_liberty.yaml']), + ('/tmp/apexlake/heat_templates/', + ['heat_templates/stress_workload_liberty.yaml']) ]) diff --git a/yardstick/vTC/apexlake/tests/conf_file_sections_test.py b/yardstick/vTC/apexlake/tests/conf_file_sections_test.py index 3266ce6b7..2b03edb04 100644 --- a/yardstick/vTC/apexlake/tests/conf_file_sections_test.py +++ b/yardstick/vTC/apexlake/tests/conf_file_sections_test.py @@ -24,6 +24,6 @@ class TestConfFileSection(unittest.TestCase): pass def test_get_sections_api_for_success(self): - expected = ['PacketGen', 'General', 'InfluxDB'] + expected = ['PacketGen', 'General', 'InfluxDB', 'OpenStack'] output = cfs.get_sections_api() self.assertEqual(expected, output) diff --git a/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml b/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml new file mode 100644 index 000000000..aa3959fc1 --- /dev/null +++ b/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2014-10-16 +description: HOT template to create a DPI + +parameters: + default_net: + type: string + default_subnet: + type: string + source_net: + type: string + source_subnet: + type: string + destination_net: + type: string + destination_subnet: + type: string + internal_net: + type: string + internal_subnet: + type: string + node: + type: string + default: compB + name: + type: string + default: vtc + ip_family: + type: string + timeout: + type: number + description: Timeout for WaitCondition, depends on your image and environment + default: 1000 + +resources: + wait_condition: + type: OS::Heat::WaitCondition + properties: + handle: {get_resource: wait_handle} + count: 1 + timeout: {get_param: timeout} + + wait_handle: + type: OS::Heat::WaitConditionHandle + + + ### DEFAULT NETWORK FOR MERLIN DATA + port_1: + type: OS::Neutron::Port + properties: + network: { get_param: default_net } + binding:vnic_type: normal + fixed_ips: + - subnet: { get_param: default_subnet } + + ### NETWORK FOR RECEIVING TRAFFIC + port_2: + type: OS::Neutron::Port + properties: + network: { get_param: source_net } + binding:vnic_type: #vnic_type + fixed_ips: + - subnet: { get_param: source_subnet } + + ### NETWORK FOR SENDING TRAFFIC + port_3: + type: OS::Neutron::Port + properties: + network: { get_param: destination_net } + binding:vnic_type: #vnic_type + fixed_ips: + - subnet: { get_param: destination_subnet } + + flavor: + type: OS::Nova::Flavor + properties: + disk: 20 + ram: #ram + vcpus: #vcpus + #extra_specs: { node: { get_param: node }, "hw:cpu_policy": "#core_pinning_enabled", "hw:cpu_threads_policy": "#core_pinning_mode", "hw:mem_page_size": "#hugepages" } + extra_specs: { node: { get_param: node } } + + server: + type: OS::Nova::Server + properties: + name: vTC + key_name: test + image: ubuntu1404 + user_data: + str_replace: + template: | + #!/bin/sh + + # Creation of a user + NAME=$name + echo "Creating custom user..." + useradd clouduser -g admin -s /bin/bash -m + echo clouduser:secrete | chpasswd + echo "Enabling ssh password login..." + sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config + service ssh restart + sleep 1 + + # wake up interfaces + ifconfig eth1 up + ifconfig eth2 up + dhclient eth1 + dhclient eth2 + + sed -i 's/localhost/localhost vtc/g' /etc/hosts + ip route del 0/0 + route add default gw 192.168.200.1 + + AA=$(netstat -ie | grep -B1 $IP_FAMILY | awk '{ print $1 }') + BB=$(echo $AA | awk '{ print $1 }') + + # Setup Instrumentation Agent + rm -rf cimmaron + mkdir cimmaron + cd cimmaron + apt-get install -y zip + wget http://10.2.1.65/~iolie/merlin/MerlinAgent-12-06-2015-TNovaVM-001.zip + unzip MerlinAgent-12-06-2015-TNovaVM-001.zip + ./updateConfiguration.py ./instrumentation.cfg tags source=tnova_vm + ./updateConfiguration.py ./instrumentation.cfg tags role="$NAME" + nohup ./Agent.py ./instrumentation.cfg >log.out 2>&1 & + cd .. + + # Setup for PF_RING and bridge between interfaces + apt-get update + apt-get install -y git build-essential gcc libnuma-dev flex byacc libjson0-dev dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config + + # Setup multicast + echo smcroute -d mgroup from $BB group 224.192.16.1 > /etc/smcroute.conf + cd /home/clouduser/ + git clone https://github.com/troglobit/smcroute.git + cd smcroute + sed -i 's/aclocal-1.11/aclocal/g' ./autogen.sh + sed -i 's/automake-1.11/automake/g' ./autogen.sh + ./autogen.sh + ./configure + make + make install + cd .. + touch multicast.sh + echo "#!/bin/bash" > multicast.sh + echo "while [ true ]" >> multicast.sh + echo "do" >> multicast.sh + echo " smcroute -k" >> multicast.sh + echo " smcroute -d" >> multicast.sh + echo " sleep 50" >> multicast.sh + echo "done" >> multicast.sh + chmod +x multicast.sh + ./multicast.sh & + + # Setup for PF_RING and bridge between interfaces + # Akis Repository + #git clone https://akiskourtis:ptindpi@bitbucket.org/akiskourtis/vtc.git + #cd vtc + #git checkout stable + + # Intel Repository + git clone http://vincenzox.m.riccobene%40intel.com:vincenzo@134.191.243.6:8081/t-nova/vtc_master.git + cd vtc_master + + cd nDPI + NDPI_DIR=$(pwd) + echo $NDPI_DIR + NDPI_INCLUDE=$(pwd)/src/include + echo $NDPI_INCLUDE + ./autogen.sh + ./configure + make + make install + cd .. + cd PF_RING + make + cd userland/examples/ + sed -i 's/EXTRA_LIBS =/EXTRA_LIBS = '"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c/g' ./Makefile + sed -i 's/ -Ithird-party/ -Ithird-party -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'/g' ./Makefile + make + cd ../.. + cd .. + cd .. + #insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0 + #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 & + insmod ./vtc_master/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0 + ./vtc_master/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 & + wc_notify --data-binary '{"status": "SUCCESS"}' + params: + wc_notify: { get_attr: ['wait_handle', 'curl_cli'] } + $name: { get_param: name } + $IP_FAMILY: { get_param: ip_family } + + flavor: { get_resource: flavor } + networks: + - port: { get_resource: port_1 } + - port: { get_resource: port_2 } + - port: { get_resource: port_3 } +outputs:
\ No newline at end of file diff --git a/yardstick/vTC/apexlake/tests/deployment_unit_test.py b/yardstick/vTC/apexlake/tests/deployment_unit_test.py index 81171670c..cec834e56 100644 --- a/yardstick/vTC/apexlake/tests/deployment_unit_test.py +++ b/yardstick/vTC/apexlake/tests/deployment_unit_test.py @@ -13,8 +13,10 @@ # limitations under the License. import unittest +import logging import mock import experimental_framework.deployment_unit as mut +import experimental_framework.common as common __author__ = 'vmriccox' @@ -166,6 +168,7 @@ class TestDeploymentUnit(unittest.TestCase): template_file = '' stack_name = '' parameters = '' + common.LOG = logging.getLogger() output = du.deploy_heat_template(template_file, stack_name, parameters, 0) self.assertEqual(output, True) @@ -180,6 +183,7 @@ class TestDeploymentUnit(unittest.TestCase): template_file = '' stack_name = '' parameters = '' + common.LOG = logging.getLogger() output = du.deploy_heat_template(template_file, stack_name, parameters, 0) self.assertEqual(output, True) @@ -197,6 +201,7 @@ class TestDeploymentUnit(unittest.TestCase): template_file = '' stack_name = '' parameters = '' + common.LOG = logging.getLogger() output = du.deploy_heat_template(template_file, stack_name, parameters, 0) self.assertEqual(output, True) diff --git a/yardstick/vTC/apexlake/tests/heat_manager_test.py b/yardstick/vTC/apexlake/tests/heat_manager_test.py index f1d3d0028..0fe8554cd 100644 --- a/yardstick/vTC/apexlake/tests/heat_manager_test.py +++ b/yardstick/vTC/apexlake/tests/heat_manager_test.py @@ -13,6 +13,9 @@ # limitations under the License. import unittest +import logging +import experimental_framework.common as common + from experimental_framework import heat_manager import mock @@ -172,6 +175,7 @@ class TestHeatManager_2(unittest.TestCase): pass def test_delete_stack_for_success_2(self): + common.LOG = logging.getLogger() self.assertFalse(self.heat_manager.delete_stack('stack_1')) diff --git a/yardstick/vTC/apexlake/tests/instantiation_validation_bench_test.py b/yardstick/vTC/apexlake/tests/instantiation_validation_bench_test.py index 9d517bcf7..369129a00 100644 --- a/yardstick/vTC/apexlake/tests/instantiation_validation_bench_test.py +++ b/yardstick/vTC/apexlake/tests/instantiation_validation_bench_test.py @@ -65,7 +65,8 @@ def dummy_run_command_2(command, get_counters=None): '100 type vlan id 100': command_counter[0] += 1 return - elif command == 'sudo ifconfig interface.100 10.254.254.254 up': + elif command == 'sudo ifconfig interface.100 10.254.254.254 up' \ + ' netmask 255.255.255.248': command_counter[1] += 1 return elif command == "sudo echo 'mgroup from interface.100 group" \ |