Add ccp show dependency tests

- Add ccp show-dep component tests
    - Add ccp show-dep error code tests
    - Add string helpers for simpler command execution result processing

Change-Id: I84d3329060f225e91c2e5ace3ebbdf441824e794
This commit is contained in:
ydehtiarov
2016-08-22 15:08:50 +03:00
parent b4be1413a8
commit 8a8e408d25
4 changed files with 275 additions and 3 deletions

View File

@@ -25,7 +25,6 @@ import yaml
from fuel_ccp_tests import logger
from fuel_ccp_tests import settings
LOG = logger.logger
@@ -35,7 +34,6 @@ def get_test_method_name():
def update_yaml(yaml_tree=None, yaml_value='', is_uniq=True,
yaml_file=settings.TIMESTAT_PATH_YAML):
"""Store/update a variable in YAML file.
yaml_tree - path to the variable in YAML file, will be created if absent,
@@ -122,6 +120,25 @@ class TimeStat(object):
return time.time() - self.begin_time
def reduce_occurrences(items, text):
""" Return string without items(substrings)
Args:
items: iterable of strings
test: string
Returns:
string
Raise:
AssertionError if any substing not present in source text
"""
for item in items:
LOG.debug(
"Verifying string {} is shown in "
"\"\"\"\n{}\n\"\"\"".format(item, text))
assert text.count(item) != 0
text = text.replace(item, "", 1)
return text
def generate_keys():
key = paramiko.RSAKey.generate(1024)
public = key.get_base64()