Skip to content

Commit 7a83065

Browse files
Added pytest.xfail to handle known failure scenario in test_quicktest for thick SR.
In case the failure does not occur, we trigger pytest.fail to catch it. Signed-off-by: Rushikesh Jadhav <[email protected]>
1 parent ab5e8e6 commit 7a83065

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/storage/linstor/test_linstor_sr.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,16 @@ def test_create_and_destroy_sr(self, pool_with_linstor, provisioning_type, stora
5353
@pytest.mark.usefixtures("linstor_sr")
5454
class TestLinstorSR:
5555
@pytest.mark.quicktest
56-
def test_quicktest(self, linstor_sr):
57-
linstor_sr.run_quicktest()
56+
def test_quicktest(self, linstor_sr, provisioning_type):
57+
try:
58+
linstor_sr.run_quicktest()
59+
except Exception:
60+
if provisioning_type == "thick":
61+
pytest.xfail(reason="Known failure for thick provisioning")
62+
raise # Let thin failures fail test
63+
else:
64+
if provisioning_type == "thick":
65+
pytest.fail("Expected failure for thick provisioning did not occur (XPASS)")
5866

5967
def test_vdi_is_not_open(self, vdi_on_linstor_sr):
6068
assert not vdi_is_open(vdi_on_linstor_sr)

0 commit comments

Comments
 (0)