Fix issue with incorrect uploading packages

Fixed issue with incorrect uploading packages
in engine's functional tests setUpClass.

Change-Id: I0748d9d96c1c692109f39318a64de2ca8a71a94e
This commit is contained in:
Sergey Murashov 2014-06-09 15:53:25 +04:00
parent 45f002010a
commit 64c0f52751
3 changed files with 20 additions and 25 deletions

View File

@ -20,7 +20,6 @@ import testtools
import time
import uuid
from glanceclient import Client as gclient
from keystoneclient.v2_0 import client as ksclient
import functionaltests.engine.config as cfg
@ -43,24 +42,6 @@ class Client(object):
'Content-type': 'application/json'
}
glance_endpoint = \
self.auth.service_catalog.url_for(service_type='image',
endpoint_type='publicURL')
glance = gclient('1', endpoint=glance_endpoint,
token=self.auth.auth_token)
for i in glance.images.list():
if 'murano_image_info' in i.properties.keys():
if 'linux' == json.loads(
i.properties['murano_image_info'])['type']:
self.linux = i.name
elif 'windows' in json.loads(
i.properties['murano_image_info'])['type']:
self.windows = i.name
elif 'demo' in json.loads(
i.properties['murano_image_info'])['type']:
self.demo = i.name
def create_environment(self, name):
post_body = {'name': name}
resp = requests.post(self.endpoint + 'environments',
@ -133,6 +114,9 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
auth_url=CONF.murano.auth_url,
murano_url=CONF.murano.murano_url)
cls.linux = CONF.murano.linux_image
cls.windows = CONF.murano.windows_image
cls.location = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
@ -147,10 +131,13 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
endpoint=CONF.murano.murano_url,
url='catalog/packages')
headers = cls.client.headers.copy()
del headers['Content-type']
return requests.post(request_url,
files=files,
data=post_body,
headers=cls.client.headers).json()['id']
headers=headers).json()['id']
cls.postgre_id = upload_package(
'PostgreSQL',
@ -191,7 +178,7 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
post_body = {
"instance": {
"flavor": "m1.medium",
"image": self.client.linux,
"image": self.linux,
"?": {
"type": "io.murano.resources.LinuxMuranoInstance",
"id": str(uuid.uuid4())
@ -225,7 +212,7 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
post_body = {
"instance": {
"flavor": "m1.medium",
"image": self.client.linux,
"image": self.linux,
"?": {
"type": "io.murano.resources.LinuxMuranoInstance",
"id": str(uuid.uuid4())
@ -259,7 +246,7 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
post_body = {
"instance": {
"flavor": "m1.medium",
"image": self.client.linux,
"image": self.linux,
"?": {
"type": "io.murano.resources.LinuxMuranoInstance",
"id": str(uuid.uuid4())
@ -293,7 +280,7 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
post_body = {
"instance": {
"flavor": "m1.medium",
"image": self.client.linux,
"image": self.linux,
"?": {
"type": "io.murano.resources.LinuxMuranoInstance",
"id": str(uuid.uuid4())

View File

@ -4,3 +4,5 @@ user = admin
password = admin
tenant = admin
murano_url = http://127.0.0.1:8082/v1/
linux_image = default_linux
windows_image = default_windows

View File

@ -34,7 +34,13 @@ MuranoGroup = [
help='keystone tenant'),
cfg.StrOpt('murano_url',
default='http://127.0.0.1:8082/v1/',
help="murano url")
help="murano url"),
cfg.StrOpt('linux_image',
default='default_linux',
help="image for linux services"),
cfg.StrOpt('windows_image',
default='default_windows',
help="image for windows services")
]