From 81a2dbc706658550ae3cb7aa32e95734cdd2a993 Mon Sep 17 00:00:00 2001 From: Vaishnavi Bhat Date: Wed, 8 May 2024 23:41:53 +0530 Subject: [PATCH] Enable dynamic debug only if secureboot is off When secureboot is enabled, dynamic debug fails to get enabled. vnic dynamic debug is enabled if secureboot is disabled on the OS side. Signed-off-by: Vaishnavi Bhat --- io/net/virt-net/network_virtualization.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/io/net/virt-net/network_virtualization.py b/io/net/virt-net/network_virtualization.py index dbc93f628..61817496f 100755 --- a/io/net/virt-net/network_virtualization.py +++ b/io/net/virt-net/network_virtualization.py @@ -35,6 +35,7 @@ from avocado.utils.network.hosts import LocalHost from avocado.utils.ssh import Session from avocado.utils import wait +from avocado.utils import linux from pexpect import pxssh import re from avocado.utils.network.hosts import RemoteHost @@ -156,10 +157,13 @@ def setUp(self): 'failover' in str(self.name.name): self.cancel("this test is not needed") self.local = LocalHost() - cmd = "echo 'module ibmvnic +pt; func send_subcrq -pt' > /sys/kernel/debug/dynamic_debug/control" - result = process.run(cmd, shell=True, ignore_status=True) - if result.exit_status: - self.fail("failed to enable debug mode") + if not linux.is_os_secureboot_enabled(): + cmd = "echo 'module ibmvnic +pt; func send_subcrq -pt' > /sys/kernel/debug/dynamic_debug/control" + result = process.run(cmd, shell=True, ignore_status=True) + if result.exit_status: + self.fail("failed to enable debug mode") + else: + self.log("failed to enable debug mode") @staticmethod def get_mcp_component(component): @@ -1132,9 +1136,10 @@ def tearDown(self): except Exception: self.log.debug("Unable to set back the original active device") self.session_hmc.quit() - cmd = "echo 'module ibmvnic -pt; func send_subcrq -pt' > /sys/kernel/debug/dynamic_debug/control" - result = process.run(cmd, shell=True, ignore_status=True) - if result.exit_status: - self.log.debug("failed to disable debug mode") + if not linux.is_os_secureboot_enabled(): + cmd = "echo 'module ibmvnic -pt; func send_subcrq -pt' > /sys/kernel/debug/dynamic_debug/control" + result = process.run(cmd, shell=True, ignore_status=True) + if result.exit_status: + self.log.debug("failed to disable debug mode") self.tune_rxtx_queue() self.session.quit()