Skip to content

Instantly share code, notes, and snippets.

@mbukatov
Last active June 20, 2019 18:32
Show Gist options
  • Save mbukatov/31b5df93ae194fa4048c225264d6fad9 to your computer and use it in GitHub Desktop.
Save mbukatov/31b5df93ae194fa4048c225264d6fad9 to your computer and use it in GitHub Desktop.

Evidence related to fixing accidental changes in mutable default structures #265

With master branch:

$ grep KeyError: report.master-ff0206c.format.xml
E               KeyError: 'root[895]root[896]'
    <failure message="KeyError: 'userID'">self =
&lt;tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7ff90e40d7b8&gt;,
test_fixture = None
E       KeyError: 'userID'
    <failure message="KeyError: 'kubernetes'">self =
&lt;tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7ff912b44080&gt;
E       KeyError: 'kubernetes'
E           KeyError: 'kubernetes'
E           KeyError: 'kubernetes'

With proposed fixes:

$ grep KeyError: report.few_fixes-8ed5847.format.xml
E               KeyError: 'root[897]root[898]'
<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="6" failures="4" name="pytest" skipped="0" tests="12" time="589.036">
<properties>
<property name="polarion-projct-id" value="OpenShiftContainerStorage"/>
</properties>
<testcase classname="tests.test_foo.TestPvCreation" file="tests/test_foo.py" line="14" name="test_foo_bar" time="0.003">
<system-out>#x1B[1m
collected 20 items / 10 deselected / 10 selected #x1B[0m
tests/test_foo.py::TestPvCreation::test_foo_bar </system-out>
</testcase>
<testcase classname="tests.test_foo.TestPvCreation" file="tests/test_foo.py" line="19" name="test_foo_baz" time="0.001">
<properties>
<property name="polarion-testcase-id" value="BAR-122"/>
</properties>
</testcase>
<testcase classname="tests.manage.test_create_storageclass_with_same_name.TestCaseOCS322" file="tests/manage/test_create_storageclass_with_same_name.py" line="97" name="test_create_storageclass_with_same_name" time="56.083">
<properties>
<property name="polarion-testcase-id" value="OCS-322"/>
</properties>
</testcase>
<testcase classname="tests.manage.test_ocs_324.TestCaseOCS324" file="tests/manage/test_ocs_324.py" line="87" name="test_pvc_delete_create_same_name[CephBlockPool]" time="102.166">
<failure message="ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)">self = &lt;tests.manage.test_ocs_324.TestCaseOCS324 object at 0x7f9e5ca9ca90&gt;, test_fixture = None
def test_pvc_delete_create_same_name(self, test_fixture):
"""
TC OCS 324
"""
global PVC_OBJ
&gt; PVC_OBJ = helpers.create_pvc(sc_name=self.sc_obj.name)
tests/manage/test_ocs_324.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/helpers.py:224: in create_pvc
desired_status=constants.STATUS_BOUND, **pvc_data
tests/helpers.py:62: in create_resource
condition=desired_status, resource_name=resource_name
ocs/ocp.py:237: in wait_for_resource
timeout, sleep, self.get, resource_name, True, selector
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;utility.utils.TimeoutSampler object at 0x7f9e5c9c5278&gt;
def __iter__(self):
if self.start_time is None:
self.start_time = time.time()
while True:
self.last_sample_time = time.time()
try:
yield self.func(*self.func_args, **self.func_kwargs)
except Exception:
pass
if self.timeout &lt; (time.time() - self.start_time):
&gt; raise self.timeout_exc_cls(*self.timeout_exc_args)
E ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)
utility/utils.py:922: TimeoutExpiredError</failure>
</testcase>
<testcase classname="tests.manage.test_ocs_324.TestCaseOCS324" file="tests/manage/test_ocs_324.py" line="87" name="test_pvc_delete_create_same_name[CephBlockPool]" time="0.002">
<properties>
<property name="polarion-testcase-id" value="OCS-324"/>
</properties>
<error message="test teardown failure">request = &lt;SubRequest 'test_fixture' for &lt;Function test_pvc_delete_create_same_name[CephBlockPool]&gt;&gt;
@pytest.fixture(params=[constants.CEPHBLOCKPOOL, constants.CEPHFILESYSTEM])
def test_fixture(request):
"""
Parametrized fixture which allows test to be run for different CEPH
interface.
The test will run for each interface provided in params.
"""
self = request.node.cls
self.interface_type = request.param
setup(self)
yield
&gt; teardown(self)
tests/manage/test_ocs_324.py:28:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;class 'tests.manage.test_ocs_324.TestCaseOCS324'&gt;
def teardown(self):
"""
Deletes the resources for the type of interface used.
"""
logger.info(f"Deleting resources for {self.interface_type} interface")
&gt; PVC_OBJ.delete()
E AttributeError: 'NoneType' object has no attribute 'delete'
tests/manage/test_ocs_324.py:69: AttributeError</error>
</testcase>
<testcase classname="tests.manage.test_ocs_324.TestCaseOCS324" file="tests/manage/test_ocs_324.py" line="87" name="test_pvc_delete_create_same_name[CephFileSystem]" time="40.192">
<properties>
<property name="polarion-testcase-id" value="OCS-324"/>
</properties>
<error message="test setup failure">request = &lt;SubRequest 'test_fixture' for &lt;Function test_pvc_delete_create_same_name[CephFileSystem]&gt;&gt;
@pytest.fixture(params=[constants.CEPHBLOCKPOOL, constants.CEPHFILESYSTEM])
def test_fixture(request):
"""
Parametrized fixture which allows test to be run for different CEPH
interface.
The test will run for each interface provided in params.
"""
self = request.node.cls
self.interface_type = request.param
&gt; setup(self)
tests/manage/test_ocs_324.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/manage/test_ocs_324.py:50: in setup
assert helpers.create_cephfilesystem(), (
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def create_cephfilesystem():
"""
Function for deploying CephFileSystem (MDS)
Returns:
bool: True if CephFileSystem creates successful
"""
fs_data = copy.deepcopy(defaults.CEPHFILESYSTEM_DICT)
fs_data['metadata']['name'] = create_unique_resource_name(
'test', 'cephfs'
)
fs_data['metadata']['namespace'] = config.ENV_DATA['cluster_namespace']
global CEPHFS_OBJ
CEPHFS_OBJ = OCS(**fs_data)
CEPHFS_OBJ.create()
POD = pod.get_all_pods(
namespace=defaults.ROOK_CLUSTER_NAMESPACE
)
for pod_names in POD:
if 'rook-ceph-mds' in pod_names.labels.values():
assert pod_names.ocp.wait_for_resource(
condition=constants.STATUS_RUNNING,
selector='app=rook-ceph-mds'
)
&gt; assert validate_cephfilesystem(fs_name=fs_data['metadata']['name'])
E AssertionError
tests/helpers.py:414: AssertionError</error>
<error message="test teardown failure">tp = &lt;class 'KeyError'&gt;, value = None, tb = None
def reraise(tp, value, tb=None):
try:
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
&gt; raise value
venv/lib64/python3.7/site-packages/six.py:693:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def get_status_after_execution():
"""
"""
ENV_STATUS_POST['pod'] = POD.get(all_namespaces=True)['items']
ENV_STATUS_POST['sc'] = SC.get(all_namespaces=True)['items']
ENV_STATUS_POST['cephfs'] = CEPHFILESYSTEM.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['cephbp'] = CEPHBLOCKPOOL.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['pv'] = PV.get(all_namespaces=True)['items']
ENV_STATUS_POST['pvc'] = PVC.get(all_namespaces=True)['items']
ENV_STATUS_POST['secret'] = SECRET.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['namespace'] = NS.get(
all_namespaces=True
)['items']
pod_diff = DeepDiff(
ENV_STATUS_PRE['pod'], ENV_STATUS_POST['pod']
)
sc_diff = DeepDiff(
ENV_STATUS_PRE['sc'], ENV_STATUS_POST['sc']
)
cephfs_diff = DeepDiff(
ENV_STATUS_PRE['cephfs'], ENV_STATUS_POST['cephfs']
)
cephbp_diff = DeepDiff(
ENV_STATUS_PRE['cephbp'], ENV_STATUS_POST['cephbp']
)
pv_diff = DeepDiff(
ENV_STATUS_PRE['pv'], ENV_STATUS_POST['pv']
)
pvc_diff = DeepDiff(
ENV_STATUS_PRE['pvc'], ENV_STATUS_POST['pvc']
)
secret_diff = DeepDiff(
ENV_STATUS_PRE['secret'], ENV_STATUS_POST['secret']
)
namespace_diff = DeepDiff(
ENV_STATUS_PRE['namespace'], ENV_STATUS_POST['namespace']
)
diffs_dict = {
'pods': pod_diff,
'sc': sc_diff,
'cephfs': cephfs_diff,
'cephbp': cephbp_diff,
'pvs': pv_diff,
'pvcs': pvc_diff,
'secret': secret_diff,
'ns': namespace_diff,
}
leftover_detected = False
leftovers = {'Leftovers added': [], 'Leftovers removed': []}
for kind, kind_diff in diffs_dict.items():
if ADDED_RESOURCE in kind_diff:
leftovers['Leftovers added'].append({
kind: kind_diff[ADDED_RESOURCE][
&gt; ''.join(kind_diff[ADDED_RESOURCE])
]
})
E KeyError: 'root[897]root[898]'
utility/environment_check.py:128: KeyError</error>
</testcase>
<testcase classname="tests.manage.test_ocs_336_346.TestOSCBasics" file="tests/manage/test_ocs_336_346.py" line="69" name="test_ocs_336" time="42.405">
<properties>
<property name="polarion-testcase-id" value="OCS-336"/>
</properties>
<failure message="ocs.exceptions.CommandFailed: Error during execution of command: ['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', 'create', '-f', '/tmp/Secret6goum85m', '-o', 'yaml']. Error is Error from server (AlreadyExists): error when creating &quot;/tmp/Secret6goum85m&quot;: secrets &quot;csi-cephfs-secret&quot; already exists">self = &lt;tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7f9e5cb89c88&gt;, test_fixture = None
@pytest.mark.polarion_id("OCS-336")
def test_ocs_336(self, test_fixture):
"""
Testing basics: secret creation,
storage class creation and pvc with cephfs
"""
self.cephfs_secret = copy.deepcopy(defaults.CSI_CEPHFS_SECRET)
del self.cephfs_secret['data']['userID']
del self.cephfs_secret['data']['userKey']
self.cephfs_secret['data']['adminKey'] = (
get_admin_key_from_ceph_tools()
)
self.cephfs_secret['data']['adminID'] = constants.ADMIN_BASE64
logging.info(self.cephfs_secret)
secret = OCS(**self.cephfs_secret)
&gt; secret.create()
tests/manage/test_ocs_336_346.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
resources/ocs.py:84: in create
status = self.ocp.create(yaml_file=self.temp_yaml.name)
ocs/ocp.py:132: in create
return self.exec_oc_cmd(command)
ocs/ocp.py:66: in exec_oc_cmd
out = run_cmd(cmd=oc_cmd)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cmd = ['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', 'create', ...], kwargs = {}
r = CompletedProcess(args=['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', '... from server (AlreadyExists): error when creating "/tmp/Secret6goum85m": secrets "csi-cephfs-secret" already exists\n')
def run_cmd(cmd, **kwargs):
"""
Run an arbitrary command locally
Args:
cmd (str): command to run
Raises:
CommandFailed: In case the command execution fails
Returns:
(str) Decoded stdout of command
"""
log.info(f"Executing command: {cmd}")
if isinstance(cmd, str):
cmd = shlex.split(cmd)
r = subprocess.run(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
**kwargs
)
log.debug(f"CMD output: {r.stdout.decode()}")
if r.stderr:
log.error(f"CMD error:: {r.stderr.decode()}")
if r.returncode:
raise CommandFailed(
&gt; f"Error during execution of command: {cmd}."
f"\nError is {r.stderr.decode()}"
)
E ocs.exceptions.CommandFailed: Error during execution of command: ['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', 'create', '-f', '/tmp/Secret6goum85m', '-o', 'yaml'].
E Error is Error from server (AlreadyExists): error when creating "/tmp/Secret6goum85m": secrets "csi-cephfs-secret" already exists
utility/utils.py:657: CommandFailed</failure>
</testcase>
<testcase classname="tests.manage.test_ocs_336_346.TestOSCBasics" file="tests/manage/test_ocs_336_346.py" line="101" name="test_ocs_346" time="32.359">
<properties>
<property name="polarion-testcase-id" value="OCS-346"/>
</properties>
<failure message="ocs.exceptions.CommandFailed: Error during execution of command: ['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', 'create', '-f', '/tmp/Secret4poz3_hk', '-o', 'yaml']. Error is Error from server (AlreadyExists): error when creating &quot;/tmp/Secret4poz3_hk&quot;: secrets &quot;csi-rbd-secret&quot; already exists">self = &lt;tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7f9e5cb61940&gt;
@pytest.mark.polarion_id("OCS-346")
def test_ocs_346(self):
"""
Testing basics: secret creation,
storage class creation and pvc with rbd
"""
self.rbd_secret = copy.deepcopy(defaults.CSI_RBD_SECRET)
del self.rbd_secret['data']['kubernetes']
self.rbd_secret['data']['admin'] = get_admin_key_from_ceph_tools()
logging.info(self.rbd_secret)
secret = OCS(**self.rbd_secret)
&gt; secret.create()
tests/manage/test_ocs_336_346.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
resources/ocs.py:84: in create
status = self.ocp.create(yaml_file=self.temp_yaml.name)
ocs/ocp.py:132: in create
return self.exec_oc_cmd(command)
ocs/ocp.py:66: in exec_oc_cmd
out = run_cmd(cmd=oc_cmd)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cmd = ['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', 'create', ...], kwargs = {}
r = CompletedProcess(args=['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', '...ror from server (AlreadyExists): error when creating "/tmp/Secret4poz3_hk": secrets "csi-rbd-secret" already exists\n')
def run_cmd(cmd, **kwargs):
"""
Run an arbitrary command locally
Args:
cmd (str): command to run
Raises:
CommandFailed: In case the command execution fails
Returns:
(str) Decoded stdout of command
"""
log.info(f"Executing command: {cmd}")
if isinstance(cmd, str):
cmd = shlex.split(cmd)
r = subprocess.run(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
**kwargs
)
log.debug(f"CMD output: {r.stdout.decode()}")
if r.stderr:
log.error(f"CMD error:: {r.stderr.decode()}")
if r.returncode:
raise CommandFailed(
&gt; f"Error during execution of command: {cmd}."
f"\nError is {r.stderr.decode()}"
)
E ocs.exceptions.CommandFailed: Error during execution of command: ['oc', '-n', 'default', '--kubeconfig', '/home/ocsqe/data/cluster-2019-06-20/auth/kubeconfig', 'create', '-f', '/tmp/Secret4poz3_hk', '-o', 'yaml'].
E Error is Error from server (AlreadyExists): error when creating "/tmp/Secret4poz3_hk": secrets "csi-rbd-secret" already exists
utility/utils.py:657: CommandFailed</failure>
</testcase>
<testcase classname="tests.manage.test_pvc_deletion_during_io.TestCaseOCS371" file="tests/manage/test_pvc_deletion_during_io.py" line="30" name="test_run_io_and_delete_pvc" time="130.638">
<properties>
<property name="polarion-testcase-id" value="OCS-371"/>
</properties>
<error message="test setup failure">request = &lt;SubRequest 'create_pvc' for &lt;Function test_run_io_and_delete_pvc&gt;&gt;
@pytest.fixture()
def create_pvc(request):
"""
Create a persistent Volume Claim
"""
class_instance = request.node.cls
class_instance.pvc_obj = helpers.create_pvc(
&gt; sc_name=class_instance.sc_obj.name
)
tests/fixtures.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/helpers.py:224: in create_pvc
desired_status=constants.STATUS_BOUND, **pvc_data
tests/helpers.py:62: in create_resource
condition=desired_status, resource_name=resource_name
ocs/ocp.py:237: in wait_for_resource
timeout, sleep, self.get, resource_name, True, selector
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;utility.utils.TimeoutSampler object at 0x7f9e5c802668&gt;
def __iter__(self):
if self.start_time is None:
self.start_time = time.time()
while True:
self.last_sample_time = time.time()
try:
yield self.func(*self.func_args, **self.func_kwargs)
except Exception:
pass
if self.timeout &lt; (time.time() - self.start_time):
&gt; raise self.timeout_exc_cls(*self.timeout_exc_args)
E ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)
utility/utils.py:922: TimeoutExpiredError</error>
<error message="test teardown failure">tp = &lt;class 'ocs.exceptions.ResourceLeftoversException'&gt;, value = None, tb = None
def reraise(tp, value, tb=None):
try:
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
&gt; raise value
venv/lib64/python3.7/site-packages/six.py:693:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def get_status_after_execution():
"""
"""
ENV_STATUS_POST['pod'] = POD.get(all_namespaces=True)['items']
ENV_STATUS_POST['sc'] = SC.get(all_namespaces=True)['items']
ENV_STATUS_POST['cephfs'] = CEPHFILESYSTEM.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['cephbp'] = CEPHBLOCKPOOL.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['pv'] = PV.get(all_namespaces=True)['items']
ENV_STATUS_POST['pvc'] = PVC.get(all_namespaces=True)['items']
ENV_STATUS_POST['secret'] = SECRET.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['namespace'] = NS.get(
all_namespaces=True
)['items']
pod_diff = DeepDiff(
ENV_STATUS_PRE['pod'], ENV_STATUS_POST['pod']
)
sc_diff = DeepDiff(
ENV_STATUS_PRE['sc'], ENV_STATUS_POST['sc']
)
cephfs_diff = DeepDiff(
ENV_STATUS_PRE['cephfs'], ENV_STATUS_POST['cephfs']
)
cephbp_diff = DeepDiff(
ENV_STATUS_PRE['cephbp'], ENV_STATUS_POST['cephbp']
)
pv_diff = DeepDiff(
ENV_STATUS_PRE['pv'], ENV_STATUS_POST['pv']
)
pvc_diff = DeepDiff(
ENV_STATUS_PRE['pvc'], ENV_STATUS_POST['pvc']
)
secret_diff = DeepDiff(
ENV_STATUS_PRE['secret'], ENV_STATUS_POST['secret']
)
namespace_diff = DeepDiff(
ENV_STATUS_PRE['namespace'], ENV_STATUS_POST['namespace']
)
diffs_dict = {
'pods': pod_diff,
'sc': sc_diff,
'cephfs': cephfs_diff,
'cephbp': cephbp_diff,
'pvs': pv_diff,
'pvcs': pvc_diff,
'secret': secret_diff,
'ns': namespace_diff,
}
leftover_detected = False
leftovers = {'Leftovers added': [], 'Leftovers removed': []}
for kind, kind_diff in diffs_dict.items():
if ADDED_RESOURCE in kind_diff:
leftovers['Leftovers added'].append({
kind: kind_diff[ADDED_RESOURCE][
''.join(kind_diff[ADDED_RESOURCE])
]
})
leftover_detected = True
if REMOVED_RESOURCE in kind_diff:
leftovers['Leftovers added'].append({
kind: kind_diff[REMOVED_RESOURCE][
''.join(kind_diff[REMOVED_RESOURCE])
]
})
leftover_detected = True
if leftover_detected:
raise exceptions.ResourceLeftoversException(
&gt; f"\nThere are leftovers in the environment after test case:"
f"\nResources added: {leftovers['Leftovers added']}"
f"\nResources removed: {leftovers['Leftovers removed']}"
)
E ocs.exceptions.ResourceLeftoversException:
E There are leftovers in the environment after test case:
E Resources added: [{'pvcs': {'apiVersion': 'v1', 'kind': 'PersistentVolumeClaim', 'metadata': {'annotations': {'volume.beta.kubernetes.io/storage-provisioner': 'rbd.csi.ceph.com'}, 'creationTimestamp': '2019-06-20T18:10:15Z', 'finalizers': ['kubernetes.io/pvc-protection'], 'name': 'pvc-test-2020101451', 'namespace': 'openshift-storage', 'resourceVersion': '167975', 'selfLink': '/api/v1/namespaces/openshift-storage/persistentvolumeclaims/pvc-test-2020101451', 'uid': 'a729d303-9386-11e9-a991-0612e5e11e92'}, 'spec': {'accessModes': ['ReadWriteOnce'], 'dataSource': None, 'resources': {'requests': {'storage': '3Gi'}}, 'storageClassName': 'storageclass-test-2020101314', 'volumeMode': 'Filesystem'}, 'status': {'phase': 'Pending'}}}]
E Resources removed: []
utility/environment_check.py:141: ResourceLeftoversException</error>
</testcase>
<testcase classname="tests.manage.test_pvc_invalid_inputs.TestPvcCreationInvalidInputs" file="tests/manage/test_pvc_invalid_inputs.py" line="71" name="test_pvccreation_invalid_inputs" time="57.469">
<properties>
<property name="polarion-testcase-id" value="OCS-284"/>
</properties>
</testcase>
<testcase classname="tests.manage.test_rbd_csi_default_sc.TestCaseOCS347" file="tests/manage/test_rbd_csi_default_sc.py" line="62" name="test_ocs_347" time="97.890">
<failure message="ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)">self = &lt;tests.manage.test_rbd_csi_default_sc.TestCaseOCS347 object at 0x7f9e5c9d23c8&gt;
def test_ocs_347(self):
global PVC, STORAGE_CLASS
log.info("Creating RBD StorageClass")
STORAGE_CLASS = helpers.create_storage_class(
constants.CEPHBLOCKPOOL, 'rbd', SECRET.name
)
log.info("Creating a PVC")
&gt; PVC = helpers.create_pvc(STORAGE_CLASS.name)
tests/manage/test_rbd_csi_default_sc.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/helpers.py:224: in create_pvc
desired_status=constants.STATUS_BOUND, **pvc_data
tests/helpers.py:62: in create_resource
condition=desired_status, resource_name=resource_name
ocs/ocp.py:237: in wait_for_resource
timeout, sleep, self.get, resource_name, True, selector
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;utility.utils.TimeoutSampler object at 0x7f9e5cafc7b8&gt;
def __iter__(self):
if self.start_time is None:
self.start_time = time.time()
while True:
self.last_sample_time = time.time()
try:
yield self.func(*self.func_args, **self.func_kwargs)
except Exception:
pass
if self.timeout &lt; (time.time() - self.start_time):
&gt; raise self.timeout_exc_cls(*self.timeout_exc_args)
E ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)
utility/utils.py:922: TimeoutExpiredError</failure>
</testcase>
<testcase classname="tests.manage.test_rbd_csi_default_sc.TestCaseOCS347" file="tests/manage/test_rbd_csi_default_sc.py" line="62" name="test_ocs_347" time="29.098">
<properties>
<property name="polarion-testcase-id" value="OCS-347"/>
</properties>
<error message="test teardown failure">def finalizer():
&gt; teardown()
tests/manage/test_rbd_csi_default_sc.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def teardown():
"""
Tearing down the environment
"""
log.info("Deleting PVC")
&gt; PVC.delete()
E NameError: name 'PVC' is not defined
tests/manage/test_rbd_csi_default_sc.py:40: NameError</error>
</testcase>
</testsuite>
<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="7" failures="3" name="pytest" skipped="0" tests="13" time="452.148">
<properties>
<property name="polarion-projct-id" value="OpenShiftContainerStorage"/>
</properties>
<testcase classname="tests.test_foo.TestPvCreation" file="tests/test_foo.py" line="14" name="test_foo_bar" time="0.003">
<system-out>#x1B[1m
collected 20 items / 10 deselected / 10 selected #x1B[0m
tests/test_foo.py::TestPvCreation::test_foo_bar </system-out>
</testcase>
<testcase classname="tests.test_foo.TestPvCreation" file="tests/test_foo.py" line="19" name="test_foo_baz" time="0.001">
<properties>
<property name="polarion-testcase-id" value="BAR-122"/>
</properties>
</testcase>
<testcase classname="tests.manage.test_create_storageclass_with_same_name.TestCaseOCS322" file="tests/manage/test_create_storageclass_with_same_name.py" line="95" name="test_create_storageclass_with_same_name" time="56.648">
<properties>
<property name="polarion-testcase-id" value="OCS-322"/>
</properties>
</testcase>
<testcase classname="tests.manage.test_ocs_324.TestCaseOCS324" file="tests/manage/test_ocs_324.py" line="87" name="test_pvc_delete_create_same_name[CephBlockPool]" time="101.536">
<failure message="ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)">self = &lt;tests.manage.test_ocs_324.TestCaseOCS324 object at 0x7ff90e21a4a8&gt;, test_fixture = None
def test_pvc_delete_create_same_name(self, test_fixture):
"""
TC OCS 324
"""
global PVC_OBJ
&gt; PVC_OBJ = helpers.create_pvc(sc_name=self.sc_obj.name)
tests/manage/test_ocs_324.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/helpers.py:223: in create_pvc
desired_status=constants.STATUS_BOUND, **pvc_data
tests/helpers.py:61: in create_resource
condition=desired_status, resource_name=resource_name
ocs/ocp.py:237: in wait_for_resource
timeout, sleep, self.get, resource_name, True, selector
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;utility.utils.TimeoutSampler object at 0x7ff90e145358&gt;
def __iter__(self):
if self.start_time is None:
self.start_time = time.time()
while True:
self.last_sample_time = time.time()
try:
yield self.func(*self.func_args, **self.func_kwargs)
except Exception:
pass
if self.timeout &lt; (time.time() - self.start_time):
&gt; raise self.timeout_exc_cls(*self.timeout_exc_args)
E ocs.exceptions.TimeoutExpiredError: Timed Out: (60,)
utility/utils.py:920: TimeoutExpiredError</failure>
</testcase>
<testcase classname="tests.manage.test_ocs_324.TestCaseOCS324" file="tests/manage/test_ocs_324.py" line="87" name="test_pvc_delete_create_same_name[CephBlockPool]" time="0.002">
<properties>
<property name="polarion-testcase-id" value="OCS-324"/>
</properties>
<error message="test teardown failure">request = &lt;SubRequest 'test_fixture' for &lt;Function test_pvc_delete_create_same_name[CephBlockPool]&gt;&gt;
@pytest.fixture(params=[constants.CEPHBLOCKPOOL, constants.CEPHFILESYSTEM])
def test_fixture(request):
"""
Parametrized fixture which allows test to be run for different CEPH
interface.
The test will run for each interface provided in params.
"""
self = request.node.cls
self.interface_type = request.param
setup(self)
yield
&gt; teardown(self)
tests/manage/test_ocs_324.py:28:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;class 'tests.manage.test_ocs_324.TestCaseOCS324'&gt;
def teardown(self):
"""
Deletes the resources for the type of interface used.
"""
logger.info(f"Deleting resources for {self.interface_type} interface")
&gt; PVC_OBJ.delete()
E AttributeError: 'NoneType' object has no attribute 'delete'
tests/manage/test_ocs_324.py:69: AttributeError</error>
</testcase>
<testcase classname="tests.manage.test_ocs_324.TestCaseOCS324" file="tests/manage/test_ocs_324.py" line="87" name="test_pvc_delete_create_same_name[CephFileSystem]" time="40.956">
<properties>
<property name="polarion-testcase-id" value="OCS-324"/>
</properties>
<error message="test setup failure">request = &lt;SubRequest 'test_fixture' for &lt;Function test_pvc_delete_create_same_name[CephFileSystem]&gt;&gt;
@pytest.fixture(params=[constants.CEPHBLOCKPOOL, constants.CEPHFILESYSTEM])
def test_fixture(request):
"""
Parametrized fixture which allows test to be run for different CEPH
interface.
The test will run for each interface provided in params.
"""
self = request.node.cls
self.interface_type = request.param
&gt; setup(self)
tests/manage/test_ocs_324.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/manage/test_ocs_324.py:50: in setup
assert helpers.create_cephfilesystem(), (
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def create_cephfilesystem():
"""
Function for deploying CephFileSystem (MDS)
Returns:
bool: True if CephFileSystem creates successful
"""
fs_data = defaults.CEPHFILESYSTEM_DICT.copy()
fs_data['metadata']['name'] = create_unique_resource_name(
'test', 'cephfs'
)
fs_data['metadata']['namespace'] = config.ENV_DATA['cluster_namespace']
global CEPHFS_OBJ
CEPHFS_OBJ = OCS(**fs_data)
CEPHFS_OBJ.create()
POD = pod.get_all_pods(
namespace=defaults.ROOK_CLUSTER_NAMESPACE
)
for pod_names in POD:
if 'rook-ceph-mds' in pod_names.labels.values():
assert pod_names.ocp.wait_for_resource(
condition=constants.STATUS_RUNNING,
selector='app=rook-ceph-mds'
)
&gt; assert validate_cephfilesystem(fs_name=fs_data['metadata']['name'])
E AssertionError
tests/helpers.py:413: AssertionError</error>
<error message="test teardown failure">tp = &lt;class 'KeyError'&gt;, value = None, tb = None
def reraise(tp, value, tb=None):
try:
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
&gt; raise value
venv/lib64/python3.7/site-packages/six.py:693:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def get_status_after_execution():
"""
"""
ENV_STATUS_POST['pod'] = POD.get(all_namespaces=True)['items']
ENV_STATUS_POST['sc'] = SC.get(all_namespaces=True)['items']
ENV_STATUS_POST['cephfs'] = CEPHFILESYSTEM.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['cephbp'] = CEPHBLOCKPOOL.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['pv'] = PV.get(all_namespaces=True)['items']
ENV_STATUS_POST['pvc'] = PVC.get(all_namespaces=True)['items']
ENV_STATUS_POST['secret'] = SECRET.get(
all_namespaces=True
)['items']
ENV_STATUS_POST['namespace'] = NS.get(
all_namespaces=True
)['items']
pod_diff = DeepDiff(
ENV_STATUS_PRE['pod'], ENV_STATUS_POST['pod']
)
sc_diff = DeepDiff(
ENV_STATUS_PRE['sc'], ENV_STATUS_POST['sc']
)
cephfs_diff = DeepDiff(
ENV_STATUS_PRE['cephfs'], ENV_STATUS_POST['cephfs']
)
cephbp_diff = DeepDiff(
ENV_STATUS_PRE['cephbp'], ENV_STATUS_POST['cephbp']
)
pv_diff = DeepDiff(
ENV_STATUS_PRE['pv'], ENV_STATUS_POST['pv']
)
pvc_diff = DeepDiff(
ENV_STATUS_PRE['pvc'], ENV_STATUS_POST['pvc']
)
secret_diff = DeepDiff(
ENV_STATUS_PRE['secret'], ENV_STATUS_POST['secret']
)
namespace_diff = DeepDiff(
ENV_STATUS_PRE['namespace'], ENV_STATUS_POST['namespace']
)
diffs_dict = {
'pods': pod_diff,
'sc': sc_diff,
'cephfs': cephfs_diff,
'cephbp': cephbp_diff,
'pvs': pv_diff,
'pvcs': pvc_diff,
'secret': secret_diff,
'ns': namespace_diff,
}
leftover_detected = False
leftovers = {'Leftovers added': [], 'Leftovers removed': []}
for kind, kind_diff in diffs_dict.items():
if ADDED_RESOURCE in kind_diff:
leftovers['Leftovers added'].append({
kind: kind_diff[ADDED_RESOURCE][
&gt; ''.join(kind_diff[ADDED_RESOURCE])
]
})
E KeyError: 'root[895]root[896]'
utility/environment_check.py:128: KeyError</error>
</testcase>
<testcase classname="tests.manage.test_ocs_336_346.TestOSCBasics" file="tests/manage/test_ocs_336_346.py" line="67" name="test_ocs_336" time="32.031">
<properties>
<property name="polarion-testcase-id" value="OCS-336"/>
</properties>
<failure message="KeyError: 'userID'">self = &lt;tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7ff90e40d7b8&gt;, test_fixture = None
@pytest.mark.polarion_id("OCS-336")
def test_ocs_336(self, test_fixture):
"""
Testing basics: secret creation,
storage class creation and pvc with cephfs
"""
self.cephfs_secret = defaults.CSI_CEPHFS_SECRET.copy()
&gt; del self.cephfs_secret['data']['userID']
E KeyError: 'userID'
tests/manage/test_ocs_336_346.py:75: KeyError</failure>
</testcase>
<testcase classname="tests.manage.test_ocs_336_346.TestOSCBasics" file="tests/manage/test_ocs_336_346.py" line="99" name="test_ocs_346" time="30.294">
<properties>
<property name="polarion-testcase-id" value="OCS-346"/>
</properties>
<failure message="KeyError: 'kubernetes'">self = &lt;tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7ff912b44080&gt;
@pytest.mark.polarion_id("OCS-346")
def test_ocs_346(self):
"""
Testing basics: secret creation,
storage class creation and pvc with rbd
"""
self.rbd_secret = defaults.CSI_RBD_SECRET.copy()
&gt; del self.rbd_secret['data']['kubernetes']
E KeyError: 'kubernetes'
tests/manage/test_ocs_336_346.py:107: KeyError</failure>
</testcase>
<testcase classname="tests.manage.test_pvc_deletion_during_io.TestCaseOCS371" file="tests/manage/test_pvc_deletion_during_io.py" line="30" name="test_run_io_and_delete_pvc" time="56.663">
<properties>
<property name="polarion-testcase-id" value="OCS-371"/>
</properties>
<error message="test setup failure">request = &lt;SubRequest 'create_rbd_secret' for &lt;Function test_run_io_and_delete_pvc&gt;&gt;
@pytest.fixture()
def create_rbd_secret(request):
"""
Create a secret
"""
class_instance = request.node.cls
def finalizer():
"""
Delete the project
"""
if class_instance.secret_obj.get():
class_instance.secret_obj.delete()
request.addfinalizer(finalizer)
class_instance.secret_obj = helpers.create_secret(
&gt; interface_type=constants.CEPHBLOCKPOOL
)
tests/fixtures.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
interface_type = 'CephBlockPool'
def create_secret(interface_type):
"""
Create a secret
Args:
interface_type (str): The type of the interface
(e.g. CephBlockPool, CephFileSystem)
Returns:
OCS: An OCS instance for the secret
"""
secret_data = dict()
if interface_type == constants.CEPHBLOCKPOOL:
secret_data = defaults.CSI_RBD_SECRET.copy()
&gt; del secret_data['data']['kubernetes']
E KeyError: 'kubernetes'
tests/helpers.py:111: KeyError</error>
<error message="test teardown failure">tp = &lt;class 'AttributeError'&gt;, value = None, tb = None
def reraise(tp, value, tb=None):
try:
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
&gt; raise value
venv/lib64/python3.7/site-packages/six.py:693:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
venv/lib64/python3.7/site-packages/six.py:693: in reraise
raise value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def finalizer():
"""
Delete the project
"""
&gt; if class_instance.secret_obj.get():
E AttributeError: type object 'TestCaseOCS371' has no attribute 'secret_obj'
tests/fixtures.py:17: AttributeError</error>
</testcase>
<testcase classname="tests.manage.test_pvc_invalid_inputs.TestPvcCreationInvalidInputs" file="tests/manage/test_pvc_invalid_inputs.py" line="69" name="test_pvccreation_invalid_inputs" time="67.750">
<properties>
<property name="polarion-testcase-id" value="OCS-284"/>
</properties>
</testcase>
<testcase classname="tests.manage.test_rbd_csi_default_sc.TestCaseOCS347" file="tests/manage/test_rbd_csi_default_sc.py" line="62" name="test_ocs_347" time="65.707">
<properties>
<property name="polarion-testcase-id" value="OCS-347"/>
</properties>
<error message="test setup failure">request = &lt;SubRequest 'test_fixture' for &lt;Function test_ocs_347&gt;&gt;
@pytest.fixture(scope='class')
def test_fixture(request):
"""
This is a test fixture
"""
def finalizer():
teardown()
request.addfinalizer(finalizer)
&gt; setup()
tests/manage/test_rbd_csi_default_sc.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/manage/test_rbd_csi_default_sc.py:32: in setup
SECRET = helpers.create_secret(constants.CEPHBLOCKPOOL)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
interface_type = 'CephBlockPool'
def create_secret(interface_type):
"""
Create a secret
Args:
interface_type (str): The type of the interface
(e.g. CephBlockPool, CephFileSystem)
Returns:
OCS: An OCS instance for the secret
"""
secret_data = dict()
if interface_type == constants.CEPHBLOCKPOOL:
secret_data = defaults.CSI_RBD_SECRET.copy()
&gt; del secret_data['data']['kubernetes']
E KeyError: 'kubernetes'
tests/helpers.py:111: KeyError</error>
<error message="test teardown failure">def finalizer():
&gt; teardown()
tests/manage/test_rbd_csi_default_sc.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def teardown():
"""
Tearing down the environment
"""
log.info("Deleting PVC")
&gt; PVC.delete()
E NameError: name 'PVC' is not defined
tests/manage/test_rbd_csi_default_sc.py:40: NameError</error>
</testcase>
</testsuite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment