Removed Root previlages 53/4653/1
authorMofassir Arif <Mofassir_arif@dellteam.com>
Wed, 16 Dec 2015 10:25:51 +0000 (02:25 -0800)
committerMofassir Arif <Mofassir_arif@dellteam.com>
Wed, 16 Dec 2015 11:41:54 +0000 (03:41 -0800)
QTIP now uses a key of its own to ssh into VMs
The ssh for the baremetal servers still needs work

Change-Id: I1aa37e07c4f9b3f7f4902d16cdbf74f39eb6c698
Signed-off-by: Mofassir Arif <Mofassir_arif@dellteam.com>
Conflicts:
.gitignore

22 files changed:
.create_zones.py.swp [deleted file]
.gitignore
benchmarks/playbooks/dhrystone.yaml
benchmarks/playbooks/dpi.yaml
benchmarks/playbooks/info_script/info_collect.py
benchmarks/playbooks/iperf.yaml
benchmarks/playbooks/ramspeed.yaml
benchmarks/playbooks/result_transform/dpi/dpi_transform.py
benchmarks/playbooks/result_transform/ssl/ssl_transform.py
benchmarks/playbooks/ssl.yaml
benchmarks/playbooks/sys_info_pbook.yaml
benchmarks/playbooks/whetstone.yaml
data/QtipKey [new file with mode: 0644]
data/QtipKey.pub [new file with mode: 0644]
data/hosts [new file with mode: 0644]
data/ssh_exch.exp
func/cli.py
func/create_zones.py
func/driver.py
func/env_setup.py
func/spawn_vm.py
test_cases/compute/dpi_serial.yaml

diff --git a/.create_zones.py.swp b/.create_zones.py.swp
deleted file mode 100644 (file)
index 0467b7b..0000000
Binary files a/.create_zones.py.swp and /dev/null differ
index 7d44098..437faa8 100644 (file)
@@ -29,6 +29,7 @@ var/
 #  before PyInstaller builds the exe, so as to inject date/other infos into it.
 *.manifest
 *.spec
+*.pyc
 
 # Installer logs
 pip-log.txt
index 34ccfd8..d825e87 100644 (file)
@@ -2,9 +2,9 @@
    connection: local
    tasks:
     - name: making dhrystone directory
-      file: path={{Dest_dir}}/dhrystone/dhrystone_temp state=directory
+      file: path=../../{{Dest_dir}}/dhrystone/dhrystone_temp state=directory
     - name: making temporary dhrystone directory
-      file: path={{Dest_dir}}/dhrystone/dhrystone_temp state=directory
+      file: path=../../{{Dest_dir}}/dhrystone/dhrystone_temp state=directory
  
  - hosts:  "{{role}}"
 
     - name: make directory
       shell: mkdir $HOME/qtip_result
     - include: ./sys_info_pbook.yaml
-<<<<<<< HEAD
       vars:
           network: false
-=======
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
     - name: Installing UnixBench dependencies if CentOS
       shell: yum install git gcc  patch perl-Time-HiRes -y
       when: ansible_os_family == "RedHat"
       shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.json") | cut -d'/' -f2
       register: files_to_copy
     - name: copy results
