免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1819 | 回复: 2
打印 上一主题 下一主题

[系统管理] 有没有人用过LTP(Linux Test Project) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-04-10 08:37 |只看该作者 |倒序浏览
我在使用LTP中的perf_lan.sh脚本时,里面有个read_args的命令在系统中死活找不到,也不知道是哪个软件包里的。。。。有哪位可以指点一下么。。。
  1. #! /bin/sh
  2. unset LIBPATH
  3. #
  4. #   Copyright (c) International Business Machines  Corp., 2000
  5. #
  6. #   This program is free software;  you can redistribute it and/or modify
  7. #   it under the terms of the GNU General Public License as published by
  8. #   the Free Software Foundation; either version 2 of the License, or
  9. #   (at your option) any later version.
  10. #
  11. #   This program is distributed in the hope that it will be useful,
  12. #   but WITHOUT ANY WARRANTY;  without even the implied warranty of
  13. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  14. #   the GNU General Public License for more details.
  15. #
  16. #   You should have received a copy of the GNU General Public License
  17. #   along with this program;  if not, write to the Free Software
  18. #   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. #
  20. #
  21. #
  22. #  FILE   : perf_lan
  23. #
  24. #  PURPOSE: Generates LAN traffic using ICMP echo packets.
  25. #
  26. #
  27. #  SETUP: The home directory of root on the machine exported as "RHOST"
  28. #         MUST have a ".rhosts" file with the hostname of the client
  29. #         machine, where the test is executed.
  30. #
  31. #  HISTORY:
  32. #    06/06/03 Manoj Iyer manjo@mail.utexas.edu
  33. #      - Modified testcase to use Test API and fixed bugs.
  34. #    03/01 Robbie Williamson (robbiew@us.ibm.com)
  35. #      -Ported
  36. #
  37. #
  38. #***********************************************************************

  39. do_setup()
  40. {
  41.     RHOST=${RHOST:-`hostname`}
  42.     TCtmp=${TCtmp:-$LTPROOT/testcases/bin/${TC}$}

  43.     PACKETSIZE=${PACKETSIZE:-512}
  44.     NUMPACKETS=${NUMPACKETS:-1}
  45.     NUMLOOPS=${NUMLOOPS:-10}
  46.     PINGPONG="pingpong${EXEC_SUFFIX}"

  47.     tst_setup

  48.     trap interrupt_testcase INT TERM URG USR1
  49. }

  50. #-----------------------------------------------------------------------
  51. #
  52. # FUNCTION:  do_test
  53. # INPUT:     None.
  54. # OUTPUT:    Informational messages are logged into the run log.
  55. #
  56. #-----------------------------------------------------------------------

  57. do_test()
  58. {
  59.     tst_resm TINFO "Executing $0"

  60.     while [ $TST_COUNT -le $NUMLOOPS ]; do

  61.         $PINGPONG $RHOST $PACKETSIZE $NUMPACKETS

  62.         RETVALUE=$?

  63.         case "$RETVALUE" in
  64.             0)  tst_resm TINFO "Successful execution for loop $TST_COUNT";;
  65.             1)  end_testcase "Error trying to send to host";;
  66.             2)  end_testcase "Error - Data length is too long";;
  67.             3)  end_testcase "Usage error ";;
  68.             5)  end_testcase "Error - Socket setting";;
  69.             6)  end_testcase "Error - Pipe broken";;
  70.             7)  end_testcase "Error - Fork fail";;
  71.             10) end_testcase "Error - wrong Protocol";;
  72.             *)  end_testcase "Unexpected exit code from $PINGPONG: $RETVALUE";;
  73.        esac
  74.        incr_tst_count

  75.     done

  76. }

  77. #-----------------------------------------------------------------------
  78. #
  79. # FUNCTION:     interrupt_testcase
  80. # PURPOSE:      Finish up the testcase - called when the time has expired
  81. # INPUT:        None.
  82. # OUTPUT:       None.
  83. #
  84. #-----------------------------------------------------------------------

  85. interrupt_testcase()
  86. {
  87.     tst_resm TINFO "Testcase interrupted - cleaning up"
  88.     tst_resm TINFO "Killing background process if it is still running"
  89.     kill -9 $CHILDPID
  90.     end_testcase
  91. }

  92. #-----------------------------------------------------------------------
  93. #
  94. # FUNCTION:  MAIN
  95. # PURPOSE:   To invoke functions that perform the tasks as described in
  96. #             the design in the prolog above.
  97. # INPUT:     See SETUP in the prolog above.
  98. # OUTPUT:    Logged run results written to testcase run log
  99. #
  100. #-----------------------------------------------------------------------
  101. . net_cmdlib.sh

  102. read_args $*

  103. do_setup
  104. do_test
  105. end_testcase
复制代码

论坛徽章:
0
2 [报告]
发表于 2014-04-10 08:37 |只看该作者
就是118行中的“read_args $*”。。。

论坛徽章:
0
3 [报告]
发表于 2014-04-10 16:37 |只看该作者
问题解决了,把read_args改为read_opts就可以了。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP