Remove UNICODE_MESSAGES template
https://review.openstack.org/#/c/537328/ moves this template to monasca-common * add monasca-common dependency Change-Id: I99307314a75b2cb49a75d9c83247ccaf339123a9 Story: 2001400 Task: 12525
This commit is contained in:
parent
368fde9c08
commit
bfad66aebd
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,6 +38,7 @@ nosetests.xml
|
|||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
.project
|
.project
|
||||||
.pydevproject
|
.pydevproject
|
||||||
|
.idea/
|
||||||
|
|
||||||
# Complexity
|
# Complexity
|
||||||
output/*.html
|
output/*.html
|
||||||
|
@ -14,12 +14,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import codecs
|
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
|
||||||
from tempest.common import credentials_factory as cred_factory
|
from tempest.common import credentials_factory as cred_factory
|
||||||
from tempest import exceptions
|
from tempest import exceptions
|
||||||
from tempest import test
|
from tempest import test
|
||||||
@ -122,61 +120,3 @@ class BaseLogsTestCase(test.BaseTestCase):
|
|||||||
method(resource_id)
|
method(resource_id)
|
||||||
except exceptions.EndpointNotFound:
|
except exceptions.EndpointNotFound:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _hex_to_unicode(hex_raw):
|
|
||||||
hex_raw = six.b(hex_raw.replace(' ', ''))
|
|
||||||
hex_str_raw = codecs.getdecoder('hex')(hex_raw)[0]
|
|
||||||
hex_str = hex_str_raw.decode('utf-8', 'replace')
|
|
||||||
return hex_str
|
|
||||||
|
|
||||||
# NOTE(trebskit) => http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
|
|
||||||
UNICODE_MESSAGES = [
|
|
||||||
# Unicode is evil...
|
|
||||||
{'case': 'arabic', 'input': 'يونيكود هو الشر'},
|
|
||||||
{'case': 'polish', 'input': 'Unicode to zło'},
|
|
||||||
{'case': 'greek', 'input': 'Unicode είναι κακό'},
|
|
||||||
{'case': 'portuguese', 'input': 'Unicode é malvado'},
|
|
||||||
{'case': 'lao', 'input': 'unicode ເປັນຄວາມຊົ່ວຮ້າຍ'},
|
|
||||||
{'case': 'german', 'input': 'Unicode ist böse'},
|
|
||||||
{'case': 'japanese', 'input': 'ユニコードは悪です'},
|
|
||||||
{'case': 'russian', 'input': 'Unicode - зло'},
|
|
||||||
{'case': 'urdu', 'input': 'یونیسیڈ برائی ہے'},
|
|
||||||
{'case': 'weird', 'input': '🆄🅽🅸🅲🅾🅳🅴 🅸🆂 🅴🆅🅸🅻...'}, # funky, huh ?
|
|
||||||
# conditions from link above
|
|
||||||
# 2.3 Other boundary conditions
|
|
||||||
{'case': 'stress_2_3_1', 'input': _hex_to_unicode('ed 9f bf')},
|
|
||||||
{'case': 'stress_2_3_2', 'input': _hex_to_unicode('ee 80 80')},
|
|
||||||
{'case': 'stress_2_3_3', 'input': _hex_to_unicode('ef bf bd')},
|
|
||||||
{'case': 'stress_2_3_4', 'input': _hex_to_unicode('f4 8f bf bf')},
|
|
||||||
{'case': 'stress_2_3_5', 'input': _hex_to_unicode('f4 90 80 80')},
|
|
||||||
# 3.5 Impossible byes
|
|
||||||
{'case': 'stress_3_5_1', 'input': _hex_to_unicode('fe')},
|
|
||||||
{'case': 'stress_3_5_2', 'input': _hex_to_unicode('ff')},
|
|
||||||
{'case': 'stress_3_5_3', 'input': _hex_to_unicode('fe fe ff ff')},
|
|
||||||
# 4.1 Examples of an overlong ASCII character
|
|
||||||
{'case': 'stress_4_1_1', 'input': _hex_to_unicode('c0 af')},
|
|
||||||
{'case': 'stress_4_1_2', 'input': _hex_to_unicode('e0 80 af')},
|
|
||||||
{'case': 'stress_4_1_3', 'input': _hex_to_unicode('f0 80 80 af')},
|
|
||||||
{'case': 'stress_4_1_4', 'input': _hex_to_unicode('f8 80 80 80 af')},
|
|
||||||
{'case': 'stress_4_1_5', 'input': _hex_to_unicode('fc 80 80 80 80 af')},
|
|
||||||
# 4.2 Maximum overlong sequences
|
|
||||||
{'case': 'stress_4_2_1', 'input': _hex_to_unicode('c1 bf')},
|
|
||||||
{'case': 'stress_4_2_2', 'input': _hex_to_unicode('e0 9f bf')},
|
|
||||||
{'case': 'stress_4_2_3', 'input': _hex_to_unicode('f0 8f bf bf')},
|
|
||||||
{'case': 'stress_4_2_4', 'input': _hex_to_unicode('f8 87 bf bf bf')},
|
|
||||||
{'case': 'stress_4_2_5', 'input': _hex_to_unicode('fc 83 bf bf bf bf')},
|
|
||||||
# 4.3 Overlong representation of the NUL character
|
|
||||||
{'case': 'stress_4_3_1', 'input': _hex_to_unicode('c0 80')},
|
|
||||||
{'case': 'stress_4_3_2', 'input': _hex_to_unicode('e0 80 80')},
|
|
||||||
{'case': 'stress_4_3_3', 'input': _hex_to_unicode('f0 80 80 80')},
|
|
||||||
{'case': 'stress_4_3_4', 'input': _hex_to_unicode('f8 80 80 80 80')},
|
|
||||||
{'case': 'stress_4_3_5', 'input': _hex_to_unicode('fc 80 80 80 80 80')},
|
|
||||||
# and some cheesy example from polish novel 'Pan Tadeusz'
|
|
||||||
{'case': 'mr_t', 'input': 'Hajże na Soplicę!'},
|
|
||||||
# it won't be complete without that one
|
|
||||||
{'case': 'mr_b', 'input': 'Grzegorz Brzęczyszczykiewicz, '
|
|
||||||
'Chrząszczyżewoszyce, powiat Łękołody'},
|
|
||||||
# great success, christmas time
|
|
||||||
{'case': 'olaf', 'input': '☃'}
|
|
||||||
]
|
|
||||||
|
@ -15,11 +15,12 @@
|
|||||||
from tempest.lib.common.utils import test_utils
|
from tempest.lib.common.utils import test_utils
|
||||||
from tempest.lib import decorators
|
from tempest.lib import decorators
|
||||||
|
|
||||||
|
from monasca_common.tests.validation import test_metric_validation
|
||||||
from monasca_tempest_tests.tests.log_api import base
|
from monasca_tempest_tests.tests.log_api import base
|
||||||
|
|
||||||
_RETRY_COUNT = 15
|
_RETRY_COUNT = 15
|
||||||
_RETRY_WAIT = 2
|
_RETRY_WAIT = 2
|
||||||
_UNICODE_CASES = base.UNICODE_MESSAGES
|
_UNICODE_CASES = test_metric_validation.UNICODE_MESSAGES
|
||||||
|
|
||||||
|
|
||||||
class TestUnicodeV3(base.BaseLogsTestCase):
|
class TestUnicodeV3(base.BaseLogsTestCase):
|
||||||
|
@ -10,3 +10,4 @@ oslo.utils>=3.33.0 # Apache-2.0
|
|||||||
tempest>=17.1.0 # Apache-2.0
|
tempest>=17.1.0 # Apache-2.0
|
||||||
oslotest>=3.2.0 # Apache-2.0
|
oslotest>=3.2.0 # Apache-2.0
|
||||||
mock>=2.0.0 # BSD
|
mock>=2.0.0 # BSD
|
||||||
|
monasca-common>=2.8.0 # Apache-2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user