CN112035301A - Shell-based automatic server testing method and system - Google Patents

Shell-based automatic server testing method and system Download PDF

Info

Publication number
CN112035301A
CN112035301A CN202010839133.3A CN202010839133A CN112035301A CN 112035301 A CN112035301 A CN 112035301A CN 202010839133 A CN202010839133 A CN 202010839133A CN 112035301 A CN112035301 A CN 112035301A
Authority
CN
China
Prior art keywords
script
time
test
generating
automatically
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
CN202010839133.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.)
Shenzhen Guoxin Hengyun Information Security Co Ltd
Original Assignee
Shenzhen Guoxin Hengyun Information Security 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 Guoxin Hengyun Information Security Co Ltd filed Critical Shenzhen Guoxin Hengyun Information Security Co Ltd
Priority to CN202010839133.3A priority Critical patent/CN112035301A/en
Publication of CN112035301A publication Critical patent/CN112035301A/en
Pending 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

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 provides a method and a system for automatically testing a server based on a shell, which comprises the following steps: logging in root authority to set OS on a CentOS series operating system; generating a hard disk read-write script by using the dd instruction, and placing the hard disk read-write script under a system directory for calling; editing a test script by calling dd script, "shell" grammar and ipmitool instruction; and adding the written test script to a startup item, executing restart, and automatically testing and generating a log document after restarting the system each time. By adopting the technical scheme of the invention, the automatic test of the compatibility and the stability of the server is realized, the test efficiency is improved, the test items are perfected, the quality customs capacity is enhanced, the time spent on artificial judgment errors and test data arrangement is reduced, the labor cost is reduced, and the product quality can be seen more visually.

Description

