On Wed, 2014-06-25 at 17:39 +0200, chru...@suse.cz wrote: Hi, Sorry for the delayed reply. > Hi! > > ---
> > -clean: > > - rm -f $(PROGRAMS) > > +CPPFLAGS += -Wno-parentheses -DETH_P_CAN=0x000C -DPF_CAN=29 \ > ^ > This should be removed and warnings (if > there are any) fixed > Got it. > > + -DAF_CAN=PF_CAN > > > > -distclean: > > - rm -f $(PROGRAMS) *~ > > +INSTALL_TARGETS := *.sh > > > > + if [ $ret -ne 0 ]; then > > + tst_resm TCONF "insmod can modules fail: errno - $ret" > ^ > modprobe Got it. > > + exit 1 > > The message says TCONF but then exits with 1, which is > TFAIL. > > Why don't you use the tst_brkm() which (after sourcing > test.sh) will exit with correct exit value for you? I will use tst_brkm TCONF to instead of tst_resm and exit. > > + fi > > + > > + modprobe can_raw > > + ret=$? > > + if [ $ret -ne 0 ]; then > > + tst_resm TCONF "insmod can_raw modules fail: errno - $ret" > ^ > modprobe Got it. > > + exit 1 > > + fi > > + > > + # ensure the vcan driver to perform the ECHO on driver level > > + modprobe -r vcan > > + ret=$? > > + if [ $ret -ne 0 ]; then > > + tst_resm TCONF "rmsmod vcan modules fail: errno - $ret" > ^ > modprobe -r Got it. > > + exit 1 > > + fi > > > > -# load needed CAN networklayer modules > > -modprobe -f can > > -modprobe -f can_raw > > + modprobe vcan echo=1 > > + ret=$? > > + if [ $ret -ne 0 ]; then > > + tst_resm TCONF "insmod vcan modules fail: errno - $ret" > ^ > modprobe vcan echo=1 Got it. > > + exit 1 > > + fi > > > > -# ensure the vcan driver to perform the ECHO on driver level > > -modprobe -r vcan > > -modprobe -f vcan echo=1 > > + VCAN=vcan0 > > > > -VCAN=vcan0 > > + # create virtual CAN device > > + ip link add dev $VCAN type vcan || exit 1 > > + ifconfig $VCAN up > > It would be better to stick with just ip. > > i.e. > > ip link set dev $VCAN up > I will use ip link set ... > > -# create virtual CAN device > > -ip link add dev $VCAN type vcan || exit 1 > > -ifconfig $VCAN up > > + # check precondition for CAN frame flow test > > + HAS_ECHO=`ip link show $VCAN | grep -c ECHO` > > > > -# check precondition for CAN frame flow test > > -HAS_ECHO=`ip link show $VCAN | grep -c ECHO` > > + if [ $HAS_ECHO -ne 1 ]; then > > There should be some error message here. > OK. I will add tst_brkm TBROK "ECHO is not 1". > > + exit 1 > > + fi > > +} > > > > -if [ $HAS_ECHO -ne 1 ] > > -then > > - exit 1 > > +cleanup() > > +{ > > + ifconfig $VCAN down > > ip link set dev $VCAN down > OK. I will use ip link set ... > > + ip link del dev $VCAN > > + modprobe -r vcan > > + modprobe -r can_raw > > + modprobe -r can > > +} > > + > > +if [ $# -ne 1 ]; then > > + echo "Usage: $0 [can_filter | can_rcv_own_msgs]" > > + exit 1 > > fi > > > > -# test of CAN filters on af_can.c > > -./tst-filter $VCAN || exit 1 > > +TCID="$1" > > +TST_TOTAL=1 > > +TST_COUNT=1 > > + > > +. test.sh > > This should rather be at the start of the script and the TST_COUNT > should not be initialized. > OK. I will do that. > > +TST_CLEANUP=cleanup > > > > -# test of CAN frame flow down to the netdevice and up again > > -./tst-rcv-own-msgs $VCAN || exit 1 > > +setup > > > > -exit 0 > > +"$1" "$VCAN" > > +ret=$? > > > > +if [ $ret -ne 0 ]; then > > + tst_resm TFAIL "Test $1 FAIL with exit num: $ret" > > +else > > + tst_resm TPASS "Test $1 PASS" > > +fi > > > > +tst_exit > > diff --git a/testcases/network/can/filter-tests/tst-filter.c > > b/testcases/network/can/filter-tests/tst-filter.c > > index 26eacf7..f248999 100644 > > --- a/testcases/network/can/filter-tests/tst-filter.c > > +++ b/testcases/network/can/filter-tests/tst-filter.c > > @@ -1,8 +1,4 @@ > > /* > > - * $Id: tst-filter.c 1263 2011-07-09 18:00:41Z hartkopp $ > > - */ > > - > > -/* > > * tst-filter.c > > * > > * Copyright (c) 2011 Volkswagen Group Electronic Research > > @@ -65,9 +61,8 @@ > > #define TC 18 /* # of testcases */ > > > > const int rx_res[TC] = { 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, > > 1, 1 }; > > -const int rxbits_res[TC] = > > - { 4369, 4369, 4369, 4369, 17, 4352, 17, 4352, 257, 257, 4112, 4112, 1, > > 256, > > -16, 4096, 1, 256 }; > > +const int rxbits_res[TC] = { 4369, 4369, 4369, 4369, 17, 4352, 17, 4352, > > 257, > > + 257, 4112, 4112, 1, 256, 16, 4096, 1, 256 }; > > > > canid_t calc_id(int testcase) > > { > > @@ -85,13 +80,12 @@ canid_t calc_mask(int testcase) > > { > > canid_t mask = CAN_SFF_MASK; > > > > - if (testcase > 15) > > - return (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG); > > - > > if (testcase & 4) > > mask |= CAN_EFF_FLAG; > > if (testcase & 8) > > mask |= CAN_RTR_FLAG; > > + if (testcase > 15) > > + mask = (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG); > > What is the reason for this change? Does the test fail without it? > When I use <kernel_path>/scripts/checkpatch.pl to check the patch, it output like: #20: FILE: testcases/network/can/filter-tests/tst-filter.c:84: + return (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG); total: 1 errors, 0 warnings, 15 lines checked So I change the original codeļ¼ if (testcase > 15) mask = (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG); At last, thank you very much. Best regards, Zeng ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list