CN112667487A - Method and device for executing FIO performance test by using Python script under Linux - Google Patents

Method and device for executing FIO performance test by using Python script under Linux Download PDF

Info

Publication number
CN112667487A
CN112667487A CN202011566180.1A CN202011566180A CN112667487A CN 112667487 A CN112667487 A CN 112667487A CN 202011566180 A CN202011566180 A CN 202011566180A CN 112667487 A CN112667487 A CN 112667487A
Authority
CN
China
Prior art keywords
fio
script
python
test
setting
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.)
Pending
Application number
CN202011566180.1A
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.)
Shenzhen Innovation Technology Co ltd
Original Assignee
Shenzhen Innovation 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 Shenzhen Innovation Technology Co ltd filed Critical Shenzhen Innovation Technology Co ltd
Priority to CN202011566180.1A priority Critical patent/CN112667487A/en
Publication of CN112667487A publication Critical patent/CN112667487A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for executing FIO performance test by using Python script under Linux, wherein the method comprises the following steps: setting an FIO test script based on the installed FIO tool, and setting a Python automation script based on the installed Python tool; calling the FIO test script based on the Python automation script; running the Python automation script; and obtaining the FIO performance test result after the operation is finished. The invention can automatically execute the test without manually monitoring the test result, and the test result can be directly counted without searching, copying, pasting and counting one by one in the output result of the FIO based on a manual mode.

Description

