From f17e90656e16aaa6f9ff7d28726e7146be6b8d72 Mon Sep 17 00:00:00 2001 From: Naresh Bannoth Date: Thu, 19 Sep 2024 16:06:32 +0530 Subject: [PATCH 1/2] Fixing the issue of getting "Unknown" value with platform.processor platform.processor is returning the unknown value and hence tests were failing. So changed this checking with other util functions like cpu.get_arch() Signed-off-by: Naresh Bannoth --- io/pci/pci_hotplug.py | 4 ++-- memory/memhotplug.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/io/pci/pci_hotplug.py b/io/pci/pci_hotplug.py index 6504447f3..01330c441 100755 --- a/io/pci/pci_hotplug.py +++ b/io/pci/pci_hotplug.py @@ -22,8 +22,8 @@ import os import time -import platform from avocado import Test +from avocado.utils import cpu from avocado.utils import nvme from avocado.utils import wait, multipath from avocado.utils import linux_modules, genio, pci @@ -46,7 +46,7 @@ def setUp(self): """ Setup the device. """ - if 'ppc' not in platform.processor(): + if 'ppc' not in cpu.get_arch(): self.cancel("Processor is not ppc64") if os.path.exists('/proc/device-tree/bmc'): self.cancel("Test Unsupported! on this platform") diff --git a/memory/memhotplug.py b/memory/memhotplug.py index 80f504514..81789fc1e 100644 --- a/memory/memhotplug.py +++ b/memory/memhotplug.py @@ -16,8 +16,8 @@ import os import glob import re -import platform import multiprocessing +from avocado.utils import cpu from avocado import Test from avocado.utils import process, memory, build, archive from avocado.utils.software_manager.manager import SoftwareManager @@ -81,7 +81,7 @@ def collect_dmesg(object): class MemStress(Test): ''' - Stress test to exercise memory component + Stress test to exercize memory component This test performs memory hotunplug/hotplug tests with below scenarios: 1. hotunplug one by one in a loop for all @@ -195,7 +195,7 @@ def test_hotplug_toggle(self): self.__error_check() def test_dlpar_mem_hotplug(self): - if 'ppc' in platform.processor() and 'PowerNV' not in open('/proc/cpuinfo', 'r').read(): + if 'ppc' in cpu.get_arch() and 'PowerNV' not in open('/proc/cpuinfo', 'r').read(): if b"mem_dlpar=yes" in process.system_output("drmgr -C", ignore_status=True, shell=True): self.log.info("\nDLPAR remove memory operation\n") for _ in range(len(self.blocks_hotpluggable) // 2): From ecf26c5f8d295e36aa27d43b08739309e14122dc Mon Sep 17 00:00:00 2001 From: Naresh Bannoth Date: Thu, 19 Sep 2024 16:06:32 +0530 Subject: [PATCH 2/2] Fixing the issue of getting "Unknown" value with platform.processor platform.processor is returning the unknown value and hence tests were failing. So changed this checking with other util functions like cpu.get_arch() Signed-off-by: Naresh Bannoth