)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"0275cb645f341246cdfb0b82d4f5631dedaf0628","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"f5999779_671161d5","updated":"2026-08-05 17:21:48.000000000","message":"i had some suggestion and i drop them\n\nthere are some simplification i instinctively want to make but when i read through the change i found i came back around to the design you are propsoign\n\nthe only change that we coudl make, always creatign the fixture but savign a refernce to the mock so you can modifyit when needed, isnt actully less complex in the end os im fien with this approch.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"}],"nova/tests/fixtures/libvirt.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"be094a10343812cb5e81225cdf92a3ef9b7da8df","unresolved":true,"context_lines":[{"line_number":2839,"context_line":"                \u0027nova.virt.libvirt.vif.LibvirtGenericVIFDriver._unplug_os_vif\u0027,"},{"line_number":2840,"context_line":"                lambda *a, **kw: None))"},{"line_number":2841,"context_line":""},{"line_number":2842,"context_line":"        self.amd_sev \u003d None"},{"line_number":2843,"context_line":"        if self.stub_amd_sev:"},{"line_number":2844,"context_line":"            self.amd_sev \u003d self.useFixture(AmdSevFixture())"},{"line_number":2845,"context_line":""},{"line_number":2846,"context_line":"        # os_vif.initialize is typically done in nova-compute startup"}],"source_content_type":"text/x-python","patch_set":8,"id":"e0a61266_91b150af","line":2843,"range":{"start_line":2842,"start_character":0,"end_line":2843,"end_character":29},"updated":"2026-08-10 12:49:23.000000000","message":"this is still condtional\n\nwhe we sugested we do it alwasy we really did mean alwasy inclduing in the test for sev, they would just update the mock which si store in the base clase rather then disable the fixutre and mock kernel_supports_amd_sev directly\n\nso this is still a little inconsitent with your last comment","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bed49ad58a7d20545734270f43741cde5ff6a800","unresolved":true,"context_lines":[{"line_number":2839,"context_line":"                \u0027nova.virt.libvirt.vif.LibvirtGenericVIFDriver._unplug_os_vif\u0027,"},{"line_number":2840,"context_line":"                lambda *a, **kw: None))"},{"line_number":2841,"context_line":""},{"line_number":2842,"context_line":"        self.amd_sev \u003d None"},{"line_number":2843,"context_line":"        if self.stub_amd_sev:"},{"line_number":2844,"context_line":"            self.amd_sev \u003d self.useFixture(AmdSevFixture())"},{"line_number":2845,"context_line":""},{"line_number":2846,"context_line":"        # os_vif.initialize is typically done in nova-compute startup"}],"source_content_type":"text/x-python","patch_set":8,"id":"b15e37aa_4c289729","line":2843,"range":{"start_line":2842,"start_character":0,"end_line":2843,"end_character":29},"in_reply_to":"9c4a95a9_7fec9156","updated":"2026-08-17 17:26:58.000000000","message":"i was not expelcign the testing of _kernel_supports_amd_sev ot enable the libvirt fixutre as the unit test fo that method shoudl not be calling the fixtureis mocked methods.\n\ni thinik we can proceed with this patch as it is and revis it more later.\n\nits imporant that we fix this testing regression before rc1 but once we have this initall fix in we can revise it more.","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"9811796ebf27d74523e328eadcbd448a4560fff0","unresolved":true,"context_lines":[{"line_number":2839,"context_line":"                \u0027nova.virt.libvirt.vif.LibvirtGenericVIFDriver._unplug_os_vif\u0027,"},{"line_number":2840,"context_line":"                lambda *a, **kw: None))"},{"line_number":2841,"context_line":""},{"line_number":2842,"context_line":"        self.amd_sev \u003d None"},{"line_number":2843,"context_line":"        if self.stub_amd_sev:"},{"line_number":2844,"context_line":"            self.amd_sev \u003d self.useFixture(AmdSevFixture())"},{"line_number":2845,"context_line":""},{"line_number":2846,"context_line":"        # os_vif.initialize is typically done in nova-compute startup"}],"source_content_type":"text/x-python","patch_set":8,"id":"9c4a95a9_7fec9156","line":2843,"range":{"start_line":2842,"start_character":0,"end_line":2843,"end_character":29},"in_reply_to":"e0a61266_91b150af","updated":"2026-08-10 15:58:42.000000000","message":"We need to disable this stub when we test the _kernel_supports_amd_sev method itself. Or can we do mock and then disable that mock in any way ?","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"}],"nova/tests/functional/libvirt/test_amd_sev.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"83cd8c5ebdbfb658da0f06446cff00fc8624e655","unresolved":false,"context_lines":[{"line_number":13,"context_line":"import copy"},{"line_number":14,"context_line":"from unittest import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import fixtures"},{"line_number":17,"context_line":"from oslo_utils.fixture import uuidsentinel as uuids"},{"line_number":18,"context_line":"from oslo_utils import versionutils"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"72915f10_6159613f","line":16,"updated":"2026-08-10 06:37:14.000000000","message":"pep8: F401 \u0027fixtures\u0027 imported but unused","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"583775627a33c477724971d76d9319b7b38727ce","unresolved":false,"context_lines":[{"line_number":13,"context_line":"import copy"},{"line_number":14,"context_line":"from unittest import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import fixtures"},{"line_number":17,"context_line":"from oslo_utils.fixture import uuidsentinel as uuids"},{"line_number":18,"context_line":"from oslo_utils import versionutils"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"a19cd03a_a2f8dbf1","line":16,"updated":"2026-08-10 17:21:03.000000000","message":"pep8: F401 \u0027fixtures\u0027 imported but unused","commit_id":"ee0fc4801c1aff863024a691844258646ba640c5"}],"nova/tests/functional/libvirt/test_report_cpu_traits.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"83cd8c5ebdbfb658da0f06446cff00fc8624e655","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"}],"source_content_type":"text/x-python","patch_set":8,"id":"15c870a6_0e68336f","line":16,"updated":"2026-08-10 06:37:14.000000000","message":"pep8: F401 \u0027builtins\u0027 imported but unused","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"83cd8c5ebdbfb658da0f06446cff00fc8624e655","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"15738cd4_43521d9f","line":17,"updated":"2026-08-10 06:37:14.000000000","message":"pep8: F401 \u0027contextlib\u0027 imported but unused","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"83cd8c5ebdbfb658da0f06446cff00fc8624e655","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import ddt"}],"source_content_type":"text/x-python","patch_set":8,"id":"58a2e33b_05893fbd","line":18,"updated":"2026-08-10 06:37:14.000000000","message":"pep8: F401 \u0027os.path\u0027 imported but unused","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"83cd8c5ebdbfb658da0f06446cff00fc8624e655","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import ddt"},{"line_number":22,"context_line":"import fixtures"}],"source_content_type":"text/x-python","patch_set":8,"id":"392f5352_3fdab388","line":19,"updated":"2026-08-10 06:37:14.000000000","message":"pep8: F401 \u0027unittest.mock\u0027 imported but unused","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"583775627a33c477724971d76d9319b7b38727ce","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"}],"source_content_type":"text/x-python","patch_set":9,"id":"8f503192_a269feea","line":16,"updated":"2026-08-10 17:21:03.000000000","message":"pep8: F401 \u0027builtins\u0027 imported but unused","commit_id":"ee0fc4801c1aff863024a691844258646ba640c5"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"583775627a33c477724971d76d9319b7b38727ce","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"002d945c_020e3445","line":17,"updated":"2026-08-10 17:21:03.000000000","message":"pep8: F401 \u0027contextlib\u0027 imported but unused","commit_id":"ee0fc4801c1aff863024a691844258646ba640c5"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"583775627a33c477724971d76d9319b7b38727ce","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import ddt"}],"source_content_type":"text/x-python","patch_set":9,"id":"0c575c20_030e3131","line":18,"updated":"2026-08-10 17:21:03.000000000","message":"pep8: F401 \u0027os.path\u0027 imported but unused","commit_id":"ee0fc4801c1aff863024a691844258646ba640c5"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"583775627a33c477724971d76d9319b7b38727ce","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import builtins"},{"line_number":17,"context_line":"import contextlib"},{"line_number":18,"context_line":"import os.path"},{"line_number":19,"context_line":"from unittest import mock"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import ddt"},{"line_number":22,"context_line":"import fixtures"}],"source_content_type":"text/x-python","patch_set":9,"id":"29ed9b9d_74e66228","line":19,"updated":"2026-08-10 17:21:03.000000000","message":"pep8: F401 \u0027unittest.mock\u0027 imported but unused","commit_id":"ee0fc4801c1aff863024a691844258646ba640c5"}],"nova/tests/functional/regressions/test_bug_1928063.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"53f0deb46692dfd09ec98b22041f040d78bfe3ef","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5facabaa_24e16e06","line":30,"updated":"2026-08-05 19:07:02.000000000","message":"Doesn\u0027t this mean that on AMD machines we\u0027re testing against the local filesystem and on non-AMD machines we\u0027re testing against the mock? That discrepancy seems like a bad idea to me. Wouldn\u0027t it be better to have tests that use the mock that run always, and a set of tests that test the real stuff that skip on non-AMD machines? Otherwise we would see tests pass that are just being mocked (AFAIU) and maybe think more is happening there. It also seems like that would make it easier to determine why things are failing for people who happen to run on AMD (or not) systems if someone tries to repro a test failure and gets a skip with a reason.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"224465847373a7a9d0e0de666a688876cb6055d8","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"105d4445_b4eb60a2","line":30,"in_reply_to":"02539057_b2994206","updated":"2026-08-06 12:29:10.000000000","message":"so the longer term fix is this code shoudl be using the filesystme modeule\n\nhttps://github.com/openstack/nova/blob/master/nova/filesystem.py\n\nfor all sysfs access.\n\nif we swap it to that we can have a fixture that will create a fake sysfs tree using a tempdir and we can just put that in place so that any un mocked reads/write will not use the real /sys and we can add emulation of the sysfs path for sev ectra there by default.\n\nthat woudl be a littel closer to hwoe we woudl do it for a functional test but it would be more robust and shareable between both.\n\nwe actully already have a fixture for this that currently just covers the cpu for the ablity to offlien them\n\nhttps://github.com/openstack/nova/blob/master/nova/tests/fixtures/filesystem.py#L41\n\nfor any test that is not testing sev this will make the test protable and correct\nfor any test that is you would mock.\n\nthats a large change then i wotuh t we would want to do howreever to fix this.\n\nill drop my +2 for now while we dicuss the path forward.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"d8301a0079d9d210dfe26c46f418134b811376de","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"667cb216_4b03dda5","line":30,"in_reply_to":"105d4445_b4eb60a2","updated":"2026-08-06 13:46:04.000000000","message":"I can do that, though we eventually need a class level flag to control fixture because some of the test cases need to instantiate SysFileSystemFixture with a different condition...","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"df40510a13f67c53f7315d8b1637d77595466e39","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3e6f821c_ca724904","line":30,"in_reply_to":"105d4445_b4eb60a2","updated":"2026-08-10 05:11:31.000000000","message":"I\u0027ve updated the change to follow \u0027mock always and change the behavior\u0027 approach. I created a dedicated fixture to avoid implementing the stub function in multiple places.\n\nThe problem with the current SysFileSystemFixture is that it does not allow us to change its behavior after setUp because it manipulate files only during setUp. I can technically update it to support such but will take a look in follow-up if it\u0027s ok.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"c1171f80e0d20f06b33e7f528b6b53e3fba4bbd3","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"8a42e2b0_5b8b8c8a","line":30,"in_reply_to":"2e977e68_e60b5f24","updated":"2026-08-06 16:50:15.000000000","message":"The current problem with SysFileSystemFixture is that I have to implement appropriate setters to manupulate files in the mock path (it is not just mocking functions but it creates a temp directory and direct all sysfs access to the directory, so we can\u0027t easily override values), so that I can address both these two suggestions. I\u0027m afraid implementing that require large amount of work than I expected initially.\n\nIIUC the initial concern by Dan is now cleared, and I\u0027m wondering if we can merge this as-is to allow people to run unit tests on AMD machine and then address the refactoring approach separately.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"68ced2094474d40767bc52aab2a249d30ea8a086","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9cfa2a88_c998205d","line":30,"in_reply_to":"3e6f821c_ca724904","updated":"2026-08-25 22:38:37.000000000","message":"Done","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"4a047096189b29417f9cda2bf4fc33df4a60b44e","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"d7012faa_ead3c1cc","line":30,"in_reply_to":"5facabaa_24e16e06","updated":"2026-08-06 00:54:48.000000000","message":"\u003e Doesn\u0027t this mean that on AMD machines we\u0027re testing against the local filesystem and on non-AMD machines we\u0027re testing against the mock? \n\nI\u0027m not sure I understand your concern. Mock is applied regardless of the machine where tests run. We selectively disable mock according to what is being tested.\n\nThe problem with the existing code was that it implicitly rely on the absence of /sys/module/kvm_amd/parameters/amd but this could be present in AMD machine. The change mocks out the check so that the path looks absent in any test code.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6fa6ed22666983f1043cfdd1dd4032c13481b49f","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"2e977e68_e60b5f24","line":30,"in_reply_to":"667cb216_4b03dda5","updated":"2026-08-06 13:54:51.000000000","message":"\u003e and this might be what Dan suggests here)\n\nNo, I think I was just not thinking straight. For some reason I got in my head that this was trying to keep the behavior of testing against the real filesystem on AMD machines (hence the delta in behavior we\u0027re trying to fix here). I was just moving a bit quick as I know this is blocking tests for some people and Takashi poked me to have a look.\n\nRe-looking this morning that of course makes no sense, so please ignore me :)\n\nI do like gibi\u0027s suggestions of just always mocking as I think that makes it a lot less invasive all over the place. I also think that Sean is right, we should be encapsulating filesystem access like this which makes the mocking cleaner anyway.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"a870475677f60f3379b4c111202a60c7d7bf3ca7","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"e40fbfbc_1287807e","line":30,"in_reply_to":"8a42e2b0_5b8b8c8a","updated":"2026-08-06 17:44:26.000000000","message":"what gibi suggested \"to always mock with false and save the mock in the fixture\" is exactly what i said on irc for what it worth\n\nhttps://meetings.opendev.org/irclogs/%23openstack-nova/%23openstack-nova.2026-08-04.log.html#openstack-nova.2026-08-04.log.html#t2026-08-04T15:06:32\n```\nself.kernel_sev \u003d  self.useFixture(fixtures.MockPatch(\u0027nova.virt.libvirt.host.Host._kernel_supports_amd_sev\u0027, return_value\u003dFalse).mock\n``\nthat is what i was referign to in https://review.opendev.org/c/openstack/nova/+/999780/comments/f5999779_671161d5\n\ni rasied the SysFileSystemFixture was just because wehn reviweitn the serise orgianlly i asked you to do the refactoring to use the filesystem module in a followup\n\nso with emrging this or the refactor gibi and i orgianlly sugested to fix ti for now.\n\nit woudl be nice to remvoe the driect open calls when reading sysfs ingeranl and move all sysfs access speratly to use the filesystm module\nand as part fo that we can use/extend SysFileSystemFixture to cater for more caes as needed.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"084934d0e6bf0e42892d9e4ef0498ee6feb8e5e7","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"02539057_b2994206","line":30,"in_reply_to":"c2a710b3_3d3b340c","updated":"2026-08-06 09:34:18.000000000","message":"We still need a way to get rid of the mock because there are several test cases. \n - TestLibvirtSEV* in unit tests verifies the behavior of _kernel_supports_amd_sev which is mocked\n - LibvirtReportSevTraitsTestBase in functional tests attempts e2e testing so applies mocking in lower layer at os.path.exists/open\n\n\nChanging the mock layer into more internal access, especially os.path.exists may allow that approach more easily, though I gave up that due to many test cases attempt to patch os.path.exists and that conflicts with the approach.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d580e8b5f9c9c205381bc58bf52dc9714735114b","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    nova.virt.hardware.get_mem_encryption_constraint."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    microversion \u003d \u0027latest\u0027"},{"line_number":30,"context_line":"    STUB_AMD_SEV \u003d False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    @mock.patch.object("},{"line_number":33,"context_line":"        fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"c2a710b3_3d3b340c","line":30,"in_reply_to":"d7012faa_ead3c1cc","updated":"2026-08-06 09:00:25.000000000","message":"One thing that we can improve (and this might be what Dan suggests here) is to \n1. not have a flag\n2. always apply a mock with a return_value \u003d False and save the mock as a field of self\n3. Any test case that needs a different value returned by that mock can use self.\u003cmock\u003e.return_value or .side_effect to customize the behavior.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"}],"nova/tests/unit/virt/libvirt/test_host.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"53f0deb46692dfd09ec98b22041f040d78bfe3ef","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":6,"id":"a4c03bb6_53c9563c","line":2117,"updated":"2026-08-05 19:07:02.000000000","message":"It feels to me like any test that wants this unpatched should at a minimum be in functional/ no?","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"4a047096189b29417f9cda2bf4fc33df4a60b44e","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":6,"id":"b9668d96_8f405435","line":2117,"in_reply_to":"a4c03bb6_53c9563c","updated":"2026-08-06 00:54:48.000000000","message":"the code triggering the sysfs access (which was brought during train cycle) is called from a various path in libvirt driver, and we do need this mock for unit tests too.","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"df40510a13f67c53f7315d8b1637d77595466e39","unresolved":false,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":6,"id":"4c146050_356de0bb","line":2117,"in_reply_to":"b9668d96_8f405435","updated":"2026-08-10 05:11:31.000000000","message":"Done","commit_id":"3013d86b990320f7a4cb1f08a16a10cf21dfbda2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"be094a10343812cb5e81225cdf92a3ef9b7da8df","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":8,"id":"cef42fdf_1b183da5","line":2117,"updated":"2026-08-10 12:49:23.000000000","message":"as is this\n\nlooking at these function you do not actually need a full libvirt fixture right\n\nyour only using the host module in this case and you should be mockin any calsl to libirt or other funciton in this module when unite testing ewach one.\n\n_kernel_supports_amd_sev just needs open moked\nhttps://github.com/openstack/nova/blob/48d4b3f7032364e2030035a33596c0f407cb0279/nova/virt/libvirt/host.py#L2015-L2027 \n\n\nsupports_amd_sev should be mocking .get_capabilities() get_domain_capabilities() and techinlclly _kernel_supports_amd_sev() which you can already contole the behivor of via the base fixture without disablity it.\n\nyour alrday even mockign some of those below as needed\n```\n with mock.patch.object(fakelibvirt.virConnect, \u0027getCapabilities\u0027,\n                               return_value\u003dfake_caps_xml):\n```\n\nso do you really need to disable it here and keep that configurablity?\n\nim not against this versoin fo the patch but it feels like you stopped before actully removing the optionaltiy of the fixuture mocking","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bed49ad58a7d20545734270f43741cde5ff6a800","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":8,"id":"f8359c72_f113eb87","line":2117,"in_reply_to":"1698ccef_afb4790e","updated":"2026-08-17 17:26:58.000000000","message":"im ok to defer futher refactorigns of this to a sepreate commit\n\ni think i woudl prefer to proceed with the current version to adress the regression and then we can lop back later and change it if we have time or its needed but lets see how others feel about this","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"c0e47d52e3ff5ca9028db6938869bcd29f633c5d","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":8,"id":"1698ccef_afb4790e","line":2117,"in_reply_to":"7b9fea8c_bb515e3c","updated":"2026-08-10 16:34:01.000000000","message":"Hmm so what we need to mock here is not getCapabilities but getDomainCapabilities. And we also have to mock a few other APIs used in get_domain_capabilities.\n\nI can technically implement that, However this is the most primitive test case to verify the behavior of capability detection logic, and I think that generic libvirt fixture with standard xml structure would be preferred. I can replicate it technically, though that require undesired maintenance overhead I feel.","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"9811796ebf27d74523e328eadcbd448a4560fff0","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":8,"id":"43c932ba_56262788","line":2117,"in_reply_to":"cef42fdf_1b183da5","updated":"2026-08-10 15:58:42.000000000","message":"OK let me consider that approach. My current concern is that it requires us to duplicate the logic to generate the fake xml response but I\u0027ll check it with actual code.","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"9811796ebf27d74523e328eadcbd448a4560fff0","unresolved":true,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":8,"id":"7b9fea8c_bb515e3c","line":2117,"in_reply_to":"cef42fdf_1b183da5","updated":"2026-08-10 15:58:42.000000000","message":"Oh I didn\u0027t think of removing the mock coverage in this function. Let me consider that approach.","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"68ced2094474d40767bc52aab2a249d30ea8a086","unresolved":false,"context_lines":[{"line_number":2114,"context_line":"    def setUp(self):"},{"line_number":2115,"context_line":"        super(TestLibvirtSEV, self).setUp()"},{"line_number":2116,"context_line":""},{"line_number":2117,"context_line":"        self.useFixture(nova_fixtures.LibvirtFixture(stub_amd_sev\u003dFalse))"},{"line_number":2118,"context_line":"        self.host \u003d host.Host(\"qemu:///system\")"},{"line_number":2119,"context_line":"        self.addCleanup(self.host.cleanup)"},{"line_number":2120,"context_line":"        self.host._delayed_executor \u003d ("}],"source_content_type":"text/x-python","patch_set":8,"id":"f440058b_a655015f","line":2117,"in_reply_to":"f8359c72_f113eb87","updated":"2026-08-25 22:38:37.000000000","message":"Done","commit_id":"587b8c22401a5d19092eb544e70254857f8101a1"}]}