Method and device for executing FIO performance test by using Python script under Linux
Technical Field
The invention relates to the technical field of storage performance detection, in particular to a method and a device for executing FIO performance test by using Python script under Linux.
Background
At present, when FIO is used for testing the storage performance under Linux, most of the FIO adopts a manual method to perform read-write test, one command is executed in each read-write test, multiple parameters are often required to be set to execute multiple command tests, and after the test is finished, the result data of read-write bandwidth, IOPS, delay and the like are counted and put into a table so as to be convenient for analyzing the test result. The method is mechanical for testers, the testers need to wait for test results and count the test results, the counting results are tedious and time-consuming, the working efficiency is not high, the testers are tedious in the whole testing process, and the testing requirements may not be completed under the limit condition.
Disclosure of Invention
The embodiment of the specification provides a method and a device for executing FIO performance test by using Python script under Linux.
The method for executing the FIO performance test by using the Python script under the Linux provided by the embodiment of the present specification includes:
setting an FIO test script based on the installed FIO tool, and setting a Python automation script based on the installed Python tool;
calling the FIO test script based on the Python automation script;
running the Python automation script;
and obtaining the FIO performance test result after the operation is finished.
The apparatus for performing an FIO performance test using a Python script under Linux provided in an embodiment of the present specification includes:
the setting module is used for setting an FIO test script based on the installed FIO tool and setting a Python automation script based on the installed Python tool;
a calling module for calling the FIO test script based on the Python automation script;
the operation module is used for operating the Python automation script;
and the acquisition module acquires the FIO performance test result after the operation is finished.
The embodiment of the invention can automatically execute the test without manually monitoring the test result, and the test result can be directly counted without searching, copying, pasting and counting one by one in the output result of the FIO based on a manual mode.
Drawings
Fig. 1 is a flowchart of a method for performing FIO performance testing using Python scripts under Linux according to some embodiments of the present disclosure.
Fig. 2 is a block diagram of an apparatus for performing FIO performance testing using Python scripts under Linux according to some embodiments of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
As shown in fig. 1, some embodiments of the present specification provide a method for performing FIO performance testing using Python scripts under Linux, including setting a FIO test script based on an installed FIO tool, and setting a Python automation script based on the installed Python tool; calling the FIO test script based on the Python automation script; running the Python automation script; and obtaining the FIO performance test result after the operation is finished.
In some embodiments of the present specification, the step of setting an FIO test script is specifically to summarize test commands to be executed into the FIO test script by using a Shell script; and modifying the path in the FIO test script into a path needing to be tested, and setting the parameters in the FIO test script as the parameters needing to be tested.
In some embodiments of the present description, the step of calling the FIO test script based on the Python automation script specifically is to modify a calling name and a path of the FIO test script in the Python automation script to a calling name and a path corresponding to the FIO test script.
In some embodiments of the present description, the step of obtaining an FIO performance test result after the operation is finished specifically is to generate an FIO performance test result in a directory of the Python automation script after the operation is finished, and extract data including bandwidth data, IOPS data, and delay data from the FIO performance test result into a CSV file.
With reference to fig. 2, an embodiment of the present invention further provides a device for performing an FIO performance test using a Python script under Linux, including a setting module, configured to set a FIO test script based on an installed FIO tool, and set a Python automation script based on an installed Python tool; a calling module for calling the FIO test script based on the Python automation script; the operation module is used for operating the Python automation script; and the acquisition module acquires the FIO performance test result after the operation is finished.
In some embodiments of the present specification, the setting module is further specifically configured to summarize test commands to be executed into the FIO test script using a Shell script; and modifying the path in the FIO test script into a path needing to be tested, and setting the parameters in the FIO test script as the parameters needing to be tested.
In some embodiments of the present description, the calling module is further specifically configured to modify a calling name and a path of an FIO test script in the Python automation script into a calling name and a path corresponding to the FIO test script.
In some embodiments of the present description, the obtaining module is further specifically configured to extract, from an FIO performance test result generated in the directory of the Python automation script after the operation is finished, data including bandwidth data, IOPS data, and delay data into a CSV file.
There is also provided in some embodiments of the present specification an electronic device and a computer-readable storage medium, the electronic device comprising a memory for storing a computer software program; and the processor is used for realizing the steps of the method for executing the FIO performance test by using the Python script under the Linux when the computer software program is run. The computer readable storage medium stores a computer software program that when executed implements the steps of a method for performing FIO performance testing using Python scripts under Linux.
The following is specifically described with reference to fig. 1 to 2.
The specific steps for automatically executing the FTO performance test and result statistics in the embodiment of the invention are as follows:
1. prepare the test environment, install the FIO tool, install Python.
2. The FIO test script and the Python script are placed in a test environment.
The format of the FIO test script is described as follows: the FIO generation report and the FIO test script are in the same directory (no path is added before the report name is generated); "> > >" for fixing redirection symbols; script variables need to be directly exhaustive in the loop, rather than defining variables to be exhaustive, for example, it should be: for var in 4k 8k 16k 32k 64k 256k 1 m; instead of:
bs1='4k 8k 16k'
for i in$bs1
3. modifying the path in the FIO test script into a path to be tested, and setting the parameters as parameters to be tested; the calling name and path of the FIO test script in the Python automation script are modified to be the corresponding names and paths.
4. Directly running Python automation script: for example: py.
5. After the operation is finished, a form file named 'FIO _ < timestamp >' can be generated under the directory of the current execution script, and the form file is the counted FIO performance test result data.
In summary, the invention can automatically execute the test without manually monitoring the test result, and the test result can be directly counted without searching, copying, pasting and counting one by one in the output result of the FIO based on a manual mode.
While the process flows described above may include multiple operations occurring in a particular order, it should be appreciated that the processes may include more or less operations, which may be performed sequentially or in parallel (e.g., using parallel processors or a multi-threaded environment). The present invention is described with reference to flowchart illustrations and/or block diagrams of methods according to embodiments of the invention.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method or device comprising the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the method embodiment, since it is substantially similar to the apparatus embodiment, the description is simple, and the relevant points can be referred to the partial description of the apparatus embodiment. The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method for executing FIO performance test by using Python script under Linux, which is characterized by comprising the following steps:
setting an FIO test script based on the installed FIO tool, and setting a Python automation script based on the installed Python tool;
calling the FIO test script based on the Python automation script;
running the Python automation script;
and obtaining the FIO performance test result after the operation is finished.
2. The method for performing FIO performance testing using Python scripts under Linux of claim 1,
the step of setting the FIO test script, specifically,
summarizing the test commands to be executed into the FIO test script by using Shell scripts;
and modifying the path in the FIO test script into a path needing to be tested, and setting the parameters in the FIO test script as the parameters needing to be tested.
3. The method for performing FIO performance testing using Python scripts under Linux of claim 2,
the step of calling the FIO test script based on the Python automation script is specifically,
and modifying the calling name and the path of the FIO test script in the Python automation script into the calling name and the path corresponding to the FIO test script.
4. The method for performing FIO performance testing using Python scripts under Linux of claim 3,
the step of obtaining the FIO performance test result after the operation is finished is specifically,
and after the operation is finished, generating an FIO performance test result under the directory of the Python automation script, and extracting data including bandwidth data, IOPS data and delay data from the FIO performance test result to a CSV file.
5. An apparatus for performing FIO performance test using Python script under Linux, comprising:
the setting module is used for setting an FIO test script based on the installed FIO tool and setting a Python automation script based on the installed Python tool;
a calling module for calling the FIO test script based on the Python automation script;
the operation module is used for operating the Python automation script;
and the acquisition module acquires the FIO performance test result after the operation is finished.
6. The apparatus for performing FIO performance testing using Python script under Linux of claim 5,
the setting module is further specifically configured to summarize the test command to be executed into the FIO test script using a Shell script; and modifying the path in the FIO test script into a path needing to be tested, and setting the parameters in the FIO test script as the parameters needing to be tested.
7. The apparatus for performing FIO performance testing using Python script under Linux of claim 6,
the calling module is further specifically configured to modify a calling name and a path of an FIO test script in the Python automation script to a calling name and a path corresponding to the FIO test script.
8. The apparatus for performing FIO performance testing using Python script under Linux of claim 7,
the obtaining module is further specifically configured to generate an FIO performance test result in the directory of the Python automation script after the operation is finished, and extract data including bandwidth data, IOPS data, and delay data from the FIO performance test result to the CSV file.
9. An electronic device, comprising
A memory for storing a computer software program;
a processor for implementing the steps of the method for performing a FIO performance test using Python scripts under Linux according to any one of claims 1 to 4 when running the computer software program.
10. A computer-readable storage medium, characterized in that,
the computer readable storage medium having stored thereon a computer software program which when executed performs the steps of the method of performing a FIO performance test using Python scripts under Linux according to any one of claims 1 to 4.
CN202011566180.1A 2020-12-25 2020-12-25 Method and device for executing FIO performance test by using Python script under Linux Pending CN112667487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011566180.1A CN112667487A (en) 2020-12-25 2020-12-25 Method and device for executing FIO performance test by using Python script under Linux

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011566180.1A CN112667487A (en) 2020-12-25 2020-12-25 Method and device for executing FIO performance test by using Python script under Linux

