From 80d2b7a9766bffe2674b628ef70d389dfaba9ab3 Mon Sep 17 00:00:00 2001 From: Manel Caro Date: Fri, 19 May 2023 12:15:00 -0400 Subject: Provide support to test Sandisk eMMc --- test-cli/test/tests/qmmcflash.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'test-cli/test/tests') diff --git a/test-cli/test/tests/qmmcflash.py b/test-cli/test/tests/qmmcflash.py index 0f5a0c1..ca7ace2 100644 --- a/test-cli/test/tests/qmmcflash.py +++ b/test-cli/test/tests/qmmcflash.py @@ -21,6 +21,7 @@ class Qmmcflash(unittest.TestCase): self.__mmc_res_file = varlist.get('emmc_res_file', self.__xmlObj.getKeyVal(self.__QeMMCName, "emmc_res_file", "emmc_status.txt")) self.__mmcPort = varlist.get('mmc_port', self.__xmlObj.getKeyVal(self.__QeMMCName, "mmc_port", "0")) self.__mmcID = varlist.get('mmc_id', self.__xmlObj.getKeyVal(self.__QeMMCName, "mmc_id", "0001")) + self.__mmcdh = varlist.get('mmc_dh', self.__xmlObj.getKeyVal(self.__QeMMCName, "mmc_dh", "1")) self.__resultlist = [] @@ -32,19 +33,20 @@ class Qmmcflash(unittest.TestCase): mime='text/plain', data=dataOut.stdout.decode('utf-8'), result=self.__resultlist) - sysDevice = "/sys/bus/mmc/drivers/mmcblk/mmc{}:{}".format(self.__mmcPort, self.__mmcID) - r, data = sys_read("{}/life_time".format(sysDevice)) - if not r: - self.fail("emmc: life_time not found") - res = scanf("0x%d 0x%d", data) - if res[0] > 3 or res[1] > 3: - self.fail("emmc: review {} life_time > 3".format(sysDevice)) - r, data = sys_read("{}/pre_eol_info".format(sysDevice)) - if not r: - self.fail("emmc: pre_eol_info not found") - res = scanf("0x%d", data) - if res[0] != 1: - self.fail("emmc: review {} pre_eol_info != 1".format(sysDevice)) + if self.__mmcdh == "1": + sysDevice = "/sys/bus/mmc/drivers/mmcblk/mmc{}:{}".format(self.__mmcPort, self.__mmcID) + r, data = sys_read("{}/life_time".format(sysDevice)) + if not r: + self.fail("emmc: life_time not found") + res = scanf("0x%d 0x%d", data) + if res[0] > 3 or res[1] > 3: + self.fail("emmc: review {} life_time > 3".format(sysDevice)) + r, data = sys_read("{}/pre_eol_info".format(sysDevice)) + if not r: + self.fail("emmc: pre_eol_info not found") + res = scanf("0x%d", data) + if res[0] != 1: + self.fail("emmc: review {} pre_eol_info != 1".format(sysDevice)) except ErrorReturnCode as Error: self.fail("emmc: failed {} ".format(Error.exit_code)) -- cgit v1.1