summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qflash.py
diff options
context:
space:
mode:
authorManel Caro <mcaro@iatec.biz>2021-11-06 16:28:38 +0100
committerManel Caro <mcaro@iatec.biz>2021-11-06 16:28:38 +0100
commitcf19bfe18cbd283b188a858ee1629f9909c924f4 (patch)
tree1efb23519727130058401df090ab1b5f4cc8ba99 /test-cli/test/tests/qflash.py
parentb6932fbaf898724ae87c29f8965621610f377084 (diff)
parentd5b273a3b58a250742049df4ca0ef0ba54f53d33 (diff)
downloadboard-rel.0.1.zip
board-rel.0.1.tar.gz
board-rel.0.1.tar.bz2
Merge branch 'sopa-test'rel.0.1sopa-test
Diffstat (limited to 'test-cli/test/tests/qflash.py')
-rw-r--r--test-cli/test/tests/qflash.py77
1 files changed, 0 insertions, 77 deletions
diff --git a/test-cli/test/tests/qflash.py b/test-cli/test/tests/qflash.py
deleted file mode 100644
index cdc4109..0000000
--- a/test-cli/test/tests/qflash.py
+++ /dev/null
@@ -1,77 +0,0 @@
-from test.helpers.syscmd import SysCommand
-import unittest
-from test.helpers.globalVariables import globalVar
-
-class Qflasher(unittest.TestCase):
-
- def __init__(self, testname, testfunc):
- super(Qflasher, self).__init__(testfunc)
- self._testMethodDoc = testname
- model=globalVar.g_mid
- if model.find("IGEP0046") == 0:
- self._flash_method = "mx6"
- self._binlocation="/boot/"
- elif model.find("IGEP0000") == 0:
- self._flash_method = "mx6"
- self._binlocation="/boot/"
- elif model.find("IGEP0034") == 0:
- self._flash_method = "nandti"
- self._binlocation = "/boot/"
- elif model.find("SOPA") == 0:
- self._flash_method = "sopaflash"
- elif model.find("OMAP3") == 0:
- self._flash_method = "nandti"
- self._binlocation = "/boot/"
- elif model.find("OMAP5") == 0:
- self._flash_method = "nandti"
- self._binlocation = "/boot/"
-
-
- def execute(self):
- # CASE eMMC boards.
- if(self._flash_method == "mx6"):
- str_cmd= "dd if={}u-boot.imx of=/dev/mmcblk2 bs=512 seek=2 2>&1 >/dev/null".format(self._binlocation)
- flash_command = SysCommand("flash_command", str_cmd)
- if flash_command.execute() == 0:
- str_cmd = "sync"
- sync_command = SysCommand("sync_command", str_cmd)
- if sync_command.execute() != 0:
- self.fail("failed: could not sync")
- else:
- self.fail("failed: could not complete flash eMMC commands")
- # CASE of nandflash boards
- elif(self._flash_method == "nandti"):
- str_cmd = "nandwrite -p -s 0x0 /dev/mtd0 {}u-boot.img 2>&1 >/dev/null; " \
- "nandwrite -p -s 0x20000 /dev/mtd0 {}u-boot.img 2>&1 >/dev/null; " \
- "nandwrite -p -s 0x40000 /dev/mtd0 {}u-boot.img 2>&1 >/dev/null; " \
- "nandwrite -p -s 0x60000 /dev/mtd0 {}u-boot.img 2>&1 >/dev/null; " \
- "".format(self._binlocation, self._binlocation, self._binlocation, self._binlocation,)
- flash_MLO_command = SysCommand("flash_MLO_command", str_cmd)
- if flash_MLO_command.execute() == 0:
- str_cmd= "nandwrite -p /dev/mtd1 {}u-boot.img 2>&1 >/dev/null".format(self._binlocation)
- flash_uBoot_command = SysCommand("flash_command", str_cmd)
- if flash_uBoot_command.execute() == 0:
- str_cmd = "sync"
- sync_command = SysCommand("sync_command", str_cmd)
- if sync_command.execute() != 0:
- self.fail("failed: could not sync")
- else:
- self.fail("failed: could not complete flash u-boot commnds")
- else:
- self.fail("failed: could not complete flash MLO commnd")
-
-
- # CASE of SOPA0000 BOARD. FULL FLASH (u-boot+kernel+rootfs)
- elif (self._flash_method == "sopaflash"):
- str_cmd = "nandtest /dev/mtd0 >/dev/null"
- flash_command = SysCommand("flash_command", str_cmd)
- if flash_command.execute() == 0:
- str_cmd = "/usr/bin/igep-flash --skip-nandtest --image /opt/firmware/demo-ti-image-*-*.tar* >/dev/null 2>&1"
- sync_command = SysCommand("sync_command", str_cmd)
- if sync_command.execute() != 0:
- self.fail("failed: could not complete flashing procces")
- else:
- self.fail("failed: could not complete nandtest mtd0")
-
- else:
- self.fail("failed: could not find flash method")