Skip to content

Commit

Permalink
Fixing the issue of getting "Unknown" value with platform.processor
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Naresh-ibm committed Sep 19, 2024
1 parent 87864b9 commit f17e906
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions io/pci/pci_hotplug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions memory/memhotplug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit f17e906

Please sign in to comment.