|
<?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 = <tests.manage.test_ocs_324.TestCaseOCS324 object at 0x7f9e5ca9ca90>, test_fixture = None |
|
|
|
def test_pvc_delete_create_same_name(self, test_fixture): |
|
""" |
|
TC OCS 324 |
|
""" |
|
global PVC_OBJ |
|
|
|
> 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 = <utility.utils.TimeoutSampler object at 0x7f9e5c9c5278> |
|
|
|
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 < (time.time() - self.start_time): |
|
> 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 = <SubRequest 'test_fixture' for <Function test_pvc_delete_create_same_name[CephBlockPool]>> |
|
|
|
@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 |
|
> teardown(self) |
|
|
|
tests/manage/test_ocs_324.py:28: |
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
|
|
|
self = <class 'tests.manage.test_ocs_324.TestCaseOCS324'> |
|
|
|
def teardown(self): |
|
""" |
|
Deletes the resources for the type of interface used. |
|
""" |
|
logger.info(f"Deleting resources for {self.interface_type} interface") |
|
|
|
> 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 = <SubRequest 'test_fixture' for <Function test_pvc_delete_create_same_name[CephFileSystem]>> |
|
|
|
@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) |
|
|
|
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' |
|
) |
|
> assert validate_cephfilesystem(fs_name=fs_data['metadata']['name']) |
|
E AssertionError |
|
|
|
tests/helpers.py:414: AssertionError</error> |
|
<error message="test teardown failure">tp = <class 'KeyError'>, 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) |
|
> 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]) |
|
] |
|
}) |
|
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 "/tmp/Secret6goum85m": secrets "csi-cephfs-secret" already exists">self = <tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7f9e5cb89c88>, 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) |
|
> 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( |
|
> 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 "/tmp/Secret4poz3_hk": secrets "csi-rbd-secret" already exists">self = <tests.manage.test_ocs_336_346.TestOSCBasics object at 0x7f9e5cb61940> |
|
|
|
@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) |
|
> 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( |
|
> 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 = <SubRequest 'create_pvc' for <Function test_run_io_and_delete_pvc>> |
|
|
|
@pytest.fixture() |
|
def create_pvc(request): |
|
""" |
|
Create a persistent Volume Claim |
|
""" |
|
class_instance = request.node.cls |
|
|
|
class_instance.pvc_obj = helpers.create_pvc( |
|
> 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 = <utility.utils.TimeoutSampler object at 0x7f9e5c802668> |
|
|
|
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 < (time.time() - self.start_time): |
|
> 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 = <class 'ocs.exceptions.ResourceLeftoversException'>, 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) |
|
> 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( |
|
> 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 = <tests.manage.test_rbd_csi_default_sc.TestCaseOCS347 object at 0x7f9e5c9d23c8> |
|
|
|
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") |
|
> 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 = <utility.utils.TimeoutSampler object at 0x7f9e5cafc7b8> |
|
|
|
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 < (time.time() - self.start_time): |
|
> 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(): |
|
> teardown() |
|
|
|
tests/manage/test_rbd_csi_default_sc.py:21: |
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
|
|
|
def teardown(): |
|
""" |
|
Tearing down the environment |
|
""" |
|
log.info("Deleting PVC") |
|
> PVC.delete() |
|
E NameError: name 'PVC' is not defined |
|
|
|
tests/manage/test_rbd_csi_default_sc.py:40: NameError</error> |
|
</testcase> |
|
</testsuite> |