* [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution
@ 2014-07-01 18:16 Stephen Warren
2014-07-01 18:16 ` [U-Boot] [PATCH 2/3] test: dfu: add some more test cases Stephen Warren
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Stephen Warren @ 2014-07-01 18:16 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
Call cleanup() before running tests too. If a previous test was CTRL-C'd
some stale files may have been left around. dfu-util refuses to receive
a file to a filename that already exists, which results in false test
failures if the files aren't cleaned up first.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
test/dfu/dfu_gadget_test.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/dfu/dfu_gadget_test.sh b/test/dfu/dfu_gadget_test.sh
index c5c5f1d957f1..4133155ae97d 100755
--- a/test/dfu/dfu_gadget_test.sh
+++ b/test/dfu/dfu_gadget_test.sh
@@ -66,6 +66,7 @@ printf "$COLOUR_GREEN===========================================================
echo "DFU EP0 transmission test program"
echo "Trouble shoot -> disable DBG (even the KERN_DEBUG) in the UDC driver"
echo "@ -> TRATS2 # dfu 0 mmc 0"
+cleanup
mkdir -p $DIR$RCV_DIR
touch $LOG_FILE
--
1.8.1.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [U-Boot] [PATCH 2/3] test: dfu: add some more test cases
2014-07-01 18:16 [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Stephen Warren
@ 2014-07-01 18:16 ` Stephen Warren
2014-07-08 7:58 ` Lukasz Majewski
2014-07-01 18:16 ` [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test Stephen Warren
2014-07-08 7:57 ` [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Lukasz Majewski
2 siblings, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2014-07-01 18:16 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
On Tegra, the DFU buffer size is 1M. Consequently, the 8M test always
fails. Add tests for the 1M size, and one byte less as a corner case,
so that some large tests are executed and expected to pass.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
test/dfu/dfu_gadget_test_init.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/dfu/dfu_gadget_test_init.sh b/test/dfu/dfu_gadget_test_init.sh
index fb54ad8c55ee..2163a685a55d 100755
--- a/test/dfu/dfu_gadget_test_init.sh
+++ b/test/dfu/dfu_gadget_test_init.sh
@@ -9,7 +9,7 @@ COLOUR_DEFAULT="\33[0m"
LOG_DIR="./log"
-TEST_FILES_SIZES="63 64 65 127 128 129 4095 4096 4097 959 960 961 8M"
+TEST_FILES_SIZES="63 64 65 127 128 129 4095 4096 4097 959 960 961 1048575 1048576 8M"
printf "Init script for generating data necessary for DFU test script"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/3] test: dfu: add some more test cases
2014-07-01 18:16 ` [U-Boot] [PATCH 2/3] test: dfu: add some more test cases Stephen Warren
@ 2014-07-08 7:58 ` Lukasz Majewski
0 siblings, 0 replies; 6+ messages in thread
From: Lukasz Majewski @ 2014-07-08 7:58 UTC (permalink / raw)
To: u-boot
Hi Stephen,
> From: Stephen Warren <swarren@nvidia.com>
>
> On Tegra, the DFU buffer size is 1M. Consequently, the 8M test always
> fails. Add tests for the 1M size, and one byte less as a corner case,
> so that some large tests are executed and expected to pass.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> test/dfu/dfu_gadget_test_init.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/dfu/dfu_gadget_test_init.sh
> b/test/dfu/dfu_gadget_test_init.sh index fb54ad8c55ee..2163a685a55d
> 100755 --- a/test/dfu/dfu_gadget_test_init.sh
> +++ b/test/dfu/dfu_gadget_test_init.sh
> @@ -9,7 +9,7 @@ COLOUR_DEFAULT="\33[0m"
>
> LOG_DIR="./log"
>
> -TEST_FILES_SIZES="63 64 65 127 128 129 4095 4096 4097 959 960 961 8M"
> +TEST_FILES_SIZES="63 64 65 127 128 129 4095 4096 4097 959 960 961
> 1048575 1048576 8M"
> printf "Init script for generating data necessary for DFU test
> script"
Applied to u-boot-dfu tree.
Stephen, thanks for your support.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test
2014-07-01 18:16 [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Stephen Warren
2014-07-01 18:16 ` [U-Boot] [PATCH 2/3] test: dfu: add some more test cases Stephen Warren
@ 2014-07-01 18:16 ` Stephen Warren
2014-07-08 7:58 ` Lukasz Majewski
2014-07-08 7:57 ` [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Lukasz Majewski
2 siblings, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2014-07-01 18:16 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
The buffer is too small if it's < size to read, not if it's <= the size.
This fixes the 1MB test case on Tegra, which has a 1MB buffer.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
drivers/dfu/dfu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 6cd3fbb58ae4..3512b149c560 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -332,7 +332,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
case DFU_RAM_ADDR:
break;
default:
- if (dfu->r_left >= dfu_buf_size) {
+ if (dfu->r_left > dfu_buf_size) {
printf("%s: File too big for buffer\n",
__func__);
return -EOVERFLOW;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test
2014-07-01 18:16 ` [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test Stephen Warren
@ 2014-07-08 7:58 ` Lukasz Majewski
0 siblings, 0 replies; 6+ messages in thread
From: Lukasz Majewski @ 2014-07-08 7:58 UTC (permalink / raw)
To: u-boot
Hi Stephen,
> From: Stephen Warren <swarren@nvidia.com>
>
> The buffer is too small if it's < size to read, not if it's <= the
> size. This fixes the 1MB test case on Tegra, which has a 1MB buffer.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> drivers/dfu/dfu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 6cd3fbb58ae4..3512b149c560 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -332,7 +332,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf,
> int size, int blk_seq_num) case DFU_RAM_ADDR:
> break;
> default:
> - if (dfu->r_left >= dfu_buf_size) {
> + if (dfu->r_left > dfu_buf_size) {
> printf("%s: File too big for
> buffer\n", __func__);
> return -EOVERFLOW;
Applied to u-boot-dfu tree.
Stephen, thanks for your support.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution
2014-07-01 18:16 [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Stephen Warren
2014-07-01 18:16 ` [U-Boot] [PATCH 2/3] test: dfu: add some more test cases Stephen Warren
2014-07-01 18:16 ` [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test Stephen Warren
@ 2014-07-08 7:57 ` Lukasz Majewski
2 siblings, 0 replies; 6+ messages in thread
From: Lukasz Majewski @ 2014-07-08 7:57 UTC (permalink / raw)
To: u-boot
Hi Stephen,
> From: Stephen Warren <swarren@nvidia.com>
>
> Call cleanup() before running tests too. If a previous test was
> CTRL-C'd some stale files may have been left around. dfu-util refuses
> to receive a file to a filename that already exists, which results in
> false test failures if the files aren't cleaned up first.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Applied to u-boot-dfu tree.
Stephen, thanks for your support.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-08 7:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 18:16 [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Stephen Warren
2014-07-01 18:16 ` [U-Boot] [PATCH 2/3] test: dfu: add some more test cases Stephen Warren
2014-07-08 7:58 ` Lukasz Majewski
2014-07-01 18:16 ` [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test Stephen Warren
2014-07-08 7:58 ` Lukasz Majewski
2014-07-08 7:57 ` [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Lukasz Majewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox