From 95bf8a8c96b2be94512e042f3f3c82edcbebf84d Mon Sep 17 00:00:00 2001 From: Mofassir Arif Date: Thu, 22 Oct 2015 12:39:37 -0700 Subject: [PATCH] Python Framework for QTIP Dhrystone Whetstone and DPI benchmarks have been implemented CLI arguments have been implemented test case are sorted based on category such as compute,network and storage glance and heat client have been used to generate the stack. automatic upload of QTIP image and delete function for existing stack before creating new stack has been implemented system information collecton and result generation has been implemented JIRA: QTIP-17 Signed-off-by: Mofassir Arif Change-Id: I4b7b134017723c30c771cc14d2edce33fcb8ba00 --- .create_zones.py.swp | Bin 0 -> 12288 bytes FUELCRED | 32 +++ QTIP.sh | 137 ----------- README | 36 ++- Test-cases/Bare_vs_Bare/Config.yaml | 4 - Test-cases/Bare_vs_VM/Config.yaml | 2 - benchmarks/foo | 0 benchmarks/playbooks/cachebench.yaml | 38 --- benchmarks/playbooks/dhrystone.yaml | 31 --- benchmarks/playbooks/ramspeedbench.yaml | 38 --- benchmarks/playbooks/whetstone.yaml | 31 --- clean.sh | 4 +- data/ssh_exch.exp | 7 +- docs/sample_config.yaml | 47 ++++ fetch_os_creds.sh | 171 ++++++++++++++ foremancred | 5 + func/__init__.py | 0 func/__init__.pyc | Bin 0 -> 145 bytes func/cli.py | 60 +++++ func/cli.pyc | Bin 0 -> 2097 bytes func/create_zones.py | 117 +++++++++ func/create_zones.pyc | Bin 0 -> 3912 bytes func/driver.py | 29 +++ func/driver.pyc | Bin 0 -> 1068 bytes func/env_setup.py | 160 +++++++++++++ func/env_setup.pyc | Bin 0 -> 5113 bytes func/fetchimg.py | 30 +++ func/fetchimg.pyc | Bin 0 -> 1073 bytes func/spawn_vm.py | 263 +++++++++++++++++++++ func/spawn_vm.pyc | Bin 0 -> 8366 bytes func/validate_yaml.py | 32 +++ func/validate_yaml.pyc | Bin 0 -> 777 bytes heat/HeatTemplate.yaml | 120 ++++++++++ heat/SampleHeat.yaml | 42 ++++ heat/TEST.yaml | 133 +++++++++++ heat/WorkingTemplate.yaml | 70 ++++++ .../Bare_vs_VM/SampleHeat.yaml => heat/heat.yaml | 24 +- qtip.py | 18 ++ test_cases/.TESTER.yaml.swo | Bin 0 -> 12288 bytes test_cases/.TESTER.yaml.swp | Bin 0 -> 12288 bytes {Test-cases => test_cases}/SampleHeat.yaml | 14 +- test_cases/TESTER.yaml | 36 +++ test_cases/compute/.whetstone_serial.yaml.swp | Bin 0 -> 12288 bytes test_cases/compute/dhrystone_parallel.yaml | 45 ++++ test_cases/compute/dhrystone_serial.yaml | 35 +++ test_cases/compute/dpi_parallel.yaml | 36 +++ test_cases/compute/dpi_serial.yaml | 38 +++ test_cases/compute/ssl_parallel.yaml | 37 +++ test_cases/compute/ssl_serial.yaml | 34 +++ test_cases/compute/whetstone_parallel.yaml | 45 ++++ test_cases/compute/whetstone_serial.yaml | 35 +++ test_cases/network/iperf.yaml | 17 ++ 52 files changed, 1742 insertions(+), 311 deletions(-) create mode 100644 .create_zones.py.swp create mode 100644 FUELCRED delete mode 100755 QTIP.sh delete mode 100644 Test-cases/Bare_vs_Bare/Config.yaml delete mode 100644 Test-cases/Bare_vs_VM/Config.yaml create mode 100644 benchmarks/foo delete mode 100644 benchmarks/playbooks/cachebench.yaml delete mode 100644 benchmarks/playbooks/dhrystone.yaml delete mode 100644 benchmarks/playbooks/ramspeedbench.yaml delete mode 100644 benchmarks/playbooks/whetstone.yaml create mode 100644 docs/sample_config.yaml create mode 100755 fetch_os_creds.sh create mode 100644 foremancred create mode 100644 func/__init__.py create mode 100644 func/__init__.pyc create mode 100644 func/cli.py create mode 100644 func/cli.pyc create mode 100644 func/create_zones.py create mode 100644 func/create_zones.pyc create mode 100644 func/driver.py create mode 100644 func/driver.pyc create mode 100644 func/env_setup.py create mode 100644 func/env_setup.pyc create mode 100644 func/fetchimg.py create mode 100644 func/fetchimg.pyc create mode 100644 func/spawn_vm.py create mode 100644 func/spawn_vm.pyc create mode 100644 func/validate_yaml.py create mode 100644 func/validate_yaml.pyc create mode 100644 heat/HeatTemplate.yaml create mode 100644 heat/SampleHeat.yaml create mode 100644 heat/TEST.yaml create mode 100644 heat/WorkingTemplate.yaml rename Test-cases/Bare_vs_VM/SampleHeat.yaml => heat/heat.yaml (87%) create mode 100644 qtip.py create mode 100644 test_cases/.TESTER.yaml.swo create mode 100644 test_cases/.TESTER.yaml.swp rename {Test-cases => test_cases}/SampleHeat.yaml (90%) create mode 100644 test_cases/TESTER.yaml create mode 100644 test_cases/compute/.whetstone_serial.yaml.swp create mode 100644 test_cases/compute/dhrystone_parallel.yaml create mode 100644 test_cases/compute/dhrystone_serial.yaml create mode 100644 test_cases/compute/dpi_parallel.yaml create mode 100644 test_cases/compute/dpi_serial.yaml create mode 100644 test_cases/compute/ssl_parallel.yaml create mode 100644 test_cases/compute/ssl_serial.yaml create mode 100644 test_cases/compute/whetstone_parallel.yaml create mode 100644 test_cases/compute/whetstone_serial.yaml create mode 100644 test_cases/network/iperf.yaml diff --git a/.create_zones.py.swp b/.create_zones.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..0467b7b2db3e4a27f0813ccb51277f1bffc98795 GIT binary patch literal 12288 zcmeI2O^X~w7{@DtBqq91^lG5o6=oK8dv>E32#jPFF?bLX$ZmwV487AeJ?+kPce-lE zSv`0)A3+dbE?ztdA_N1T^r(n>@iTbymXrUd`h8}yP9g{kPr+|%ySnOm`S;UR3)=@< zdvCohuQ;y?wCCtY+P>%rkwlTnuaE2dQKCj}xcT0A6gyEI_9sp+8qKe04Wf~1*$J(i zCWzlqlh!EeyIKcH_bvvs9<-=$^%CV8)%_p}m3HEzc~d;X3a|o?t-#9eE0?#oXxZB8 zOY(*1cOTmVFJJ{&0akz&UnL25y6g7lil*d=B=&Mex&kA-)5L;1;+JR=|U&gwWss+yLjm z59fqu?!iz=6Up=wHQDj~MEUqwOWIR-^RXnSn( z*(^jpYchRU&DqH9^<+q&86uN<@HHi8wW}Md=x36nddB~;oI3wwId$p+P)XH9AnlhZ zr%pwVqAZsyr_K|U)9j;O@YbYt0V&JsS&(ZsYpLq7fmW&q*Xwz%)QjpxO~hj=X)gP+ zl4@m@zWa!Ca1`Uc8wT3k+1_`wN+v;1-D%MM#(oiko!+TW-#TV`VKi65x|swzO0+}H zvYpXW{cIDYO~URCc=CnYM453CTFKL*DejOq6jVA4FSnAhD((jTri~c8iwr^;j#QHZH-kekg#o;Ch1g>4HjKGjHsth;MMM;f~F1`mF>2qY4m$p9r*rQPDw1Ab~&EU z?BYDr28PS5$Z6qkt8n%x-Dte>*t6{~J^0FlA@^5Jy^=BoorY5QqcEuDD~m{LCGmv$ zEt!lxr^|CLJLK|+7Ua^v$L;ahsLKsOu~UImwgMa^02TG|!2kdN literal 0 HcmV?d00001 diff --git a/FUELCRED b/FUELCRED new file mode 100644 index 00000000..d2cebb0c --- /dev/null +++ b/FUELCRED @@ -0,0 +1,32 @@ + +#!/bin/bash + +# To use an Openstack cloud you need to authenticate against keystone, which +# returns a **Token** and **Service Catalog**. The catalog contains the +# endpoint for all services the user/tenant has access to - including nova, +# glance, keystone, swift. +# +# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We +# will use the 1.1 *compute api* +export OS_AUTH_URL=http://172.18.0.69:5000/v2.0 + +# With the addition of Keystone we have standardized on the term **tenant** +# as the entity that owns the resources. +export OS_TENANT_ID=48ea2b0008dd459b8713fe6977836318 +export OS_TENANT_NAME="admin" + +# In addition to the owning entity (tenant), openstack stores the entity +# performing the action as the **user**. +export OS_USERNAME="admin" + +# With Keystone you pass the keystone password. +echo "Please enter your OpenStack Password: " +read -sr OS_PASSWORD_INPUT +export OS_PASSWORD=$OS_PASSWORD_INPUT + +# If your configuration has multiple regions, we set that information here. +# OS_REGION_NAME is optional and only valid in certain environments. +export OS_REGION_NAME="RegionOne" +# Don't leave a blank variable, unset it if it was empty +if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi + diff --git a/QTIP.sh b/QTIP.sh deleted file mode 100755 index 2a313420..00000000 --- a/QTIP.sh +++ /dev/null @@ -1,137 +0,0 @@ -#! /bin/bash - -WDIR=$PWD - - - -function Call_Test { - - case "$1" in - dhrystone) - mkdir $PWD/results/dhrystone - ansible-playbook -s $PWD/benchmarks/playbooks/dhrystone.yaml --extra-vars "Dest_dir=$PWD/results" -v - - ;; - - ramspeed) - mkdir $PWD/results/ramspeed - ansible-playbook -s $PWD/benchmarks/playbooks/ramspeedbench.yaml --extra-vars "Dest_dir=$PWD/results" -v - ;; - - cachebench) - mkdir $PWD/results/cachebench - ansible-playbook -s $PWD/benchmarks/playbooks/cachebench.yaml --extra-vars "Dest_dir=$PWD/results" -v - ;; - - whetstone) - mkdir $PWD/results/whetstone - ansible-playbook -s $PWD/benchmarks/playbooks/whetstone.yaml --extra-vars "Dest_dir=$PWD/results" -v - ;; - - *) - echo "Please pass a correct argument to test. use -h for more details" - ;; - esac - -} - -function Fetch_VM_Image { - - mkdir $PWD/Temp_Image - - file="$PWD/Temp_Image/Cent7Modified.qcow2" - if [ -f "$file" ] - then - echo "Image already downdloaded" - else - echo "Fetching QTIP_VM Image" - cd $PWD/Temp_Image && wget https://www.dropbox.com/s/3uswrydrvhxw3qm/Cent7Modified.qcow2 - echo "Uploading image to glance" - glance image-create --name "QTIP_CentOS" --is-public true --disk-format qcow2 \ - --container-format bare \ - --file $PWD/Temp_Image/Cent7Modified.qcow2 - - - fi - cd $WDIR -} -mkdir $PWD/results -case "$1" in - -h) - printf "To run test.sh, 2 arguments are required\n" - printf "First argument: The Test case to run\nOptions:\nFirst: For a comparison between a baremetal machine and a VM\nSecond: For a comparison between two baremetal machines\n\nSecond argument: The Benchmark to run\nOptions:\ndhrystone\nwhetstone\nramspeed\ncachebench\n" - ;; - First) - - Fetch_VM_Image - - ipvar=$(cat $PWD/Test-cases/Bare_vs_VM/Config.yaml | grep "Machine_1_IP" | awk '{print$2;}') - - - passwordvar=$(cat $PWD/Test-cases/Bare_vs_VM/Config.yaml | grep "Machine_1_Password" | awk '{print$2;}') - - expect $PWD/data/ssh_exch.exp $ipvar $passwordvar - heat stack-create exp2 -f $PWD/Test-cases/Bare_vs_VM/SampleHeat.yaml - sleep 3 - VAR1=$( heat stack-show exp2 | grep "stack_status_reason" | awk '{print $6;}') - echo $VAR1 - while [ "$VAR1" != completed ] - do - echo VM is coming up - VAR1=$( heat stack-show exp2 | grep "stack_status_reason" | awk '{print $6;}') - #echo $VAR1 - done - echo VM Created - - if [ "$VAR1" == "completed" ]; then - VAR=$( heat stack-show exp2 | grep "output_value" | awk '{print $4;}'| cut -d '"' -f2) - - echo IP of VM is: - echo $VAR - - sed -i '/demo1/a '$VAR'' /etc/ansible/hosts - sed -i '/demo1/a '$ipvar'' /etc/ansible/hosts - - - - echo Waiting for ping - while ! ping -c1 $VAR &> /dev/null; do - echo Waiting for ping - done - - echo Ping detected - expect $PWD/data/ssh_exch.exp $VAR - Call_Test $2 - - echo cleaning environment - sleep 10 - $PWD/clean.sh - - - fi - - ;; - Second) - - ipvar=$(cat $PWD/Test-cases/Bare_vs_Bare/Config.yaml | grep "Machine_1_IP" | awk '{print$2;}') - echo $ipvar - passwordvar=$(cat $PWD/Test-cases/Bare_vs_Bare/Config.yaml | grep "Machine_1_IP_Password" | awk '{print$2;}') - echo $passwordvar - expect $PWD/data/ssh_exch.exp $ipvar $passwordvar - sed -i '/demo1/a '$ipvar'' /etc/ansible/hosts - ipvar=$(cat $PWD/Test-cases/Bare_vs_Bare/Config.yaml | grep "Machine_2_IP" | awk '{print$2;}') - passwordvar=$(cat $PWD/Test-cases/Bare_vs_Bare/Config.yaml | grep "Machine_2_IP_Password" | awk '{print$2;}') - expect $PWD/data/ssh_exch.exp $ipvar $passwordvar - sed -i '/demo1/a '$ipvar'' /etc/ansible/hosts - Call_Test $2 - echo cleaning environment - sleep 10 - $PWD/clean.sh - ;; - - *) - echo Incorrect Arguments passed to the script. Run script with -h for more help - ;; -esac - - diff --git a/README b/README index 0f007476..7976ba12 100644 --- a/README +++ b/README @@ -15,27 +15,30 @@ The efforts in QTIP are mostly focused on identifying -QTIP currently consists of a bash script (QTIP.sh). +QTIP Framework can now be called: (qtip.py). -The script can run 4 comuting benchmarks: +The Framework can run 5 computing benchmarks: 1. Dhrystone 2. Whetstone 3. RamBandwidth -4. Cachebandwidth +4. SSL +5. nDPI These benchmarks can be run in 2 test cases: 1. VM vs Baremetal -2. Baremetal vs Baremeatl +2. Baremetal vs Baremetal Instructions to run the script: -1. Download the OpenStack adminrc file for the deployment on which you want to create the VM for benchmarking -2. run ./QTIP {TEST CASE} {BENCHMARK} -3. ./QTIP.sh -h for more help +1. Download and source the OpenStack adminrc file for the deployment on which you want to create the VM for benchmarking +2. run python qtip.py -s {SUITE} -b {BENCHMARK} +3. run python qtip.py -h for more help +4. list of benchmarks can be found in the qtip/test-cases directory +5. SUITE referes to compute, network or storage Requirments: 1. Ansible 1.9.2 2. Python 2.7 - +3. PyYAML Configuring Test Cases: @@ -44,6 +47,23 @@ For each Test case, a Config.yaml file contains the details for the machines upo Edit the IP and the Password fields within the files for the machines on which the benchmark is to run. A robust framework that would allow to include more tests would be included within the future +Jump Host requirements: +The following packages should be installed on the server from which you intend to run QTIP. +1: Heat Client +2: Glance Client +3: Nova Client +4: Neutron Client +5: Wget +6: pyYaml + +Networking +1: The Host Machines/compute nodes to be benchmarked should have public/access network +2: The Host Machines/compute nodes should allow Password Login + + +QTIP support for Foreman + +{TBA} diff --git a/Test-cases/Bare_vs_Bare/Config.yaml b/Test-cases/Bare_vs_Bare/Config.yaml deleted file mode 100644 index 6612cbdc..00000000 --- a/Test-cases/Bare_vs_Bare/Config.yaml +++ /dev/null @@ -1,4 +0,0 @@ -Machine_1_IP: 172.18.0.17 -Machine_1_Password: Op3nStack -Machine_2_IP: 172.18.0.16 -Machine_2_Password: Op3nStack diff --git a/Test-cases/Bare_vs_VM/Config.yaml b/Test-cases/Bare_vs_VM/Config.yaml deleted file mode 100644 index e410a632..00000000 --- a/Test-cases/Bare_vs_VM/Config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -Machine_1_IP: 172.18.0.17 -Machine_1_Password: Op3nStack diff --git a/benchmarks/foo b/benchmarks/foo new file mode 100644 index 00000000..e69de29b diff --git a/benchmarks/playbooks/cachebench.yaml b/benchmarks/playbooks/cachebench.yaml deleted file mode 100644 index d0e04140..00000000 --- a/benchmarks/playbooks/cachebench.yaml +++ /dev/null @@ -1,38 +0,0 @@ - - - hosts: demo1 - - tasks: - - name: clean - shell: rm -rf /usr/bin/phoronix-test-suite - shell: rm -rf /usr/share/doc/phoronix-test-suite/ - shell: rm -rf /usr/share/phoronix-test-suite - shell: rm -rf /root/photmp/ - - name: cleaning results - file: path=/root/results state=absent - - name: make direc - file: path=/root/photmp/ state=directory - - name: Fetch Phornonix - shell: cd /root/photmp/ && wget https://www.dropbox.com/s/5kks513ozxy7vvs/phoronix-suite.tar.gz - - name: unarchive Phoronix - shell: cd /root/photmp/ && tar -zxvf phoronix-suite.tar.gz - - name: Install Phornonix Dependencies - shell: yum install php php-xml php-client php-process -y - - name: Install Phornonix - shell: cd /root/photmp/phoronix-test-suite-master/&&./install-sh - - name: batchSetup - shell: phoronix-test-suite batch-setup - - name: install - shell: phoronix-test-suite batch-install cachebench - - name: run - shell: phoronix-test-suite batch-run cachebench - - name: making directory - file: path=/root/results state=directory - - name: copying result to temp directory - shell: cp -r /var/lib/phoronix-test-suite/test-results/* /root/results/ - - name: registering files - shell: (cd /root/results/; find . -maxdepth 1 -type f) | cut -d'/' -f2 - register: files_to_copy - - name: copy results - fetch: src=/root/results/{{item}} dest={{Dest_dir}}/cachebench - with_items: files_to_copy.stdout_lines - diff --git a/benchmarks/playbooks/dhrystone.yaml b/benchmarks/playbooks/dhrystone.yaml deleted file mode 100644 index d0e5f20d..00000000 --- a/benchmarks/playbooks/dhrystone.yaml +++ /dev/null @@ -1,31 +0,0 @@ - - - hosts: demo1 - - tasks: - - name: cleaning - file: path=/root/tempT state=absent - - name: cleaning results - file: path=/root/results state=absent - - name: Installing UnixBench dependencies - shell: yum install git gcc patch perl-Time-HiRes -y - - name: Clone unixbench - shell: git clone https://github.com/kdlucas/byte-unixbench.git /root/tempT - - name: make - shell: make --directory /root/tempT/UnixBench/ - - name: downloading_patch - shell: cd /root/tempT/UnixBench/ && wget https://www.dropbox.com/s/11z85gfu0trkhus/fix-limitation.patch - - name: applying_patch - shell: cd /root/tempT/UnixBench/ && patch Run fix-limitation.patch - - name: Run dhrystone - shell: cd /root/tempT/UnixBench/&&./Run -v dhrystone - - name: making directory - file: path=/root/results state=directory - - name: copying result to temp directory - shell: cp -r /root/tempT/UnixBench/results/* /root/results/ - - name: registering files - shell: (cd /root/results/; find . -maxdepth 1 -type f) | cut -d'/' -f2 - register: files_to_copy - - name: copy results - fetch: src=/root/results/{{item}} dest={{Dest_dir}}/dhrystone - with_items: files_to_copy.stdout_lines - diff --git a/benchmarks/playbooks/ramspeedbench.yaml b/benchmarks/playbooks/ramspeedbench.yaml deleted file mode 100644 index 37ea91a8..00000000 --- a/benchmarks/playbooks/ramspeedbench.yaml +++ /dev/null @@ -1,38 +0,0 @@ - - - hosts: demo1 - - tasks: - - name: clean - shell: rm -rf /usr/bin/phoronix-test-suite - shell: rm -rf /usr/share/doc/phoronix-test-suite/ - shell: rm -rf /usr/share/phoronix-test-suite - shell: rm -rf /root/photmp/ - - name: clean previous results - file: path=/root/results path=absent - - name: make direc - file: path=/root/photmp/ state=directory - - name: Fetch Phornonix - shell: cd /root/photmp/ && wget https://www.dropbox.com/s/5kks513ozxy7vvs/phoronix-suite.tar.gz - - name: unarchive Phoronix - shell: cd /root/photmp/ && tar -zxvf phoronix-suite.tar.gz - - name: Phornonix Dependencies - shell: yum install php php-xml php-client php-process -y - - name: Install Phornonix - shell: cd /root/photmp/phoronix-test-suite-master/&&./install-sh - - name: batchSetup - shell: phoronix-test-suite batch-setup - - name: install - shell: phoronix-test-suite batch-install ramspeed - - name: run - shell: phoronix-test-suite batch-run ramspeed - - name: making directory - file: path=/root/results state=directory - - name: copying result to temp directory - shell: cp -r /var/lib/phoronix-test-suite/test-results/* /root/results/ - - name: registering files - shell: (cd /root/results/; find . -maxdepth 1 -type f) | cut -d'/' -f2 - register: files_to_copy - - name: copy results - fetch: src=/root/results/{{item}} dest={{Dest_dir}}/dhrystone - with_items: files_to_copy.stdout_lines - diff --git a/benchmarks/playbooks/whetstone.yaml b/benchmarks/playbooks/whetstone.yaml deleted file mode 100644 index 497797ff..00000000 --- a/benchmarks/playbooks/whetstone.yaml +++ /dev/null @@ -1,31 +0,0 @@ - - - hosts: demo1 - - tasks: - - name: cleaning - shell: rm -rf /root/tempT - - name: cleaning previous results - file: path=/root/results state=absent - - name: Installing UnixBench dependencies - shell: yum install git gcc patch perl-Time-HiRes -y - - name: Clone unixbench - shell: git clone https://github.com/kdlucas/byte-unixbench.git /root/tempT - - name: make - shell: make --directory /root/tempT/UnixBench/ - - name: downloading_patch - shell: cd /root/tempT/UnixBench/ && wget https://www.dropbox.com/s/11z85gfu0trkhus/fix-limitation.patch - - name: applying_patch - shell: cd /root/tempT/UnixBench/ && patch Run fix-limitation.patch - - name: Run whetstone - shell: cd /root/tempT/UnixBench/&&./Run -v whetstone - - name: making directory - file: path=/root/results state=directory - - name: copying result to temp directory - shell: cp -r /root/tempT/UnixBench/results/* /root/results/ - - name: registering files - shell: (cd /root/results/; find . -maxdepth 1 -type f) | cut -d'/' -f2 - register: files_to_copy - - name: copy results - fetch: src=/root/results/{{item}} dest={{Dest_dir}}/whetstone - with_items: files_to_copy.stdout_lines - diff --git a/clean.sh b/clean.sh index 77cc3463..27c8a489 100755 --- a/clean.sh +++ b/clean.sh @@ -1,6 +1,6 @@ #! /bin/bash echo cleaning Ip -sed -i -e '/demo1/{n;N;d;}' /etc/ansible/hosts +#sed -i -e '/demo1/{ n;N;N;N;N;d; }' /etc/ansible/hosts neutron floatingip-delete $(neutron floatingip-list| grep "17" | awk '{print $2;}') -heat stack-delete exp2 +#heat stack-delete exp2 diff --git a/data/ssh_exch.exp b/data/ssh_exch.exp index 1b462c42..4ced0c6a 100755 --- a/data/ssh_exch.exp +++ b/data/ssh_exch.exp @@ -2,11 +2,8 @@ set timeout 4 set ip [lindex $argv 0] set pswd [lindex $argv 1] -spawn ssh-copy-id -i /root/.ssh/id_rsa $ip +spawn ssh-copy-id -i /root/.ssh/id_rsa.pub $ip expect "Are you sure you want to continue connecting" {send "yes\r"} -expect "password" { send "$pswd\r"} +expect "password:" { send "$pswd\r"} interact - - - diff --git a/docs/sample_config.yaml b/docs/sample_config.yaml new file mode 100644 index 00000000..3bfca80d --- /dev/null +++ b/docs/sample_config.yaml @@ -0,0 +1,47 @@ + ## This is a sample Config.yaml file + +#Scenario would define the test case scenario. +#The benchmark key contains the benchmark to run such as dhrystone,whetstone,dpi,ssh etc. +# Host and server list he differnet machines on which the benchmark would run. +# On machines lised within hosts, the benchmarks would run in parallel. +# On machines listed within server, the benchmarks would run when the benechmarks running on hosts have been completed. +# This has been used to control the folow of the testcase. For example, running the testcases on a vm vs hostmachin, we would like to run the test case serially. It should run first on the host machine and then on the vm. This testcase flow control could be used for other testcases to be developed such as those for networking. +Scenario: + benchmark: dhrystone + host: machine_1, machine_2, virtualmachine_1 + server: + + +#Context would define the enviironment on wichic to run: +#Host Machine keys would contain Host_Machines/ Baremetal machines to run the benchmarks on +#e.g in Host Machine , machine_1 and machine_2 are the bare metal machines. For each baremetal machine its IP(which should be reachable from the location on which you run QTIP), passwords and its role(host or server) +Context: + Host_Machines: + machine_1: + ip: 172.18.0.16 + pw: Op3nStack + role: host + Virtual_Machines: + virtualmachine_1: + availability_zone: nova + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: server + +# A geeral description of the testcase. Could be used later for reports. +Test_Description: + Test_category: "Compute" + Benchmark: "dhrystone" + Overview: > + ''' This test will run the dhrystone benchmark in serial on machine_1 and machine_2.\n + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: ''' + + diff --git a/fetch_os_creds.sh b/fetch_os_creds.sh new file mode 100755 index 00000000..cefc8576 --- /dev/null +++ b/fetch_os_creds.sh @@ -0,0 +1,171 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jose.lausuch@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +usage() { + echo "usage: $0 -d -i -a " >&2 +} + +info () { + logger -s -t "fetch_os_creds.info" "$*" +} + + +error () { + logger -s -t "fetch_os_creds.error" "$*" + exit 1 +} + + +verify_connectivity() { + local ip=$1 + info "Verifying connectivity to $ip..." + for i in $(seq 0 10); do + if ping -c 1 -W 1 $ip > /dev/null; then + info "$ip is reachable!" + return 0 + fi + sleep 1 + done + error "Can not talk to $ip." +} + + + +#Get options +while getopts ":d:i:a:h:" optchar; do + case "${optchar}" in + d) dest_path=${OPTARG} ;; + i) installer_type=${OPTARG} ;; + a) installer_ip=${OPTARG} ;; + *) echo "Non-option argument: '-${OPTARG}'" >&2 + usage + exit 2 + ;; + esac +done + +# set vars from env if not provided by user as options +dest_path=${dest_path:-$HOME/opnfv-openrc.sh} +installer_type=${installer_type:-$INSTALLER_TYPE} +installer_ip=${installer_ip:-$INSTALLER_IP} + +if [ -z $dest_path ] || [ -z $installer_type ] || [ -z $installer_ip ]; then + usage + exit 2 +fi + +# Checking if destination path is valid +if [ -d $dest_path ]; then + error "Please provide the full destination path for the credentials file including the filename" +else + # Check if we can create the file (e.g. path is correct) + touch $dest_path || error "Cannot create the file specified. Check that the path is correct and run the script again." +fi + + +ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +# Start fetching the files +if [ "$installer_type" == "fuel" ]; then + #ip_fuel="10.20.0.2" + verify_connectivity $installer_ip + + # Check if controller is alive (online='True') + controller_ip=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ + 'fuel node | grep controller | grep True | awk "{print \$10}" | tail -1') &> /dev/null + + if [ -z $controller_ip ]; then + error "The controller $controller_ip is not up. Please check that the POD is correctly deployed." + fi + + info "Fetching rc file from controller $controller_ip..." + sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \ + "scp $ssh_options ${controller_ip}:/root/openrc ." &> /dev/null + sshpass -p r00tme scp 2>/dev/null $ssh_options root@${installer_ip}:~/openrc $dest_path &> /dev/null + + #This file contains the mgmt keystone API, we need the public one for our rc file + admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') + public_ip=$(sshpass -p r00tme ssh $ssh_options root@${installer_ip} \ + "ssh ${controller_ip} 'source openrc; keystone endpoint-list'" \ + | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) &> /dev/null + #| grep http | head -1 | cut -d '|' -f 4 | sed 's/v1\/.*/v1\//' | sed 's/ //g') &> /dev/null + #NOTE: this is super ugly sed 's/v1\/.*/v1\//'OS_AUTH_URL + # but sometimes the output of endpoint-list is like this: http://172.30.9.70:8004/v1/%(tenant_id)s + + +elif [ "$installer_type" == "foreman" ]; then + #ip_foreman="172.30.10.73" + controller="oscontroller1.opnfv.com" + verify_connectivity $installer_ip + + # Check if controller is alive (here is more difficult to get the ip from a command like "fuel node") + sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ + "sshpass -p Op3nStack ssh $ssh_options root@${controller} 'ls'" &> /dev/null + if [ $? -ne 0 ]; then + error "The controller ${controller} is not up. Please check that the POD is correctly deployed." + fi + + info "Fetching openrc from a Foreman Controller '${controller}'..." + sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ + "sshpass -p Op3nStack scp $ssh_options root@${controller}:~/keystonerc_admin ." &> /dev/null + sshpass -p vagrant scp $ssh_options root@${installer_ip}:~/keystonerc_admin $dest_path &> /dev/null + + #This file contains the mgmt keystone API, we need the public one for our rc file + admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') + public_ip=$(sshpass -p vagrant ssh $ssh_options root@${installer_ip} \ + "sshpass -p Op3nStack ssh $ssh_options root@${controller} \ + 'source keystonerc_admin;keystone endpoint-list'" \ + | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) &> /dev/null + +elif [ "$installer_type" == "compass" ]; then + #ip_compass="10.1.0.12" + verify_connectivity $installer_ip + + # controller_ip='10.1.0.222' + controller_ip=$(sshpass -p'root' ssh 2>/dev/null -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@10.1.0.12 \ + 'mysql -ucompass -pcompass -Dcompass -e"select package_config from cluster;"' \ + | awk -F"," '{for(i=1;i/dev/null $ssh_options root@${installer_ip} \ + "scp $ssh_options ${controller_ip}:/opt/admin-openrc.sh ." &> /dev/null + sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:~/admin-openrc.sh $dest_path &> /dev/null + echo 'export OS_REGION_NAME=regionOne' >> $dest_path + + info "This file contains the mgmt keystone API, we need the public one for our rc file" + admin_ip=$(cat $dest_path | grep "OS_AUTH_URL" | sed 's/^.*\=//' | sed "s/^\([\"']\)\(.*\)\1\$/\2/g" | sed s'/\/$//') + info "admin_ip: $admin_ip" + public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \ + "ssh ${controller_ip} 'source /opt/admin-openrc.sh; keystone endpoint-list'" \ + | grep $admin_ip | sed 's/ /\n/g' | grep ^http | head -1) + info "public_ip: $public_ip" + +else + error "Installer $installer is not supported by this script" +fi + + + +if [ "$public_ip" == "" ]; then + error "Cannot retrieve the public IP from keystone" +fi + +info "Keystone public IP is $public_ip" +sed -i "/OS_AUTH_URL/c\export OS_AUTH_URL=\'$public_ip'" $dest_path + +echo "-------- Credentials: --------" +cat $dest_path + +exit 0 diff --git a/foremancred b/foremancred new file mode 100644 index 00000000..4f238938 --- /dev/null +++ b/foremancred @@ -0,0 +1,5 @@ +export OS_USERNAME=admin +export OS_TENANT_NAME=admin +export OS_PASSWORD=octopus +export OS_AUTH_URL='http://172.18.0.27:5000/v2.0' +export PS1='[\u@\h \W(openstack_admin)]\$ ' diff --git a/func/__init__.py b/func/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/func/__init__.pyc b/func/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d217b48953ebbb0c001971c16098b58ac0d94726 GIT binary patch literal 145 zcmZSn%*(Zj-#jdt0SXv_v;z7Sk8y60eKUq&3fN}tOa=+rtNx9dO9%eK-`454RH&82e<|JW!hyM zlR<~Peo{qO#raFeyyuzO`oTJWq=AoU z(&T}#CYw_a#uGU|XBjrrr163Vz9Yl|q>7o{C|D~_gmuTTiJCN`ABiZEsOu z&Uvu*AZ^ofr=LkD6~|<-OW{33pXMP3$cY;c zacP`(4O%BUtMD^g%*(u5Ivo_+U6uASKv&x6LI>#ai5c$5!I>`RNgmltbd<0cuU@`> z_xAL=UU1J7C-#~Y6`E?vnkYNIj`A$%JwU#SY?NjCV+XDh?f#8{5AtMy^naXDWgg0% zBp=8cF?*m=mfR@aP{l7O5oe_fbWtuZk|44d%Ul-@p9aH(#*i}_7!m^H)E|$WMitJ|KT5I^UaN5%O^C&ZMurL`F zPn7H9ptQjfb@1Mq>bN2;Nw6R&Gw23KWZ7}QA==~@b(lTcJm2{6ni1>z{CgaScdpS* z1Q2P4&~ekKE0|lzwj>4D)|OUU5>n-Hh3nsp8`B#cS8`c{Rpb)KP0b(^m!mZwz9^Y4 z#w;vM=2VB3DK0pSj&A`2h>7eu!pkbA=shpc%rZUZ2#Z+E?J^X0;(#qPjbUu&POQ-d z%yGaD2usx2LI?>9E0{RTe9BomX3KI=^iUrISmmK97Nwx8{M9TKzvGo1(2pP!enYEK zQs#P8R>fj9dP7M$(W_BjE+Rx@L(UR;GvfDXu`K2z>gAL+$x=uLj0?lZqy@ibtzO@I zqV~IO)mMjVR~^vYRb78i?RqWsm3OH2y`JJvSA9;%faz~kadCv9#3BsyGG1o19e+sz zANc-9(qlGvNJF|-%c~W0`HVSJ<9(W>;@Ht+efJ+%mj_2!aLJslGs(vUME{~urt%Mkzo literal 0 HcmV?d00001 diff --git a/func/create_zones.py b/func/create_zones.py new file mode 100644 index 00000000..92ce43fe --- /dev/null +++ b/func/create_zones.py @@ -0,0 +1,117 @@ +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + + +from keystoneclient.auth.identity import v2 +from keystoneclient import session +from novaclient import client +import os +from collections import defaultdict + + +class create_zones: + + def __init__(self): + print 'Creating Zones' + self._keystone_client = None + self._nova_client = None + + def _get_keystone_client(self): + '''returns a keystone client instance''' + + if self._keystone_client is None: + ''' + self._keystone_client = keystoneclient.v2_0.client.Client( + auth_url=os.environ.get('OS_AUTH_URL'), + username=os.environ.get('OS_USERNAME'), + password=os.environ.get('OS_PASSWORD'), + tenant_name=os.environ.get('OS_TENANT_NAME')) + ''' + auth = v2.Password(auth_url=os.environ.get('OS_AUTH_URL'), + username=os.environ.get('OS_USERNAME'), + password=os.environ.get('OS_PASSWORD'), + tenant_name=os.environ.get('OS_TENANT_NAME')) + + sess = session.Session(auth=auth) + + return sess + + def _get_nova_client(self): + if self._nova_client is None: + keystone = self._get_keystone_client() + self._nova_client = client.Client('2', session=keystone) + return self._nova_client + + def check_aggregate(self, nova, agg_name): + list1 = nova.aggregates.list() + + agg_name_exist = False + for x in list1: + + if x.name == agg_name: + agg_name_exist = True + return agg_name_exist + + def get_aggregate_id(self, nova, agg_name): + list1 = nova.aggregates.list() + agg_id = 0 + agg_name_exist = False + for x in list1: + if x.name == agg_name: + agg_id = x.id + return agg_id + + def check_host_added_to_aggregate(self, nova, agg_id, hostname): + host_added = False + list1 = nova.aggregates.get_details(agg_id) + + nme = str(list1.hosts) + if(hostname in nme): + host_added = True + return host_added + + def del_agg(self, nova, id, host): + + nova.aggregates.remove_host(id, host) + nova.aggregates.delete(id) + + def create_agg(self, D): + nova = self._get_nova_client() + hyper_list = nova.hypervisors.list() + hostnA = [] + zone_machine = defaultdict(list) + + x = 0 + for x in range(len(hyper_list)): + + hostnA.append(hyper_list[x].service['host']) + hostnA[x] = str(hostnA[x]) + + hostnA.sort() + for k in D: + + zone_machine[k].append(' ') + + for x in range(len(zone_machine)): + if not self.check_aggregate(nova, hostnA[x]): + agg_idA = nova.aggregates.create(hostnA[x], D[x]) + nova.aggregates.add_host(aggregate=agg_idA, host=hostnA[x]) + + else: + + id1 = self.get_aggregate_id(nova, hostnA[x]) + self.del_agg(nova, id1, hostnA[x]) + agg_idA = nova.aggregates.create(hostnA[x], D[x]) + id1 = self.get_aggregate_id(nova, hostnA[x]) + + if not self.check_host_added_to_aggregate( + nova, id1, hostnA[x]): + + nova.aggregates.add_host(aggregate=id1, host=hostnA[x]) diff --git a/func/create_zones.pyc b/func/create_zones.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4faf6abde3bc69214db85dab80096c3cddd6b129 GIT binary patch literal 3912 zcmb_fT~i!I6umwB0ZTwI2}v-Cu0-Sd70Q®t^UkeCPE#37NAs?^lhP6M;d&cbwq z#DXV$^>6qOeDYuE572XN?*fUIPs=jB-M4%C_C5F9+jlE}%}jmq+vh)YW%yUY_dPt0 zk`(_&a*@7~bt8u3Nb*Sf6|g!m1GviE!_)@wg{wtk4=5gQKiRG?ASOZDXe@X+=9Vo{$n8y{4TB zff639Ev2Wk{zfNSk8rQ_ZpY;$XT)3T<4)% z^ntH(7DGRWPO@!ZIFC^h%vVE`VzA#C3IZH_$JuTWueTClA)}U{f20O*Z{?hk8 z+gY*uOZ~w{2gsJmE(FePE%AG4W3T8godxjL&I?cLk|ZlKpCt3>JGwzk%`}V}&Ernt zQKMlWjqSnoDcPQs@_;_=0bE0ydNt_*%}9=cM&*p8s*>6nNnIrqXC#x9982{GTTMt0 zK4{1xCFUrS0(v8$N=mpzG^O=>W#O8g<_NrI0I!)9&UcEgRm(biek<84bI%tauO`dS zo<2&R#oy}Wp0j1q>D$rdv(*Q2d-=NuI=KS?e;SnOX!6PO>gw9#ctywF7M;Q;`Z8UN zou58vFSnm2`aV5H&28m>Ohn@v8$6=BKN;;#nhYEa262o1tQ-`ch;LdSYs7G3br>a_ zi0QBRJR0Q?18BT_xQMM2sDG7|Z$PeemdfnpRdXJn`Di{;j?f6&tQ`3gogqg=IdVsb zAcY8hTag}O5CnYfV340&w%V~ZkBcv$7T*~=gX*FV6<8v=yC`evNv_VQ zH&E?O^y0VJG}*k3Mz5|cZ7B&6QN2?C`woQ0F4W{EDCE?Gl&aKU{% z?svq0$mz%6keY^61`cspkxeBQJdY^BB@Rk49_w=OkVgj-2n|x7L9V;4QHfe%M6`t- z>aIu@Fl)dF5Do0(DD>{`KGgizYfzavc#D{?JijbQ6J+h-geOto1SI)Ng8Rr zj#130&{*Djv17~q%neExa$tos+^6gm2y_l}6zQ7qc6Mx$YW0FzYCr4R_+zdnldyr0 zN!Y-6E)TV5xOUQ1nIC`16?fR&M$;ng!Zpq-XGOEDUUzz|L~l86#b_v&wNmD9fu!H* zZe@klw5vvL>#0IUUe-fr=_lijAD(qsPD9T#jNC_P1o?u=cp6vOLUhGkiKcLs%|{F7 zlDTf0)l23wzAs_+LZtR8Ac@|>NutIkNq>;;O+haL)mDrST$0QU&JQ_HkB zhF=CTop=F{tfcR%Ej&=&u!P^C!&kVJ3Z6*O;rcn4Um7u`or;5bB3R3GgtWsxN|Gs literal 0 HcmV?d00001 diff --git a/func/driver.py b/func/driver.py new file mode 100644 index 00000000..45ec3fa2 --- /dev/null +++ b/func/driver.py @@ -0,0 +1,29 @@ +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + + +import os + + +class Driver: + + def __init__(self): + print "Class driver initialized\n" + + def drive_bench(self, benchmark, roles): + result_dir = '$PWD/results' + benchmark_name = benchmark + '.yaml' + print roles + for k, v in roles: + print k + run_play = 'ansible-playbook -s $PWD/benchmarks/playbooks/{0} --extra-vars "Dest_dir={1} role={2}" -vvv'.format( + benchmark_name, result_dir, k) + + status = os.system(run_play) diff --git a/func/driver.pyc b/func/driver.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ad3c5843c7cbbe8d4bf9a23bed44e505d19e2f9 GIT binary patch literal 1068 zcmb_a&2G~`5T3P@v<-z8frLODtir(;*9ECk4+J3^3B)0SRHAACtv2ySapRxVv#}Zy zpTe{7f;<4stlPq!t~|5j*_rQ~nO*nS-S&r{N1sPN@|HOCbc*Mci za?D9vq$uj$d&;R}dia=p$B9DpB1`4PS!`mJ#NTz)_URCO#xM<1sFQK+Vm}^{3MYB0 z!+e&F%kYzlXI))}X+9>rxR4j*K%9iUhvRuR3Tux2*}`m6vXo3F<$Xrul0l4I(p)Fc z!4`c+1{Gbou%c!icvLlDNUSK`_#AHKRhz_3;+NC literal 0 HcmV?d00001 diff --git a/func/env_setup.py b/func/env_setup.py new file mode 100644 index 00000000..919df176 --- /dev/null +++ b/func/env_setup.py @@ -0,0 +1,160 @@ +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + + + + +import os +import sys +from collections import defaultdict +import yaml +import time +import paramiko + +class Env_setup(): + roles_ip_list = [] # ROLE and its corresponding IP address list + ip_pw_list = [] # IP and password, this will be used to ssh + roles_dict = defaultdict(list) + ip_pw_dict = defaultdict(list) + vm_parameters = defaultdict(list) + benchmark = '' + + def __init__(self): + print '\nParsing class initiated\n' +# obj1 = SpawnVM() + + def writeTofile(self, role): + fname2 = open('/etc/ansible/hosts', 'w') + print role.items() + for k in role: + fname2.write('[' + k + ']\n') + num = len(role[k]) + for x in range(num): + fname2.write(role[k][x] + '\n') + fname2.close + + def sshtest(self, lister): + print 'list: ',lister + for k, v in lister: + ipvar = k + pwvar = v + print '\nBeginning SSH Test!\n' + if v != '': + print ('\nSSH->>>>> %s\n' % k) + time.sleep(2) + + ssh_c = 'ssh-keyscan {0} >> ~/.ssh/known_hosts'.format(k) + + os.system(ssh_c) + ssh_cmd = 'expect ./data/ssh_exch.exp {0} {1}'.format( + ipvar, pwvar) + res = os.system(ssh_cmd) + ''' + for infinity in range(10000): + try : + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(hostname = k , username = 'root', password = v) + stdin, stdout, stderr = ssh.exec_command('ls') + print('SSH successful') + break + except: + print 'Retrying SSH' + time.sleep(1) + ''' + if v == '': + print ('SSH->>>>>', k) + ssh_c = 'ssh-keyscan {0} >> ~/.ssh/known_hosts'.format(k) + + time.sleep(3) + os.system(ssh_c) + + for infinity in range(10000): + try : + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(hostname = k ) + stdin, stdout, stderr = ssh.exec_command('ls') + break + except: + print 'Retrying SSH' + + def pingtest(self, lister): + pingFlag = 0 + + for k, v in lister.iteritems(): + time.sleep(10) + for val in v: + ipvar = val + ping_cmd = 'ping -D -c1 {0}'.format(ipvar) + while os.system(ping_cmd) != 0: + print '\nWaiting for machine\n' + time.sleep(10) + pingFlag = 0 + print ('\n\n %s is UP \n\n ' % ipvar) + + def GetHostMachineinfo(self, Hosttag): + num = len(Hosttag) + offset = len(self.roles_ip_list) + + for x in range(num): + hostlabel = 'machine_' + str(x + 1) + self.roles_ip_list.insert( + offset, (Hosttag[hostlabel]['role'], Hosttag[hostlabel]['ip'])) + self.ip_pw_list.insert( + offset, (Hosttag[hostlabel]['ip'], Hosttag[hostlabel]['pw'])) + + def GetVirtualMachineinfo(self, Virtualtag): + num = len(Virtualtag) + + for x in range(num): + hostlabel = 'virtualmachine_' + str(x + 1) + for k, v in Virtualtag[hostlabel].iteritems(): + self.vm_parameters[k].append(v) + + def parse(self, configfilepath): + try: + fname = open(configfilepath, 'r+') + doc = yaml.load(fname) +# valid_file = validate_yaml.Validate_Yaml(doc) + fname.close() + for scenario in doc: + self.benchmark = doc['Scenario']['benchmark'] + if doc['Context']['Virtual_Machines']: + self.GetVirtualMachineinfo(doc['Context']['Virtual_Machines']) + if doc['Context']['Host_Machines']: + self.GetHostMachineinfo(doc['Context']['Host_Machines']) + + # num = len(doc['Context']['Vir_Machines']) + # for x in range(num): + # lab = 'host_machine'+ str(x+1) + # self.roles_ip_list.insert(x,(doc[lab]['role'],doc[lab]['ip'])) + # self.ip_pw_list.insert(x,(doc[lab]['ip'],doc[lab]['pw'])) + for k, v in self.roles_ip_list: + self.roles_dict[k].append(v) + for k, v in self.ip_pw_list: + self.ip_pw_dict[k].append(v) + return ( + self.benchmark, + self.roles_dict.items(), + self.vm_parameters) + except KeyboardInterrupt: + fname.close() + print 'ConfigFile Closed: exiting!' + sys.exit(0) + + def updateAnsible(self): + self.writeTofile(self.roles_dict) + + def callpingtest(self): + self.pingtest(self.roles_dict) + + def callsshtest(self): + self.sshtest(self.ip_pw_list) diff --git a/func/env_setup.pyc b/func/env_setup.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f9c1433a9ea0040137f613a73be02e08b1a7c98 GIT binary patch literal 5113 zcmcIo&vP6{6@Ih3T4`5WNwyO^f=YQ!Rf;W)yx9CG2rh#oVJTpQGjbwZiE0?n^hzVm z&a9?e(khm?m=hd0LaI`g1Ah^B{st~wxWV_m*_9N+iO4HW@0;#7-LLz5-+OPi`p;JL zU;p^YN0E#^Reb*(mt{|ke@{}8%`@4PO;7tPl2)W&mCdSnBfXkz*2d3F$mYaYuFGa! z;;O{xsmbp}UWq*4oaEf=ojTS@{*BLC$AjpmxvuGj2dRsb$hijYe~}#q*0_VgnVA*z zzK6^H1&x7$o@}G7Xj>Ii6Eh*NU~K(@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euw39f;tEiS=}p) z&0d+I(WX6brY~-*-EG3D1c?5#a+q<#W&kR#qcbzhvbT@VB(r_w&ggPf!eB=}Lc<}q z!K$}$ku8|q%#7ZPl1R(_O9b!?Iw96@ka@?bzPpS3$Wjbv_*yWkCqen4xo3kl8rrhV zt|bIr5xMvA$sh{d`MRs_aPi6GwMR?Omh`wQtG-r{mKqJs|N6H|+pJ5iW$8BaLFIhk zFg{l>z*is2~pP*53YRYa?vIHzuSkOVr7pew$jHi?pVfv!2i63Je z`%OY8cU7G-tpJi>#ZUU3k}wQleeEH7VJ$p9NVh<16cz zMe&Sok-V}=tMYayg37DLb+QOw81)Kh?$AuS2DLChjBvYbF3yiSDqW)@z-J_KV@0F1 z{(8VeB>EhQ6>(V{AXKGdb`UCi5hlE`0L)`u;a~6=N>VDwU6H*GIhQIID&x)wo|-d? z+?H7_{}_s0aV7`PW5y)lQ_hvjAac+fcxw27#B6v3?OBWs>WUkcDdz&7tH^h?S2^QM zS88~la;{;;dEmF-{CM4cz4^Yc67c<28lsZp`yPq&e#wSv;Hg$HezJ)MZRp9B(KDTJ zNPGX!uV@}s^9CL*t1-c^ovj76vD#2=v{tJtO-!^shNLPyR8taEuUQdR;#D>Hac%~Q zqWvIkuLNmVxT+tE7MdM#krsWZ%{G#pDFVtLb0fp%uQ-Xi%I}B8C{45XD>nbYQOZ}* p7hfp#leT{C)HA(VHmMD|YlZfirZg=2u_iL5f9%;ewAHEVe*@YQV~hX* literal 0 HcmV?d00001 diff --git a/func/validate_yaml.py b/func/validate_yaml.py new file mode 100644 index 00000000..c0df4d87 --- /dev/null +++ b/func/validate_yaml.py @@ -0,0 +1,32 @@ +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + + +import yaml +import os + + +class Validate_Yaml(): + + def __init__(self, doc): + + print 'Validating YAML CONFIG FILE' + + if not doc['Scenario']: + print '\nScenario Field missing\n' + if not doc['Scenario']['benchmark']: + print '\nBenchmark field missing' + if not doc['Scenario']['pointless']: + print '\nBabyeating anumal' + if not doc['Context']: + print '\nEntire Context is missing' + if not doc['Context']['Host_Machine']: + print '\nNo Host Machine' + if not doc['Context']['Host_Machine']['machine_1'] diff --git a/func/validate_yaml.pyc b/func/validate_yaml.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a560316d82056b098b57413b03206d3a8217954 GIT binary patch literal 777 zcmbtSO>fgc5S>lxv{)?yPE>I4p$DI8spkrn6p~a5K_pV8~HOY-rcee7c;lx`n=~+|gq_p1SWE`F$d1YLFU8=jArnI|t zlljBix^z)l7YgIOf5og_b+tAsuma zs)d`cvM<3dKA2T@i+46(x;$HLuV9TUI9{yliKMj71}Ryyf5A+xNJJtQd*XR*DYx2` zI#n7eLyU-&Wu=z|+;Io)KOyz*5o*R@p + HOT template to create a new neutron network plus a router to the public + network, and for deploying two servers into the new network. The template also + assigns floating IP addresses to each server so they are routable from the + public network. +parameters: + key_name: + type: string + description: Name of keypair to assign to servers + default: 'key' + image: + type: string + description: Name of image to use for servers + default: 'QTIP_CentOS' + flavor: + type: string + description: Flavor to use for servers + default: 'm1.large' + public_net: + type: string + description: > + ID or name of public network for which floating IP addresses will be allocated + default: 'provider_network' + private_net_name: + type: string + description: Name of private network to be created + default: 'private_network' + private_net_cidr: + type: string + description: Private network address (CIDR notation) + default: '10.10.17.0/24' + private_net_gateway: + type: string + description: Private network gateway address + default: '10.10.17.1' + private_net_pool_start: + type: string + description: Start of private network IP address allocation pool + default: '10.10.17.2' + private_net_pool_end: + type: string + description: End of private network IP address allocation pool + default: '10.10.17.200' + +resources: + private_net: + type: OS::Neutron::Net + properties: + name: { get_param: private_net_name } + + private_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: private_net } + cidr: { get_param: private_net_cidr } + gateway_ip: { get_param: private_net_gateway } + allocation_pools: + - start: { get_param: private_net_pool_start } + end: { get_param: private_net_pool_end } + + router: + type: OS::Neutron::Router + properties: + external_gateway_info: + network: { get_param: public_net } + + router_interface: + type: OS::Neutron::RouterInterface + properties: + router_id: { get_resource: router } + subnet_id: { get_resource: private_subnet } + + server1: + type: OS::Nova::Server + properties: + name: Server1 + image: { get_param: image } + flavor: { get_param: flavor } + + networks: + - port: { get_resource: server1_port } + + server1_port: + type: OS::Neutron::Port + properties: + network_id: { get_resource: private_net } + fixed_ips: + - subnet_id: { get_resource: private_subnet } + + server1_floating_ip: + type: OS::Neutron::FloatingIP + properties: + floating_network: { get_param: public_net } + port_id: { get_resource: server1_port } + + server2: + type: OS::Nova::Server + properties: + name: Server2 + image: { get_param: image } + flavor: { get_param: flavor } + + networks: + - port: { get_resource: server2_port } + + server2_port: + type: OS::Neutron::Port + properties: + network_id: { get_resource: private_net } + fixed_ips: + - subnet_id: { get_resource: private_subnet } + + server2_floating_ip: + type: OS::Neutron::FloatingIP + properties: + floating_network: { get_param: public_net } + port_id: { get_resource: server2_port } + +outputs: + server1_private_ip: + description: IP address of server1 in private network + value: { get_attr: [ server1, first_address ] } + server1_public_ip: + description: Floating IP address of server1 in public network + value: { get_attr: [ server1_floating_ip, floating_ip_address ] } + server2_private_ip: + description: IP address of server2 in private network + value: { get_attr: [ server2, first_address ] } + server2_public_ip: + description: Floating IP address of server2 in public network + value: { get_attr: [ server2_floating_ip, floating_ip_address ] } diff --git a/heat/WorkingTemplate.yaml b/heat/WorkingTemplate.yaml new file mode 100644 index 00000000..299962d4 --- /dev/null +++ b/heat/WorkingTemplate.yaml @@ -0,0 +1,70 @@ +heat_template_version: 2014-10-16 +outputs: + + instance_ip_1: + description: IP address of the instance + value: {get_attr: [floating_ip_1, floating_ip_address]} +parameters: + availability_zone: + default: compute1 + description: The AvailZone. + type: string + private_net_name: + default: private_network + type: string + public_network: + default: provider_network + description: Public + label: Publi_N_ID + type: string +resources: + demo1_security_Group: + properties: + name: demo1_security_Group + rules: + - port_range_max: 22 + port_range_min: 22 + protocol: tcp + - protocol: icmp + type: OS::Neutron::SecurityGroup + floating_ip_1: + properties: + floating_network: {get_param: public_network} + type: OS::Neutron::FloatingIP + floating_ip_assoc_1: + properties: + floatingip_id: {get_resource: floating_ip_1} + port_id: {get_resource: public_port_1} + type: OS::Neutron::FloatingIPAssociation + my_instance_1: + properties: + availability_zone: nova + flavor: m1.small + image: Cirros + networks: + - port: {get_resource: public_port_1} + type: OS::Nova::Server + private_network: + type: OS::Neutron::Net + private_subnet: + properties: + cidr: 10.10.17.0/24 + dns_nameservers: + - 8.8.8.8 + network_id: { get_resource: private_network } + type: OS::Neutron::Subnet + public_port_1: + properties: + network: {get_resource: private_network} + security_groups: [{get_resource: demo1_security_Group}] + type: OS::Neutron::Port + router_1: + properties: + external_gateway_info: + network: { get_param: public_network } + type: OS::Neutron::Router + router_interface: + properties: + router_id: { get_resource: router_1 } + subnet: { get_resource: private_subnet } + type: OS::Neutron::RouterInterface diff --git a/Test-cases/Bare_vs_VM/SampleHeat.yaml b/heat/heat.yaml similarity index 87% rename from Test-cases/Bare_vs_VM/SampleHeat.yaml rename to heat/heat.yaml index 6ee76ac0..2ed45429 100644 --- a/Test-cases/Bare_vs_VM/SampleHeat.yaml +++ b/heat/heat.yaml @@ -13,7 +13,17 @@ private_net_name: type: string default: "private_network" + + flavor: + type: string + label: Flavor + default: m1.large + image: + type: string + label: Image name + default: CentOS + availability_zone: type: string description: The Availability Zone to launch the instance. @@ -71,19 +81,7 @@ port_range_min: 22 port_range_max: 22 - protocol: icmp - - my_instance: - type: OS::Nova::Server - properties: - image: QTIP_CentOS7 - flavor: m1.large - availability_zone: { get_param: availability_zone } - networks: - - port: { get_resource: public_port } - - - - outputs: + outputs: instance_ip: description: IP address of the instance value: { get_attr: [floating_ip, floating_ip_address] } diff --git a/qtip.py b/qtip.py new file mode 100644 index 00000000..2c488e60 --- /dev/null +++ b/qtip.py @@ -0,0 +1,18 @@ +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + + +from func.cli import cli + +def main(): + Objcli = cli() + +if __name__ == "__main__": + main() diff --git a/test_cases/.TESTER.yaml.swo b/test_cases/.TESTER.yaml.swo new file mode 100644 index 0000000000000000000000000000000000000000..b51f8c900b8a9d80dc1d9cabb9988c266a54e51c GIT binary patch literal 12288 zcmeI2y=xRf6u>7IV#KIuW1~FJz*V`;MKQ94g-O65F^P9cA;L1ZH+MT`cV?ZP-Scb| zOKbHn5Vh1lL9mO6y}QL5YF}M6sUibpfDDiUGC&5%02v?y zWPl8i0Wv@a{y_u0$yn(aV;_QAoI}ncN0FbH%Xj1p@(IavdxuaV17v^< zkO4A42FL&zAOmFJe>VUOMrG{pa=AR#GCCCQSUc{Fw`4qOMcfah5?bqyfxQ1ZPV(0Jdw}Kb;U1W8 zJ&+0HA4B6tVF)Hwy(!BZtI!b24Ts8BcO-I3n${mHf ztY^YxQgmFnimhvd^;{@5V_Cvbz5f-q6>V+07+%s*oLW(0y^dv(_(sP0X@+82AQqG#g5_gaRG0e)qJ72k=kXy0AM^nLjV8( literal 0 HcmV?d00001 diff --git a/test_cases/.TESTER.yaml.swp b/test_cases/.TESTER.yaml.swp new file mode 100644 index 0000000000000000000000000000000000000000..aa95a5c112be7b78a88e0607750905c1b0cc428c GIT binary patch literal 12288 zcmeI2&ubGw6o99CQLz4~pf`EOLh#U}se-Zx54MH&P-0Emi^4M5on)uoomppRH>MXa zp4C4=!Gq}kASmLcH$ksL&mMa6D85ZLX=p&97b(7hk73^I%)I$#E+NyJ-&|dTTa}v( z%X!9L@6K-SzBzsB+hxX#);16St+cff5m$3tX%ts)g?SD{Rw=!N5 zS@jXtRVxzfdOQ(HwYl7AF5j>8coa@fKoK%P299PRwe7jv(;GJyYV-L7*GgC6;>^a; z=Auz#fDDiUGC&5%02v?yWPl7DO9M8ZVoxyh6Gis3MLl(>E}B%40Wv@a$N(8217v^< zkO4A42FL&zAOpwH0QVWYbcV5yNdEu-@b~}EbBujQJ|pjtx5z8x1@atuhU_37vW#3u z81myRV_%W?$V=oY@&H*uYREit1v!cAPcycMWXKG10r`b_>?3=~7vvL?=k@`iLI%hH z86X2>fDDiUGC&5%!2fFi289(hR^@VetYvg4oUwM?9dF6_pcQd1kV?2UhaG$`+tAY~ zbY&8N)xdopI0QPeP<-AG*+4*BhoSCD)d8vSF?7VO)CyAN3j=xo3J!AD25W%jozWVY zZ!?eymg7ew4_8423O s==f#9(4tmWJhpxF1F_D;G2^IwGZP&(>=<1i2S#^_H9VoXk=kLu0ny7uqW}N^ literal 0 HcmV?d00001 diff --git a/Test-cases/SampleHeat.yaml b/test_cases/SampleHeat.yaml similarity index 90% rename from Test-cases/SampleHeat.yaml rename to test_cases/SampleHeat.yaml index 0cf0c45f..95b9a137 100644 --- a/Test-cases/SampleHeat.yaml +++ b/test_cases/SampleHeat.yaml @@ -13,7 +13,17 @@ private_net_name: type: string default: "private_network" + + flavor: + type: string + label: Flavor + default: m1.large + image: + type: string + label: Image name + default: CentOS + availability_zone: type: string description: The Availability Zone to launch the instance. @@ -75,8 +85,8 @@ my_instance: type: OS::Nova::Server properties: - image: CentOS - flavor: m1.large + image: { get_param: image} + flavor: { get_param: flavor} availability_zone: { get_param: availability_zone } networks: - port: { get_resource: public_port } diff --git a/test_cases/TESTER.yaml b/test_cases/TESTER.yaml new file mode 100644 index 00000000..5a3f2d33 --- /dev/null +++ b/test_cases/TESTER.yaml @@ -0,0 +1,36 @@ +Scenario: + benchmark: dpi + host: virtualmachine_1 + server: virtualmachine_2 + pointless: +Context: + Host_Machines: + + + Virtual_Machines: + virtualmachine_1: + availability_zone: nova + OS_image: QTIP_CentOS + public_network: 'provider_network' + role: iiihost + flavor: m1.large + virtualmachine_2: + availability_zone: nova + OS_image: QTIP_CentOS + public_network: 'provider_network' + role: server + flavor: m1.large + +Test_Description: + Test_category: "Compute" + Benchmark: "dpi" + Overview: > + '''This test will run the DPI benchmark in serial on virutalmachine_1 and virtualmachine_2.\n + if you wish to add a host machine add the following information under the Host_Machine tag + + machine_1: + ip: + pw: + role: + ''' + diff --git a/test_cases/compute/.whetstone_serial.yaml.swp b/test_cases/compute/.whetstone_serial.yaml.swp new file mode 100644 index 0000000000000000000000000000000000000000..bbfd3be249f36779d3a1497ea2c866590a03c734 GIT binary patch literal 12288 zcmeI2F>ljA6vwa36cClzkRGW-7V0EzMUjUJ+71+{N~^RT5W-xXOMKM6Gv~9@u&{Jz zK!Pv8gamvBMpjl}VnIku%m|(n$Bh~!x`N&*f1Uj9-o1Cf=f%ov*Y`KKV8vNxI4&@D z=hD^v2dhunhqsIwt!-}p+vsW|BCZx5rcvzZSambU*U_|BEzpsu4L8(wtc*8AR(phV z&5Fc&K2JnaL&rF^qSg=|L1weexN>~-lN{2UZY;3o}rFV z3UwE?iCRKkM*TX+*k{x`)GO2r)N|AkN}{$=Yp5@?j15qSsQai}s48j>HG}$&`Ftz# z`k3cNg9s1-B0vO)01+SpM1Tko0V4260>B{ujfc_Uv_-g3tyU*?bwi$M<4#zbEl)Whm{ydyK8i$BUUXHsxW&{Xk+%bHioFQDheeI)%PW z0M+!Osd^w4wp~ZuO06JO9bq6}-ya3?wnmY_@?IGUZwtGD zOdxN!#&}@}CRIbXvfCQkLis_&%>f30QR_8egfesBs#88KI`lGchu!=MNgXnF0PMSy(?_EuptuP$T+`GNeAnORl+PVKyi(tNDwugkei+; z%w?ruXLobkTNlbUTgBRmia`}?S6}wTp&eI$x^kd&#)tmXrGt}{6SsWZMi~b>vE$%K zr5P`&mgW9IVUw{7jg>{Gal@%Qjq5{e2{?agZlnLWgo(@6wX&G)5X%ULJAOe*H}uM* Zx@Bz|*U(f}(}l7WtmO;EjnsK0_8Z}zJJ$dJ literal 0 HcmV?d00001 diff --git a/test_cases/compute/dhrystone_parallel.yaml b/test_cases/compute/dhrystone_parallel.yaml new file mode 100644 index 00000000..29de6d6f --- /dev/null +++ b/test_cases/compute/dhrystone_parallel.yaml @@ -0,0 +1,45 @@ +Scenario: + benchmark: dhrystone + host: machine_1, machine_2 + server: blakc + +Context: + Host_Machines: + + Virtual_Machines: + virtualmachine_1: + availability_zone: compute1 + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: host + virtualmachine_2: + availability_zone: compute2 + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: host + +Test_Description: + Test_category: "Compute" + Benchmark: "dhrystone" + Overview: > + '''This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + machine_1: + ip: 172.18.0.16 + pw: Op3nStack + role: host + machine_2: + ip: 172.18.0.15 + pw: Op3nStack + role: host + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: + ''' + diff --git a/test_cases/compute/dhrystone_serial.yaml b/test_cases/compute/dhrystone_serial.yaml new file mode 100644 index 00000000..e15e8ecc --- /dev/null +++ b/test_cases/compute/dhrystone_serial.yaml @@ -0,0 +1,35 @@ + +Scenario: + benchmark: dhrystone + host: machine_1, machine_2, virtualmachine_1 + server: + +Context: + Host_Machines: + machine_1: + ip: 172.18.0.16 + pw: Op3nStack + role: host + Virtual_Machines: + virtualmachine_1: + availability_zone: nova + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: server + +Test_Description: + Test_category: "Compute" + Benchmark: "dhrystone" + Overview: > + ''' This test will run the dhrystone benchmark in serial on machine_1 and machine_2.\n + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: ''' + + diff --git a/test_cases/compute/dpi_parallel.yaml b/test_cases/compute/dpi_parallel.yaml new file mode 100644 index 00000000..5edb3968 --- /dev/null +++ b/test_cases/compute/dpi_parallel.yaml @@ -0,0 +1,36 @@ +Scenario: + benchmark: dpi + 1Run : virtualmachine_1, virtualmachine_2 + 2Run: + +Context: + Host_Machines: + + + Virtual_Machines: + virtualmachine_1: + availability_zone: compute1 + OS_image: QTIP_CentOS + public_network: 'provider_network' + role: 1Run + flavor: m1.large + virtualmachine_2: + availability_zone: compute2 + OS_image: QTIP_CentOS + public_network: 'provider_network' + role: 1Run + flavor: m1.large + +Test_Description: + Test_category: "Compute" + Benchmark: "dpi" + Overview: > + '''This test will run the DPI benchmark in parallel on virutalmachine_1 and virtualmachine_2.\n + if you wish to add a host machine add the following information under the Host_Machine tag + + machine_1: + ip: + pw: + role: + ''' + diff --git a/test_cases/compute/dpi_serial.yaml b/test_cases/compute/dpi_serial.yaml new file mode 100644 index 00000000..539975f7 --- /dev/null +++ b/test_cases/compute/dpi_serial.yaml @@ -0,0 +1,38 @@ +Scenario: + benchmark: dpi + host: virtualmachine_1 + server: virtualmachine_2 + +Context: + Host_Machines: + machine_1: + ip: 172.18.0.76 + pw: r00tme + role: 1host + + Virtual_Machines: + virtualmachine_1: + availability_zone: compute1 + OS_image: QTIP_CentOS + public_network: 'provider_network' + role: 2host + flavor: m1.large + +Test_Description: + Test_category: "Compute" + Benchmark: "dpi" + Overview: > + '''This test will run the DPI benchmark in serial on virutalmachine_1 and virtualmachine_2.\n + if you wish to add a host machine add the following information under the Host_Machine tag + virtualmachine_2: + availability_zone: compute1 + OS_image: QTIP_CentOS + public_network: 'provider_network' + role: 1host + flavor: m1.large + machine_1: + ip: + pw: + role: + ''' + diff --git a/test_cases/compute/ssl_parallel.yaml b/test_cases/compute/ssl_parallel.yaml new file mode 100644 index 00000000..eb46d8d8 --- /dev/null +++ b/test_cases/compute/ssl_parallel.yaml @@ -0,0 +1,37 @@ +Scenario: + benchmark: ssl + host: machine_1, machine_2 + server: + +Context: + Host_Machines: + + Virtual_Machines: + virtualmachine_1: + availability_zone: compute1 + public_network: 'net04_ext' + OS_image: 'QTIP_CentOS' + flavor: 'm1.large' + role: host + virtualmachine_2: + availability_zone: compute2 + public_network: 'net04_ext' + OS_image: 'QTIP_CentOS' + flavor: 'm1.large' + role: host + + +Test_Description: + Test_category: "Compute" + Benchmark: "ssl" + Overview: > + '''This test will run the SSL benchmark in parallel on virtualmachine_1 and machine_1.\n + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: + ''' diff --git a/test_cases/compute/ssl_serial.yaml b/test_cases/compute/ssl_serial.yaml new file mode 100644 index 00000000..756951bf --- /dev/null +++ b/test_cases/compute/ssl_serial.yaml @@ -0,0 +1,34 @@ +Scenario: + benchmark: ssl + 1Run: machine_1 + 2Run: virtualmachine_1 + +Context: + Host_Machines: + machine_1: + ip: 172.18.0.16 + pw: Op3nStack + role: 1Run + Virtual_Machines: + virtualmachine_1: + availability_zone: compute1 + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: 2Run + +Test_Description: + Test_category: "Compute" + Benchmark: "ssl" + Overview: > + '''This test will run the SSL benchmark in serial on virtualmachine_1 and machine_1. + The Test will run first on the Host_Machine and then on the Virtual Machine. + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: + ''' diff --git a/test_cases/compute/whetstone_parallel.yaml b/test_cases/compute/whetstone_parallel.yaml new file mode 100644 index 00000000..48bc7230 --- /dev/null +++ b/test_cases/compute/whetstone_parallel.yaml @@ -0,0 +1,45 @@ +Scenario: + benchmark: whetstone + host: machine_1, virtualmachine_1 + server: + +Context: + Host_Machines: + machine_1: + ip: 172.18.0.76 + pw: r00tme + role: host + machine_2: + ip: 172.18.0.75 + pw: r00tme + role: host + + Virtual_Machines: + virtualmachine_1: + availability_zone: compute1 + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: host + +Test_Description: + Test_category: "Compute" + Benchmark: "dhrystone" + Overview: > + '''This test will run the whetstone benchmark in parallel on machine_1 and machine_2.\n + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + virtualmachine_1: + availability_zone: nova + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: host + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: + ''' + diff --git a/test_cases/compute/whetstone_serial.yaml b/test_cases/compute/whetstone_serial.yaml new file mode 100644 index 00000000..25cefbf8 --- /dev/null +++ b/test_cases/compute/whetstone_serial.yaml @@ -0,0 +1,35 @@ + +Scenario: + benchmark: whetstone + host: machine_1, + server: virtualmachine_1 + +Context: + Host_Machines: + machine_1: + ip: 172.18.0.16 + pw: Op3nStack + role: host + Virtual_Machines: + virtualmachine_1: + availability_zone: nova + public_network: 'net04_ext' + OS_image: QTIP_CentOS + flavor: m1.large + role: server + +Test_Description: + Test_category: "Compute" + Benchmark: "whetstone" + Overview: > + ''' This test will run the whetstone benchmark in serial on machine_1 and machine_2.\n + if you wish to add a virtual machine add the following information under the Virtual_Machine tag + + virtualmachine_1: + availability_zone: + public_network: + OS_image: + flavor: + role: ''' + + diff --git a/test_cases/network/iperf.yaml b/test_cases/network/iperf.yaml new file mode 100644 index 00000000..56c49e28 --- /dev/null +++ b/test_cases/network/iperf.yaml @@ -0,0 +1,17 @@ +scenario: + benchmark: dpi + ExecOrder1: vm_1 + ExecOrder2: vm_2 + +Context: + VirtualMachines: + vm_1: + availability_zone: compute1 + OS_image: centos7 + public_network: "provider_network" + role: ExecOrder1 + vm_2: + availability_zone: compute1 + OS_image: centos7 + public_network: "provider_network" + role: ExecOrder2 -- 2.16.6