httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1726183 - in /httpd/test/mod_h2/trunk/test: test_common.sh test_trailer.sh
Date Fri, 22 Jan 2016 11:47:40 GMT
Author: icing
Date: Fri Jan 22 11:47:39 2016
New Revision: 1726183

URL: http://svn.apache.org/viewvc?rev=1726183&view=rev
Log:
local var change

Modified:
    httpd/test/mod_h2/trunk/test/test_common.sh
    httpd/test/mod_h2/trunk/test/test_trailer.sh

Modified: httpd/test/mod_h2/trunk/test/test_common.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_common.sh?rev=1726183&r1=1726182&r2=1726183&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Fri Jan 22 11:47:39 2016
@@ -94,8 +94,8 @@ case "$OPT_DIRECT" in
 esac
 
 curl_check_doc() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     ARGS="$@"
     echo -n " * curl /$DOC: $MSG..."
     rm -rf $TMP
@@ -106,8 +106,8 @@ curl_check_doc() {
 }
 
 curl_check_alpn() {
-    PROTOCOL="$1"; shift;
-    MSG="$1"; shift;
+    local PROTOCOL="$1"; shift;
+    local MSG="$1"; shift;
     ARGS="$@ -v"
     echo -n " * curl /: $MSG..."
     rm -rf $TMP
@@ -118,19 +118,19 @@ curl_check_alpn() {
 }
 
 nghttp_check_doc() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     echo -n " * nghttp /$DOC: $MSG..."
     rm -rf $TMP &&
     mkdir -p "$TMP" &&
-    ${NGHTTP} "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    ${NGHTTP} "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
     diff  $DOC_ROOT/$DOC $TMP/$DOC || fail
     echo ok.
 }
 
 nghttp_filter_assets() {
-    infile="$1"
-    outfile="$2"
+    local infile="$1"
+    local outfile="$2"
     fgrep " /" "$infile" | while read id begin end dur stat size path xxx; do
         if test "$end" = '*'; then
             end="$dur"
@@ -146,13 +146,13 @@ nghttp_filter_assets() {
 }
 
 nghttp_check_status() {
-    DOC="$1"; shift;
-    STATUS="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local STATUS="$1"; shift;
+    local MSG="$1"; shift;
     echo -n " * nghttp /$DOC: $MSG..."
     rm -rf $TMP &&
     mkdir -p "$TMP" &&
-    ${NGHTTP} -ans "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
+    ${NGHTTP} -ans "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
     nghttp_filter_assets $TMP/out $TMP/output
     read url clen status xxx < $TMP/output
     test "$STATUS" = "$status" || fail "unexpected status(exp $STATUS): $( cat $TMP/output
)"
@@ -160,26 +160,26 @@ nghttp_check_status() {
 }
 
 nghttp_check_assets() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     echo -n " * nghttp /$DOC: $MSG..."
     rm -rf $TMP &&
     mkdir -p "$TMP"
     sort > $TMP/reference
-    ${NGHTTP} -ans "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
+    ${NGHTTP} -ans "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
     nghttp_filter_assets $TMP/out $TMP/output
     diff $TMP/reference $TMP/output  || fail
     echo ok.
 }
 
 nghttp_check_pushed() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     echo -n " * nghttp /$DOC: $MSG..."
     rm -rf $TMP &&
     mkdir -p "$TMP"
     sort > $TMP/reference
-    ${NGHTTP} -ns "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
+    ${NGHTTP} -ns "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
     fgrep " /" $TMP/out | while read id begin end dur stat size path xxx; do
         if test "$end" = '*'; then
             end="$dur"
@@ -197,9 +197,9 @@ nghttp_check_pushed() {
 }
 
 nghttp_check_rst_error() {
-    DOC="$1"; shift;
-    ERROR="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local ERROR="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     echo -n " * nghttp /$DOC: $MSG..."
@@ -210,35 +210,35 @@ nghttp_check_rst_error() {
 }
 
 nghttp_check_content() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     cat > $TMP/expected
     echo -n " * nghttp /$DOC: $MSG..."
-    ${NGHTTP} "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    ${NGHTTP} "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
     diff  $TMP/expected $TMP/$DOC || fail
     echo ok.
 }
 
 nghttp_check_fcontent() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     rm -f $TMP/expected; while read fpath; do
         cat $DOC_ROOT/$fpath >> $TMP/expected
     done
     echo -n " * nghttp /$DOC: $MSG..."
