From mboxrd@z Thu Jan 1 00:00:00 1970 From: Przemyslaw Marczak Date: Wed, 17 Dec 2014 09:53:05 +0100 Subject: [U-Boot] [PATCH] fat: scripts for prepare and test read fat files In-Reply-To: References: <548B09FD.2080005@samsung.com> <1418399532-13502-1-git-send-email-p.marczak@samsung.com> <548B0FBD.8070308@samsung.com> Message-ID: <54914471.7070702@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, On 12/16/2014 09:41 PM, Simon Glass wrote: > Hi Przemyslaw, > > On 12 December 2014 at 08:54, Przemyslaw Marczak wrote: >> >> Hello, >> >> >> On 12/12/2014 04:52 PM, Przemyslaw Marczak wrote: >>> >>> --------------------------------------------------------- >>> mktest_files: script for generating random size long name files >>> --------------------------------------------------------- >>> Usage: >>> ./1_mktest_files.sh count >>> >>> count - number of files to be generated >>> >>> The output directory is: "./test_files" >>> >>> --------------------------------------------------------- >>> copy_files: copy the test_files/* into test partition mount point >>> --------------------------------------------------------- >>> Usage: >>> ./2_copy_files.sh mount_point >>> >>> ----------------------------------------------------------- >>> fat_test.sh: test fat read by write commands to the device console >>> ---------------------------------------------------------- >>> This script send commands to U-Boot console. >>> First specify few script variables, e.g: >>> - TTY="/dev/ttyS0" >>> - MMCDEV=0 >>> - PARTITION=2 >>> - LOAD_ADDR="0x40000000" >>> >>> usage: >>> 1. Target: >>> run: ums 0 mmc 0 >>> 2. Run script 1 and 2 to make and copy the test files >>> onto the test partition by UMS >>> 3. This script: >>> - set test device $PARTITION and other variables in the script, >>> which is required for sending proper commands >>> - set $TTY in the script >>> run: ./3_fat_test.sh >>> 4. Compare the crc results on the target and device consoles >>> (sorry for the mess on the console) >>> >>> Signed-off-by: Przemyslaw Marczak >>> --- >>> 1_mktest_files.sh | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ >>> 2_copy_files.sh | 20 ++++++++++++++ >>> 3_fat_test.sh | 38 ++++++++++++++++++++++++++ >>> 3 files changed, 140 insertions(+) >>> create mode 100755 1_mktest_files.sh >>> create mode 100755 2_copy_files.sh >>> create mode 100755 3_fat_test.sh >>> >> >> This is just for some quick test. >> I will add something more pretty to the sandbox. > > Perhaps this should be written in Python? We now have quite a few > tests and it's getting to the point where we might want to have a way > to run them all, check results, etc. That would be easier if we could > import them through some standard interface. For now, perhaps we > should avoid shell scripts except for really trivial things. > > You can bring in the patman libraries (we could break these out into > another dir but it doesn't seem important): > > import os > import sys > > # Bring in the patman libraries > our_path = os.path.dirname(os.path.realpath(__file__)) > sys.path.append(os.path.join(our_path, 'tools/patman')) > > import command > > The, for example: > print command.Output('ls', '-l') > > Regards, > Simon > The patch fixes the issue with the "hidden" files, so for looking the issue on some other cases I made some simple script. I understand that this is not good for a U-Boot tests, and I agree that better is to write something automated in the Python for the sandbox. I think that the fix should be merged. I can write the test for the sandbox in a free time, but it will take a moment, because now I would like to focus on the pmic framework. The pmic was on hold for too long. Best regards, -- Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak at samsung.com