-      fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{Dest_dir}}/dhrystone/dhrystone_temp
+      fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest=../../{{Dest_dir}}/dhrystone/dhrystone_temp
       with_items: files_to_copy.stdout_lines 
     - name: registering log files
       shell: (cd $HOME/qtip_result/log/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
       register: copy_log_results
     - name: copying log results
-      fetch:  src={{home_dir.stdout}}/qtip_result/log/{{item}} dest={{Dest_dir}}/dhrystone/dhrystone_temp
+      fetch:  src={{home_dir.stdout}}/qtip_result/log/{{item}} dest=../../{{Dest_dir}}/dhrystone/dhrystone_temp
       with_items: copy_log_results.stdout_lines
      
     - name: cleaning tempT
    connection: local
    tasks:
     - name: extracting_json
-      shell: ( find  {{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/dhrystone/)
+      shell: ( find  ../../{{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.json" | xargs cp -t ../../{{Dest_dir}}/dhrystone/)
     - name: making_logs_folder
-      shell: mkdir -p {{Dest_dir}}/dhrystone/logs
+      shell: mkdir -p ../../{{Dest_dir}}/dhrystone/logs
     - name: extracting_log
-      shell: ( find {{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.log"  | xargs cp -t {{Dest_dir}}/dhrystone/logs)
+      shell: ( find ../../{{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.log"  | xargs cp -t ../../{{Dest_dir}}/dhrystone/logs)
     - name: removing dhrystone_temp 
-      shell: rm -rf {{Dest_dir}}/dhrystone/dhrystone_temp
-
-       
-     
-     
-    
+      shell: rm -rf ../../{{Dest_dir}}/dhrystone/dhrystone_temp 
    # - name: cleaning_2
    #   file: path=/root/tempT  state=absent
    #   file: path=/root/qtip_result state=absent
index b2c87d3..3bc6e01 100644 (file)
@@ -2,9 +2,9 @@
    connection: local
    tasks: 
     - name: making dpi directory
-      file: path={{Dest_dir}}/dpi state=directory
+      file: path=../../{{Dest_dir}}/dpi state=directory
     - name: making temporary whetstone directory
-      file: path={{Dest_dir}}/dpi/dpi_temp state=directory
+      file: path=../../{{Dest_dir}}/dpi/dpi_temp state=directory
  
  - hosts: "{{role}}"
    tasks:
     - name: make qtip_result
       shell: mkdir $HOME/qtip_result
     - include: ./sys_info_pbook.yaml
-<<<<<<< HEAD
       vars:
           network: false
-=======
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
     - name: Installing nDPI dependencies if CentOS
       shell: yum install git gcc patch  perl-Time-HiRes autofconf automake libpcap-devel libtool -y
       when: ansible_os_family == "RedHat"
       shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.json") | cut -d'/' -f2
       register: files_to_copy
     - name: copy results
-      fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{Dest_dir}}/dpi/dpi_temp
+      fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest=../../{{Dest_dir}}/dpi/dpi_temp
       with_items: files_to_copy.stdout_lines
     - name: registering log files
       shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
       register: copy_log_results
     - name: copying log results
-      fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{Dest_dir}}/dpi/dpi_temp
+      fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest=../../{{Dest_dir}}/dpi/dpi_temp
       with_items: copy_log_results.stdout_lines
 
  #   - name: cleaning tempD
    connection: local
    tasks:
     - name: extracting_json
-      shell: ( find  {{Dest_dir}}/dpi/dpi_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/dpi/)
+      shell: ( find  ../../{{Dest_dir}}/dpi/dpi_temp/ -name "*.json" | xargs cp -t ../../{{Dest_dir}}/dpi/)
     - name: making_logs_folder
-      shell: mkdir -p {{Dest_dir}}/dpi/logs
+      shell: mkdir -p ../../{{Dest_dir}}/dpi/logs
     - name: extracting_log
-      shell: ( find {{Dest_dir}}/dpi/dpi_temp/ -name "*.log"  | xargs cp -t {{Dest_dir}}/dpi/logs)
+      shell: ( find ../../{{Dest_dir}}/dpi/dpi_temp/ -name "*.log"  | xargs cp -t ../../{{Dest_dir}}/dpi/logs)
     - name: removing dpi_temp
-      shell: rm -rf {{Dest_dir}}/dpi/dpi_temp
-
+      shell: rm -rf ../../{{Dest_dir}}/dpi/dpi_temp
\ No newline at end of file
index 6dbb51b..e286d68 100644 (file)
@@ -3,97 +3,8 @@ import pickle
 import time
 import datetime
 import json
-<<<<<<< HEAD
 import sys
 
-os.system('inxi -b -c0 -n > $PWD/est_2')
-est_ob=open("est_2","r+")
-est_ob2=open("est_1","w+")
-in_string= est_ob.read().replace('\n',' ')
-cpu_idle=float(os.popen("""top -bn1 | grep "Cpu(s)" | awk '{print $8}'""").read().rstrip())
-cpu_usage= 100-cpu_idle
-est_ob2.write(in_string);
-est_ob.close()
-est_ob2.close()
-
-Info_dict={};
-inxi_host=os.popen("""cat $PWD/est_1 | grep -o -P '(?<=Host:).*(?=Kernel)' """).read().lstrip().rstrip()
-inxi_mem=os.popen("""cat $PWD/est_1 | grep -o -P '(?<=Memory:).*(?=Init)' """).read().lstrip().rstrip()
-inxi_cpu=os.popen("""cat $PWD/est_1 | grep -o -P '(?<=CPU).*(?=speed)' | cut -f2 -d':'""").read().lstrip().rstrip()
-inxi_distro=os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=Distro:).*(?=Machine:)' """).read().rstrip().lstrip()
-inxi_kernel=os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=Kernel:).*(?=Console:)' """).read().rstrip().lstrip()
-inxi_HD=os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=HDD Total Size:).*(?=Info:)' """).read().rstrip().lstrip()
-inxi_product=os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=product:).*(?=Mobo:)' """).read().rstrip().lstrip()
-
-
-
-Info_dict['1_Hostname']=inxi_host
-Info_dict['2_Product']=inxi_product
-Info_dict['3_OS Distribution']=inxi_distro
-Info_dict['4_Kernel']=inxi_kernel
-Info_dict['5_CPU']=inxi_cpu
-Info_dict['6_CPU_Usage']=str(round(cpu_usage,3))+'%'
-Info_dict['7_Memory Usage']=inxi_mem
-Info_dict['8_Disk usage']=inxi_HD
-network_flag=str(sys.argv[1]).rstrip()
-
-if (network_flag == 'n'):
-    
-    Info_dict['9_Network_Interfaces']={};
-    tem_2=""" cat $PWD/est_1 | grep -o -P '(?<=Network:).*(?=Info:)'"""
-    print os.system(tem_2+' > Hello')
-    i=int(os.popen(tem_2+" | grep -o 'Card' | wc -l ").read())
-    print i
-
-
-    for x in range (1,i+1):
-            tem=""" cat $PWD/est_1 | grep -o -P '(?<=Card-"""+str(x)+""":).*(?=Card-"""+str(x+1)+""")'"""
-            if i == 1:
-                tem=""" cat $PWD/est_1 | grep -o -P '(?<=Network:).*(?=Info:)'"""
-                inxi_card_1=((os.popen(tem+" | grep -o -P '(?<=Card:).*(?=Drives:)'|sed 's/ *driver:.*//'").read().rstrip().lstrip()))
-                print inxi_card_1
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]={};
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]['1_Network_Card']=inxi_card_1
-                inxi_card_2=((os.popen(tem+"| grep -o -P '(?<=Card:).*(?=Drives:)'|sed -e 's/^.*IF: //'").read())).rstrip().lstrip()
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]['2_Interface_info']=inxi_card_2
-            elif x < (i):
-                print "two"
-                #inxi_Card_temp=((os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=Card-"""+str(x)+""":).*(?=Card-"""+str(x+1)+""")' """).read().rstrip().lstrip()))
-                inxi_card_1=((os.popen(tem+"| sed 's/ *driver:.*//'").read().rstrip().lstrip()))
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]={};
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]['1_Network_Card']=inxi_card_1
-                inxi_card_2=((os.popen(tem+"|sed -e 's/^.*IF: //'").read())).rstrip().lstrip()
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]['2_Interface_info']=inxi_card_2
-            elif x == i:
-                print "Three"
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]={};
-                inxi_card_1=((os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=Card-"""+str(x)+""":).*(?=Drives:)'| sed 's/ *driver:.*//' """).read().rstrip().lstrip()))
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]['1_Network_Card']=inxi_card_1
-                inxi_card_2=((os.popen(""" cat $PWD/est_1 | grep -o -P '(?<=Card-"""+str(x)+""":).*(?=Drives:)'| sed -e 's/^.*IF: //' """).read().rstrip().lstrip()))
-                Info_dict['9_Network_Interfaces']['Interface_'+str(x)]['2_Interface_info']=inxi_card_2 
-            else:
-                print "No network cards"
-    os.system("bwm-ng -c 1 | grep -v '=' | grep -v 'iface' | grep -v '-'   > bwm_dump")
-    n_interface=int(os.popen(" cat bwm_dump | grep -v 'total' |  wc -l ").read().rstrip())
-    interface={};
-    for x in range (1,n_interface):
-        interface_name=os.popen(" cat bwm_dump | awk 'NR=="+str(x)+"' | awk '{print $1}' ").read().rstrip().replace(':','')
-        interface[str(interface_name)]={};
-        interface[str(interface_name)]['Rx (KB/s)']=os.popen(" cat bwm_dump | awk 'NR=="+str(x)+"' | awk '{print $2}' ").read().rstrip()
-        interface[str(interface_name)]['Tx (KB/s)']=os.popen(" cat bwm_dump | awk 'NR=="+str(x)+"' | awk '{print $4}' ").read().rstrip()
-        interface[str(interface_name)]['Total (KB/s)']=os.popen(" cat bwm_dump | awk 'NR== "+str(x)+"' | awk '{print $6}' ").read().rstrip()
-    Info_dict['Interface I/O']=interface
-
-print Info_dict
-    
-with open('./sys_info_temp','w+')as out_info:
-    pickle.dump(Info_dict,out_info)
-
-with open('temp','w+') as result_json:
-    json.dump(Info_dict,result_json,indent=4,sort_keys=True)
-
-=======
 
 os.system('inxi -b -c0 -n > $PWD/est_2')
 est_ob = open("est_2", "r+")
