Remove unused funkload code
A couple of unneeded comments are also removed Change-Id: Icb0597921963d0bee4168c56cf365200d5baa2a5
This commit is contained in:
parent
2163b308b5
commit
f058dead1e
|
@ -63,8 +63,6 @@ class MagnetoDBTestCase(tempest.test.BaseTestCase):
|
|||
]
|
||||
cls.index_attrs = [
|
||||
{'attribute_name': 'last_posted_by', 'attribute_type': 'S'},
|
||||
# {'attribute_name': 'message', 'attribute_type': 'S'},
|
||||
# {'attribute_name': 'replies', 'attribute_type': 'N'}
|
||||
]
|
||||
cls.smoke_schema = [
|
||||
{'attribute_name': cls.hashkey, 'key_type': 'HASH'},
|
||||
|
|
|
@ -1,98 +0,0 @@
|
|||
# FunkLoad test configuration file
|
||||
# $Id: $
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Main section
|
||||
#
|
||||
[main]
|
||||
title=DynamoDb Test #1
|
||||
description=get item
|
||||
url=http://localhost/index.html
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Tests description and configuration
|
||||
#
|
||||
[test1]
|
||||
description=[test1]description
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Credential access
|
||||
#
|
||||
#[credential]
|
||||
#host=localhost
|
||||
#port=8007
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Monitoring configuration
|
||||
#
|
||||
[monitor]
|
||||
hosts=localhost
|
||||
|
||||
# Each host in [monitor]hosts should have a section
|
||||
# with a 'port' and 'description' keys
|
||||
[localhost]
|
||||
port=8008
|
||||
description=The benching and benched machine
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Configuration for unit test mode fl-run-test
|
||||
#
|
||||
[ftest]
|
||||
|
||||
# log_to destination =
|
||||
# console - to the screen
|
||||
# file - to a file
|
||||
log_to =
|
||||
# console file
|
||||
|
||||
# log_path = path and file name to store log file
|
||||
log_path = simple-test.log
|
||||
|
||||
# result_path = path to store the xml result file
|
||||
result_path = simple-test.xml
|
||||
|
||||
# ok_codes = list of successfull HTTP response code
|
||||
#ok_codes = 200:301:302
|
||||
|
||||
# sleeptime_min = minimum amount of time in seconds to sleep between requests
|
||||
# to the host
|
||||
sleep_time_min = 0
|
||||
|
||||
# sleeptime_max = maximum amount of time in seconds to sleep between requests
|
||||
# to the host
|
||||
sleep_time_max = 0
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Configuration for bench mode fl-run-bench
|
||||
#
|
||||
[bench]
|
||||
|
||||
# cycles = list of cycles with their number of concurrent users
|
||||
cycles = 20:50:100
|
||||
|
||||
# duration = duration of a cycle in seconds
|
||||
duration = 180
|
||||
|
||||
# startup_delay = time to wait between starting-up threads in seconds
|
||||
startup_delay = 0.01
|
||||
|
||||
# sleep_time = time to wait between test in seconds
|
||||
sleep_time = 0.01
|
||||
|
||||
# cycle_time = time to wait between cycle in seconds
|
||||
cycle_time = 1
|
||||
|
||||
# same keys than in [ftest] section
|
||||
log_to =
|
||||
log_path = simple-bench.log
|
||||
result_path = simple-bench.xml
|
||||
#ok_codes = 200:301:302
|
||||
sleep_time_min = 0
|
||||
sleep_time_max = 0.5
|
||||
|
||||
[distribute]
|
||||
log_path = log-distributed
|
||||
funkload_location=http://pypi.python.org/packages/source/f/funkload/funkload-1.16.1.tar.gz
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
# Copyright 2014 Mirantis Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from funkload.FunkLoadDocTest import FunkLoadTestCase
|
||||
from boto.dynamodb2.layer1 import DynamoDBConnection
|
||||
from tempest.common.utils.data_utils import rand_name
|
||||
from tempest.common.utils.data_utils import rand_uuid
|
||||
import unittest
|
||||
import random
|
||||
|
||||
|
||||
class LoadTest1(FunkLoadTestCase):
|
||||
|
||||
@classmethod
|
||||
def do_preconditions(cls):
|
||||
|
||||
cls.attrs = [
|
||||
{"AttributeName": "user_id", "AttributeType": "S"},
|
||||
{"AttributeName": "date_message_id", "AttributeType": "S"},
|
||||
{"AttributeName": "message_id", "AttributeType": "S"},
|
||||
{"AttributeName": "from_header", "AttributeType": "S"},
|
||||
{"AttributeName": "to_header", "AttributeType": "S"},
|
||||
]
|
||||
cls.gsi = None
|
||||
cls.lsi = [
|
||||
{
|
||||
"IndexName": "message_id_index",
|
||||
"KeySchema": [
|
||||
{"AttributeName": "user_id", "KeyType": "HASH"},
|
||||
{"AttributeName": "message_id", "KeyType": "RANGE"}
|
||||
],
|
||||
"Projection": {"ProjectionType": "ALL"}
|
||||
},
|
||||
{
|
||||
"IndexName": "from_header_index",
|
||||
"KeySchema": [
|
||||
{"AttributeName": "user_id", "KeyType": "HASH"},
|
||||
{"AttributeName": "from_header", "KeyType": "RANGE"}
|
||||
],
|
||||
"Projection": {"ProjectionType": "ALL"}
|
||||
},
|
||||
{
|
||||
"IndexName": "to_header_index",
|
||||
"KeySchema": [
|
||||
{"AttributeName": "user_id", "KeyType": "HASH"},
|
||||
{"AttributeName": "to_header", "KeyType": "RANGE"}
|
||||
],
|
||||
"Projection": {"ProjectionType": "ALL"}
|
||||
},
|
||||
]
|
||||
cls.schema = [
|
||||
{"AttributeName": "user_id", "KeyType": "HASH"},
|
||||
{"AttributeName": "date_message_id", "KeyType": "RANGE"}
|
||||
]
|
||||
cls.throughput = {
|
||||
"ReadCapacityUnits": 1,
|
||||
"WriteCapacityUnits": 1
|
||||
}
|
||||
cls.table_name = rand_name().replace('-', '')
|
||||
|
||||
cls.connection_data = {
|
||||
'aws_access_key_id': '',
|
||||
'aws_secret_access_key': '',
|
||||
'region': 'magnetodb-1',
|
||||
'host': '172.18.169.204',
|
||||
'port': '8080',
|
||||
'is_secure': False
|
||||
}
|
||||
cls.conn = DynamoDBConnection(**cls.connection_data)
|
||||
|
||||
if cls.table_name not in cls.conn.list_tables()['TableNames']:
|
||||
cls.conn.create_table(cls.attrs,
|
||||
cls.table_name,
|
||||
cls.schema,
|
||||
cls.throughput,
|
||||
cls.lsi,
|
||||
cls.gsi)
|
||||
|
||||
cls.user_id = 'user@mail.com'
|
||||
cls.date = '2013-12-31'
|
||||
cls.message_id = '123456'
|
||||
cls.date_message_id = '{}#{}'.format(cls.date, cls.message_id)
|
||||
cls.key = {'user_id': {'S': cls.user_id},
|
||||
'date_message_id': {'S': cls.date_message_id}}
|
||||
|
||||
item = cls.build_spam_item(cls.user_id, cls.date_message_id,
|
||||
cls.message_id, 'from@mail.com',
|
||||
'to@mail.com')
|
||||
cls.conn.put_item(cls.table_name, item)
|
||||
|
||||
@classmethod
|
||||
def do_postconditions(cls):
|
||||
cls.conn.delete_table(cls.table_name)
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""
|
||||
Method is called only if functional test is run.
|
||||
For benchmark setUpBench is run instead.
|
||||
"""
|
||||
super(LoadTest1, cls).setUpClass()
|
||||
cls.do_preconditions()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cls.do_postconditions()
|
||||
|
||||
def setUpBench(self):
|
||||
self.do_preconditions()
|
||||
|
||||
def tearDownBench(self):
|
||||
self.do_postconditions()
|
||||
|
||||
@staticmethod
|
||||
def build_spam_item(user_id, date_message_id, message_id,
|
||||
from_header, to_header):
|
||||
return {
|
||||
"user_id": {"S": user_id},
|
||||
"date_message_id": {"S": date_message_id},
|
||||
"message_id": {"S": message_id},
|
||||
"from_header": {"S": from_header},
|
||||
"to_header": {"S": to_header},
|
||||
}
|
||||
|
||||
def populate_spam_table(self, table_name, usercount, itemcount):
|
||||
|
||||
dates = ['2013-12-0%sT16:00:00.000001' % i for i in range(1, 8)]
|
||||
from_headers = ["%s@mail.com" % rand_name() for _ in range(10)]
|
||||
to_headers = ["%s@mail.com" % rand_name() for _ in range(10)]
|
||||
emails = []
|
||||
|
||||
new_items = []
|
||||
for _ in range(usercount):
|
||||
email = "%s@mail.com" % rand_name()
|
||||
emails.append(email)
|
||||
|
||||
for item in range(itemcount):
|
||||
message_id = rand_uuid()
|
||||
date = random.choice(dates)
|
||||
# put item
|
||||
item = {
|
||||
"user_id": {"S": email},
|
||||
"date_message_id": {"S": date + "#" + message_id},
|
||||
"message_id": {"S": message_id},
|
||||
"from_header": {"S": random.choice(from_headers)},
|
||||
"to_header": {"S": random.choice(to_headers)},
|
||||
}
|
||||
new_items.append(item)
|
||||
self.conn.put_item(table_name, item)
|
||||
return new_items
|
||||
|
||||
def test_load_describe_table(self):
|
||||
resp = self.conn.describe_table(self.table_name)
|
||||
self.assertTrue(resp['Table']['TableName'] == self.table_name)
|
||||
|
||||
def test_load_list_tables(self):
|
||||
self.conn.list_tables()
|
||||
|
||||
def test_load_get_item(self):
|
||||
resp = self.conn.get_item(self.table_name, self.key)
|
||||
assert "Item" in resp
|
||||
|
||||
|
||||
if __name__ in ('main', '__main__'):
|
||||
unittest.main()
|
|
@ -1,6 +1,5 @@
|
|||
boto>=2.32.1
|
||||
discover
|
||||
funkload
|
||||
hacking>=0.9.2,<0.10
|
||||
httplib2>=0.7.5
|
||||
mock>=1.0
|
||||
|
@ -13,4 +12,4 @@ sphinxcontrib-httpdomain
|
|||
testresources>=0.2.4
|
||||
testrepository>=0.0.18
|
||||
testtools>=0.9.36
|
||||
wsgi_intercept>=0.6.1
|
||||
wsgi_intercept>=0.6.1
|
||||
|
|
Loading…
Reference in New Issue