LTP, Linux Test Project

LTP-linut test project. The ltp suite is a system test suite developed by the Linux Test Project. It develops a combination of tests based on the utilization statistics of system resources to provide sufficient pressure for the system.

Use the LTP test suite to test the Linux operating system for a long time, focusing on the workload related to the Linux user environment. It is not dedicated to proving defects. To

 

If you need to install the latest version or recompile, refer to the Quick Start section.

Quick Start

Download ltp package

Version page:https://github.com/linux-test-project/ltp/releases 

wget https://github.com/linux-test-project/ltp/releases/download/20180515/ltp-full-20180515.tar.bz2

tar -xjvf ltp-full-20180515.tar.bz2

Install dependencies

CentOS 7.4

# Compile ltp use

yum install make bison flex byacc autoconf automake m4

# Analyze performance data

yum install deltarpm sysstat

Ubuntu (Kylin)

sudo apt install xxx

# For testing purposes, if you can’t find the installation directly, you can go to https://launchpad.net/ubuntu/xenial/<architecture>/ search and download, for Feiteng server, the address ishttps://launchpad.net/ubuntu/xenial/arm64/

# But it is best to get it from the source configured by the server itself

Install ltp test cases

cd ltp/ # or the decompressed ltp directory with version number

 ./configure

make all

make install

/opt/ltp/runltplite.sh # After installing ltp in the /opt directory, you can quickly execute a script to verify the installation

ltp structure

ltp folder structure (only one level is shown)

[root@host2 ltp]# pwd

/opt/ltp

[root@host2 ltp]# tree -L 1

.

├── bin

├── IDcheck.sh # Check whether the system lacks the users and user groups required to execute the LTP test suite. If they are missing, create the required users and user groups for the LTP test suite.

├── runltp         

├── runltplite.sh # This script is used to test the LTP installation, and can also be used to test the sub-projects of the test suite.

├── runtest # Each file in this directory is a collection of commands for test cases to be executed, and each file is for different aspects of the test.

├── scenario_groups

├── share # Script usage instructions directory

├── testcases # This directory stores the source code of all test cases used in the LTP test suite.

├── testscripts # This directory stores executable test scripts, a collection of different aspects of test scripts.

├── ver_linux # This script is to obtain hardware, software, and environmental information.

└── Version

[root@host2 ltp-full-20180515]# pwd

/home/wenjie/ltp/ltp-full-20180515

[root@host2 ltp-full-20180515]# tree -L 1 -d

.

├── doc # This directory is the location of the explanatory files and help documents. The contents of LTP and each tool are explained in detail in this directory.

├── include # The header file directory of the LTP test suite defines the data structure and function structure of the LTP itself.

├── lib # The library files needed by the LTP test suite when it runs, which define various functions of the LTP itself.

├── m4

├── pan # This directory stores the test driver pan of the LTP test suite.

├── runtest

├── scenario_groups

├── scripts

├── testcases # This directory stores the source code of all test cases used in the LTP test suite.

├── testscripts # This directory stores executable test scripts, a collection of different aspects of test scripts.

├── tools

└── utils

 

Test command

Initial test

The initial test directly uses the /opt/ltp/runltp script. By default, this script executes: file system stress test, hard disk I/O test, memory management stress test, IPC stress test, SCHED test, command function verification test, system call function verification test.

If no parameters are specified, then all use cases will be executed, and all execution processes will be printed to the screen without saving logs and results. It is recommended to add at least -p, -l parameters to save readable test results.

/opt/ltp/runltp -p -l result.yyyymmdd.log -f my_command_file

/opt/ltp/runltp -p -l /tmp/resultlog.20111207 -d /tmp -o /tmp/ltpscreen.20111207 -t 24h

For parameter explanation, see http://ltp.sourceforge.net/documentation/how-to/ltp.php#_3.4

my_command_file should be placed under /opt/ltp/runtest, and the content format is as follows,

#Tag       Test case

#---------------------------------------

mtest01     mtest01 -p 10

mmstress    mmstress -x 100

fork01      fork01

chdir01     symlink01 -T chdir01

#----------------------------------------

After the command is executed, if the absolute path of the log file is not specified, the log will be saved in the /opt/ltp/results directory. The output content is as follows,

Test Start Time: Mon Aug 20 11:41:40 2018

-----------------------------------------

Testcase                                           Result     Exit Value

--------                                           ------     ----------

mtest01                                            FAIL       1

mmstress                                           PASS       0

fork01                                             PASS       0

chdir01                                            PASS       0

 

-----------------------------------------------

Total Tests: 4

Total Skipped Tests: 0

Total Failures: 1

Kernel Version: 3.10.0-693.el7.1.x86_64

Machine Architecture: x86_64

Hostname: host1

 

pressure test

Execute the ltpstress.sh script in testscripts for stress testing. The script runs similar test cases in parallel and different test cases serially. By default, this script executes: NFS stress test, memory management stress test, file system stress test, math (floating point) test, multi-threaded stress test, hard disk I/O test, IPC (pipeio, semaphore) test, system call function Verification test, network stress test.

cd /opt/ltp/testscripts

sudo ./ltpstress.sh -m 35 -S -t 1  # If you directly execute the test script in the source package, you need to execute PATH=$PATH:$PWD:<LTP_ROOT>/lib/ before running, and add <LTP_ROOT>/lib and <LTP_ROOT>/testscripts to the PATH

sudo ./ltpstress.sh -d /tmp/sardata -l /tmp/ltpstress.log -I /tmp/iofile -i 5 -m 128 -t 24 -S

