* [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS @ 2018-05-07 3:24 Xiao Yang 2018-05-07 3:24 ` [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API Xiao Yang ` (2 more replies) 0 siblings, 3 replies; 14+ messages in thread From: Xiao Yang @ 2018-05-07 3:24 UTC (permalink / raw) To: ltp If the first character of optstring is set to a colon(tcp_fastopen_run.sh, nfs_lib.sh), getopts should be in silent mode rather than process it as an argument of 6. Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> --- testcases/lib/tst_net.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 3a0fe01..32b4f09 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -19,7 +19,7 @@ # Author: Alexey Kodanev <alexey.kodanev@oracle.com> # -TST_OPTS="6$TST_OPTS" +TST_OPTS="${TST_OPTS}6" TST_PARSE_ARGS_CALLER="$TST_PARSE_ARGS" TST_PARSE_ARGS="tst_net_parse_args" TST_USAGE_CALLER="$TST_USAGE" -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API 2018-05-07 3:24 [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Xiao Yang @ 2018-05-07 3:24 ` Xiao Yang 2018-05-07 6:44 ` Petr Vorel 2018-05-23 7:48 ` Petr Vorel 2018-05-07 3:24 ` [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup " Xiao Yang 2018-05-07 6:43 ` [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Petr Vorel 2 siblings, 2 replies; 14+ messages in thread From: Xiao Yang @ 2018-05-07 3:24 UTC (permalink / raw) To: ltp 1) Process getopts parameters by TST_OPTS and TST_PARSE_ARGS 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> --- testcases/network/tcp_fastopen/tcp_fastopen_run.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh index 5cc9804..865b3d4 100755 --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh @@ -20,8 +20,9 @@ TST_NETLOAD_MAX_SRV_REPLIES=3 -while getopts :hr:n:R:6 opt; do - case "$opt" in +tcp_fastopen_parse_args() +{ + case "$1" in h) echo "Usage:" echo "h help" @@ -29,17 +30,18 @@ while getopts :hr:n:R:6 opt; do echo "6 run over IPv6" exit 0 ;; - R) TST_NETLOAD_MAX_SRV_REPLIES=$OPTARG ;; - 6) TST_IPV6=6 ;; - *) tst_brkm TBROK "unknown option: $opt" ;; + R) TST_NETLOAD_MAX_SRV_REPLIES=$2 ;; + *) tst_brkm TBROK "unknown option: $1" ;; esac -done -shift $(($OPTIND - 1)) +} TST_TOTAL=1 TCID="tcp_fastopen" TST_NEEDS_TMPDIR=1 +TST_OPTS=":hr:n:R:" +TST_PARSE_ARGS=tcp_fastopen_parse_args + TST_USE_LEGACY_API=1 . tst_net.sh -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API 2018-05-07 3:24 ` [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API Xiao Yang @ 2018-05-07 6:44 ` Petr Vorel 2018-05-07 7:18 ` Xiao Yang 2018-05-23 7:48 ` Petr Vorel 1 sibling, 1 reply; 14+ messages in thread From: Petr Vorel @ 2018-05-07 6:44 UTC (permalink / raw) To: ltp Hi, > 1) Process getopts parameters by TST_OPTS and TST_PARSE_ARGS > 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions > Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> > --- > testcases/network/tcp_fastopen/tcp_fastopen_run.sh | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh > index 5cc9804..865b3d4 100755 > --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh > +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh > @@ -20,8 +20,9 @@ > TST_NETLOAD_MAX_SRV_REPLIES=3 > -while getopts :hr:n:R:6 opt; do > - case "$opt" in > +tcp_fastopen_parse_args() > +{ > + case "$1" in > h) > echo "Usage:" > echo "h help" > @@ -29,17 +30,18 @@ while getopts :hr:n:R:6 opt; do > echo "6 run over IPv6" > exit 0 > ;; > - R) TST_NETLOAD_MAX_SRV_REPLIES=$OPTARG ;; > - 6) TST_IPV6=6 ;; > - *) tst_brkm TBROK "unknown option: $opt" ;; > + R) TST_NETLOAD_MAX_SRV_REPLIES=$2 ;; > + *) tst_brkm TBROK "unknown option: $1" ;; > esac > -done > -shift $(($OPTIND - 1)) > +} > TST_TOTAL=1 > TCID="tcp_fastopen" > TST_NEEDS_TMPDIR=1 > +TST_OPTS=":hr:n:R:" > +TST_PARSE_ARGS=tcp_fastopen_parse_args > + > TST_USE_LEGACY_API=1 > . tst_net.sh Acked-by: Petr Vorel <pvorel@suse.cz> NOTE: I propose to merge this patch-set after release (as it's not a bugfix, we should respect git freeze). Kind regards, Petr ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API 2018-05-07 6:44 ` Petr Vorel @ 2018-05-07 7:18 ` Xiao Yang 0 siblings, 0 replies; 14+ messages in thread From: Xiao Yang @ 2018-05-07 7:18 UTC (permalink / raw) To: ltp On 2018/05/07 14:44, Petr Vorel wrote: > Hi, > >> 1) Process getopts parameters by TST_OPTS and TST_PARSE_ARGS >> 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions >> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com> >> --- >> testcases/network/tcp_fastopen/tcp_fastopen_run.sh | 16 +++++++++------- >> 1 file changed, 9 insertions(+), 7 deletions(-) >> diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh >> index 5cc9804..865b3d4 100755 >> --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh >> +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh >> @@ -20,8 +20,9 @@ >> TST_NETLOAD_MAX_SRV_REPLIES=3 >> -while getopts :hr:n:R:6 opt; do >> - case "$opt" in >> +tcp_fastopen_parse_args() >> +{ >> + case "$1" in >> h) >> echo "Usage:" >> echo "h help" >> @@ -29,17 +30,18 @@ while getopts :hr:n:R:6 opt; do >> echo "6 run over IPv6" >> exit 0 >> ;; >> - R) TST_NETLOAD_MAX_SRV_REPLIES=$OPTARG ;; >> - 6) TST_IPV6=6 ;; >> - *) tst_brkm TBROK "unknown option: $opt" ;; >> + R) TST_NETLOAD_MAX_SRV_REPLIES=$2 ;; >> + *) tst_brkm TBROK "unknown option: $1" ;; >> esac >> -done >> -shift $(($OPTIND - 1)) >> +} >> TST_TOTAL=1 >> TCID="tcp_fastopen" >> TST_NEEDS_TMPDIR=1 >> +TST_OPTS=":hr:n:R:" >> +TST_PARSE_ARGS=tcp_fastopen_parse_args >> + >> TST_USE_LEGACY_API=1 >> . tst_net.sh > Acked-by: Petr Vorel<pvorel@suse.cz> > > NOTE: I propose to merge this patch-set after release (as it's not a bugfix, we should respect git freeze). Hi Petr, Agreed, we could megre it after release. :-) Thanks, Xiao Yang > > Kind regards, > Petr > > > . > ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API 2018-05-07 3:24 ` [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API Xiao Yang 2018-05-07 6:44 ` Petr Vorel @ 2018-05-23 7:48 ` Petr Vorel 1 sibling, 0 replies; 14+ messages in thread From: Petr Vorel @ 2018-05-23 7:48 UTC (permalink / raw) To: ltp Hi Xiao, > 1) Process getopts parameters by TST_OPTS and TST_PARSE_ARGS > 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions > Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> > --- Pushed, with minor change removing ':' (will be added in tst_net.sh as Alexey suggested). Kind regards, Petr +++ testcases/network/tcp_fastopen/tcp_fastopen_run.sh @@ -39,7 +39,7 @@ TST_TOTAL=1 TCID="tcp_fastopen" TST_NEEDS_TMPDIR=1 -TST_OPTS=":hr:n:R:" +TST_OPTS="hr:n:R:" TST_PARSE_ARGS=tcp_fastopen_parse_args TST_USE_LEGACY_API=1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup for legacy API 2018-05-07 3:24 [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Xiao Yang 2018-05-07 3:24 ` [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API Xiao Yang @ 2018-05-07 3:24 ` Xiao Yang 2018-05-07 7:18 ` Petr Vorel ` (2 more replies) 2018-05-07 6:43 ` [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Petr Vorel 2 siblings, 3 replies; 14+ messages in thread From: Xiao Yang @ 2018-05-07 3:24 UTC (permalink / raw) To: ltp 1) Move common tst_net.sh to nfs_lib.sh itself 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> --- testcases/network/nfs/fsx-linux/fsx.sh | 2 -- testcases/network/nfs/nfs_stress/nfs01 | 2 -- testcases/network/nfs/nfs_stress/nfs02 | 2 -- testcases/network/nfs/nfs_stress/nfs03 | 2 -- testcases/network/nfs/nfs_stress/nfs04 | 2 -- testcases/network/nfs/nfs_stress/nfs05 | 2 -- testcases/network/nfs/nfs_stress/nfs06 | 2 -- testcases/network/nfs/nfs_stress/nfs_lib.sh | 13 ++++++++----- testcases/network/nfs/nfslock01/nfslock01 | 2 -- testcases/network/nfs/nfsstat01/nfsstat01 | 2 -- 10 files changed, 8 insertions(+), 23 deletions(-) diff --git a/testcases/network/nfs/fsx-linux/fsx.sh b/testcases/network/nfs/fsx-linux/fsx.sh index 84ad0e2..3f82d18 100755 --- a/testcases/network/nfs/fsx-linux/fsx.sh +++ b/testcases/network/nfs/fsx-linux/fsx.sh @@ -26,8 +26,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test() { diff --git a/testcases/network/nfs/nfs_stress/nfs01 b/testcases/network/nfs/nfs_stress/nfs01 index 93bf088..efaa215 100755 --- a/testcases/network/nfs/nfs_stress/nfs01 +++ b/testcases/network/nfs/nfs_stress/nfs01 @@ -25,8 +25,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test() { diff --git a/testcases/network/nfs/nfs_stress/nfs02 b/testcases/network/nfs/nfs_stress/nfs02 index 74aa3d8..5cbe771 100755 --- a/testcases/network/nfs/nfs_stress/nfs02 +++ b/testcases/network/nfs/nfs_stress/nfs02 @@ -25,8 +25,6 @@ TST_TOTAL=3 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test1() { diff --git a/testcases/network/nfs/nfs_stress/nfs03 b/testcases/network/nfs/nfs_stress/nfs03 index 3279a22..2de7622 100755 --- a/testcases/network/nfs/nfs_stress/nfs03 +++ b/testcases/network/nfs/nfs_stress/nfs03 @@ -25,8 +25,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs03_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh DIR_NUM=${DIR_NUM:-"100"} FILE_NUM=${FILE_NUM:-"100"} diff --git a/testcases/network/nfs/nfs_stress/nfs04 b/testcases/network/nfs/nfs_stress/nfs04 index 254c987..ccadbb1 100755 --- a/testcases/network/nfs/nfs_stress/nfs04 +++ b/testcases/network/nfs/nfs_stress/nfs04 @@ -28,8 +28,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh nfs_setup diff --git a/testcases/network/nfs/nfs_stress/nfs05 b/testcases/network/nfs/nfs_stress/nfs05 index 8c39cde..8435181 100755 --- a/testcases/network/nfs/nfs_stress/nfs05 +++ b/testcases/network/nfs/nfs_stress/nfs05 @@ -29,8 +29,6 @@ FILE_NUM=${FILE_NUM:-"50"} THREAD_NUM=${THREAD_NUM:-"8"} . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh tst_check_cmds make gcc diff --git a/testcases/network/nfs/nfs_stress/nfs06 b/testcases/network/nfs/nfs_stress/nfs06 index 628271a..0048190 100755 --- a/testcases/network/nfs/nfs_stress/nfs06 +++ b/testcases/network/nfs/nfs_stress/nfs06 @@ -25,8 +25,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test() { diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 28c43ba..7aed718 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -20,9 +20,6 @@ NFILES=${NFILES:=1000} SOCKET_TYPE="${SOCKET_TYPE:-udp}" NFS_TYPE=${NFS_TYPE:=nfs} -TST_OPTS=":hv:t:" -TST_PARSE_ARGS=nfs_parse_args - nfs_parse_args() { case "$1" in @@ -34,12 +31,18 @@ nfs_parse_args() echo "6 run over IPv6" exit 0 ;; - v) VERSION=$OPTARG;; - t) SOCKET_TYPE=$OPTARG;; + v) VERSION=$2;; + t) SOCKET_TYPE=$2;; *) tst_brkm TBROK "unknown option: $1" esac } +TST_OPTS=":hv:t:" +TST_PARSE_ARGS=nfs_parse_args + +TST_USE_LEGACY_API=1 +. tst_net.sh + get_socket_type() { local t diff --git a/testcases/network/nfs/nfslock01/nfslock01 b/testcases/network/nfs/nfslock01/nfslock01 index a545fa0..bf406e6 100755 --- a/testcases/network/nfs/nfslock01/nfslock01 +++ b/testcases/network/nfs/nfslock01/nfslock01 @@ -26,8 +26,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh LUSER=${LUSER:=root} diff --git a/testcases/network/nfs/nfsstat01/nfsstat01 b/testcases/network/nfs/nfsstat01/nfsstat01 index afd239f..9212518 100755 --- a/testcases/network/nfs/nfsstat01/nfsstat01 +++ b/testcases/network/nfs/nfsstat01/nfsstat01 @@ -22,8 +22,6 @@ TST_TOTAL=4 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh setup() { -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup for legacy API 2018-05-07 3:24 ` [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup " Xiao Yang @ 2018-05-07 7:18 ` Petr Vorel 2018-05-07 19:35 ` Petr Vorel 2018-05-23 8:12 ` Petr Vorel 2 siblings, 0 replies; 14+ messages in thread From: Petr Vorel @ 2018-05-07 7:18 UTC (permalink / raw) To: ltp Hi, > 1) Move common tst_net.sh to nfs_lib.sh itself > 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions > Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> > --- > testcases/network/nfs/fsx-linux/fsx.sh | 2 -- > testcases/network/nfs/nfs_stress/nfs01 | 2 -- > testcases/network/nfs/nfs_stress/nfs02 | 2 -- > testcases/network/nfs/nfs_stress/nfs03 | 2 -- > testcases/network/nfs/nfs_stress/nfs04 | 2 -- > testcases/network/nfs/nfs_stress/nfs05 | 2 -- > testcases/network/nfs/nfs_stress/nfs06 | 2 -- > testcases/network/nfs/nfs_stress/nfs_lib.sh | 13 ++++++++----- > testcases/network/nfs/nfslock01/nfslock01 | 2 -- > testcases/network/nfs/nfsstat01/nfsstat01 | 2 -- > 10 files changed, 8 insertions(+), 23 deletions(-) > diff --git a/testcases/network/nfs/fsx-linux/fsx.sh b/testcases/network/nfs/fsx-linux/fsx.sh > index 84ad0e2..3f82d18 100755 > --- a/testcases/network/nfs/fsx-linux/fsx.sh > +++ b/testcases/network/nfs/fsx-linux/fsx.sh > @@ -26,8 +26,6 @@ TST_TOTAL=1 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > do_test() > { > diff --git a/testcases/network/nfs/nfs_stress/nfs01 b/testcases/network/nfs/nfs_stress/nfs01 > index 93bf088..efaa215 100755 > --- a/testcases/network/nfs/nfs_stress/nfs01 > +++ b/testcases/network/nfs/nfs_stress/nfs01 > @@ -25,8 +25,6 @@ TST_TOTAL=1 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > do_test() > { > diff --git a/testcases/network/nfs/nfs_stress/nfs02 b/testcases/network/nfs/nfs_stress/nfs02 > index 74aa3d8..5cbe771 100755 > --- a/testcases/network/nfs/nfs_stress/nfs02 > +++ b/testcases/network/nfs/nfs_stress/nfs02 > @@ -25,8 +25,6 @@ TST_TOTAL=3 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > do_test1() > { > diff --git a/testcases/network/nfs/nfs_stress/nfs03 b/testcases/network/nfs/nfs_stress/nfs03 > index 3279a22..2de7622 100755 > --- a/testcases/network/nfs/nfs_stress/nfs03 > +++ b/testcases/network/nfs/nfs_stress/nfs03 > @@ -25,8 +25,6 @@ TST_TOTAL=1 > TST_CLEANUP="nfs03_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > DIR_NUM=${DIR_NUM:-"100"} > FILE_NUM=${FILE_NUM:-"100"} > diff --git a/testcases/network/nfs/nfs_stress/nfs04 b/testcases/network/nfs/nfs_stress/nfs04 > index 254c987..ccadbb1 100755 > --- a/testcases/network/nfs/nfs_stress/nfs04 > +++ b/testcases/network/nfs/nfs_stress/nfs04 > @@ -28,8 +28,6 @@ TST_TOTAL=1 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > nfs_setup > diff --git a/testcases/network/nfs/nfs_stress/nfs05 b/testcases/network/nfs/nfs_stress/nfs05 > index 8c39cde..8435181 100755 > --- a/testcases/network/nfs/nfs_stress/nfs05 > +++ b/testcases/network/nfs/nfs_stress/nfs05 > @@ -29,8 +29,6 @@ FILE_NUM=${FILE_NUM:-"50"} > THREAD_NUM=${THREAD_NUM:-"8"} > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > tst_check_cmds make gcc > diff --git a/testcases/network/nfs/nfs_stress/nfs06 b/testcases/network/nfs/nfs_stress/nfs06 > index 628271a..0048190 100755 > --- a/testcases/network/nfs/nfs_stress/nfs06 > +++ b/testcases/network/nfs/nfs_stress/nfs06 > @@ -25,8 +25,6 @@ TST_TOTAL=1 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > do_test() > { > diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh > index 28c43ba..7aed718 100644 > --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh > +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh > @@ -20,9 +20,6 @@ NFILES=${NFILES:=1000} > SOCKET_TYPE="${SOCKET_TYPE:-udp}" > NFS_TYPE=${NFS_TYPE:=nfs} > -TST_OPTS=":hv:t:" > -TST_PARSE_ARGS=nfs_parse_args > - > nfs_parse_args() > { > case "$1" in > @@ -34,12 +31,18 @@ nfs_parse_args() > echo "6 run over IPv6" > exit 0 > ;; > - v) VERSION=$OPTARG;; > - t) SOCKET_TYPE=$OPTARG;; > + v) VERSION=$2;; > + t) SOCKET_TYPE=$2;; > *) tst_brkm TBROK "unknown option: $1" > esac > } > +TST_OPTS=":hv:t:" > +TST_PARSE_ARGS=nfs_parse_args > + > +TST_USE_LEGACY_API=1 > +. tst_net.sh > + > get_socket_type() > { > local t > diff --git a/testcases/network/nfs/nfslock01/nfslock01 b/testcases/network/nfs/nfslock01/nfslock01 > index a545fa0..bf406e6 100755 > --- a/testcases/network/nfs/nfslock01/nfslock01 > +++ b/testcases/network/nfs/nfslock01/nfslock01 > @@ -26,8 +26,6 @@ TST_TOTAL=1 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > LUSER=${LUSER:=root} > diff --git a/testcases/network/nfs/nfsstat01/nfsstat01 b/testcases/network/nfs/nfsstat01/nfsstat01 > index afd239f..9212518 100755 > --- a/testcases/network/nfs/nfsstat01/nfsstat01 > +++ b/testcases/network/nfs/nfsstat01/nfsstat01 > @@ -22,8 +22,6 @@ TST_TOTAL=4 > TST_CLEANUP="nfs_cleanup" > . nfs_lib.sh > -TST_USE_LEGACY_API=1 > -. tst_net.sh > setup() > { Acked-by: Petr Vorel <pvorel@suse.cz> NOTE: I propose to merge this patch-set after release (as it's not a bugfix, we should respect git freeze). Kind regards, Petr ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup for legacy API 2018-05-07 3:24 ` [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup " Xiao Yang 2018-05-07 7:18 ` Petr Vorel @ 2018-05-07 19:35 ` Petr Vorel 2018-05-23 8:12 ` Petr Vorel 2 siblings, 0 replies; 14+ messages in thread From: Petr Vorel @ 2018-05-07 19:35 UTC (permalink / raw) To: ltp Hi Xiao, > 1) Move common tst_net.sh to nfs_lib.sh itself > 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions Second part suffers the same problem I introduced with commit 89a83d8a0, see: https://lists.linux.it/pipermail/ltp/2018-May/008035.html So we must hold this patch until ve solve it. Kind regards, Petr ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup for legacy API 2018-05-07 3:24 ` [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup " Xiao Yang 2018-05-07 7:18 ` Petr Vorel 2018-05-07 19:35 ` Petr Vorel @ 2018-05-23 8:12 ` Petr Vorel 2 siblings, 0 replies; 14+ messages in thread From: Petr Vorel @ 2018-05-23 8:12 UTC (permalink / raw) To: ltp Hi Xiao, > 1) Move common tst_net.sh to nfs_lib.sh itself > 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions > Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> > --- Pushed, with minor change removing ':' I'll add it into tst_net.sh for old API + send a patch for tst_net.sh as Alexey suggested. Kind regards, Petr ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS 2018-05-07 3:24 [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Xiao Yang 2018-05-07 3:24 ` [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API Xiao Yang 2018-05-07 3:24 ` [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup " Xiao Yang @ 2018-05-07 6:43 ` Petr Vorel 2018-05-07 7:30 ` Xiao Yang 2 siblings, 1 reply; 14+ messages in thread From: Petr Vorel @ 2018-05-07 6:43 UTC (permalink / raw) To: ltp Hi, > If the first character of optstring is set to a colon(tcp_fastopen_run.sh, > nfs_lib.sh), getopts should be in silent mode rather than process it as > an argument of 6. > Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> > --- > testcases/lib/tst_net.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh > index 3a0fe01..32b4f09 100644 > --- a/testcases/lib/tst_net.sh > +++ b/testcases/lib/tst_net.sh > @@ -19,7 +19,7 @@ > # Author: Alexey Kodanev <alexey.kodanev@oracle.com> > -TST_OPTS="6$TST_OPTS" > +TST_OPTS="${TST_OPTS}6" > TST_PARSE_ARGS_CALLER="$TST_PARSE_ARGS" > TST_PARSE_ARGS="tst_net_parse_args" > TST_USAGE_CALLER="$TST_USAGE" Acked-by: Petr Vorel <pvorel@suse.cz> Good catch. Although I propose to get rid of ':' at the beginning for users of new shell API (as it's IMHO better to see errors). Kind regards, Petr ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS 2018-05-07 6:43 ` [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Petr Vorel @ 2018-05-07 7:30 ` Xiao Yang 2018-05-07 8:09 ` Petr Vorel 0 siblings, 1 reply; 14+ messages in thread From: Xiao Yang @ 2018-05-07 7:30 UTC (permalink / raw) To: ltp On 2018/05/07 14:43, Petr Vorel wrote: > Hi, > >> If the first character of optstring is set to a colon(tcp_fastopen_run.sh, >> nfs_lib.sh), getopts should be in silent mode rather than process it as >> an argument of 6. >> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com> >> --- >> testcases/lib/tst_net.sh | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh >> index 3a0fe01..32b4f09 100644 >> --- a/testcases/lib/tst_net.sh >> +++ b/testcases/lib/tst_net.sh >> @@ -19,7 +19,7 @@ >> # Author: Alexey Kodanev<alexey.kodanev@oracle.com> > >> -TST_OPTS="6$TST_OPTS" >> +TST_OPTS="${TST_OPTS}6" >> TST_PARSE_ARGS_CALLER="$TST_PARSE_ARGS" >> TST_PARSE_ARGS="tst_net_parse_args" >> TST_USAGE_CALLER="$TST_USAGE" > Acked-by: Petr Vorel<pvorel@suse.cz> > > Good catch. Although I propose to get rid of ':' at the beginning for users of new shell > API (as it's IMHO better to see errors). Hi Petr, If getopts is in silent mode, the invalid option is placed in OPTARG, so we can see errors by printing the value of OPTARG. But it is reasonable for me to get rid of ':' at the beginning of optstring. :-) Thanks, Xiao Yang > > Kind regards, > Petr > > > . > ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS 2018-05-07 7:30 ` Xiao Yang @ 2018-05-07 8:09 ` Petr Vorel 2018-05-07 10:31 ` Alexey Kodanev 0 siblings, 1 reply; 14+ messages in thread From: Petr Vorel @ 2018-05-07 8:09 UTC (permalink / raw) To: ltp Hi Xiao, > > Good catch. Although I propose to get rid of ':' at the beginning for users of new shell > > API (as it's IMHO better to see errors). > Hi Petr, > If getopts is in silent mode, the invalid option is placed in OPTARG, so > we can see errors by printing > the value of OPTARG. But it is reasonable for me to get rid of ':' at the > beginning of optstring. :-) I know, TBROK inform us, so it can stay how it is for legacy API. I meant it for the new API, where is going to be removed (the TBROK as well) as error is handled in tst_run in tst_test.sh. > Thanks, > Xiao Yang Kind regards, Petr Vorel ^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS 2018-05-07 8:09 ` Petr Vorel @ 2018-05-07 10:31 ` Alexey Kodanev 2018-05-07 10:53 ` Petr Vorel 0 siblings, 1 reply; 14+ messages in thread From: Alexey Kodanev @ 2018-05-07 10:31 UTC (permalink / raw) To: ltp On 05/07/2018 11:09 AM, Petr Vorel wrote: > Hi Xiao, > >>> Good catch. Although I propose to get rid of ':' at the beginning for users of new shell >>> API (as it's IMHO better to see errors). >> Hi Petr, > >> If getopts is in silent mode, the invalid option is placed in OPTARG, so >> we can see errors by printing >> the value of OPTARG. But it is reasonable for me to get rid of ':' at the >> beginning of optstring. :-) > I know, TBROK inform us, so it can stay how it is for legacy API. > I meant it for the new API, where is going to be removed (the TBROK as well) as error is > handled in tst_run in tst_test.sh. > What about silence error in tst_test.sh? And remove preceding column in the tests (tcp_fastopen.sh, nfs_lib.sh). We handle the error already there, in tst_run (and in old API the scripts have TBROK), so there is no point printing one more redundant message that doesn't have LTP format. diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index 8d49d34..edac619 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -265,11 +265,12 @@ tst_run() OPTIND=1 - while getopts "hi:$TST_OPTS" name $TST_ARGS; do + while getopts ":hi:$TST_OPTS" name $TST_ARGS; do case $name in 'h') tst_usage; exit 0;; 'i') TST_ITERATIONS=$OPTARG;; - '?') tst_usage; exit 2;; + '?') tst_usage + tst_brk TBROK "invalid option: '$OPTARG'";; *) $TST_PARSE_ARGS "$name" "$OPTARG";; esac ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS 2018-05-07 10:31 ` Alexey Kodanev @ 2018-05-07 10:53 ` Petr Vorel 0 siblings, 0 replies; 14+ messages in thread From: Petr Vorel @ 2018-05-07 10:53 UTC (permalink / raw) To: ltp Hi, > On 05/07/2018 11:09 AM, Petr Vorel wrote: > > Hi Xiao, > >>> Good catch. Although I propose to get rid of ':' at the beginning for users of new shell > >>> API (as it's IMHO better to see errors). > >> Hi Petr, > >> If getopts is in silent mode, the invalid option is placed in OPTARG, so > >> we can see errors by printing > >> the value of OPTARG. But it is reasonable for me to get rid of ':' at the > >> beginning of optstring. :-) > > I know, TBROK inform us, so it can stay how it is for legacy API. > > I meant it for the new API, where is going to be removed (the TBROK as well) as error is > > handled in tst_run in tst_test.sh. > What about silence error in tst_test.sh? And remove preceding column in the > tests (tcp_fastopen.sh, nfs_lib.sh). We handle the error already there, in > tst_run (and in old API the scripts have TBROK), so there is no point > printing one more redundant message that doesn't have LTP format. > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh > index 8d49d34..edac619 100644 > --- a/testcases/lib/tst_test.sh > +++ b/testcases/lib/tst_test.sh > @@ -265,11 +265,12 @@ tst_run() > OPTIND=1 > - while getopts "hi:$TST_OPTS" name $TST_ARGS; do > + while getopts ":hi:$TST_OPTS" name $TST_ARGS; do > case $name in > 'h') tst_usage; exit 0;; > 'i') TST_ITERATIONS=$OPTARG;; > - '?') tst_usage; exit 2;; > + '?') tst_usage > + tst_brk TBROK "invalid option: '$OPTARG'";; > *) $TST_PARSE_ARGS "$name" "$OPTARG";; > esac +1 as it makes sense to unify things. It's just a bit faster to have printed the name of the script (if we don't use ':'). BTW this change affect only tests using new API (i.e. not tcp_fastopen_run.sh, nor nfs_lib.sh which still use legacy API). I'm working on rewriting tests into new API. Kind regards, Petr ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-05-23 8:12 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-05-07 3:24 [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Xiao Yang 2018-05-07 3:24 ` [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions for legacy API Xiao Yang 2018-05-07 6:44 ` Petr Vorel 2018-05-07 7:18 ` Xiao Yang 2018-05-23 7:48 ` Petr Vorel 2018-05-07 3:24 ` [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup " Xiao Yang 2018-05-07 7:18 ` Petr Vorel 2018-05-07 19:35 ` Petr Vorel 2018-05-23 8:12 ` Petr Vorel 2018-05-07 6:43 ` [LTP] [PATCH 1/3] lib/tst_net.sh: Append 6 to the end of $TST_OPTS Petr Vorel 2018-05-07 7:30 ` Xiao Yang 2018-05-07 8:09 ` Petr Vorel 2018-05-07 10:31 ` Alexey Kodanev 2018-05-07 10:53 ` Petr Vorel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.