From dabadeb2e75d5a49d71d58c5b699220c25f5574b Mon Sep 17 00:00:00 2001 From: Shirisha Ganta Date: Mon, 8 May 2023 11:51:11 +0530 Subject: [PATCH] ras_ppcutils.py: Compare ls-vdev output with lsblk We are verifying the device by comparing ls-vdev and lsblk outputs, by adding a condition check Signed-off-by: Shirisha Ganta --- ras/ras_ppcutils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ras/ras_ppcutils.py b/ras/ras_ppcutils.py index 27a21c6bf..00e97a418 100644 --- a/ras/ras_ppcutils.py +++ b/ras/ras_ppcutils.py @@ -19,7 +19,7 @@ import os import re from avocado import Test -from avocado.utils import process, distro, build, archive +from avocado.utils import process, distro, build, archive, disk from avocado import skipIf, skipUnless from avocado.utils.software_manager.manager import SoftwareManager @@ -339,10 +339,18 @@ def test_ls_vdev(self): """ self.log.info("===============Executing ls-vdev tool test====" "===========") + self.is_fail = 0 self.run_cmd("ls-vdev") self.run_cmd("ls-vdev -h") self.run_cmd("ls-vdev -V") - self.error_check() + dev_name = self.run_cmd_out("ls-vdev").split()[1] + lsblk_disks = disk.get_disks() + lsblk_dev_name = [i.replace('/dev/', '') for i in lsblk_disks] + if dev_name.strip() not in lsblk_dev_name: + self.is_fail += 1 + if self.is_fail >= 1: + self.fail("%s command(s) failed in ls-vdev tool " + "verification" % self.is_fail) @skipIf(IS_POWER_NV or IS_KVM_GUEST, "This test is not supported on KVM guest or PowerNV platform")