On Tue, Nov 26, 2013 at 07:28:27PM +0100, [email protected] wrote: > Hi! > > Valuable $errmesg wasn't initialized at beginning, when bash option > > "nounset" is set, statement like errmesg="$errmesg XXXXXX" will cause > > bash unbound variable error. > > > > Furthermore, $errmesg will be echoed every time it is assigned, so > > there is no need for accumulated assignment. > > > > Signed-off-by: Monson Shao <[email protected]> > > --- > > testcases/kernel/containers/netns/runnetnstest.sh | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/testcases/kernel/containers/netns/runnetnstest.sh > > b/testcases/kernel/containers/netns/runnetnstest.sh > > index fb494a2..f7bf80f 100755 > > --- a/testcases/kernel/containers/netns/runnetnstest.sh > > +++ b/testcases/kernel/containers/netns/runnetnstest.sh > > @@ -60,7 +60,7 @@ two_children_ns > > rc=$? > > if [ $rc -ne 0 ]; then > > exit_code=$rc > > - errmesg="$errmesg two_children_ns: return code is $exit_code ; " > > + errmesg="two_children_ns: return code is $exit_code ; " > > echo $errmesg > > else > > echo "two_children_ns: PASS" > > @@ -71,7 +71,7 @@ crtchild_delchild > > rc=$? > > if [ $rc -ne 0 ]; then > > exit_code=$rc > > - errmesg="$errmesg crtchild_delchild: return code is $exit_code ; " > > + errmesg="crtchild_delchild: return code is $exit_code ; " > > echo $errmesg > > else > > echo "crtchild_delchild: PASS" > > @@ -83,7 +83,7 @@ par_chld_ipv6 > > rc=$? > > if [ $rc -ne 0 ]; then > > exit_code=$rc > > - errmesg="$errmesg par_chld_ipv6: return code is $exit_code ; " > > + errmesg="par_chld_ipv6: return code is $exit_code ; " > > echo $errmesg > > else > > echo "par_chld_ipv6: PASS" > > @@ -99,7 +99,7 @@ echo > > #rc=$? > > #if [ $rc -ne 0 ]; then > > # exit_code=$rc > > -# errmesg="$errmesg sysfsview: return code is $exit_code ; " > > +# errmesg="sysfsview: return code is $exit_code ; " > > # echo $errmesg > > #else > > # echo "sysfsview: PASS" > > @@ -119,7 +119,7 @@ par_chld_ftp > > rc=$? > > if [ $rc -ne 0 ]; then > > exit_code=$rc > > - errmesg="$errmesg par_chld_ftp: FAIL $exit_code ; " > > + errmesg="par_chld_ftp: FAIL $exit_code ; " > > echo $errmesg > > else > > echo "par_chld_ftp: PASS" > > I wonder why there is errmesg variable at all and not just echo, it > doesn't seems to be used anywhere else.
I wonder too, but I thought there might be some reason, so I only fix the error and leave the imperfect behind. > > Moreover the way the testcases are executed is not well designed, the > runtest file 'containers' executes script container_test.sh which > executes several scripts and the scripts finally executes the tescases. > This is really nightmare if you are trying to find what fails and why... > > It would be much better to execute the testcases directly one by one > from the runtest file, and in most of the cases that would just need to > move code the checks if there is support for particual container to the > testcases. Can't agree more, but it takes time to change the whole structure in testcases/kernel/containers/netns/ ... Thanks, monson > > -- > Cyril Hrubis > [email protected] -- #29 @NAY - Beijing, China - UTC+08 IRC: monson (#kernel-qe, #eng-china) Int.: 838 8384 Ext.: +86 10 6260 8384 ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