@@ -195,4 +106,4 @@ with open('./sys_info_temp', 'w+')as out_info:
     pickle.dump(Info_dict, out_info)
 
 #       json.dump(Info_dict, out_json, sort_keys=True,separators=(',',':'),indent=4)
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
+
index 9d4d185..dd5c2b0 100644 (file)
@@ -34,6 +34,8 @@
     - name: making  results temporary directory
       shell: mkdir $HOME/qtip_result
     - include: ./sys_info_pbook.yaml
+      vars:
+        network: true
     - name: Installing Epel-release when CentOS
       shell: yum install epel-release -y
       when: ansible_os_family == "RedHat"
@@ -84,4 +86,4 @@
         when: role is defined
     - name: extracting_json
       shell: ( find  ../../{{Dest_dir}}/iperf/iperf_temp/ -name "*.json" | xargs cp -t ../../{{Dest_dir}}/iperf/)
-      when: rolename == "2-host"
+      when: rolename == "2-host"
\ No newline at end of file
index ce2ac25..6e317ec 100644 (file)
@@ -2,9 +2,9 @@
    connection: local
    tasks:
     - name: making ramspeed  directory
-      file: path={{Dest_dir}}/ramspeed state=directory
+      file: path=../../{{Dest_dir}}/ramspeed state=directory
     - name: making temporary ramspeed directory