sudo ./ltpstress.sh -p -S -t 1 -b /dev/sdd -B xfs -m 128

-l: Record test results to /tmp/ltpstress.log (lowercase L)

-I: Record the result of "iostat" to iofile, the default is /tmp/ltpstress.iostat (uppercase i)

-i: Specify the sar or top snapshot interval, the default is 10 seconds

-m: Specify the minimum memory usage, the default is: RAM + 1/2 swap

-n: Do not stress test the network

-S: Use sar to capture data

-T: Use the top tool modified by LTP to capture data

-T: Specify the test time # The -t parameter of the ltpstress.sh script, only supports the integer "hour".

-b: Part of the test requires a disk without mount. If not specified, the script will create a loop device for testing

-B: description of the file system of the disk specified by -b

Note: If you do not specify -m, the pressure will be greater, and resource consumption may burst. Be sure to bring the -m parameter.

 

Correspondence of file structure related to stress test script:

  • Ltpstress.sh in testscripts
  • Stress.part1, stress.part2, stress.part3 under the runtest directory (test set configuration files)
  • Run in the background pan
  • Execute each test case in Testcase finally

The combination of test cases can be adjusted by modifying the stress.part<n> file under runtest.

 

Test data analysis


By default, the test results are placed in /tmp
ltpstress.log: Record related log information, mainly whether the test passes or fails (pass or fail)
ltpstress.data: the day file recorded by the sar tool, including cpu, memory, i/o, etc.
ltpstress.<xxx>.output1: corresponding to stress.part1, some output information of the test command
ltpstress.<xxx>.output2: corresponding to stress.part2
ltpstress.<xxx>.output3: corresponding to stress.part3

 

ltpstress.sh supports -S to call the sar command to record server performance data. If -S is not specified, the top command customized by ltp will be used to record performance data.

sar -u -f ltpstress.data # cpu average utilization rate

sar -r -f ltpstress.data # memory average usage rate

sar -b -f ltpstress.data # IO transfer rate

sar -d -f ltpstress.data # Activity information of each disk

Extract the wrong use cases, and then analyze the reasons for each wrong use case.

grep FAIL ltpstress.xxx.output* | sort | uniq >failcase.txt

 

 

Related test collection

  • runtests/net.nfs: contains test collections of NFS v2, v3, and v4, which need to be enabled and configured for nfs and portmap services. Excuting an order:

    /opt/ltp/runltp -p -l result.yyyymmdd.log -f net.nfs

  • runtests/network_commands: contains a collection of tests for ftp and ssh.
  • runtests/scsi_debug.part1: corresponding script testscripts/ltp-scsi_debug.sh.

 

In the downloaded ltp package, there is a separate disktest directory under testcases/kernal/io/. Contains the disktest script, which can be executed. The document is attached.disktest_manual.html

 

Reference documents:

http://ltp.sourceforge.net/documentation/how-to/ltp.php#_1

 

https://github.com/linux-test-project/ltp

Intelligent Recommendation

[Ltp] [eas] test cases resolved

contents eas_one_small_task eas_one_big_task eas_small_to_big eas_big_to_small eas_small_big_toggle eas_two_big_three_small sched_cfs_prio sched_dl_runtime sched_latency_dl sched_latency_rt sched_prio...

Linux performance testing tools LTP

Linux Test Project Linux Test Project is sponsored by SGI, OSDL, and Bull joint project of IBM, Cisco, Fujitsu, SUSE, Red Hat, Oracle and other development and maintenance. The project's objective is ...

HanLP vs LTP word segmentation function test

The article is taken from github, this test uses HanLP 1.6.0, LTP 3.4.0 Test idea The two lexicons were trained using the same corpus, and the same test data tested the performance of the two lexicons...

Ltp test suite - pthread_rwlock_unlock_3-1 analysis record

I recently did a ltp test on the linux-4.14 kernel. The pthread_rwlock_unlock_3-1 use case test did not pass, and then I did the test on various other Linux systems. Test failed: reader did not get th...

Ltp test suite - pthread_rwlock_rdlock_2-1 analysis record

The test pthread_rwlock_rdlock_2-1.c use case failed. The log is as follows: [83#yuchen@ubuntu ltp]# gcc 2-1.c -o 21 -pthread [84#yuchen@ubuntu ltp]# ./21 main: has priority: 3 main: attempt read lock...

More Recommendation

Shell script example (2)-ltp test

Test sched_latency_dl 100 times  ...

LTP Chapter 4 Development_exit() Test Set

LTP series link: Chapter 1 Introduction to LTP and Internal Mechanism Chapter 2 Develop Shell Test Set Chapter 3 Development System Call Test Set Chapter 4 Development _exit() test set Chapter 5 Devel...

LTP Chapter 2 Develop Shell Test Set

LTP series link: Chapter 1 Introduction to LTP and Internal Mechanism Chapter 2 Develop Shell Test Set Chapter 3 Development System Call Test Set Chapter 4 Development _exit() test set Chapter 5 Devel...

UOS LTP compile USSTAT test item error

Environmental information Error information Show repeatedly definition the Struct USTAT structure. analyze There is no definition of Struct USTat in a normal environment. If you want to use this struc...

LTP Chapter 6 Development of IO Blocking Test Set

LTP series link: Chapter 1 Introduction to LTP and Internal Mechanism Chapter 2 Develop Shell Test Set Chapter 3 Development System Call Test Set Chapter 4 Development _exit() test set Chapter 5 Devel...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top