Shell-based automatic server testing method and system
Technical Field
The invention belongs to the technical field of server testing, and particularly relates to a method and a system for automatically testing a server based on a shell.
Background
With the development of communication, cloud computing and storage technologies, motherboards developed based on the intel X86 architecture are more and more mature, the functions are more and more, the performance is more and more powerful, and the competition in the market is more and more tragic. For users, besides functions and performance, the most important is the stability, compatibility and safety of products, which are necessary conditions for separating from other manufacturers. However, in order to improve the stability, compatibility and safety of the product, detailed tests are required before the product is shipped, so as to ensure the quality of the product after shipment. Including stability testing and compatibility testing.
1. And (3) stability testing: in the product trial production stage, the mainboard needs to be fully equipped to carry out large-batch, long-time and uninterrupted restart test. The purpose is as follows: detecting whether the work of a mainboard is stable or not, and avoiding the phenomena of crash, power failure, blue screen and the like; secondly, whether the collocated equipment, such as a hard disk, PCIe equipment, a network and the like, works normally after being restarted into the system every time, and the situation of lost device does not occur.
2. And (3) compatibility testing: in the product trial production stage, performance tests need to be performed on all the device interfaces one by one, whether the mainboard interface meets the corresponding protocol or not is detected, whether the performance is damaged or not is detected when the corresponding device is matched, and the problems that the device cannot be identified or the performance and the protocol are greatly different are avoided.
At present, the prior art test method has the following disadvantages:
(1) for server products, due to the limited number of PCIe buses and the application mode of the server (large-capacity storage space is required), the situation of coexistence of SATA or SAS and NVME is determined, and Raid (disk array) may exist at the same time.
(2) The compatibility test of the hard disk, the PCIe equipment and the network needs to be carried out separately, the test period is prolonged, the loading of the test is increased, and the production efficiency is influenced.
(3) The test of mainboard compatibility and mainboard restart stability need separately go on, lengthen test period, increase the loading of test, influence the efficiency of production.
(4) When the test is restarted, whether the performance of the equipment is normal or not cannot be checked.
(5) At present, most of the actual automatic tests in the prior art are semi-automatic modes, namely, automatic tests and manual judgment are carried out to judge whether test data pass or not. Therefore, much effort and manpower are required, and the efficiency is not high.
Disclosure of Invention
Aiming at the technical problems, the invention discloses a method and a system for automatically testing a server based on a shell, which realize the automatic testing of the compatibility and the stability of the server.
In contrast, the technical scheme adopted by the invention is as follows:
a server automatic testing method based on shell comprises the following steps:
step S1, logging root authority to set OS on the CentOS series operating system;
step S2, generating a hard disk read-write script by using the dd instruction, and placing the hard disk read-write script under a system directory for calling;
step S3, editing the test script by calling dd script, "shell" grammar and ipmitool instruction;
and step S4, adding the written test script to the startup item, restarting, and performing automatic test and generating log documents after restarting the system each time.
As a further improvement of the present invention, in step S1, the OS setting includes setting the OS to text mode start, setting the network to power on automatic connection, and setting the OS to login-free.
As a further improvement of the present invention, step S4 includes, after each reboot of the system:
automatically recording the restart times and generating a log document; and when problems occur, subsequent debug, risk assessment and phenomenon reappearance are facilitated.
Automatically capturing disk identifiers and firmware information of all hard disks, generating a log document, and recording information captured each time; the information can check the disk identifier and the firmware information of the hard disk, so that whether the disk is lost or not and whether the CPLD works normally or not are judged. The hard disk comprises SATA \ NVME \ SAS \ USB and other hard disks.
Automatically performing n times of performance tests on all hard disks including the composed Raid, generating a log document, and recording the speed of each reading and writing, so as to achieve the purpose of testing the stability and simultaneously performing a performance compatibility test; the n is a positive integer and can be set according to requirements. The hard disk comprises SATA \ NVME \ SAS \ USB and other hard disks. Further, n is 10.
Automatically performing network ping tests of all network ports, generating log documents and recording ping lost conditions each time; therefore, the connection condition of the network after each restart is known.
And automatically grabbing the PCIe equipment, generating a log document, and recording the grabbing condition at each time, so that the grabbing condition of the PCIe equipment is known after the PCIe equipment is restarted at each time.
As a further improvement of the present invention, in step S4, after each reboot of the system, the number of reboots and the current time are automatically recorded, and log documents are merged. According to the interval of the recorded time at each time, whether abnormal conditions such as overlong starting time and the like occur in the test process of the mainboard can be intuitively known, and therefore the stability condition of the mainboard is obtained.
As a further improvement of the present invention, in step S4, after the written test script is added to the boot entry, the instruction: vi/root/. bashrc.
The invention also discloses a server automatic test system based on the shell, which comprises the following components:
the OS setting module is used for logging in root authority to set the OS on a CentOS series operating system;
the dd script generation module generates a hard disk read-write script by using the dd instruction, and the hard disk read-write script is placed under the system directory for calling;
the test script editing module edits the test script by calling dd script, shell grammar and ipmitool instruction;
and the test execution module is used for adding the written test script to the startup item, executing restart, and automatically testing and generating log documents after restarting the system each time.
As a further improvement of the invention, the OS setting comprises setting the OS to be started in a text mode, setting the network to be automatically connected when the OS is started, and setting the OS to be login-free.
As a further improvement of the invention, when the test execution module carries out automatic test, the restart times are automatically recorded after restarting the system every time, and log documents are generated;
automatically capturing disk identifiers and firmware information of all hard disks, generating a log document, and recording information captured each time;
automatically performing n times of performance tests on all hard disks including the composed Raid, generating a log document, and recording the speed of each reading and writing; n is a positive integer and is set as required; further, n is 10.
Automatically performing network ping tests of all network ports, generating log documents and recording ping lost conditions each time;
and automatically grabbing PCIe equipment, generating log documents and recording the grabbing condition every time.
As a further improvement of the invention, after restarting the system each time, the restart times and the current time are automatically recorded, and log documents are merged.
Compared with the prior art, the invention has the beneficial effects that:
firstly, by adopting the technical scheme of the invention, the automatic test of the compatibility and the stability of the server is realized, the automatic judgment can be carried out without manpower after the script is executed, and the complete test condition can be known only by the corresponding log document. Meanwhile, the SATA or SAS and NVME can synchronously perform compatibility test and stability test, and the Raid can also perform automatic compatibility and stability test for a long time.
Secondly, by adopting the technical scheme of the invention, network ping test is automatically carried out by automatically grabbing PCIe equipment; compatibility tests and stability tests are combined, wherein the compatibility tests can be used as data references to achieve the effect of double check, and the compatibility tests can be directly conducted under some special conditions, such as short construction period; in addition, by recording the restart times and time, the comprehensive performance of the product can be known, and the follow-up product and risk assessment can be helped when problems are found.
Thirdly, by adopting the technical scheme of the invention, the testing efficiency is improved, the testing items are perfected, the quality blocking capability is enhanced, the human judgment errors and the time spent on sorting the testing data are reduced, the labor cost is reduced, the product quality can be seen more visually, and the subjective initiative is added.
Drawings
Fig. 1 is a flowchart of a method for automatically testing a server based on a shell according to the present invention.
Detailed Description
Preferred embodiments of the present invention are described in further detail below.
As shown in fig. 1, an automated testing method for a server based on a shell includes:
after the server is powered on and started, after the advanced hardware circuit initialization, the BIOS initialization, the BMC initialization and the hardware equipment initialization, installing a CentOS operating system, and then, comprising:
step S1, logging root authority to set OS on the CentOS series operating system; the OS setting comprises setting the OS to be started in a text mode, setting the network to be automatically connected when the OS is started, and setting the OS to be login-free.
Step S2, generating a hard disk read-write script by using the dd instruction, and placing the hard disk read-write script under a system directory for calling;
step S3, editing the test script by calling dd script, "shell" grammar (echo, for in, cat, past.. etc.), ipmitool instruction;
step S4, adding the written test script to the startup item, and according to the instruction: vi/root/. bashrc. And executing the script after restarting. And after the script is received every time, the system automatically restarts and runs the script again, and the operation is circulated infinitely until the operation is stopped manually.
After restarting the system each time, carrying out automatic test and generating log documents, specifically comprising:
automatically recording the restart times and generating a log document; and when problems occur, subsequent debug, risk assessment and phenomenon reappearance are facilitated.
Automatically capturing disk identifiers and firmware information of all hard disks, generating a log document, and recording information captured each time; the information can check the disk identifier and the firmware information of the hard disk, so that whether the disk is lost or not and whether the CPLD works normally or not are judged. The hard disk comprises SATA \ NVME \ SAS \ USB and other hard disks.
Automatically performing 10 times of performance tests on all hard disks including the composed Raid, generating a log document, and recording the speed of each reading and writing, so as to achieve the purpose of testing the stability and simultaneously performing a performance compatibility test; the hard disk comprises SATA \ NVME \ SAS \ USB and other hard disks.
Automatically performing network ping tests of all network ports, generating log documents and recording ping lost conditions each time; therefore, the connection condition of the network after each restart is known.
And automatically grabbing the PCIe equipment, generating a log document, and recording the grabbing condition at each time, so that the grabbing condition of the PCIe equipment is known after the PCIe equipment is restarted at each time.
And after restarting the system every time, automatically recording the restarting times and the current time, and merging log documents. According to the interval of the recorded time at each time, whether abnormal conditions such as overlong starting time and the like occur in the test process of the mainboard can be intuitively known, and therefore the stability condition of the mainboard is obtained.
The script autonomously judging test result comprises the following steps: confirming the time interval recorded each time, confirming whether the performance test is normal or not each time, confirming the network ping lost condition each time, confirming the PCIe grabbing condition each time, and confirming whether the drive letter and the firmware information grabbed each time are correct or not.
The script running effect is as follows: the compatibility and stability test of the SATA or SAS and NVME can be realized. In the test process, the script can autonomously judge whether each test passes or not, the test data does not need to be checked manually, and the test data is only used as a reserved file.
The invention also discloses a server automatic test system based on the shell, which comprises the following components:
the OS setting module is used for logging in root authority to set the OS on a CentOS series operating system;
the dd script generation module generates a hard disk read-write script by using the dd instruction, and the hard disk read-write script is placed under the system directory for calling;
the test script editing module edits the test script by calling dd script, shell grammar and ipmitool instruction;
and the test execution module is used for adding the written test script to the startup item, executing restart, and automatically testing and generating log documents after restarting the system each time.
The OS setting comprises setting the OS to be started in a text mode, setting the network to be automatically connected when the OS is started, and setting the OS to be login-free.
When the test execution module carries out automatic test, after restarting the system each time, automatically recording the restart times and the current time, and merging log documents;
automatically capturing disk identifiers and firmware information of all hard disks, generating a log document, and recording information captured each time;
automatically performing n times of performance tests on all hard disks including the composed Raid, generating a log document, and recording the speed of each reading and writing; n is a positive integer and is set as required; further, n is 10.
Automatically performing network ping tests of all network ports, generating log documents and recording ping lost conditions each time;
and automatically grabbing PCIe equipment, generating log documents and recording the grabbing condition every time.
The invention also discloses a computer readable storage medium, which comprises a computer program, and when the computer program runs on the electronic equipment, the electronic equipment is caused to execute the automatic testing method based on the server under the shell.
The invention also discloses a device, which comprises a processor and a memory which are connected, and is characterized in that: the processor is configured to execute the computer program stored in the memory to perform the under-shell based server automation test as described above.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (8)