-      file: path={{Dest_dir}}/ramspeed/ramspeed_temp state=directory
+      file: path=../../{{Dest_dir}}/ramspeed/ramspeed_temp state=directory
  
 
  - hosts:  "{{role}}"
 
   
     - name: copy results
-      fetch:  src=/root/results/{{item}}  dest={{Dest_dir}}/ssl
+      fetch:  src=/root/results/{{item}}  dest=../../{{Dest_dir}}/ssl
       with_items: files_to_copy.stdout_lines
 
  - hosts: 127.0.0.1
    connection: local
    tasks:
     - name: extracting_json
-      shell: ( find  {{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/ramspeed/)
+      shell: ( find  ../../{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.json" | xargs cp -t ../../{{Dest_dir}}/ramspeed/)
     - name: making_logs_folder
-      shell: mkdir -p {{Dest_dir}}/ramspeed/logs
+      shell: mkdir -p ../../{{Dest_dir}}/ramspeed/logs
     - name: extracting_log
-      shell: ( find {{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.log"  | xargs cp -t {{Dest_dir}}/ramspeed/logs)
+      shell: ( find ../../{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.log"  | xargs cp -t ../../{{Dest_dir}}/ramspeed/logs)
     - name: removing ramspeed_log
-      shell: rm -rf {{Dest_dir}}/ramspeed/ramspeed_temp
+      shell: rm -rf ../../{{Dest_dir}}/ramspeed/ramspeed_temp
 
index 2aa4575..b95e0e2 100644 (file)
@@ -46,9 +46,4 @@ result = {}
 result['DPI_benchmark(M pps)'] = round(dpi_result_pps, 3)
 result['DPI_benchmark(Gb/s)'] = round(dpi_result_bps, 3)
 with open('./result_temp', 'w+') as result_file:
-    pickle.dump(result, result_file)
-<<<<<<< HEAD
-
-=======
-print json.dumps(result, indent=4, sort_keys=True)
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
+    pickle.dump(result, result_file)
\ No newline at end of file
index 575b94a..20ca5cf 100644 (file)
@@ -35,11 +35,7 @@ aes_1024B = os.popen(
 aes_8192B = os.popen(
     "cat AES-128-CBC_dump | grep  'aes-128-cbc  ' | awk '{print $6}' ").read().rstrip()
 
-<<<<<<< HEAD
 
-=======
-#    def get_nova_client(self):
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
 hostname = os.popen("hostname").read().rstrip()
 time_stamp = str(datetime.datetime.utcnow().isoformat())
 
@@ -47,13 +43,7 @@ time_stamp = str(datetime.datetime.utcnow().isoformat())
 os.system("mv RSA_dump " + hostname + "-" + time_stamp + ".log")
 os.system("cat AES-128-CBC_dump >> " + hostname + "-" + time_stamp + ".log")
 
-<<<<<<< HEAD
-=======
-#      if self._glance_client is None:
-##          keystone = self.get_keystone_client()
-#         nova = client.Client('2', token = keystone.auth_token)
 
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
 
 result = {}
 
@@ -75,9 +65,3 @@ result['3. AES-128-cbc throughput']['5. 16 Bytes block (B/sec)'] = [aes_8192B]
 with open('./result_temp', 'w+') as result_file:
     pickle.dump(result, result_file)
 
-<<<<<<< HEAD
-
-=======
-# print json.dumps(result, indent=4, sort_keys=True)
-# print result.items()
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
index 8b5b427..d27a967 100644 (file)
@@ -2,17 +2,9 @@
    connection: local
    tasks:
     - name: making ssl directory
-<<<<<<< HEAD
-      file: path={{Dest_dir}}/ssl state=directory
-    - name: making temporary ssl directory
-      file: path={{Dest_dir}}/ssl/ssl_temp state=directory
-=======
       file: path=../../{{Dest_dir}}/ssl state=directory
     - name: making temporary ssl directory
       file: path=../../{{Dest_dir}}/ssl/ssl_temp state=directory
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
-
  - hosts: "{{role}}"
    tasks:
    
     - name: making  results temporary directory
       shell: mkdir $HOME/qtip_result 
     - include: ./sys_info_pbook.yaml
-<<<<<<< HEAD
       vars:
           network: false
-=======
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
     - name: Installing OpenSSL dependencies when CentOS
       shell: yum install git  wget gcc patch  perl-Time-HiRes autofconf automake libpcap-devel libtool -y
       when: ansible_os_family == "RedHat"
       shell: apt-get  install git gcc wget   perl autoconf automake libpcap-dev libtool -y
       when: ansible_os_family == "Debian"
     - name: Fetching OpenSSL
-      shell: cd $HOME/Open_SSL/ && wget https://www.openssl.org/source/openssl-1.0.2d.tar.gz
+      shell: cd $HOME/Open_SSL/ && wget https://www.openssl.org/source/openssl-1.0.2e.tar.gz
     - name: Untar OpenSSL
-      shell: cd $HOME/Open_SSL/ && tar -zxvf openssl-1.0.2d.tar.gz
+      shell: cd $HOME/Open_SSL/ && tar -zxvf openssl-1.0.2e.tar.gz
     - name: configure
-      shell: cd $HOME/Open_SSL/openssl-1.0.2d  && ./config
+      shell: cd $HOME/Open_SSL/openssl-1.0.2e  && ./config
     - name: make 
-      shell: cd  $HOME/Open_SSL/openssl-1.0.2d && make 
+      shell: cd  $HOME/Open_SSL/openssl-1.0.2e && make 
     - name: make install
-      shell: cd  $HOME/Open_SSL/openssl-1.0.2d && make install
+      shell: cd  $HOME/Open_SSL/openssl-1.0.2 && make install
     - name: Benchmarking RSA signatures
-      shell: cd $HOME/Open_SSL/openssl-1.0.2d/apps  &&  ./openssl speed rsa >> $HOME/qtip_result/RSA_dump
+      shell: cd $HOME/Open_SSL/openssl-1.0.2e/apps  &&  ./openssl speed rsa >> $HOME/qtip_result/RSA_dump
     - name: Benchmaring AES-128-cbc cipher encryption  throughput
-      shell: cd $HOME/Open_SSL/openssl-1.0.2d/apps  &&  ./openssl speed -evp aes-128-cbc >> $HOME/qtip_result/AES-128-CBC_dump
+      shell: cd $HOME/Open_SSL/openssl-1.0.2e/apps  &&  ./openssl speed -evp aes-128-cbc >> $HOME/qtip_result/AES-128-CBC_dump
     - name: Fetching result transformation script
       copy: src=./result_transform/ssl/ssl_transform.py dest={{home_dir.stdout}}/qtip_result
     - name: Transforming result
    connection: local
    tasks:
     - name: extracting_json
-<<<<<<< HEAD
-      shell: ( find  {{Dest_dir}}/ssl/ssl_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/ssl/)
-    - name: making_logs_folder
-      shell: mkdir -p {{Dest_dir}}/ssl/logs
-    - name: extracting_log
-      shell: ( find {{Dest_dir}}/ssl/ssl_temp/ -name "*.log"  | xargs cp -t {{Dest_dir}}/ssl/logs)
-    - name: removing ssl_temp
-      shell: rm -rf {{Dest_dir}}/ssl/ssl_temp
-=======
       shell: ( find  ../../{{Dest_dir}}/ssl/ssl_temp/ -name "*.json" | xargs cp -t ../../{{Dest_dir}}/ssl/)
     - name: making_logs_folder
-      shell: mkdir -p {{../../Dest_dir}}/ssl/logs
+      shell: mkdir -p ../../{{Dest_dir}}/ssl/logs
     - name: extracting_log
-      shell: ( find {{../../Dest_dir}}/ssl/ssl_temp/ -name "*.log"  | xargs cp -t {{../../Dest_dir}}/ssl/logs)
+      shell: ( find ../../{{Dest_dir}}/ssl/ssl_temp/ -name "*.log"  | xargs cp -t ../../{{Dest_dir}}/ssl/logs)
     - name: removing ssl_temp
-      shell: rm -rf {{../../Dest_dir}}/ssl/ssl_temp
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
-
+      shell: rm -rf ../../{{Dest_dir}}/ssl/ssl_temp
\ No newline at end of file
index 9eca0bc..19c811c 100644 (file)
@@ -7,7 +7,6 @@
    - name: system info collection tool install when Ubuntu
      shell: apt-get install inxi -y
      when: ansible_os_family  == "Debian"
-<<<<<<< HEAD
    - name: Install ansible copy dependencies if remote host has selinux enabled
      shell: yum  install libselinux-python -y
      when: ansible_os_family == "RedHat"
    - name: collecting system information for network test  cases
      shell: cd $HOME/qtip_result && python info_collect.py n
      when: network
-=======
    - name: system_info script copy
      copy: src=./info_script/info_collect.py dest={{home_dir.stdout}}/qtip_result/
    - name: collecting_sys_info
-     shell: cd $HOME/qtip_result &&  python info_collect.py
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
-   
+     shell: cd $HOME/qtip_result &&  python info_collect.py   
 
index 7106381..c22ea43 100644 (file)
     - name: make directory
       shell: mkdir $HOME/qtip_result
     - include: ./sys_info_pbook.yaml
-<<<<<<< HEAD
       vars:
           network: false
-=======
->>>>>>> 5a7dcc0... Networking testcases for QTIP Framework
     - name: Installing UnixBench dependencies if CentOS
       shell: yum install git gcc patch perl-Time-HiRes -y
       when: ansible_os_family == "RedHat"
diff --git a/data/QtipKey b/data/QtipKey
new file mode 100644 (file)
index 0000000..3f52077
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAxVpAC+Q8LTyftATCgVHIKvDkXYzHI/8CZeKlVWHlHUA0/6Eu
+qSrhzbpOwSaQi2C3x4Eszvh7/CfuVMql11yShsXwFD7aV6x0YG7q8IUScHILUFal
+m0Fx52No7IpB3llluUV+kh8ay68V9OGvMZrQ+wWw4ieh2alUnpvFwteXmb8NQtXW
+6pm2algUVixc4R3//YKLnGkj93pGFlQlDz5Q0vg+69jHNgodGewIrxCWeZk2pnn0
+vNAdWTQUTm7z/1uYz6AIeR/Wx66msmchFRmmDpP7aHXSSQEBySF7v/GEsZ1JwtBW
+07WebNiTv9wYoOfyKVuZuTbBwjqlT4x5CpIJEwIDAQABAoIBAFHcDZThJtTcwKG7
+F7LsaUrmgNMNAc08iZIZYNr5sD9h0pn2EZS55M+g5+nWRT6K77AhNKTlDQiax5EE
+PaYHEAA3Ok4rhAW50svtNiZuDCf4Jhk815R+oPCJm4wCDTBdhIRE/ys9G7BA/6qD
+slexD94Pjj9AkTHnuuHPW0hmhMuQaSg96EO6QUWCG/HeMFDGcorBlM0s+NeR46Jm
+dI8tOvt+rSa68oDtKEwhUbP5cATNdAITzo9+4We5EnYhW9/nRsaF/um2BPih6JnU
+zG9udvZwj+YARmEfxhXzeRDpi30qYil/+CUF+qdyd8eoPBvhsW6rr1TA6XYGmPDN
+SnlPLAECgYEA6RtgGqL34orxiqT3tDkA2Lb4aSq9Zntr09VAqwft4I3550XihHsa
+lqJoy2macX36f60oRDZEL3v4cH22zyjojav4MXe2fLlCiApy45xCzsGkWizxTe5D
+184jUIcRxb/sGbOulbXBdu8lmtNiyslvkAoj75bvL2MXhytbYgikhrMCgYEA2Lv1
+9Os+VXT9py/67dO/GY14NUpT1sFq2zxPYWpKxJD+j/NVZsflpPd/V5cGANZGovA0
+c8WNupJmCO1P20uldRX5dJ3EhhER2kn0yKhZuBBxmrELQZdnXGc9T8ub0xJVbo2u
+K3Km3C1Dx7Us4BwzGOO6K2kYbT1ij/vAbZWmpCECgYBdkhqStqYwbrukfrHbyyH2
+3AN9G6XpdFOFNc3+mXE4OWV+G4Rgz5WNr+XG+T4AnqQmChjmwK3ALdA9P4lZQL+Q
+1t4K5VYAXNFDEIarrPb4Tayucenu8VyUTO/KDF3q9i5M5t6Gw+3D0x1SN9YpNpCs
+zhU8wGaErA8uuA23nWaFlwKBgQDXSf6MB5GnucqtZI/R5uCRNWIPLYISdZb7p/EC
+R1912sHDpGdU7YREVkV8cFxaQH9yI0E3LyoWBo6sl28X2xDEOcvN91ncAuDFAWnS
+WMimek8e5nbT9N2LgFH7Dbn/9NpAMySrq/vsAlqt6l5lUB3Bv5SSwpatDKj3dZA0
+Ss95gQKBgQCvwxW4PSd+hxdofwGd6KBwhA404GPdcVLLmASGVYRNcVNyfhUmMCn+
+UF1WsBCOcnWjJ/pT864S9Rp1bbqzpQS8Pz1vJwhkaHEJD0a5l+KhD4llsWDjUNfI
+KfVffcmydNC3uRD59WPZEAgu+gOS8kRw7lybFTNuMS7B3dC5v9UtWg==
+-----END RSA PRIVATE KEY-----
diff --git a/data/QtipKey.pub b/data/QtipKey.pub
new file mode 100644 (file)
index 0000000..7a40f91
--- /dev/null
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFWkAL5DwtPJ+0BMKBUcgq8ORdjMcj/wJl4qVVYeUdQDT/oS6pKuHNuk7BJpCLYLfHgSzO+Hv8J+5UyqXXXJKGxfAUPtpXrHRgburwhRJwcgtQVqWbQXHnY2jsikHeWWW5RX6SHxrLrxX04a8xmtD7BbDiJ6HZqVSem8XC15eZvw1C1dbqmbZqWBRWLFzhHf/9goucaSP3ekYWVCUPPlDS+D7r2Mc2Ch0Z7AivEJZ5mTamefS80B1ZNBRObvP/W5jPoAh5H9bHrqayZyEVGaYOk/toddJJAQHJIXu/8YSxnUnC0FbTtZ5s2JO/3Big5/IpW5m5NsHCOqVPjHkKkgkT root@foreman-jump.opnfv.com
diff --git a/data/hosts b/data/hosts
new file mode 100644 (file)
index 0000000..8594858
--- /dev/null
@@ -0,0 +1,4 @@
+[2-host]
+172.18.0.121
+[1-server]
+172.18.0.122
index 4ced0c6..c52140b 100755 (executable)
@@ -2,7 +2,7 @@
 set timeout 4
 set ip [lindex $argv 0]
 set pswd [lindex $argv 1]
-spawn  ssh-copy-id -i /root/.ssh/id_rsa.pub  $ip
+spawn  ssh-copy-id -i QtipKey $ip
 expect "Are you sure you want to continue connecting" {send "yes\r"}
 expect "password:" { send "$pswd\r"}
 
index 33aacbc..83a7c36 100644 (file)
@@ -43,7 +43,7 @@ class cli():
 
                 [benchmark, roles, vm_info, benchmark_details, pip] = obj.parse('./test_cases/' + args.suite
                                                  + '/' + args.benchmark)
-                
+
                 if len(vm_info) != 0:
                     vmObj = SpawnVM(vm_info)
                 obj.callpingtest()
index 86cfc23..a21fb41 100644 (file)
@@ -55,7 +55,7 @@ class create_zones:
 
         agg_name_exist = False
         for x in list1:
-            
+
             if x.name == agg_name:
                 agg_name_exist = True
         return agg_name_exist
index 83e64a8..318c67b 100644 (file)
@@ -28,7 +28,7 @@ class Driver:
         self.dic_json['Dest_dir'] = str(result_dir)
         self.dic_json['ip1']=''
         self.dic_json['ip2']=''
-        
+
         for k,v in benchmark_detail:
             self.dic_json[k]=v
         for k, v in roles:
@@ -43,8 +43,8 @@ class Driver:
                         index= index+1
             dic_json = json.dumps(dict(self.dic_json.items()))
             print dic_json
-            run_play = 'ansible-playbook -s ./benchmarks/playbooks/{0} --extra-vars \'{1}\'  -vvv'.format(benchmark_name, dic_json)
+            run_play = 'ansible-playbook -s ./benchmarks/playbooks/{0} --private-key=./data/QtipKey -i ./data/hosts --extra-vars \'{1}\' '.format(benchmark_name, dic_json)
 #            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)
-       
+
index 1db5456..f3c01a7 100644 (file)
@@ -28,7 +28,7 @@ class Env_setup():
         print '\nParsing class initiated\n'
 
     def writeTofile(self, role):
-        fname2 = open('/etc/ansible/hosts', 'w')
+        fname2 = open('./data/hosts', 'w')
         print role.items()
         for k in role:
             fname2.write('[' + k + ']\n')
@@ -44,48 +44,46 @@ class Env_setup():
             pwvar = v
             print '\nBeginning SSH Test!\n'
             if v != '':
-                print ('\nSSH->>>>> %s\n' % k)
+                print ('\nSSH->>>>> {0} {1}\n'.format(k,v))
                 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)
-                '''
+                #os.system(ssh_c)
+                ssh_cmd = 'expect ./data/ssh_exch.exp {0} {1}'.format(ipvar, pwvar)
+                print ssh_cmd
+                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)
+                        ssh.connect(k , username = 'root', password = v)
                         stdin, stdout, stderr = ssh.exec_command('ls')
                         print('SSH successful')
                         break
                     except:
                         print 'Retrying SSH'
-                        time.sleep(1)
-                '''
+                        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 )
+                        ssh.connect(k, key_filename= './data/QtipKey')
                         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:
@@ -98,9 +96,9 @@ class Env_setup():
                 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(
@@ -109,6 +107,7 @@ class Env_setup():
                 offset, (Hosttag[hostlabel]['ip'], Hosttag[hostlabel]['pw']))
 
     def GetVirtualMachineinfo(self, Virtualtag):
+
         num = len(Virtualtag)
         for x in range(num):
             hostlabel = 'virtualmachine_' + str(x + 1)
@@ -116,7 +115,7 @@ class Env_setup():
                 self.vm_parameters[k].append(v)
 
     def GetBenchmarkDetails(self, detail_dic):
-        
+
         print detail_dic
         for k,v in detail_dic.items():
             self.benchmark_details[k]= v
@@ -135,7 +134,6 @@ class Env_setup():
                 self.GetHostMachineinfo(doc['Context']['Host_Machines'])
             if doc.get('Scenario',{}).get('benchmark_details',{}):
                 self.GetBenchmarkDetails(doc.get('Scenario',{}).get('benchmark_details',{}))
-            
             for k, v in self.roles_ip_list:
                 self.roles_dict[k].append(v)
             for k, v in self.ip_pw_list:
index c1baced..e794700 100644 (file)
@@ -7,8 +7,6 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-
-
 import os
 import sys
 from collections import defaultdict
@@ -23,7 +21,6 @@ import time
 import json
 from func.create_zones import create_zones
 
-
 class SpawnVM(Env_setup):
     vm_role_ip_dict = defaultdict(list)
 
@@ -54,7 +51,8 @@ class SpawnVM(Env_setup):
                 print 'Error in qtip/heat/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1)
                 print 'EXITING PROGRAM. Correct File and restart'
                 sys.exit(0)
-        fopen = open('/root/.ssh/id_rsa.pub', 'r')
+        #fopen = open('/root/.ssh/id_rsa.pub', 'r')
+        fopen = open('./data/QtipKey.pub', 'r')
         fopenstr = fopen.read()
         fopenstr = fopenstr.rstrip()
         scriptcmd = '#!/bin/bash \n echo {0} >>  foo.txt \n echo {1} >> /root/.ssh/authorized_keys'.format(
@@ -77,9 +75,9 @@ class SpawnVM(Env_setup):
                  'description': 'Availability Zone of the instance',
                  'default': avail_zone,
                  'type': 'string'
-                
+
                  }
-            
+
             Heat_Dic['resources']['public_port_' +str(x)] = {
                     'type': 'OS::Neutron::Port',
                     'properties': {
@@ -124,18 +122,18 @@ class SpawnVM(Env_setup):
                         'port_range_min': 22,
                         'port_range_max': 5201},
                         {'protocol': 'icmp'}]}}
-                        
+
             Heat_Dic['outputs']['instance_PIP_' +str(x)] = {
                 'description': 'IP address of the instance',
                 'value': {'get_attr': ['my_instance_' + str(x), 'first_address']}}
             Heat_Dic['outputs']['instance_ip_' +str(x)] = {
                 'description': 'IP address of the instance',
                 'value': {'get_attr': ['floating_ip_' + str(x), 'floating_ip_address']}}
-            
+
             Heat_Dic['outputs']['availability_instance_' + str(x)] = {
                 'description': 'Availability Zone of the Instance',
                 'value': { 'get_param': 'availability_zone_'+str(x)}}
-            
+
 
         Heat_Dic['outputs']['KeyPair_PublicKey'] = {
             'description': 'Private Key',
@@ -206,7 +204,7 @@ class SpawnVM(Env_setup):
             qtip_image = glance.images.upload(
                 qtip_image.id, open('./Temp_Img/QTIP_CentOS.qcow2'))
         json_temp = json.dumps(Heat_template)
-        
+
         for checks in range(3):
             for prev_stacks in heat.stacks.list():
 
@@ -216,13 +214,13 @@ class SpawnVM(Env_setup):
                     time.sleep(10)
 
         print '\nStack Creating Started\n'
-        
+
        # try:
         heat.stacks.create(stack_name=stackname, template=Heat_template)
 
         #except:
             #print 'Create Failed :( '
-        
+
         cluster_detail = heat.stacks.get(stackname)
         while(cluster_detail.status != 'COMPLETE'):
             if cluster_detail.status == 'IN_PROGRESS':
@@ -237,10 +235,10 @@ class SpawnVM(Env_setup):
 
             for I in cluster_detail.outputs:
                 availabilityKey = 'availability_instance_'+str(vm+1)
+
                 if I['output_key'] == availabilityKey:
                     zone.insert(s,str(I['output_value']))
-                    s=s+1   
+                    s=s+1
             for i in cluster_detail.outputs:
                 instanceKey = "instance_ip_" + str(vm + 1)
                 privateIPkey = 'instance_PIP_' + str(vm +1)
@@ -248,13 +246,13 @@ class SpawnVM(Env_setup):
                     Env_setup.roles_dict[vm_role_ip_dict['role'][vm]].append(
                                                         str(i['output_value']))
                     Env_setup.ip_pw_list.append((str(i['output_value']),''))
-                    
+
                 if i['output_key'] == privateIPkey:
                     Env_setup.ip_pw_dict[vm_role_ip_dict['role'][vm]]=str(i['output_value'])
                 if i['output_key'] == 'KeyPair_PublicKey':
                     sshkey = str(i['output_value'])
 
-        with open('/root/.ssh/my_key.pem', 'w') as fopen:
+        with open('./data/my_key.pem', 'w') as fopen:
             fopen.write(sshkey)
         fopen.close()
         print Env_setup.ip_pw_list
index 539975f..e8f3462 100644 (file)
@@ -6,18 +6,14 @@ Scenario:
 Context:
   Host_Machines:
      machine_1:
-      ip: 172.18.0.76
-      pw: r00tme
+      ip: 172.18.0.17
+      pw: Op3nStack
+      role: 1host
+     machine_2:
+      ip: 172.18.0.16
+      pw: Op3nStack
       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"
@@ -28,6 +24,15 @@ Test_Description:
          availability_zone: compute1
          OS_image: QTIP_CentOS
          public_network: 'provider_network'
+
+          Virtual_Machines:
+             virtualmachine_1:
+              availability_zone: compute1
+              OS_image: QTIP_CentOS
+              public_network: 'provider_network'
+              role: 2host
+              flavor: m1.large
+
          role: 1host
          flavor: m1.large
         machine_1: