CN110825571A - Method and device for acquiring error information of test log of Linux system - Google Patents

Method and device for acquiring error information of test log of Linux system Download PDF

Info

Publication number
CN110825571A
CN110825571A CN201911034338.8A CN201911034338A CN110825571A CN 110825571 A CN110825571 A CN 110825571A CN 201911034338 A CN201911034338 A CN 201911034338A CN 110825571 A CN110825571 A CN 110825571A
Authority
CN
China
Prior art keywords
log
information
scanning
error information
bmc
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
CN201911034338.8A
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 CN201911034338.8A priority Critical patent/CN110825571A/en
Publication of CN110825571A publication Critical patent/CN110825571A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for acquiring error information of a test log of a Linux system, which comprises the following steps: inquiring a script to be executed according to the information of the test machine, and creating an execution task; establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords; and scanning the system log and the BMC log in sequence according to the analysis rule to acquire log error information. The invention also discloses a device for acquiring the error information of the test log of the Linux system. The invention is convenient for the testers to check the log rapidly, and avoids repeated work. The testing efficiency is improved, the labor cost is saved, and the product quality is ensured.

Description

Method and device for acquiring error information of test log of Linux system
Technical Field
The invention relates to the technical field of server testing, in particular to a method and a device for acquiring error information of a test log of a Linux system.
Background
In the manual test, when a plurality of test machines are tested, mutual switching among a plurality of servers and repeated typing of commands are avoided, and a user needs to repeat various simple and monotonous working modes to realize the repeated switching among different machines. Therefore, how to automatically execute the log analysis scripts of each system and obtain the Bug information of each testing machine is very necessary to improve the accuracy and efficiency of the test.
Disclosure of Invention
The invention aims to provide a method and a device for acquiring error information of a test log of a Linux system, which are convenient for testers to check the log quickly and avoid repeated work. .
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides a method for acquiring error information of a test log of a Linux system, which comprises the following steps:
inquiring logs to be tested according to the information of the testing machine;
establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords;
and scanning the system log and the BMC log in sequence according to the analysis rule to acquire log error information.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the querying, according to the test machine information, a log to be tested specifically includes:
loading server information comprising IP, user name and password in the configuration file, and circularly traversing all servers;
and connecting the server, and scanning the log to be tested at regular time.
With reference to the first aspect, in a second possible implementation manner of the first aspect, the establishing a parsing rule according to the log blacklist information, the log white list information, and the log keyword specifically includes:
performing incremental scanning on the logs according to keywords of the log blacklist, reading a configuration file, acquiring blacklist keywords, and combining the log keywords into a Shell script;
outputting a result scanned from the keywords of the blacklist, circularly traversing the information of the white list, and screening the information of the white list to form a second scanning result;
and analyzing the second scanning result again, repeating for more than 3 times in 1 second of the timestamp to obtain an interference log, and performing cyclic traversal on the log to remove the interference log.
With reference to the first aspect, in a third possible implementation manner of the first aspect, the sequentially scanning the system log and the BMC log according to the parsing rule to obtain log error information specifically includes:
connecting a server, opening a system Log execution pipeline, scanning the system Log according to an analysis rule, acquiring system Log error information, and storing the system Log error information to the server in a Log form;
and after the system Log is scanned, closing the system Log execution pipeline, opening the BMC Log execution pipeline, scanning the BMC Log according to the analysis rule, acquiring error information of the BMC Log, and storing the error information of the BMC Log to a server in a Log form.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the sequentially scanning the system log and the BMC log according to the parsing rule to obtain log error information further includes:
after the BMC log scanning is finished, closing a BMC log scanning execution pipeline;
and closing the server Session and continuing to scan the next server.
With reference to the first aspect, in a fifth possible implementation manner of the first aspect, after the step of sequentially scanning the system log and the BMC log according to the parsing rule and acquiring log error information, the method further includes:
and uploading the scanned file to a Web server at regular time.
The second aspect of the present invention provides an apparatus for obtaining error information of a Linux system test log, including:
the analysis rule establishing module is used for establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords;
the test task creating module is used for inquiring the log to be tested according to the test machine information;
and the log error information acquisition module is used for scanning the system log and the BMC log in sequence according to the analysis rule to acquire log error information.
The device for acquiring the error information of the Linux system test log in the second aspect of the invention can realize the method in the first aspect and achieve the same effect.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
the invention circularly traverses the test server, inquires the script to be executed according to the information of the test machine, and creates the task. And combining a set of universal scripts according to the black-and-white list information and the keyword information of the log. Creating a Jsch connection object, opening a command pipeline, executing a log analysis script, acquiring log error information, displaying the log error information on an interface, and storing a log file in a TXT form. The test personnel can conveniently and rapidly check the log, and repetitive work is avoided. The testing efficiency is improved, the labor cost is saved, and the product quality is ensured.
Drawings
FIG. 1 is a flow chart of a method of an embodiment of the present invention;
FIG. 2 is a flowchart of a method of step S1 according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a method of step S2 according to a first embodiment of the present invention;
FIG. 4 is a flowchart of the method of step S3 according to the first embodiment of the present invention;
FIG. 5 is a flow chart of a second method of an embodiment of the invention;
FIG. 6 is a schematic diagram of an embodiment of the apparatus of the present invention.
Detailed Description
In order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
As shown in fig. 1, a method for obtaining error information of a Linux system test log includes the following steps:
s1, inquiring the log to be tested according to the test machine information;
s2, establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords;
and S3, scanning the system log and the BMC log in sequence according to the analysis rule to acquire log error information.
As shown in fig. 2, in step S1, the method for querying the log to be tested according to the test machine information includes the following steps:
s11, loading server information including IP, user name and password in the configuration file, and circularly traversing all servers;
and S12, connecting the server, and scanning the log to be tested at regular time.
As shown in fig. 3, in step S2, establishing a parsing rule according to the log blacklist information, the log whitelist information, and the log keyword, specifically includes:
s21, performing incremental scanning on the log according to the keywords of the log blacklist, reading the configuration file, acquiring the keywords of the blacklist, and combining the keywords of the log into a Shell script;
s22, outputting the result of the keyword scanning of the blacklist, circularly traversing the information of the white list, and screening the information of the white list to form a second scanning result;
s23, analyzing the second scanning result again, repeating for more than 3 times in 1 second of the timestamp to be regarded as an interference log, and performing cycle traversal on the log to remove the interference log;
as shown in fig. 4, in step S3, scanning the system log and the BMC log in sequence according to the analysis rule to obtain log error information specifically includes:
s31, connecting a server, opening a system Log execution pipeline, scanning the system Log according to an analysis rule, acquiring system Log error information, and storing the system Log error information to the server in a Log form;
s32, after the system Log is scanned, closing a system Log execution pipeline, opening a BMC Log execution pipeline, scanning the BMC Log according to an analysis rule, acquiring error information of the BMC Log, and storing the error information of the BMC Log to a server in a Log form;
s33, after the BMC log scanning is finished, closing the BMC log scanning execution pipeline;
s34, closing the Session of the server, and continuing to scan the next server;
and S35, uploading the scanned file to a Web server at regular time.
As shown in fig. 5, a method for obtaining error information of a Linux system test log is characterized by comprising the following steps:
loading server information comprising IP, user name and password in a configuration file;
judging whether the execution of the server list is finished, if so, exiting; if not, acquiring the last scanning end time start time;
acquiring End Time of the scanning Time;
judging whether the End Time is greater than the start Time, if not, judging whether the End Time is greater than the start Time; returning to the previous step; if yes, executing the next step;
scanning logs from start Time to End Time according to the analysis rule;
acquiring a system log path and a system log scanning script, and acquiring a BMC log path and a BMC log scanning script;
opening a system log execution pipeline;
executing a system log scanning script;
after the scanning is finished, closing a system log execution pipeline;
opening a BMC log execution pipeline;
scanning a BMC log scanning script;
after the scanning is finished, closing a BMC log execution pipeline;
uploading and downloading files;
and the servle acquires data, and performs analysis statistics and interface display.
As shown in fig. 6, an apparatus for obtaining error information of a Linux system test log includes:
the analysis rule establishing module 101 is used for establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords;
the test task creating module 102 is used for inquiring the log to be tested according to the information of the test machine;
the log error information obtaining module 103 scans the system log and the BMC log in sequence according to the analysis rule to obtain log error information.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (7)

1. A method for obtaining error information of a test log of a Linux system is characterized by comprising the following steps:
inquiring logs to be tested according to the information of the testing machine;
establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords;
and scanning the system log and the BMC log in sequence according to the analysis rule to acquire log error information.
2. The method for obtaining the error information of the test log of the Linux system as claimed in claim 1, wherein the querying the log to be tested according to the test machine information specifically comprises:
loading server information comprising IP, user name and password in the configuration file, and circularly traversing all servers;
and connecting the server, and scanning the log to be tested at regular time.
3. The method according to claim 2, wherein the establishing of the parsing rule according to the log blacklist information, the log white list information and the log keyword specifically comprises:
performing incremental scanning on the logs according to keywords of the log blacklist, reading a configuration file, acquiring blacklist keywords, and combining the log keywords into a Shell script;
outputting a result scanned from the keywords of the blacklist, circularly traversing the information of the white list, and screening the information of the white list to form a second scanning result;
and analyzing the second scanning result again, repeating for more than 3 times in 1 second of the timestamp to obtain an interference log, and performing cyclic traversal on the log to remove the interference log.
4. The method according to claim 3, wherein the step of scanning the system log and the BMC log in sequence according to the parsing rule to obtain the log error information specifically comprises:
connecting a server, opening a system Log execution pipeline, scanning the system Log according to an analysis rule, acquiring system Log error information, and storing the system Log error information to the server in a Log form;
and after the system Log is scanned, closing the system Log execution pipeline, opening the BMC Log execution pipeline, scanning the BMC Log according to the analysis rule, acquiring error information of the BMC Log, and storing the error information of the BMC Log to a server in a Log form.
5. The method according to claim 4, wherein the step of scanning the system log and the BMC log in sequence according to the parsing rule to obtain the log error information further comprises:
after the BMC log scanning is finished, closing a BMC log scanning execution pipeline;
and closing the server Session and continuing to scan the next server.
6. The method for obtaining the error information of the test log in the Linux system as recited in claim 5, wherein the step of sequentially scanning the system log and the BMC log according to the parsing rule and obtaining the log error information further comprises:
and uploading the scanned file to a Web server at regular time.
7. A device for obtaining error information of a test log of a Linux system is characterized by comprising:
the analysis rule establishing module is used for establishing an analysis rule according to the log blacklist information, the log white list information and the log keywords;
the test task creating module is used for inquiring the log to be tested according to the test machine information;
and the log error information acquisition module is used for scanning the system log and the BMC log in sequence according to the analysis rule to acquire log error information.
CN201911034338.8A 2019-10-29 2019-10-29 Method and device for acquiring error information of test log of Linux system Withdrawn CN110825571A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911034338.8A CN110825571A (en) 2019-10-29 2019-10-29 Method and device for acquiring error information of test log of Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911034338.8A CN110825571A (en) 2019-10-29 2019-10-29 Method and device for acquiring error information of test log of Linux system

Publications (1)

Publication Number Publication Date
CN110825571A true CN110825571A (en) 2020-02-21

Family

ID=69551162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911034338.8A Withdrawn CN110825571A (en) 2019-10-29 2019-10-29 Method and device for acquiring error information of test log of Linux system

Country Status (1)

Country Link
CN (1) CN110825571A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626232A (en) * 2021-06-30 2021-11-09 苏州浪潮智能科技有限公司 Method, device and equipment for checking server logs and readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626232A (en) * 2021-06-30 2021-11-09 苏州浪潮智能科技有限公司 Method, device and equipment for checking server logs and readable medium
CN113626232B (en) * 2021-06-30 2023-07-14 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for checking server log

Similar Documents

Publication Publication Date Title
US8924933B2 (en) Method and system for automated testing of computer applications
CN106294094B (en) Test method, client, server and system of game server
CN109582395B (en) Applet running method and device, electronic equipment and storage medium
US7793155B2 (en) Automated software testing via multi-channel remote computing
CN104375914A (en) Automatic testing method for internal pressure change of server
CN106776318A (en) A kind of test script method for recording and system
CN112559348B (en) Test analysis method, system, equipment and medium based on jacoco
CN113505068A (en) Automatic test method, device, equipment and storage medium for HTTP (hyper text transport protocol) interface
CN109902009A (en) A kind of method and system tested automatically under linux environment
CN106972983B (en) Automatic testing device and method for network interface
CN112115051A (en) Page traversal detection method, device and equipment for application and readable storage medium
CN114780377A (en) Method and device for determining software exception, storage medium and electronic device
CN111176981B (en) Method for testing related behaviors of Android application network
CN110825571A (en) Method and device for acquiring error information of test log of Linux system
CN113206849B (en) Vulnerability scanning method and device based on ghidra and related equipment
CN105808422A (en) Network-based software test method, client and to-be-tested equipment
CN111666200A (en) Testing method and terminal for time consumption of cold start of PC software
CN116383025A (en) Performance test method, device, equipment and medium based on Jmeter
CN113868129B (en) Method for checking accuracy of back-end data and automatic testing tool
CN113934642B (en) Software compatibility testing method based on dynamic and static combination
CN116166536A (en) Test method, test device, electronic equipment and storage medium
CN113032255B (en) Response noise identification method, model, electronic device and computer storage medium
CN111753296B (en) Method and device for repairing system component bugs
CN109995607B (en) Method for testing flow overhead, terminal, server and computer storage medium
CN113434417B (en) Regression testing method and device for loopholes, storage medium and electronic device

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: 20200221

WW01 Invention patent application withdrawn after publication