CN109901982A - Method, equipment and the medium of automatic running performance test based on linux - Google Patents

Method, equipment and the medium of automatic running performance test based on linux Download PDF

Info

Publication number
CN109901982A
CN109901982A CN201910153497.3A CN201910153497A CN109901982A CN 109901982 A CN109901982 A CN 109901982A CN 201910153497 A CN201910153497 A CN 201910153497A CN 109901982 A CN109901982 A CN 109901982A
Authority
CN
China
Prior art keywords
test
program
linux
running performance
test program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201910153497.3A
Other languages
Chinese (zh)
Inventor
牟茜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910153497.3A priority Critical patent/CN109901982A/en
Publication of CN109901982A publication Critical patent/CN109901982A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present invention provides method, equipment and the medium of a kind of automatic running performance test based on linux, belongs to computer field.Wherein method includes: that detection test program whether there is;If not, downloading test program;Test program is installed;Execute test program, and record log.After test run of the embodiment of the present invention, whether log marks certain test to terminate, report an error under automatic checkout system, detects and record system configuration at this time and health status, improves testing efficiency and server reliability.Equipment, electronic equipment and the storage medium of automatic running performance test based on linux provided by the embodiment of the present invention, all have above-mentioned technical effect.

Description

Method, equipment and the medium of automatic running performance test based on linux
Technical field
The present invention relates to field of computer technology, in particular to a kind of server performance test method;Further relate to a kind of clothes Business device performance test apparatus and storage medium.
Background technique
With the development of society, the progress of science and technology, the rapid development of information technology, universal, the server product of computer The various industries field for having been applied to society, in addition the development of network, the sharing etc. of information, dependence of the people to computer Property is increasing.Requirement of the user of server product to high quality, efficient working method is higher and higher, therefore for Closely bound up IT system service in work and life, they also require to provide service quality faster, more efficient.Server Performance test is particularly important under such background.
The response time of tested application system and the performance of resource consumption are mainly investigated in performance test, this test is related to multiple Test software.Server performance test automation is poor in the prior art, needs to improve.
Relevant english term abbreviation in the present invention:
Python is a kind of computer programming language.It is a kind of dynamic, object-oriented scripting language, initial quilt Designed for writing automatized script (shell), with the continuous renewal of version and the addition of language new function, more and more quilts For independent, mega project exploitation.
The address IP:IP refers to Internet protocol address (English: Internet Protocol Address, and being translated into internet Protocol address), it is the abbreviation of IP Address.IP address is a kind of unified address format that IP agreement provides, it is interconnection Online one logical address of each network and each host assignment, the difference of physical address is shielded with this.
Unix bench:UnixBench is the tool of the test Linux system basic performance of a open source, is that comparison is logical The tool of test performance.
Spec CPU:SPEC CPU is the cpu subsystem assessment software that SPEC tissue is released.
Summary of the invention
The purpose of the embodiment of the present invention is that provide a kind of method of automatic running performance test based on linux, realize from Tool downloading, installation run to the automated server performance test of log crawl.The embodiment of the present invention another object is that base It in the automatic running performance test apparatus of linux, all has above-mentioned realization and is downloaded from tool, installation runs to log crawl The technical effect of automated server performance test.
In order to solve the above technical problems, the embodiment of the invention provides a kind of automatic running performance test based on linux Method, comprising:
Detection test program whether there is;If not, downloading test program;
Test program is installed;
Execute test program, and record log.
Optionally, further includes: test environment preparation process.
Optionally, detection test program whether there is;If not, downloading test program, comprising the steps of:
It checks under specified path with the presence or absence of the test procedure document for needing to run;
If so, output file prompting download information.
If not, downloading test procedure document from the server of storage test procedure document, and it is stored under system under test (SUT) Under the specified path of creation.
Optionally, test program, and record log are executed, comprising the steps of:
By preset duration, test program is executed;
Whether usage log labeled test terminates, report an error under automatic checkout system, detects and records system configuration at this time And health status.
Optionally, test environment preparation process includes:
The test starting time is obtained, and generates log;
The specified file catalogue of script operation is checked for exist, outgoing route is deposited such as there is no createing directory In information;
Terminate all program process being currently running.
In order to solve the above technical problems, the embodiment of the invention also provides a kind of, the automatic running performance based on linux is surveyed The equipment of examination includes:
Test program detection module whether there is for detecting test program;If not, downloading test program;
Test program installs module, for installing test program;
Test execution and logging modle, for executing test program, and record log.
Optionally, environment preparation module is tested, for preparing a clean test environment for test starting.
Optionally, test program detection module, for checking under specified path with the presence or absence of the test program for needing to run File;If so, output file prompting download information.If not, downloading test from the server of storage test procedure document Program file, and be stored under the specified path created under system under test (SUT).
Test execution and logging modle execute test program for pressing preset duration;Usage log labeled test terminates, Whether report an error under automatic checkout system, detect and records system configuration at this time and health status.
In order to solve the above technical problems, the embodiment of the invention also provides a kind of electronic equipment, comprising:
Memory, for storing computer program;
Processor realizes the above-mentioned automatic running performance test based on linux when for executing the computer program Method.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of computer readable storage medium, the calculating Computer program is stored on machine readable storage medium storing program for executing, the computer program realizes above-mentioned be based on when being executed by processor The method of the automatic running performance test of linux.
The method method of automatic running performance test provided by the present invention based on linux, including detection test program It whether there is;If not, downloading test program;Test program is installed;Execute test program, and the step of record log.
As it can be seen that test run specifies duration that will end automatically, after test run, log marks certain test to terminate, from Whether report an error under dynamic detection system, detect and record system configuration at this time and health status, improves testing efficiency and server Reliability.
Equipment, electronic equipment and the storage of automatic running performance test based on linux provided by the embodiment of the present invention Medium all has above-mentioned technical effect.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to institute in the prior art and embodiment Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 shows for a kind of method flow of the automatic running performance test based on linux provided by the embodiment of the present invention 1 It is intended to;
Fig. 2 shows for a kind of method flow of the automatic running performance test based on linux provided by the embodiment of the present invention 2 It is intended to;
Fig. 3 shows for a kind of method flow of the automatic running performance test based on linux provided by the embodiment of the present invention 3 It is intended to;
Fig. 4 is a kind of system of the equipment of the automatic running performance test based on linux provided by the embodiment of the present invention 4 Schematic diagram;
Fig. 5 is a kind of electronic equipment schematic diagram.
Specific embodiment
Core of the invention is to provide a kind of method of automatic running performance test based on linux, realizes under tool It carries, installation runs to the automated server performance test of log crawl;Another core of the invention is to provide one kind and is based on The equipment and storage medium of the automatic running performance test of linux, all have above-mentioned technical effect.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Embodiment 1.
Referring to FIG. 1, Fig. 1 is a kind of automatic running performance test based on linux provided by the embodiment of the present invention The flow diagram of method;With reference to Fig. 1, the method method for being somebody's turn to do the automatic running performance test based on linux includes:
Detection test program whether there is;If not, downloading test program;
Test program is installed;
Execute test program, and record log.
Specifically, detection test program whether there is;If not, downloading test program;Checking whether there is under specified path The test procedure document for needing to run such as is not present and if so, printing test file has been downloaded, then from storing tools Test program is downloaded on server, is stored under the specified path created under system under test (SUT).
In the present embodiment, testing tool is preferentially stored in tool server, and server ip is set as fixed IP, convenient for subsequent Routine call.Tested server is connect with tool server, and confirms accessible, script is copied to is by server Under system.Booting enters under linux system in the present embodiment, and automated procedures run.py is copied under system.
Specifically, installation test program;It is automatic to execute decompression installation and operation tool.
Specifically, executing test program, and record log.Test data is stored, needs to allow herein according to test and test certainly Oneself runs through or is arranged program operation duration, and test run specifies duration that will end automatically, and after test run, log marks certain Whether test terminates, report an error under automatic checkout system, detects and records system configuration at this time and health status.Method can be certainly It is dynamic to execute the performance testing tool needed, and operation result is recorded in log, it conveniently checks the beginning of test program, pacifies Dress, operation and result;This kind of test method is suitable for currently a popular various Linux and operates, and is suitable for all and thinks to run automatically Program.
Embodiment 2.
Referring to FIG. 2, Fig. 2 is a kind of automatic running performance test based on linux provided by the embodiment of the present invention 2 Method flow schematic diagram;
On the basis of embodiment 1, the method for the automatic running performance test based on linux as shown in Figure 2, comprising surveying Test ring border preparation process, specifically includes: obtaining the test starting time, and generates log;Check for the finger of script operation Determine file directory, such as there is no createing directory, exists, there are information for outgoing route;Terminate all programs being currently running Process.Prepare a clean test environment for test starting.
Embodiment 3
Referring to FIG. 3, Fig. 3 is a kind of automatic running performance test based on linux provided by the embodiment of the present invention 3 Method flow schematic diagram;
The method that the present embodiment executes the automatic running performance test based on linux includes following below scheme.
(1) test starts;
(2) detect whether that there are test program script operating paths, such as no creation script operating path.If so, continue into Row is in next step;
(3) terminate all processes;
(4) judge whether to download a certain test program x.If so, downloading test program x to specified file from tool server Folder, and carry out in next step.If not, directly carrying out in next step;
(5) it installs and runs test program x;
(6) setting test execution duration is detected whether, if so, the time limit then, terminates current test process.If not, executing Terminate to test program, and records.
(7) audit log and machine health status.
(8) check whether that all tests are completed in execution, if not, continuing to execute (4);If so, test terminates.
In the present embodiment, the method specific procedure design of the automatic running performance test based on linux is as follows.
1) program running log function is defined, for recording test program operation and terminating;
def Log(logstr):
T=time.strftime (' %Y-%m-%d%H:%M:%S', time.localtime (time.time ()))
# converts local zone time to indicate the time in the form of date Hour Minute Second
Fd=open ('/tmp/item', ' a')
# opens the item file under one/tmp for adding.If this document is existing, file pointer will be placed on text The ending of part.That is, new content will be written to after existing content.If this document is not present, new text is created Part is written
fd.write(t+logstr+'\n')
The information that # is written under item file: t grabs time and logstr description information, and enters a new line
Fd.close () # closes file
2) it defines unixbench and runs function
defunixbentch():
Log (': Unix bentch start.4 hours '), # recorded running log
Os.chdir ('/opt') # is for changing work at present catalogue to specified path
if os.path.exists('/opt/UnixBench'):
Print (" Unix bentch file is already download. ") # such as path exist if print routine Downloading
else:
Os.system (' wget http: // '+ip+'/tool/UnixBench.tgz') there is no take from tool in the path # Testing tool is downloaded under business device specified path
Os.system (' tar xf UnixBench.tgz') # decompression tool
Os.chdir ('/opt/UnixBench') # is for changing work at present catalogue to specified path
Os.system (' make >/dev/null') # compiler test program
Os.system (' ./Run-c 1 | tee/tmp/log/unixbentch.log') # operation is tested and records operation Data
Os.system (' ./Run-c 4 | tee/tmp/log/unixbentch.log') # operation is tested and records operation Data
Os.system (' ./Run-c 16 | tee/tmp/log/unixbentch.log') # operation is tested and records operation Data
Log (': Unix bentch end.') # records test run and terminates
3) it defines spec CPU and runs function
def specCpu():
Log (': SpecCpu start.4 hours '), # recorded running log
Os.chdir ('/opt') # is for changing work at present catalogue to specified path
if os.path.exists('/opt/spec'):
Print (" SpecCpu file is alread download. ") # print routine if path exists has been downloaded
else:
Os.system (' wget http: // '+ip+'/tool/gcc520.tar.gz') there is no take from tool in the path # Gcc running environment packet needed for downloading testing tool under business device specified path
The path # os.system (' wget http: // '+ip+'/tool/spec2006.tar.gz') is not present from tool Testing tool is downloaded under server specified path
Os.system (' tar xf spec2006.tar.gz') # decompression testing tool
Os.system (' tar xf gcc520.tar.gz') # decompression gcc packet
Spec2006 file is renamed as spec by os.system (' mv spec2006spec') #
Os.chdir ('/opt/spec') # is for changing work at present catalogue to specified path
Os.system (' ./install.sh') # installation testing tool
Os.system (' ./prerun') # operation setup test program
Os.system (' ../shrc') # operation setup test program
Os.system (' ./run.sh&') # running background test program
T=1# restricted program is run 4 hours, initial count
While t < 240:# restricted program is run 4 hours
Time.sleep (60) # restricted program is run 4 hours
T=t+1# restricted program is run 4 hours
Os.system (' killall-9runspec') after # operation four hours, terminate all runspec processes
Log (': SpecCpu end') # records test run and terminates
4) all above-mentioned definition can be used to be added in script for other test programs;
This method is mainly used for the automatic test approach of performance under Linux system, the foot created using Python This;Before test starts, testing tool is put under the specified folder of tool server, and tool server is set as fixed IP;Tested server is connect with tool server, and confirms accessible, script is copied under the system by server, Run Script;This method can be performed automatically the performance testing tool of needs, and operation result is recorded in log, side Just it checks the beginning of test program, installs, operation and result;This kind of test method is suitable for currently a popular various Linux and grasps Make, and is suitable for all and thinks the program run automatically.
Embodiment 4.
Referring to FIG. 4, Fig. 4 is
As shown in figure 4, the equipment of the present embodiment provides a kind of automatic running performance test based on linux, includes:
Test program detection module whether there is for detecting test program;If not, downloading test program;
Test program installs module, for installing test program;
Test execution and logging modle, for executing test program, and record log.
Embodiment 5.
The equipment for the automatic running performance test based on linux that the present embodiment provides a kind of includes:
Test program detection module whether there is for detecting test program;If not, downloading test program;
Test program installs module, for installing test program;
Test execution and logging modle, for executing test program, and record log.
Environment preparation module is tested, for preparing a clean test environment for test starting.
Specifically, test program detection module, for checking under specified path with the presence or absence of the test program for needing to run File;If so, output file prompting download information.If not, downloading test from the server of storage test procedure document Program file, and be stored under the specified path created under system under test (SUT).
Specifically, test execution and logging modle execute test program for pressing preset duration;Usage log label is surveyed Whether examination terminates, report an error under automatic checkout system, detects and records system configuration at this time and health status.
Embodiment 6.
It please be as shown in figure 5, a kind of electronic equipment, comprising:
Memory, for storing computer program;
Processor realizes the above-mentioned automatic running performance test based on linux when for executing the computer program Method.
A kind of computer readable storage medium is stored with computer program, the calculating on computer readable storage medium Machine program realizes the above-mentioned automatic running performance test based on linux method when being executed by processor.
The computer readable storage medium may include: USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. is various to deposit Store up the medium of program code.
Above method embodiment is please referred to for the introduction of computer readable storage medium provided by the present invention, the present invention This will not be repeated here.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment, set For standby and computer readable storage medium, since it is corresponded to the methods disclosed in the examples, so the comparison of description is simple Single, reference may be made to the description of the method.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
Computer management method provided by the present invention, relevant device and computer readable storage medium are carried out above It is discussed in detail.Used herein a specific example illustrates the principle and implementation of the invention, above embodiments Explanation be merely used to help understand method and its core concept of the invention.It should be pointed out that for the common of the art , without departing from the principle of the present invention, can be with several improvements and modifications are made to the present invention for technical staff, these Improvement and modification also fall into the protection scope of the claims in the present invention.

Claims (10)

1. a kind of method of the automatic running performance test based on linux characterized by comprising
Detection test program whether there is;If not, downloading test program;
Test program is installed;
Execute test program, and record log.
2. as described in claim 1 in the method for the automatic running performance test of linux, which is characterized in that include test wrapper Border preparation process.
3. as described in claim 1 in the method for the automatic running performance test of linux, which is characterized in that detection test journey Sequence whether there is;If not, downloading test program, comprising the steps of:
It checks under specified path with the presence or absence of the test procedure document for needing to run;
If so, output file prompting download information;
If not, downloading test procedure document from the server of storage test procedure document, and it is stored under system under test (SUT) and creates Specified path under.
4. as described in claim 1 in the method for the automatic running performance test of linux, which is characterized in that
Execute test program, and record log, comprising the steps of:
By preset duration, test program is executed;
Whether usage log labeled test terminates, report an error under automatic checkout system, detects and records system configuration at this time and be good for Health situation.
5. as claimed in claim 2 in the method for the automatic running performance test of linux, which is characterized in that
Test environment preparation process includes:
The test starting time is obtained, and generates log;
The specified file catalogue of script operation is checked for, such as there is no createing directory, there is then outgoing route and there is letter Breath;
Terminate all program process being currently running.
6. a kind of equipment of the automatic running performance test based on linux, characterized by comprising:
Test program detection module whether there is for detecting test program;If not, downloading test program;
Test program installs module, for installing test program;
Test execution and logging modle, for executing test program, and record log.
7. the equipment of the automatic running performance test based on linux as claimed in claim 6, characterized by comprising:
Environment preparation module is tested, for preparing a clean test environment for test starting.
8. the equipment of the automatic running performance test based on linux as claimed in claim 6, which is characterized in that
Test program detection module, for checking under specified path with the presence or absence of the test procedure document for needing to run;If so, defeated File prompting download information out;If not, downloading test procedure document from the server of storage test procedure document, and deposit It is placed under the specified path created under system under test (SUT);
Test execution and logging modle execute test program for pressing preset duration;Usage log labeled test terminates, automatically Whether report an error under detection system, detect and records system configuration at this time and health status.
9. a kind of electronic equipment characterized by comprising
Memory, for storing computer program;
Processor realizes oneself based on linux as described in any one of claim 1 to 5 when for executing the computer program The method of dynamic runnability test.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program is realized as described in any one of claim 1 to 5 when the computer program is executed by processor based on the automatic of linux The method of runnability test.
CN201910153497.3A 2019-02-28 2019-02-28 Method, equipment and the medium of automatic running performance test based on linux Withdrawn CN109901982A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910153497.3A CN109901982A (en) 2019-02-28 2019-02-28 Method, equipment and the medium of automatic running performance test based on linux

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910153497.3A CN109901982A (en) 2019-02-28 2019-02-28 Method, equipment and the medium of automatic running performance test based on linux

