Skip to content

Commit 269e63b

Browse files
committed
test: temporarily disable security A/B tests for PCI uVMs
Tests test_spectre_meltdown_checker_on_guest and test_check_vulnerability_files_ab run A/B tests between the HEAD of the target branch and the tip of a PR branch. This will currently fail, because Firecracker builds from the HEAD of the target branch know nothing about the `--enable-pci` command line flag, so launching the Firecracker binary for revision A will fail. Only run these tests for non-PCI uVMs for now. Once this commit gets merged we will re-enable and make sure that everything works as expected. Signed-off-by: Babis Chalios <[email protected]>
1 parent aed10cd commit 269e63b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tests/integration_tests/security/test_vulnerabilities.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,22 +216,18 @@ def microvm_factory_a(record_property):
216216

217217

218218
@pytest.fixture
219-
def uvm_any_a(
220-
microvm_factory_a, uvm_ctor, guest_kernel, rootfs, cpu_template_any, pci_enabled
221-
):
219+
def uvm_any_a(microvm_factory_a, uvm_ctor, guest_kernel, rootfs, cpu_template_any):
222220
"""Return uvm with revision A firecracker
223221
224222
Since pytest caches fixtures, this guarantees uvm_any_a will match a vm from uvm_any.
225223
See https://docs.pytest.org/en/stable/how-to/fixtures.html#fixtures-can-be-requested-more-than-once-per-test-return-values-are-cached
226224
"""
227-
return uvm_ctor(
228-
microvm_factory_a, guest_kernel, rootfs, cpu_template_any, pci_enabled
229-
)
225+
return uvm_ctor(microvm_factory_a, guest_kernel, rootfs, cpu_template_any, False)
230226

231227

232-
def test_check_vulnerability_files_ab(request, uvm_any):
228+
def test_check_vulnerability_files_ab(request, uvm_any_without_pci):
233229
"""Test vulnerability files on guests"""
234-
res_b = check_vulnerabilities_files_on_guest(uvm_any)
230+
res_b = check_vulnerabilities_files_on_guest(uvm_any_without_pci)
235231
if global_props.buildkite_pr:
236232
# we only get the uvm_any_a fixtures if we need it
237233
uvm_a = request.getfixturevalue("uvm_any_a")
@@ -243,17 +239,17 @@ def test_check_vulnerability_files_ab(request, uvm_any):
243239

244240
def test_spectre_meltdown_checker_on_guest(
245241
request,
246-
uvm_any,
242+
uvm_any_without_pci,
247243
spectre_meltdown_checker,
248244
):
249245
"""Test with the spectre / meltdown checker on any supported guest."""
250-
res_b = spectre_meltdown_checker.get_report_for_guest(uvm_any)
246+
res_b = spectre_meltdown_checker.get_report_for_guest(uvm_any_without_pci)
251247
if global_props.buildkite_pr:
252248
# we only get the uvm_any_a fixtures if we need it
253249
uvm_a = request.getfixturevalue("uvm_any_a")
254250
res_a = spectre_meltdown_checker.get_report_for_guest(uvm_a)
255251
assert res_b <= res_a
256252
else:
257253
assert res_b == spectre_meltdown_checker.expected_vulnerabilities(
258-
uvm_any.cpu_template_name
254+
uvm_any_without_pci.cpu_template_name
259255
)

0 commit comments

Comments
 (0)