ltp-2

 
结果分析
grep FAIL ltpscreen.20061222 | sort | uniq >failcase.txt
grep FAIL resultlog.20061222 | sort | uniq >>failcase.txt
将所有FAIL过滤出来,得到完整的所有FAIL的testcase。
cat failcase.txt


3 系统监控
LTP 测试套件附带的 top 工具是经过修改的,用作系统监控工具。使用 top 可以实时地观察处理器的行为。改进的 top 工具具有附加的功能,可以将 top 结果的快照保存到文件中,并给出结果文件的平均总结,包括 CPU、内存和交换空间利用率等信息。
sar -u -o ./log/1.log 60 5
4 LTP的结构
                LTP的目录结构基本上分为文档目录(doc)、测试驱动程序目录(pan)、测试脚本目录(testscripts)、测试用例库(testcase)、测试命令文件
                目录(runtest)、头文件目录(include)、库目录(lib)等。
            ---Doc:该目录是说明文件和帮助文档的所在地,这个目录中对LTP的内容和每个工具都有详细的说明。
            ---Pan:该目录存储的是LTP测试套件的测试驱动程序pan。
                bump:    bump - send signal to tags run by pan
                            bump [-1] [-s sig] [-a active-file] [tags...]
                            http://ltp.sourceforge.net/ltpmantemp.php?file=man1/bump.html
                pan:     会记录测试产生的详细的格式复杂的输出,但它不进行数据的整理和统计
                scanner: 测试结果分析工具,它会理解pan的输出格式,并输出成一个表格的形式来总结那些测试passed或failed。
            ---Testscripts:该目录中存储的是可执行的测试脚本,不同方面的测试脚本的集合。
                adp.sh
                adp_children.sh
                adp_test.sh
                autofs1.sh 测试文件系统代码,会 make a filesystem使用它,必须要有一张可写的3寸磁盘放在软驱中,并且光驱里面需要有超过100M的空间。
                                Make sure that uid=root is running this script.
                                Make sure that autofs package has been installed.
                                Make sure that autofs module is built into the kernel or loaded.
                                 CODE COVERAGE:
                                #                41.46% - fs/autofs/dirhash.c
                                 #                33.33% - fs/autofs/init.c
                                 #                27.70% - fs/autofs/inode.c
                                #                38.16% - fs/autofs/root.c
                                 #                 0.00% - fs/autofs/symlink.c
                                 #                43.40% - fs/autofs/waitq.c
                autofs4.sh:使用它,必须要有一张可写的3寸磁盘放在软驱中,并且光驱里面需要有超过100M的空间。
                diskio.sh: 使用它,必须要有一张可写的3寸磁盘放在软驱中,并且光驱里面需要有超过100M的空间
                exportfs.sh
                                DESCRIPTION : A script that will test exportfs on Linux system.
                                # REQUIREMENTS:
                                #                1) NFS Server system with rsh enabled between client & server.
                                #
                                # HISTORY     :
                                #      06/18/2003 Prakash Narayana (prakashn@us.ibm.com)
                                #
                                # CODE COVERAGE: 7.1% - fs/exportfs (Total Coverage)
                                #                 7.1% - fs/exportfs/expfs.c
                isofs.sh
                                USAGE       : isofs.sh <optional> -n (no clean up)
                                #
                                # DESCRIPTION : A script that will test isofs on Linux system.
                                #                It makes ISO9660 file system with different options and also
                                #                mounts the ISO9660 file system with different mount options.
                                #
                                # CODE COVERAGE: 40.5% - fs/isofs (Total Coverage)
                                #
                                #                 23.7% - fs/isofs/dir.c
                                #                 46.0% - fs/isofs/inode.c
                                #                 22.9% - fs/isofs/joliet.c
                                #                 50.0% - fs/isofs/namei.c
                                #                 38.5% - fs/isofs/rock.c
                                #                 10.7% - fs/isofs/util.c
                                #
                                ##############################################################
                ltp-aiodio.sh: 文件系统测试ext2.ext3.xfs.jfs
                                                This script should be run after installing the libaio RPM or libraries
                                                # A valid large file should be passed to the test.
                                                # These tests will only run correctly if the kernel and libaio has been compiled
                                                # with at least a 3.3.X GCC. Older versions of the compiler will seg fault.
                ltp-scsi_debug.sh:Check if scsi_debug module was built or not
                ltpdmmapper.sh:
                                                # This script should be run prior to running executing the filesystem tests.
                                                # valid devices need to be passed for Device Mapper to work correctly
                                                Note: In order to run this test, you must turn on "device mapper"
                                        component in kernel (it is under device drivers item when you
                                        run make menuconfig); and you must install userspace supporting
                                        files (libdevmapper and dmsetup). They are in the device-mapper
                                        package. You can download it from http://www.sistina.com. Follow
                                        the README/INSTALL file within the package to install it.

                ltpfslvm.sh:
                                                # This script should be run prior to running executing the filesystem tests.
                                                # valid devices need to be passed for Device Mapper to work correctly
                ltpfsnolvm.sh:同上
                ltpstress.sh的目标,是使用 LTP 测试套件对Linux 操作系统进行超长时间的测试,重点在于Linux 用户环境相关的工作负荷,而并不是致力于
                                    证明缺陷。这个应用程序组合了来自 LTP 的测试套件不同方面的多个测试以及内存和网络传输负载生成器。在执行之前,测试会根据系
                                    统中存在多少物理和虚拟内存来调整其总的内存使用情况。
                usage: ltpstress [-d datafile] [-i # (in seconds)] [-I iofile] [-l logfile] [-m # (in Mb)] [-n] [-t duration]
                        [[-S]|[-T]]
                        -d datafile     Data file for 'sar' or 'top' to log to. Default is "/tmp/ltpstress.data".
                        -i # (in sec)   Interval that 'sar' or 'top' should take snapshots. Default is 10 seconds.
                         -I iofile       Log results of 'iostat' to a file every interval. Default is "/tmp/ltpstress.iodata".
                         -l logfile      Log results of test in a logfile.
                         -m # (in Mb)    Specify the _minimum_ memory load of # megabytes in background. Default is all the RAM +
                                            1/2 swap.
                         -n              Disable networking stress.
                         -S              Use 'sar' to measure data.
                         -T              Use LTP's modified 'top' tool to measure data.
                         -t duration     Execute the testsuite for given duration in hours. Default is 24.
                        example: ${0##*/} -d /tmp/sardata -l /tmp/ltplog.$$ -m 128 -t 24 -S

                                    ltpstress.sh的测试方法:
                                    测试方法有两个的阶段:一个是“初始测试”,一个是“压力测试”。通过初始测试是开始测试的必要条件。初始测试包括 LTP 测试套
                                    件在硬件和操作系统上成功运转,这些硬件和操作系统将用于可靠性运转。LTP 测试套件包附带的驱动程序脚本 runalltest.sh 用
                                    于验证内核。这个脚本串行地运行一组成包的测试,并报告全部结果。也可以选择同时并行地运行几个实例。默认地,这个脚本执行:
                                    - 文件系统压力测试。
                                    - 硬盘 I/O 测试。
                                    - 内存管理压力测试。
                                    - IPC 压力测试。
                                    - SCHED测试。
                                    - 命令功能的验证测试。
                                    - 系统调用功能的验证测试。
                math.sh:run ./runltp -f $(pwd)/runtest/math
                networkstress.sh
                networktests.sh使用它,首先要有另外一台用做提供服务的主机,而且上面需要安装有和测试的客户机相同的ltp套件,并且都安装在同一个对应的
                                    目录中,例如:/ r oot/ltp;This script executes the networking related tests. Before executing this
                                    script, two environment variables must be set RHOST (Remote Host Name) and PASSWD (root password
                                    of the remote host).
                runEALtests.sh
                runpan.sh:This will only run the quickhit tests
                syscalls.sh:./runltp -f ${PWD}/runtest/syscalls -q "$@"
                sysfs.sh:# USAGE       : sysfs.sh [ -k <kernel_module> ]
                            #
                            # DESCRIPTION : A script that will test sysfs on Linux system.
                            # REQUIREMENTS: CONFIG_DUMMY must have been used to build kernel, and the
                            #        dummy network module must exist.
                            #
                            # HISTORY     :
                            #      06/24/2003 Prakash Narayana (prakashn@us.ibm.com)
                            #
                            # CODE COVERAGE: 31.3% - fs/sysfs (Total Coverage)
                            #
                            #                  0.0% - fs/sysfs/bin.c
                            #                 61.8% - fs/sysfs/dir.c
                            #                 27.5% - fs/sysfs/file.c
                            #                 40.4% - fs/sysfs/inode.c
                            #                 41.2% - fs/sysfs/mount.c
                            #                 58.1% - fs/sysfs/symlink.c
                            #
                            ##############################################################
                test_selinux.sh:Run the selinux test suite.
                tpm_tools.sh:run the tpm-tools test suite.
                yesenter.txt
                ---Testcase:该目录存储了所有LTP测试套件中所使用的测试用例的源码。
                ---Runtest:该目录中的每个文件都是要执行的测试用例的命令集合,每个文件针对测试的不同方面。
                ---Include:LTP测试套件的头文件目录,定义了LTP自身的数据结构和函数结构。
                ---Lib:LTP测试套件运行时自身需要的库文件,定义了LTP自身的各种函数。
5 LTP 的测试方法
                LTP测试套件有一个专门的测试驱动程序pan,具体的测试用例的执行都是由pan来调用执行,它可以跟踪孤儿进程和抓取测试的输出信息。它的工作方式是
                这样的:
                从一个测试命令文件中读取要测试的条目的要执行的命令行,然后等待该项测试的结束,并记录详细的测试输出。默认状态下pan会随机的选择一个命令行来
                运行,可以指定在同一时间要执行测试的次数。
                pan会记录测试产生的详细的格式复杂的输出,但它不进行数据的整理和统计,数据整理统计的工作由scanner来完成,scanner是一个测试结果分析工
                具,它会理解pan的输出格式,并输出成一个表格的形式来总结那些测试passed或failed。
6 LTP的实际运行
实际运行当中,您还需要配置一些必要的服务才可以正确的运行LTP的测试套件,以ltprunall.sh为例,它是不需要配置其他服务就可以运行的,但是对于ltpstress.sh,是需要配置一些相关服务之后才可以正确运行的,需要您配置的服务如下:

配置rsh和rlogin服务,使用户能以root身份不需密码验证直接登录本机。
开启xinetd服务。
在用户主目录下建立一个名为.rhosts的文件,文件内容是允许对本机进行rsh和rlogin操作的主机名和IP地址。一个相应的例子如下:
# vi .rhosts
test.my.domain
192.168.1.11
localhost.localdomain
127.0.0.1

配置工作最后要做的就是重启xinetd服务,因为rsh和rlogin是受xinetd服务控制的:
/etc/init.d/xinetd restart
或service xinetd restart

然后您就可以运行ltpstress.sh的脚本了。通常用到的参数是 [-d outputfile] [-l logfile] [-t run-time] [-S],-S 选项用来在测试运行过程中使用sar工具来采样系统的性能输出。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值