Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitreview
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/nova.git
defaultbranch=stable/2023.1
defaultbranch=unmaintained/2023.1
9 changes: 9 additions & 0 deletions nova/tests/unit/privsep/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# under the License.

import errno
import fixtures
import os
from unittest import mock

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

def test_supports_direct_io(self):
self.mock_open.return_value = 3
Expand Down Expand Up @@ -85,6 +93,7 @@ def test_supports_direct_io_with_exception_in_write(self):
def test_supports_direct_io_with_exception_in_open(self):
self.mock_open.side_effect = ValueError()

self.mock_open.assert_not_called()
self.assertRaises(ValueError, nova.privsep.utils.supports_direct_io,
'.')

Expand Down