Publications (1)

Publication Number Publication Date
CN112667487A true CN112667487A (en) 2021-04-16

Family

ID=75409534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011566180.1A Pending CN112667487A (en) 2020-12-25 2020-12-25 Method and device for executing FIO performance test by using Python script under Linux

Country Status (1)

Country Link
CN (1) CN112667487A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991641A (en) * 2023-06-25 2023-11-03 珠海妙存科技有限公司 FIO-based compatibility testing method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045707A (en) * 2015-07-24 2015-11-11 浪潮电子信息产业股份有限公司 Python-based server stability test method
CN107608841A (en) * 2017-10-25 2018-01-19 郑州云海信息技术有限公司 Hard disk test document generating method, device, equipment and readable storage medium storing program for executing
CN107704350A (en) * 2017-10-12 2018-02-16 郑州云海信息技术有限公司 A kind of automatic test SSD Qos method of testing
CN108335722A (en) * 2018-01-03 2018-07-27 郑州云海信息技术有限公司 A kind of method of automatic test SSD interface rate
CN108763042A (en) * 2018-05-24 2018-11-06 广东睿江云计算股份有限公司 A kind of Cloud Server performance data acquisition method and device based on python
CN108920319A (en) * 2018-07-26 2018-11-30 郑州云海信息技术有限公司 It is a kind of can real-time display performance data hard disk method for testing pressure
CN110798373A (en) * 2019-09-20 2020-02-14 苏州浪潮智能科技有限公司 Method for realizing performance test, test server and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045707A (en) * 2015-07-24 2015-11-11 浪潮电子信息产业股份有限公司 Python-based server stability test method
CN107704350A (en) * 2017-10-12 2018-02-16 郑州云海信息技术有限公司 A kind of automatic test SSD Qos method of testing
CN107608841A (en) * 2017-10-25 2018-01-19 郑州云海信息技术有限公司 Hard disk test document generating method, device, equipment and readable storage medium storing program for executing
CN108335722A (en) * 2018-01-03 2018-07-27 郑州云海信息技术有限公司 A kind of method of automatic test SSD interface rate
CN108763042A (en) * 2018-05-24 2018-11-06 广东睿江云计算股份有限公司 A kind of Cloud Server performance data acquisition method and device based on python
CN108920319A (en) * 2018-07-26 2018-11-30 郑州云海信息技术有限公司 It is a kind of can real-time display performance data hard disk method for testing pressure
CN110798373A (en) * 2019-09-20 2020-02-14 苏州浪潮智能科技有限公司 Method for realizing performance test, test server and computer storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991641A (en) * 2023-06-25 2023-11-03 珠海妙存科技有限公司 FIO-based compatibility testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN110825619A (en) Automatic generation method and device of interface test case and storage medium
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN111209185B (en) Keyword-based automated testing method and computer-readable storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN111367803A (en) Method and system for improving testing efficiency of client software
US10613969B2 (en) Code coverage module with testing function identifier
CN108572895B (en) Stability test method for automatically checking software and hardware configuration under Linux
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN112667487A (en) Method and device for executing FIO performance test by using Python script under Linux
CN113656304A (en) Method and device for testing front-end application program and storage medium
CN111767218B (en) Automatic test method, equipment and storage medium for continuous integration
CN112084108A (en) Test script generation method and device and related components
CN110147313B (en) Log output method and device
Jain et al. Comparative study of software automation testing tools: OpenScript and selenium
CN113238953A (en) UI automation test method and device, electronic equipment and storage medium
CN113326193A (en) Applet testing method and device
CN113722229A (en) Software testing method and device, electronic equipment and storage medium
CN113360373A (en) Test method for full traversal of Activity page of mobile application
CN111813665A (en) Big data platform interface data testing method and system based on python
CN110795142A (en) Configuration file generation method and device
CN110888807A (en) Automatic android application packet capturing method
CN109857636A (en) A kind of methods and applications positioning App homepage in Android client UI automation process
CN116594918B (en) Test case change influence analysis method, device, equipment and storage medium
CN111858315B (en) Software debugging method, device, equipment and medium based on version management

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210416