-    ${NGHTTP} "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    ${NGHTTP} "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
     diff  $TMP/expected $TMP/$DOC || fail
     echo ok.
 }
 
 nghttp_check_promises() {
-    MSG="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
-    mkdir -p "$(dirname $TMP/$DOC)"
+    mkdir -p "$TMP"
     cat > $TMP/expected
     echo -n " * nghttp /$DOC: $MSG..."
     ${NGHTTP} $ARG_UPGRADE -nv "$@" 2>&1 | fgrep "PUSH_PROMISE" |
@@ -252,8 +252,8 @@ nghttp_check_promises() {
 }
 
 mh2fuzz_check_cache_digest() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     cat > $TMP/expected
@@ -264,9 +264,9 @@ mh2fuzz_check_cache_digest() {
 }
 
 curl_check_status() {
-    DOC="$1"; shift;
-    STATUS="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local STATUS="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     echo -n " * curl /$DOC: $MSG..."
@@ -279,9 +279,9 @@ curl_check_status() {
 }
 
 curl_check_upgrade() {
-    DOC="$1"; shift;
-    UPGRADE="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local UPGRADE="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     echo -n " * curl /$DOC: $MSG..."
@@ -294,8 +294,8 @@ curl_check_upgrade() {
 }
 
 curl_check_content() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     cat > $TMP/expected
@@ -306,40 +306,38 @@ curl_check_content() {
 }
 
 curl_check_redir() {
-    DOC="$1"; shift;
-    REF_DOC="$1"; shift;
-    MSG="$1"; shift;
-    ARGS="$@"
+    local DOC="$1"; shift;
+    local REF_DOC="$1"; shift;
+    local MSG="$1"; shift;
     echo -n " * curl redir /$DOC: $MSG..."
     rm -rf $TMP
     mkdir -p $TMP
-    ${CURL} -D - $ARGS $URL_PREFIX/$DOC >$TMP/redir.out || fail
+    ${CURL} -D - "$@" $URL_PREFIX/$DOC >$TMP/redir.out || fail
     LOCATION=$( fgrep -i 'location:' $TMP/redir.out | sed -e "s,.*$URL_PREFIX/,," | tr -d
'\r\n' )
     test "$REF_DOC" != "$LOCATION" && fail "expected redirect to >>>$REF_DOC<<<,
found >>>$LOCATION<<<"
-    ${CURL} $ARGS $URL_PREFIX/$LOCATION >$TMP/$LOCATION || fail
+    ${CURL} "$@" $URL_PREFIX/$LOCATION >$TMP/$LOCATION || fail
     diff  $DOC_ROOT/$REF_DOC $TMP/$LOCATION || fail
     echo ok.
 }
 
 curl_check_necho() {
-    COUNT="$1"; shift;
-    TEXT="$1"; shift;
-    REF="$1"; shift;
-    MSG="$1"; shift;
-    ARGS="$@"
+    local COUNT="$1"; shift;
+    local TEXT="$1"; shift;
+    local REF="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p $TMP
     echo -n " * curl /necho.py?count=$COUNT&text=$TEXT..."
-    ${CURL} $ARGS -F count="$COUNT" -F text="$TEXT" $URL_PREFIX/necho.py > $TMP/echo 2>&1
|| fail
+    ${CURL} "$@" -F count="$COUNT" -F text="$TEXT" $URL_PREFIX/necho.py > $TMP/echo 2>&1
|| fail
     diff  $REF $TMP/echo || fail
     echo ok.
 }
 
 curl_post_file() {
-    DOC="$1"; shift;
-    FILE="$1"; shift;
-    MSG="$1"; shift;
-    ARGS="$@"
+    local DOC="$1"; shift;
+    local FILE="$1"; shift;
+    local MSG="$1"; shift;
+    local ARGS="$@"
     fname="$(basename $FILE)"
     rm -rf $TMP
     mkdir -p $TMP
@@ -351,25 +349,23 @@ curl_post_file() {
 }
 
 curl_post_data() {
-    DOC="$1"; shift;
-    FILE="$1"; shift;
-    MSG="$1"; shift;
-    ARGS="$@"
+    local DOC="$1"; shift;
+    local FILE="$1"; shift;
+    local MSG="$1"; shift;
     fname="$(basename $FILE)"
     rm -rf $TMP
     mkdir -p $TMP
     echo -n " * curl /$DOC: $MSG..."
-    ${CURL} $ARGS --form file=@"$FILE" $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
-    ${CURL} $ARGS $URL_PREFIX/files/"$fname" > $TMP/data.down 2>&1 || fail
+    ${CURL} "$@" --form file=@"$FILE" $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    ${CURL} "$@" $URL_PREFIX/files/"$fname" > $TMP/data.down 2>&1 || fail
     diff  $FILE $TMP/data.down || fail
     echo ok.
 }
 
 nghttp_remove_file() {
-    DOC="$1"; shift;
-    FILE="$1"; shift;
-    MSG="$1"; shift;
-    ARGS="$@"$ARG_UPGRADE
+    local DOC="$1"; shift;
+    local FILE="$1"; shift;
+    local MSG="$1"; shift;
     fname="$(basename $FILE)"
     rm -rf $TMP
     mkdir -p $TMP
@@ -382,14 +378,14 @@ $fname
 --DSAJKcd9876--
 EOF
     echo -n " * nghttp /$DOC: rm $fname..."
-    ${NGHTTP} -v $ARGS --data=$TMP/updata -H'Content-Type: multipart/form-data; boundary=DSAJKcd9876'
$URL_PREFIX/$DOC > $TMP/$DOC || fail "error removing $fname"
+    ${NGHTTP} -v "$@"$ARG_UPGRADE --data=$TMP/updata -H'Content-Type: multipart/form-data;
boundary=DSAJKcd9876' $URL_PREFIX/$DOC > $TMP/$DOC || fail "error removing $fname"
     echo ok.
 }
 
 nghttp_post_file() {
-    DOC="$1"; shift;
-    FILE="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local FILE="$1"; shift;
+    local MSG="$1"; shift;
     fname="$(basename $FILE)"
     rm -rf $TMP
     mkdir -p $TMP
@@ -417,10 +413,9 @@ EOF
 }
 
 nghttp_post_name() {
-    DOC="$1"; shift;
-    NAME="$1"; shift;
-    MSG="$1"; shift;
-    fname="$(basename $FILE)"
+    local DOC="$1"; shift;
+    local NAME="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p $TMP
     cat > $TMP/expected
@@ -439,22 +434,22 @@ EOF
 }
 
 nghttp_post_data() {
-    DOC="$1"; shift;
-    FILE="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local FILE="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p $TMP
     echo -n " * nghttp /$DOC: $MSG..."
-    ${NGHTTP} "$@" $ARG_UPGRADE --data=$FILE $URL_PREFIX/$DOC > $TMP/data.down || fail
"error uploading $fname"
+    ${NGHTTP} "$@"$ARG_UPGRADE --data=$FILE $URL_PREFIX/$DOC > $TMP/data.down || fail
"error uploading $fname"
     diff  $FILE $TMP/data.down || fail
     echo ok.
 }
 
 
 curl_check_altsvc() {
-    DOC="$1"; shift;
-    EXP_ALT_SVC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local EXP_ALT_SVC="$1"; shift;
+    local MSG="$1"; shift;
     mkdir -p $TMP
     echo -n " * curl check alt_svc at /$DOC..."
     ${CURL} "$@" -D $TMP/headers $URL_PREFIX/$DOC > /dev/null 2>&1 || fail "curl
failed with $?"
@@ -465,8 +460,8 @@ curl_check_altsvc() {
 }
 
 mh2fuzz_check_frames() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     cat > $TMP/expected
@@ -477,8 +472,8 @@ mh2fuzz_check_frames() {
 }
 
 mh2fuzz_check_recv_frames() {
-    DOC="$1"; shift;
-    MSG="$1"; shift;
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
     rm -rf $TMP
     mkdir -p "$(dirname $TMP/$DOC)"
     cat > $TMP/expected

Modified: httpd/test/mod_h2/trunk/test/test_trailer.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_trailer.sh?rev=1726183&r1=1726182&r2=1726183&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_trailer.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_trailer.sh Fri Jan 22 11:47:39 2016
@@ -37,13 +37,11 @@ if min_version 2.4.18; then
         --trailer "test: 3" --no-content-length 
 
     # check that we see a normal header as expected
-    nghttp_check_content echohd.py'?name=X' "echo header" \
-        -H 'X: 1' <<EOF
+    nghttp_check_content echohd.py'?name=X' "echo header" -H 'X: 1' <<EOF
 X: 1
 EOF
     # check if we also see a POSTed header
-    nghttp_post_name echohd.py'?name=X' Y "post+header" \
-        -H "X: 2" <<EOF
+    nghttp_post_name echohd.py'?name=X' Y "post+header" -H "X: 2" <<EOF
 X: 2
 EOF
     # check that in CGI, headers are visible, but trailers not



Mime
View raw message