1. A server automatic test method based on shell is characterized in that: which comprises the following steps:
step S1, logging root authority to set OS on the CentOS series operating system;
step S2, generating a hard disk read-write script by using the dd instruction, and placing the hard disk read-write script under a system directory for calling;
step S3, editing the test script by calling dd script, "shell" grammar and ipmitool instruction;
and step S4, adding the written test script to the startup item, restarting, and performing automatic test and generating log documents after restarting the system each time.
2. The automated testing method for the server under the shell according to claim 1, wherein: in step S1, the OS setting includes setting the OS to text mode start, setting the network to boot automatic connection, and setting the OS to secure login.
3. The automated testing method for the server under the shell according to claim 2, wherein: in step S4, after restarting the system each time, automatically recording the restart times and generating log documents;
automatically capturing disk identifiers and firmware information of all hard disks, generating a log document, and recording information captured each time;
automatically performing n times of performance tests on all hard disks including the composed Raid, generating a log document, and recording the speed of each reading and writing; n is a positive integer and is set as required; further, n is 10.
Automatically performing network ping tests of all network ports, generating log documents and recording ping lost conditions each time;
and automatically grabbing PCIe equipment, generating log documents and recording the grabbing condition every time.
4. The automated testing method for the server under the shell according to claim 3, wherein: in step S4, after the system is restarted each time, the number of times of restarting and the current time are automatically recorded, and log documents are merged.
5. A server automatic test system based on shell is characterized by comprising:
the OS setting module is used for logging in root authority to set the OS on a CentOS series operating system;
the dd script generation module generates a hard disk read-write script by using the dd instruction, and the hard disk read-write script is placed under the system directory for calling;
the test script editing module edits the test script by calling dd script, shell grammar and ipmitool instruction;
and the test execution module is used for adding the written test script to the startup item, executing restart, and automatically testing and generating log documents after restarting the system each time.
6. The automated shell-based server testing system of claim 5, wherein: the OS setting comprises setting the OS to be started in a text mode, setting the network to be automatically connected when the OS is started, and setting the OS to be login-free.
7. The automated shell-based server testing system of claim 6, wherein: when the test execution module carries out automatic test, after restarting the system each time, automatically recording the restart times and generating a log document;
automatically capturing disk identifiers and firmware information of all hard disks, generating a log document, and recording information captured each time;
automatically performing n times of performance tests on all hard disks including the composed Raid, generating a log document, and recording the speed of each reading and writing; n is a positive integer and is set as required; further, n is 10.
Automatically performing network ping tests of all network ports, generating log documents and recording ping lost conditions each time;
and automatically grabbing PCIe equipment, generating log documents and recording the grabbing condition every time.
8. The automated shell-based server testing system of claim 7, wherein: and after restarting the system every time, automatically recording the restarting times and the current time, and merging log documents.
CN202010839133.3A 2020-08-19 2020-08-19 Shell-based automatic server testing method and system Pending CN112035301A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010839133.3A CN112035301A (en) 2020-08-19 2020-08-19 Shell-based automatic server testing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010839133.3A CN112035301A (en) 2020-08-19 2020-08-19 Shell-based automatic server testing method and system

