@@ -1487,8 +1487,9 @@ def add_vdis_for_coalesce(self, sr):
14871487 @mock .patch ('vhdutil.VhdUtil' )
14881488 @mock .patch ('cleanup.journaler.Journaler' , autospec = True )
14891489 @mock .patch ('cleanup.Util.runAbortable' )
1490+ @mock .patch ('cleanup.SR._create_running_file' , autospec = True )
14901491 def test_coalesce_success (
1491- self , mock_abortable , mock_journaler , mock_vhdutil , mock_util ,
1492+ self , mock_create_running_file , mock_abortable , mock_journaler , mock_vhdutil , mock_util ,
14921493 mock_unlink ):
14931494 """
14941495 Non-leaf coalesce
@@ -1497,6 +1498,7 @@ def test_coalesce_success(
14971498
14981499 mock_abortable .side_effect = self .runAbortable
14991500 mock_vhdutil .return_value .check .return_value = cowutil .CowUtil .CheckResult .Success
1501+ mock_vhdutil .return_value .isCoalesceableOnRemote .return_value = False
15001502
15011503 sr_uuid = uuid4 ()
15021504 sr = create_cleanup_sr (self .xapi_mock , uuid = str (sr_uuid ))
@@ -1537,8 +1539,9 @@ def test_coalesce_success(
15371539 @mock .patch ('vhdutil.VhdUtil' )
15381540 @mock .patch ('cleanup.journaler.Journaler' , autospec = True )
15391541 @mock .patch ('cleanup.Util.runAbortable' )
1542+ @mock .patch ('cleanup.SR._create_running_file' , autospec = True )
15401543 def test_coalesce_error (
1541- self , mock_abortable , mock_journaler , mock_vhdutil , mock_util ,
1544+ self , mock_running_file , mock_abortable , mock_journaler , mock_vhdutil , mock_util ,
15421545 mock_unlink ):
15431546 """
15441547 Handle errors in coalesce
@@ -1548,6 +1551,7 @@ def test_coalesce_error(
15481551
15491552 self .xapi_mock .getConfigVDI .return_value = {}
15501553
1554+
15511555 def run_abortable (func , ret , ns , abortTest , pollInterval , timeOut ):
15521556 raise util .SMException ("Timed out" )
15531557
@@ -1565,6 +1569,7 @@ def run_abortable(func, ret, ns, abortTest, pollInterval, timeOut):
15651569 mock_journaler .get .return_value = None
15661570
15671571 mock_vhdutil .return_value .getParent .return_value = vdis ['parent' ].path
1572+ mock_vhdutil .return_value .isCoalesceableOnRemote .return_value = False
15681573
15691574 sr .coalesce (vdis ['vdi' ], False )
15701575
@@ -1576,8 +1581,9 @@ def run_abortable(func, ret, ns, abortTest, pollInterval, timeOut):
15761581 @mock .patch ('vhdutil.VhdUtil' )
15771582 @mock .patch ('cleanup.journaler.Journaler' , autospec = True )
15781583 @mock .patch ('cleanup.Util.runAbortable' )
1584+ @mock .patch ('cleanup.SR._create_running_file' , autospec = True )
15791585 def test_coalesce_error_raw_parent (
1580- self , mock_abortable , mock_journaler , mock_vhdutil , mock_util ,
1586+ self , mock_create_running_file , mock_abortable , mock_journaler , mock_vhdutil , mock_util ,
15811587 mock_unlink ):
15821588 """
15831589 Handle errors in coalesce with raw parent
@@ -1605,6 +1611,7 @@ def run_abortable(func, ret, ns, abortTest, pollInterval, timeOut):
16051611 mock_journaler .get .return_value = None
16061612
16071613 mock_vhdutil .return_value .getParent .return_value = vdis ['parent' ].path
1614+ mock_vhdutil .return_value .isCoalesceableOnRemote .return_value = False
16081615
16091616 sr .coalesce (vdis ['vdi' ], False )
16101617
0 commit comments