Skip to content

Commit 5fc31aa

Browse files
authored
Merge pull request #146 from stackhpc/upstream/2023.1-2025-01-20
Synchronise 2023.1 with upstream
2 parents 1c8031b + c1c6d67 commit 5fc31aa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.gitreview

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
host=review.opendev.org
33
port=29418
44
project=openstack/nova.git
5-
defaultbranch=stable/2023.1
5+
defaultbranch=unmaintained/2023.1

nova/tests/unit/privsep/test_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# under the License.
1414

1515
import errno
16+
import fixtures
1617
import os
1718
from unittest import mock
1819

@@ -55,6 +56,13 @@ def setUp(self):
5556
self.mock_close = close_patcher.start()
5657
self.mock_unlink = unlink_patcher.start()
5758
random_string_patcher.start()
59+
# as of change Iac1b0891ae584ce4b95964e6cdc0ff2483a4e57d in oslo.log
60+
# oslo.log will now internally call os.write() in its PipeMutex code.
61+
# This causes the mock_write() to be called which breaks some of
62+
# the testcases as we expect mock_write() to be called only
63+
# by the code under test.
64+
self.useFixture(fixtures.MonkeyPatch(
65+
"nova.privsep.utils.LOG", mock.Mock()))
5866

5967
def test_supports_direct_io(self):
6068
self.mock_open.return_value = 3
@@ -85,6 +93,7 @@ def test_supports_direct_io_with_exception_in_write(self):
8593
def test_supports_direct_io_with_exception_in_open(self):
8694
self.mock_open.side_effect = ValueError()
8795

96+
self.mock_open.assert_not_called()
8897
self.assertRaises(ValueError, nova.privsep.utils.supports_direct_io,
8998
'.')
9099

0 commit comments

Comments
 (0)