Publications (1)

Publication Number Publication Date
CN112035301A true CN112035301A (en) 2020-12-04

Family

ID=73576994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010839133.3A Pending CN112035301A (en) 2020-08-19 2020-08-19 Shell-based automatic server testing method and system

Country Status (1)

Country Link
CN (1) CN112035301A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948190A (en) * 2021-02-26 2021-06-11 浪潮电子信息产业股份有限公司 Hardware testing method, system and related device of server

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899119A (en) * 2015-05-21 2015-09-09 浪潮电子信息产业股份有限公司 Method for automatically detecting hard disk abnormality
CN105760262A (en) * 2015-11-30 2016-07-13 浪潮电子信息产业股份有限公司 Method for carrying out cross validation on stability of hard disk based on dc and reboot under linux
CN106776189A (en) * 2017-01-11 2017-05-31 郑州云海信息技术有限公司 It is a kind of that method of testing is restarted based on platform of soaring automatically
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
CN110096393A (en) * 2018-01-31 2019-08-06 北京可信华泰信息技术有限公司 A kind of credible measure of server
CN110750396A (en) * 2019-08-30 2020-02-04 苏州浪潮智能科技有限公司 Server operating system compatibility testing method and device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899119A (en) * 2015-05-21 2015-09-09 浪潮电子信息产业股份有限公司 Method for automatically detecting hard disk abnormality
CN105760262A (en) * 2015-11-30 2016-07-13 浪潮电子信息产业股份有限公司 Method for carrying out cross validation on stability of hard disk based on dc and reboot under linux
CN106776189A (en) * 2017-01-11 2017-05-31 郑州云海信息技术有限公司 It is a kind of that method of testing is restarted based on platform of soaring automatically
CN110096393A (en) * 2018-01-31 2019-08-06 北京可信华泰信息技术有限公司 A kind of credible measure of server
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
CN110750396A (en) * 2019-08-30 2020-02-04 苏州浪潮智能科技有限公司 Server operating system compatibility testing method and device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948190A (en) * 2021-02-26 2021-06-11 浪潮电子信息产业股份有限公司 Hardware testing method, system and related device of server

