diff mbox series

[U-Boot] test: Update test-imagetools.sh to match new syntax

Message ID 20190214131135.4726-1-martyn.welch@collabora.com
State Accepted
Commit 280fafff165428bc69db221faaccaf4edfc32d9d
Delegated to: Tom Rini
Headers show
Series [U-Boot] test: Update test-imagetools.sh to match new syntax | expand

Commit Message

Martyn Welch Feb. 14, 2019, 1:11 p.m. UTC
The syntax of dumpimage was simplified in commit 12b831879a76 ("tools:
dumpimage: Simplify arguments"), but the test
(test/image/test-imagetools.sh) was not updated and is now failing.

Update the test to use the new syntax.

Reported-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>

---

 test/image/test-imagetools.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Vagrant Cascadian Feb. 20, 2019, 1:09 a.m. UTC | #1
On 2019-02-14, Martyn Welch wrote:
> The syntax of dumpimage was simplified in commit 12b831879a76 ("tools:
> dumpimage: Simplify arguments"), but the test
> (test/image/test-imagetools.sh) was not updated and is now failing.
>
> Update the test to use the new syntax.

This does fix the tests with the new syntax, so:

Tested-by: Vagrant Cascadian <vagrant@debian.org>


It doesn't address the changed syntax of the command. All users of
dumpimage outside of u-boot will have to update to the new syntax, and
detect the version if they for some reason need to support both old and
new dumpimage syntax. Maybe that's not a deal-breaker; I'm not sure how
to cleanly handle that.


live well,
  vagrant

> ---
>
>  test/image/test-imagetools.sh | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/test/image/test-imagetools.sh b/test/image/test-imagetools.sh
> index 256af71d42..907f46a7b5 100755
> --- a/test/image/test-imagetools.sh
> +++ b/test/image/test-imagetools.sh
> @@ -102,10 +102,10 @@ create_multi_image()
>  extract_multi_image()
>  {
>  	echo -e "\nExtracting multi-file image contents..."
> -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 0 ${DATAFILE0}
> -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 1 ${DATAFILE1}
> -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2 ${DATAFILE2}
> -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2 ${DATAFILE2} -o ${TEST_OUT}
> +	do_cmd ${DUMPIMAGE} -T multi -p 0 -o ${DATAFILE0} ${IMAGE_MULTI}
> +	do_cmd ${DUMPIMAGE} -T multi -p 1 -o ${DATAFILE1} ${IMAGE_MULTI}
> +	do_cmd ${DUMPIMAGE} -T multi -p 2 -o ${DATAFILE2} ${IMAGE_MULTI}
> +	do_cmd ${DUMPIMAGE} -T multi -p 2 -o ${TEST_OUT} ${IMAGE_MULTI}
>  	echo "done."
>  }
>  
> @@ -166,10 +166,10 @@ create_fit_image()
>  extract_fit_image()
>  {
>  	echo -e "\nExtracting FIT image contents..."
> -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 0 ${DATAFILE0}
> -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 1 ${DATAFILE1}
> -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2 ${DATAFILE2}
> -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2 ${DATAFILE2} -o ${TEST_OUT}
> +	do_cmd ${DUMPIMAGE} -T flat_dt -p 0 -o ${DATAFILE0} ${IMAGE_FIT_ITB}
> +	do_cmd ${DUMPIMAGE} -T flat_dt -p 1 -o ${DATAFILE1} ${IMAGE_FIT_ITB}
> +	do_cmd ${DUMPIMAGE} -T flat_dt -p 2 -o ${DATAFILE2} ${IMAGE_FIT_ITB}
> +	do_cmd ${DUMPIMAGE} -T flat_dt -p 2 -o ${TEST_OUT} ${IMAGE_FIT_ITB}
>  	echo "done."
>  }
>  
> -- 
> 2.20.1
Martyn Welch Feb. 20, 2019, 10:51 a.m. UTC | #2
On Tue, 2019-02-19 at 17:09 -0800, Vagrant Cascadian wrote:
> On 2019-02-14, Martyn Welch wrote:
> > The syntax of dumpimage was simplified in commit 12b831879a76
> > ("tools:
> > dumpimage: Simplify arguments"), but the test
> > (test/image/test-imagetools.sh) was not updated and is now failing.
> > 
> > Update the test to use the new syntax.
> 
> This does fix the tests with the new syntax, so:
> 
> Tested-by: Vagrant Cascadian <vagrant@debian.org>
> 
> 
> It doesn't address the changed syntax of the command. All users of
> dumpimage outside of u-boot will have to update to the new syntax,
> and
> detect the version if they for some reason need to support both old
> and
> new dumpimage syntax. Maybe that's not a deal-breaker; I'm not sure
> how
> to cleanly handle that.
> 

Thanks for the Tested-by.

The syntax of dumpimage seemed horribly broken to me when I attempted
to use it, hence deciding to scratch that itch.

This seems to be a developer tool and I can't think of any uses for
this where I'd feel the need to script it. Of course I might be wrong
and others may have very different workflows to me. :-)

There's the "-V" option that's been present since the first commit of
this tool, so if necessary it would be possible to check that and make
decisions based on what it returns.

Martyn


> 
> live well,
>   vagrant
> 
> > ---
> > 
> >  test/image/test-imagetools.sh | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/test/image/test-imagetools.sh b/test/image/test-
> > imagetools.sh
> > index 256af71d42..907f46a7b5 100755
> > --- a/test/image/test-imagetools.sh
> > +++ b/test/image/test-imagetools.sh
> > @@ -102,10 +102,10 @@ create_multi_image()
> >  extract_multi_image()
> >  {
> >  	echo -e "\nExtracting multi-file image contents..."
> > -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 0
> > ${DATAFILE0}
> > -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 1
> > ${DATAFILE1}
> > -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2
> > ${DATAFILE2}
> > -	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2
> > ${DATAFILE2} -o ${TEST_OUT}
> > +	do_cmd ${DUMPIMAGE} -T multi -p 0 -o ${DATAFILE0}
> > ${IMAGE_MULTI}
> > +	do_cmd ${DUMPIMAGE} -T multi -p 1 -o ${DATAFILE1}
> > ${IMAGE_MULTI}
> > +	do_cmd ${DUMPIMAGE} -T multi -p 2 -o ${DATAFILE2}
> > ${IMAGE_MULTI}
> > +	do_cmd ${DUMPIMAGE} -T multi -p 2 -o ${TEST_OUT} ${IMAGE_MULTI}
> >  	echo "done."
> >  }
> >  
> > @@ -166,10 +166,10 @@ create_fit_image()
> >  extract_fit_image()
> >  {
> >  	echo -e "\nExtracting FIT image contents..."
> > -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 0
> > ${DATAFILE0}
> > -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 1
> > ${DATAFILE1}
> > -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2
> > ${DATAFILE2}
> > -	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2
> > ${DATAFILE2} -o ${TEST_OUT}
> > +	do_cmd ${DUMPIMAGE} -T flat_dt -p 0 -o ${DATAFILE0}
> > ${IMAGE_FIT_ITB}
> > +	do_cmd ${DUMPIMAGE} -T flat_dt -p 1 -o ${DATAFILE1}
> > ${IMAGE_FIT_ITB}
> > +	do_cmd ${DUMPIMAGE} -T flat_dt -p 2 -o ${DATAFILE2}
> > ${IMAGE_FIT_ITB}
> > +	do_cmd ${DUMPIMAGE} -T flat_dt -p 2 -o ${TEST_OUT}
> > ${IMAGE_FIT_ITB}
> >  	echo "done."
> >  }
> >  
> > -- 
> > 2.20.1
Tom Rini March 9, 2019, 3:53 a.m. UTC | #3
On Thu, Feb 14, 2019 at 01:11:35PM +0000, Martyn Welch wrote:

> The syntax of dumpimage was simplified in commit 12b831879a76 ("tools:
> dumpimage: Simplify arguments"), but the test
> (test/image/test-imagetools.sh) was not updated and is now failing.
> 
> Update the test to use the new syntax.
> 
> Reported-by: Vagrant Cascadian <vagrant@debian.org>
> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Vagrant Cascadian <vagrant@debian.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/test/image/test-imagetools.sh b/test/image/test-imagetools.sh
index 256af71d42..907f46a7b5 100755
--- a/test/image/test-imagetools.sh
+++ b/test/image/test-imagetools.sh
@@ -102,10 +102,10 @@  create_multi_image()
 extract_multi_image()
 {
 	echo -e "\nExtracting multi-file image contents..."
-	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 0 ${DATAFILE0}
-	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 1 ${DATAFILE1}
-	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2 ${DATAFILE2}
-	do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2 ${DATAFILE2} -o ${TEST_OUT}
+	do_cmd ${DUMPIMAGE} -T multi -p 0 -o ${DATAFILE0} ${IMAGE_MULTI}
+	do_cmd ${DUMPIMAGE} -T multi -p 1 -o ${DATAFILE1} ${IMAGE_MULTI}
+	do_cmd ${DUMPIMAGE} -T multi -p 2 -o ${DATAFILE2} ${IMAGE_MULTI}
+	do_cmd ${DUMPIMAGE} -T multi -p 2 -o ${TEST_OUT} ${IMAGE_MULTI}
 	echo "done."
 }
 
@@ -166,10 +166,10 @@  create_fit_image()
 extract_fit_image()
 {
 	echo -e "\nExtracting FIT image contents..."
-	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 0 ${DATAFILE0}
-	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 1 ${DATAFILE1}
-	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2 ${DATAFILE2}
-	do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2 ${DATAFILE2} -o ${TEST_OUT}
+	do_cmd ${DUMPIMAGE} -T flat_dt -p 0 -o ${DATAFILE0} ${IMAGE_FIT_ITB}
+	do_cmd ${DUMPIMAGE} -T flat_dt -p 1 -o ${DATAFILE1} ${IMAGE_FIT_ITB}
+	do_cmd ${DUMPIMAGE} -T flat_dt -p 2 -o ${DATAFILE2} ${IMAGE_FIT_ITB}
+	do_cmd ${DUMPIMAGE} -T flat_dt -p 2 -o ${TEST_OUT} ${IMAGE_FIT_ITB}
 	echo "done."
 }