On Tuesday 21 October 2008, CAI Qian wrote:
> Hi,
>
> I have one concern about this part,
>
> diff --git a/testcases/network/iptables/iptables_tests.sh
>  b/testcases/network/iptables/iptables_tests.sh
> @@ -134,12 +134,12 @@
>       TCID=iptables01         # Name of the test case.
>       TST_COUNT=1             # Test number.
>
> -     local chaincnt=0        # chain counter
> +     chaincnt=0      # chain counter
>
> -     local cmd="iptables -L -t filter"
> +     cmd="iptables -L -t filter"
>       tst_resm TINFO \
>               "$TCID: $cmd will list all rules in table filter."
> @@ -155,10 +155,10 @@
>               fi
>       fi
>
> -     local cmd="iptables -L -t nat"
> +     cmd="iptables -L -t nat"
>       tst_resm TINFO \
>               "$TCID: $cmd will list all rules in table nat."
> -     $cmd &>$LTPTMP/tst_iptables.out || RC=$?
> +     $cmd > $LTPTMP/tst_iptables.out 2>&1 || RC=$?
>       if [ $RC -ne 0 ]; then
>               tst_res TFAIL $LTPTMP/tst_iptables.out \
>                       "$TCID: $cmd failed to list rules. Reason:"
> @@ -174,10 +174,10 @@
>               fi
>       fi
>
> -     local cmd="iptables -L -t mangle"
> +     cmd="iptables -L -t mangle"
>       tst_resm TINFO \
>               "$TCID: $cmd will list all rules in table mangle."
> -     $cmd &>$LTPTMP/tst_iptables.out || RC=$?
> +     $cmd > $LTPTMP/tst_iptables.out 2>&1 || RC=$?
>       if [ $RC -ne 0 ]; then
>               tst_res TFAIL $LTPTMP/tst_iptables.out \
>                       "$TCID: $cmd failed to list rules. Reason:"
> @@ -351,15 +351,15 @@
>       RC=0                    # Return value from commands.
>       TCID=iptables04         # Name of the test case.
>       TST_COUNT=4             # Test number.
> -     local dport=45886                               # destination port
> -     local logprefix="$TCID-$(date +%m%d%H%M%S):"    # log-prefix used by
> iptables +    dport=45886                             # destination port
> +     logprefix="$TCID-$(date +%m%d%H%M%S):"  # log-prefix used by iptables
>
>       tst_resm TINFO \
> @@ -417,14 +417,14 @@
>       RC=0                    # Return value from commands.
>       TCID=iptables05         # Name of the test case.
>       TST_COUNT=5             # Test number.
> -     local dport=0                                   # destination port
> -     local logprefix="$TCID-$(date +%m%d%H%M%S):"    # log-prefix used by
> iptables +    dport=0                                 # destination port
> +     logprefix="$TCID-$(date +%m%d%H%M%S):"  # log-prefix used by iptables
>
>       tst_resm TINFO \
> @@ -492,15 +492,15 @@
>       RC=0                    # Return value from commands.
>       TCID=iptables06         # Name of the test case.
>       TST_COUNT=6             # Test number.
> -     local logcnt=0          # log counter
> -     local logprefix="$TCID-$(date +%m%d%H%M%S):"    # log-prefix used by
> iptables +    logcnt=0                # log counter
> +     logprefix="$TCID-$(date +%m%d%H%M%S):"  # log-prefix used by iptables
>
>       tst_resm TINFO \
>
> As all "local" keywords has been removed, is it possible that those
> variable have been reused unexpectedly later? Otherwise, all those patches
> look good, and seems not break any existing functionality.

did you actually hit an issue with the usage of "local" ?  while it isnt in 
POSIX, there has yet to be anyone to use a real shell that doesnt support it.  
considering the bugs it prevents, it should stay if you dont have a real 
case.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to