Similar Documents

Publication Publication Date Title
CN110750396B (en) Server operating system compatibility testing method and device and storage medium
US7519866B2 (en) Computer boot operation utilizing targeted boot diagnostics
US7734945B1 (en) Automated recovery of unbootable systems
KR101143679B1 (en) Automated firmware recovery
CN104536875A (en) Automatic server restart testing method based on IPMI
CN108431781A (en) The self diagnosis of the mistake of device driver detection and automatic diagnostic data are collected
CN111209151A (en) Linux-based NVME SSD hot plug test method, system, terminal and storage medium
CN110941520B (en) Hardware function test system and method based on two-out-of-two safety control unit
CN112035301A (en) Shell-based automatic server testing method and system
US11263083B1 (en) Method and apparatus for selective boot-up in computing devices
CN114265733A (en) Automatic testing method and device for abnormal power failure of solid state disk
CN104657232A (en) BIOS automatic recovery system and BIOS automatic recovery method
CN106909382B (en) Method and device for outputting different types of system starting information
CN105630523A (en) Computer BIOS data recovery system and method
CN114116330B (en) Server performance testing method, system, terminal and storage medium
CN116662050A (en) Error injection support function verification method, device, terminal and medium
CN114385405A (en) Method, device and system for realizing server restart reason recording
CN115168146A (en) Anomaly detection method and device
CN114510375A (en) Flash chip data area dynamic sharing system and method
US20160004607A1 (en) Information processing apparatus and information processing method
CN113722170B (en) PFR function test method, device, equipment and readable storage medium
CN113094221B (en) Fault injection method, device, computer equipment and readable storage medium
CN113835631B (en) Residual platform configuration data deleting method, system, terminal and storage medium
CN114385379B (en) Method, system, terminal and storage medium for detecting on-board information refreshing
CN113835937A (en) Uninterruptible power restart testing method based on Linux general server

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