aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/hosts7
-rw-r--r--data/my_key.pem50
-rw-r--r--data/pushtoDB.py23
-rw-r--r--func/spawn_vm.py30
-rw-r--r--test_cases/dell-us-testing-bm-1/compute/dhrystone_bm.yaml2
-rw-r--r--test_cases/dell-us-testing-bm-1/compute/dpi_bm.yaml4
-rw-r--r--test_cases/dell-us-testing-bm-1/compute/ssl_bm.yaml2
-rw-r--r--test_cases/dell-us-testing-bm-1/compute/whetstone_bm.yaml2
-rw-r--r--test_list/compute.txt5
9 files changed, 83 insertions, 42 deletions
diff --git a/data/hosts b/data/hosts
index 9a91cb0d..66320d25 100644
--- a/data/hosts
+++ b/data/hosts
@@ -1,4 +1,3 @@
-[2-host]
-172.18.0.104
-[1-server]
-172.18.0.105
+[host]
+172.18.0.114
+172.18.0.113
diff --git a/data/my_key.pem b/data/my_key.pem
index ddf097e0..c7f92edb 100644
--- a/data/my_key.pem
+++ b/data/my_key.pem
@@ -1,27 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEA1gn04GbR4xZqRU9N4wp5+nlJxLTUO1o6X2XvAYvJeT+WczSt
-ghX5SE5EYCHaL2NoAaMpm6fXUMNAw/LdC5n2d6FzDKuvECmdChEUrFv2WTGleDJG
-uy3TjJQwMTZTC16ZV9MpBvkztEwxQf5PYjM2fAR3GJ27Lk9xZFeN4yB5NbK0AB2g
-PY8MMZfsvXKNgxci8a7MMnaGvSq3YeDIiB3S6QdUFUWW69JE/c69UkwUl9s1VWlA
-/j8GcoH5O1I2mlBfMj63QiYsQOcUEx3FSHoLqNeaDPCvRi0TEnTKRNtRln4Vg9Ky
-/TqGaB4ctj0IWZyFi30tME1o7n5z/JA/4A4AxQIDAQABAoIBAEq0au2vtW4HMsxC
-I7MswuozTxYC71hP47PMRiFKAuX41bAcILsYpEsiVicfaaHEllaL9kfHyxT7MS2z
-JIeaEzYp+ZfgjFedzpvm3kpSRqdW9q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vC+x
+/wYnn9qucgfK/iPzmOs5L0NA8R4F0gC88m9fJ2W6DSXT9AEgnWVaOLR1RPgkNdmc
++ZabjH0uysTAz0eC4NFJaUT+UUu3xvfGrBhZGncCgYEAkPQOc8pjcV2Acu5tp8Qm
+bEQep+7+KBpZRo/7hQRFi+u6EvbE/OvR/FvGJvcn6MrCkDxn4DE7fKGudGpdmeho
+7+y2R0Zj+3HcjXyIEi0Q9x+UxoxmRblyaRYly80LPo0xduYK7QFq+0m4vMy2J1/1
+ffabMq1NbXbdRaNdV14p9d0CgYEAwcGGOqMaDTDtqnCUZjZVbr5eFNMqPOqa2gzA
+BRBp7z9+n1bmEqQ834HMYEPQgQoCCbt4UIyeRAlL98V7P+2rnHe45XTYTNST212i
+5Iit++NyVjd2a8TtdsYIDqOQTWEo7i7stwseWUShdLdroTB1T2EMGS4qCw4WBn42
+j207GWsCgYAEEzJAEA90hE1OqxLmU54YxoenZCIYzuTwRpPKV8e09yWWtvvPV/z+
+pxLbAD7fH0KrfDUJcpG9yjRZPXYNFnSsGzaa69U5hUUVGJt+v/o0c8iQHxqjgYUz
+F41TE6oorp0Q5pPOy9Sy9ZBBKqGo6JxozCFp+w1XVm63bzNLKCR9DQ==
-----END RSA PRIVATE KEY-----
diff --git a/data/pushtoDB.py b/data/pushtoDB.py
new file mode 100644
index 00000000..fab78520
--- /dev/null
+++ b/data/pushtoDB.py
@@ -0,0 +1,23 @@
+import requests
+import json
+import os
+TEST_DB = 'http://213.77.62.197'
+
+
+
+def push_results_to_db(db_url=TEST_DB, case_name, logger=None, pod_name='dell-us-testing-bm-1', payload):
+ url = db_url + "/results"
+ installer = get_installer_type(logger)
+ params = {"project_name": "functest", "case_name": case_name,
+ "pod_name": os.environ[''], "installer": installer,
+ "version": git_version, "details": payload}
+
+ headers = {'Content-Type': 'application/json'}
+ try:
+ r = requests.post(url, data=json.dumps(params), headers=headers)
+ logger.debug(r)
+ return True
+ except:
+ print "Error:", sys.exc_info()[0]
+ return False
+
diff --git a/func/spawn_vm.py b/func/spawn_vm.py
index 39587b34..4723e999 100644
--- a/func/spawn_vm.py
+++ b/func/spawn_vm.py
@@ -23,6 +23,7 @@ from func.create_zones import create_zones
class SpawnVM(Env_setup):
vm_role_ip_dict = defaultdict(list)
+ installer = ''
def __init__(self, vm_info):
print 'SpawnVM Class initiated'
@@ -35,10 +36,28 @@ class SpawnVM(Env_setup):
nova =self. _get_nova_client()
azoneobj = create_zones()
azoneobj.create_agg(vm_info['availability_zone'])
- self.Heat_template1 = self.HeatTemplate_vm(vm_info)
+ installer= self.get_installer_type()
+ self.Heat_template1 = self.HeatTemplate_vm(vm_info,installer)
self.create_stack(vm_role_ip_dict, self.Heat_template1)
- def HeatTemplate_vm(self, vm_params):
+ def get_installer_type(self):
+ print 'Getting Installer Name'
+ return os.environ['INSTALLER_TYPE']
+
+ def get_public_network(self,installer_detected):
+
+ '''
+ TODO: GET THE NAMES OF THE PUBLIC NETWORKS for OTHER PROJECTS
+ '''
+ print 'Getting Public Network'
+ if installer_detected.lower() == 'fuel':
+ return 'net04_ext'
+ if installer_detected.lower() == 'apex':
+ return 'net04_ext'
+ if installer_detected.lower() == 'compass':
+ return 'net04_ext'
+
+ def HeatTemplate_vm(self, vm_params, installer):
try:
Heat_Dic=''
with open('./heat/SampleHeat.yaml', 'r+') as H_temp:
@@ -54,7 +73,9 @@ class SpawnVM(Env_setup):
fopenstr = fopenstr.rstrip()
scriptcmd = '#!/bin/bash \n echo {0} >> foo.txt \n echo {1} >> /root/.ssh/authorized_keys'.format(
fopenstr, fopenstr)
-
+
+ netName = self.get_public_network(installer)
+ print netName
Heat_Dic['heat_template_version'] = '2014-10-16'
Heat_Dic['resources']['KeyPairSavePrivate'] = {
'type': 'OS::Nova::KeyPair',
@@ -65,7 +86,8 @@ class SpawnVM(Env_setup):
}
Heat_Dic['parameters']['public_network'] = {
'type': 'string',
- 'default': vm_params['public_network'][0]
+ #'default': vm_params['public_network'][0]
+ 'default': netName
}
for x in range(1, len(vm_params['availability_zone']) + 1):
avail_zone = vm_params['availability_zone'][x - 1]
diff --git a/test_cases/dell-us-testing-bm-1/compute/dhrystone_bm.yaml b/test_cases/dell-us-testing-bm-1/compute/dhrystone_bm.yaml
index 022cf5ee..ffe7b7ff 100644
--- a/test_cases/dell-us-testing-bm-1/compute/dhrystone_bm.yaml
+++ b/test_cases/dell-us-testing-bm-1/compute/dhrystone_bm.yaml
@@ -7,7 +7,7 @@ Scenario:
Context:
Host_Machines:
machine_1:
- ip: 10.20.0.4
+ ip: 10.20.0.6
pw:
role: host
machine_2:
diff --git a/test_cases/dell-us-testing-bm-1/compute/dpi_bm.yaml b/test_cases/dell-us-testing-bm-1/compute/dpi_bm.yaml
index 27b6d863..b7347a69 100644
--- a/test_cases/dell-us-testing-bm-1/compute/dpi_bm.yaml
+++ b/test_cases/dell-us-testing-bm-1/compute/dpi_bm.yaml
@@ -5,11 +5,11 @@ Scenario:
Context:
Host_Machines:
machine_1:
- ip: 172.18.0.17
+ ip: 10.20.0.6
pw: Op3nStack
role: 1host
machine_2:
- ip: 172.18.0.16
+ ip: 10.20.0.5
pw: Op3nStack
role: 1host
Virtual_Machines:
diff --git a/test_cases/dell-us-testing-bm-1/compute/ssl_bm.yaml b/test_cases/dell-us-testing-bm-1/compute/ssl_bm.yaml
index bded6d2d..50c2f622 100644
--- a/test_cases/dell-us-testing-bm-1/compute/ssl_bm.yaml
+++ b/test_cases/dell-us-testing-bm-1/compute/ssl_bm.yaml
@@ -5,7 +5,7 @@ Scenario:
Context:
Host_Machines:
machine_1:
- ip: 10.20.0.4
+ ip: 10.20.0.6
pw:
role: 1Run
machine_2:
diff --git a/test_cases/dell-us-testing-bm-1/compute/whetstone_bm.yaml b/test_cases/dell-us-testing-bm-1/compute/whetstone_bm.yaml
index 136ac2b0..d4d2b244 100644
--- a/test_cases/dell-us-testing-bm-1/compute/whetstone_bm.yaml
+++ b/test_cases/dell-us-testing-bm-1/compute/whetstone_bm.yaml
@@ -7,7 +7,7 @@ Scenario:
Context:
Host_Machines:
machine_1:
- ip: 10.20.0.4
+ ip: 10.20.0.6
pw:
role: host
machine_2:
diff --git a/test_list/compute.txt b/test_list/compute.txt
index 044d8de6..6896da39 100644
--- a/test_list/compute.txt
+++ b/test_list/compute.txt
@@ -1,8 +1,5 @@
-dhrystone_bm.yaml
dhrystone_vm.yaml
+dhrystone_bm.yaml
whetstone_bm.yaml
-whetstone_vm.yaml
ssl_bm.yaml
-ssl_vm.yaml
dpi_bm.yaml
-dpi_vm.yaml