Publications (1)

Publication Number Publication Date
CN109901982A true CN109901982A (en) 2019-06-18

Family

ID=66946045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910153497.3A Withdrawn CN109901982A (en) 2019-02-28 2019-02-28 Method, equipment and the medium of automatic running performance test based on linux

Country Status (1)

Country Link
CN (1) CN109901982A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269733A (en) * 2020-10-15 2021-01-26 苏州浪潮智能科技有限公司 Automatic aging test method for server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269733A (en) * 2020-10-15 2021-01-26 苏州浪潮智能科技有限公司 Automatic aging test method for server and storage medium
CN112269733B (en) * 2020-10-15 2022-08-16 苏州浪潮智能科技有限公司 Automatic aging test method for server and storage medium

Similar Documents

Publication Publication Date Title
Schröter et al. If your bug database could talk
Zeng et al. Studying the characteristics of logging practices in mobile apps: a case study on f-droid
KR100868762B1 (en) Method of error detecting method for embedded sofeware
Chen et al. An automated approach to estimating code coverage measures via execution logs
Levin Mac OS X and iOS internals: to the apple's core
US8694967B2 (en) User interface inventory
US20070220370A1 (en) Mechanism to generate functional test cases for service oriented architecture (SOA) applications from errors encountered in development and runtime
US20120151488A1 (en) Measuring Transaction Performance Across Application Asynchronous Flows
CN106325970A (en) Compiling method and compiling system
CN103123605B (en) A kind of Android platform automatic integration test method and device
CN102541731B (en) Platform-agnostic diagnostic data collection and display
US10599558B1 (en) System and method for identifying inputs to trigger software bugs
CN115080398A (en) Automatic interface test system and method
WO2022127196A1 (en) Application identification method and apparatus, and device and storage medium
US8560895B2 (en) Distillation and reconstruction of provisioning components
CN109032929A (en) Program log record obtaining method and device and electronic equipment
US7409677B1 (en) Method and system for creation and use of embedded trace description
CA2811617C (en) Commit sensitive tests
CN109901982A (en) Method, equipment and the medium of automatic running performance test based on linux
CN104036193A (en) Local cross-domain vulnerability detection method and device for application program
US8997048B1 (en) Method and apparatus for profiling a virtual machine
CN108334443A (en) Generate method, apparatus, equipment and the computer readable storage medium of test case
US7765541B1 (en) Minimization methodology
TW201241622A (en) System and method for debugging programs
Ruprecht et al. Automatic feature selection in large-scale system-software product lines

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20190618

WW01 Invention patent application withdrawn after publication