CN114817042A - Server testing method and device, testing platform and readable storage medium - Google Patents

Server testing method and device, testing platform and readable storage medium Download PDF

Info

Publication number
CN114817042A
CN114817042A CN202210468227.3A CN202210468227A CN114817042A CN 114817042 A CN114817042 A CN 114817042A CN 202210468227 A CN202210468227 A CN 202210468227A CN 114817042 A CN114817042 A CN 114817042A
Authority
CN
China
Prior art keywords
target
server
test
operating system
tested
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
CN202210468227.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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202210468227.3A priority Critical patent/CN114817042A/en
Publication of CN114817042A publication Critical patent/CN114817042A/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/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The application discloses a server testing method, a device, a testing platform and a readable storage medium, wherein the method is applied to the testing platform of an out-of-band network accessing a tested server, and comprises the following steps: receiving a test selection command, and combining a tested server, an operating system and configuration items corresponding to the test selection command to obtain a test case; acquiring a target image corresponding to a test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system; and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result. According to the technical scheme, the automatic test is realized by using the test platform, so that testers are liberated, the labor consumption is reduced, the test is not limited by time and is performed in parallel, the test efficiency is improved, all test cases generated can be covered, and the test comprehensiveness is realized.

Description

Server testing method and device, testing platform and readable storage medium
Technical Field
The present application relates to the technical field of server management, and more particularly, to a server testing method, device, testing platform, and readable storage medium.
Background
For server vendors and server management software, each model goes through out-of-band installation adaptation and testing of the common operating system. For server management software, each model needs to adapt to the out-of-band installation function of multiple operating systems, if one model simultaneously considers the configuration of the operating systems and the operating systems during installation, if the number of the adapted models is n, the number of the common operating systems is m, and the configuration is k, once the code of the management software is changed, n m k installation situations theoretically need to be tested, and the test workload is huge. For a server manufacturer, at least m × k tests are required to test an operating system that can be adapted to a new model.
At present, a tester manually performs a server out-of-band system installation test, specifically, the tester uploads a system image, installs an operating system on a server based on the system image, and checks the configuration of the installed operating system to determine whether the operating system is normally installed. However, as can be seen from the above description, the existing tests have the following problems: once the management software code is changed, the number of the tests required is more than n x m x k, and once a new model is pushed out or re-adapted, the number of the tests required is more than m x k, the number of the tests is large, and the manual tests are difficult to cover; when testing a plurality of operating systems, testers are required to upload different types of mirror images repeatedly each time, and the mirror images are large and waste time; because the installation of the operating system is slow, the time of a tester is greatly consumed in the installation process; only the working time when a tester is on the spot can the test be carried out, so that the available test time is less, the utilization rate of equipment is reduced, and the test efficiency is low; the manual inspection of the installation configuration is time consuming and labor intensive.
In summary, how to reduce the labor consumption in the testing process and achieve efficient and comprehensive testing is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present application is to provide a server testing method, device, testing platform and readable storage medium, which are used to reduce the manpower consumption in the testing process and achieve efficient and comprehensive testing.
In order to achieve the above purpose, the present application provides the following technical solutions:
a server testing method is applied to a testing platform of an out-of-band network accessing a tested server, and comprises the following steps:
receiving a test selection command, and combining a tested server, an operating system and configuration items corresponding to the test selection command to obtain a test case;
acquiring a target image corresponding to the test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system;
and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result.
Preferably, before obtaining the target image corresponding to the test case from the operating system image, the method further includes:
receiving a test case and an operation mode selection command, acquiring a corresponding target test case from the test case, and selecting a corresponding target operation mode;
acquiring a target image corresponding to the test case from the operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system, wherein the method comprises the following steps:
and acquiring a target image corresponding to the target test case from the operating system image, installing an operating system in a corresponding target tested server according to the target image and the target test case and configuring the operating system according to the target operation mode.
Preferably, if the target operation mode is an automatic mode, according to the target operation mode, installing an operating system in a corresponding target tested server according to the target image and the target test case and configuring the operating system, including:
generating an automatic response file according to the target test case;
decompressing the target mirror image and driving the decompressed target mirror image into the automatic response file to generate a new mirror image;
and mounting the new mirror image into the target server to be tested, installing an operating system in the target server to be tested according to the new mirror image, and configuring the operating system.
Preferably, if the target operation mode is a third-party mode, installing an operating system in a corresponding target tested server according to the target image and the target test case according to the target operation mode, and configuring the operating system, including:
calling an interface of a third-party system through a pre-programmed API (application program interface), importing the target image into the third-party system through the interface of the third-party system, installing an operating system in a corresponding target tested server by using the third-party system according to the target image and the test case, and configuring the operating system.
Preferably, the detecting the operating system installation and the configuration item generation of the target server under test includes:
if the out-of-band network is communicated with the service network, detecting the installation and configuration item generation of the operating system of the target server to be tested by utilizing an SSH mode;
and if the out-of-band network is physically isolated from the service network, detecting the installation of the operating system of the target server to be detected and the generation of the configuration item by using the Live CD mode.
Preferably, the detecting the operating system installation and configuration item generation of the target server under test by using the SSH mode includes:
trying to connect the target tested server with the installed operating system by using the root password configured in the test case;
if the target server to be tested is successfully connected, distributing a first detection script generated according to the test case to the target server to be tested so as to judge the target server to be tested by using the first detection script; the first detection script comprises a detected configuration item and a condition for judging whether the configuration item is successfully generated or not;
and receiving a judgment result returned by the first detection script, judging whether the test case is successfully executed according to the judgment result, and generating a corresponding test result.
Preferably, the detecting the operating system installation and configuration item generation of the target tested server by using the Live CD mode includes:
turning off a positioning lamp of the target server to be tested, and mounting the Live CD on the target server to be tested; the Live CD comprises an IPMI tool and a second detection script;
identifying and mounting the hard disk of the target server to be tested by using the second detection script, and detecting whether the configuration items generated in the target server to be tested are consistent with the configuration items contained in the test case;
if the configuration item generated in the target tested server is consistent with the configuration item contained in the test case, turning on a positioning lamp of the target tested server by using the IPMI tool;
after the Live CD is successfully mounted on the target server to be tested, detecting whether a positioning lamp of the target server to be tested is turned on within a preset time;
if the positioning lamp of the target tested server is not turned on within the preset time, generating a test result of the test case failure; and if the positioning lamp of the target tested server is turned on within the preset time, generating a successful test result of the test case.
A server testing device is applied to a testing platform of an out-of-band network accessing to a tested server, and comprises the following components:
the receiving module is used for receiving the test selection command and combining the tested server, the operating system and the configuration items corresponding to the test selection command to obtain a test case;
the acquisition module is used for acquiring a target image corresponding to the test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case and configuring the operating system;
and the detection module is used for detecting the installation of the operating system of the target tested server and the generation of the configuration items and generating a corresponding test result.
A test platform, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the server testing method according to any one of the above when executing the computer program.
A readable storage medium, having stored therein a computer program which, when executed by a processor, carries out the steps of the server testing method according to any one of the preceding claims.
The application provides a server testing method, a device, a testing platform and a readable storage medium, wherein the method is applied to the testing platform of an out-of-band network accessing a tested server, and comprises the following steps: receiving a test selection command, and combining a tested server, an operating system and configuration items corresponding to the test selection command to obtain a test case; acquiring a target image corresponding to a test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system; and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result.
According to the technical scheme, after the test selection command is received by the test platform of the out-of-band network accessing the tested server, the corresponding tested server, the operating system and the configuration item are combined according to the test selection command to generate the test case, then, the target image corresponding to the test case is automatically obtained from the prestored operating system image, and the operating system is installed and the configuration item is configured in the corresponding target tested server according to the target image and the test case, wherein the prestored operating system image can be repeatedly utilized in the server test, so that the operating system image is prevented from being repeatedly uploaded, the time is saved, and the test efficiency is improved. And then, detecting the installation of the operating system of the target tested server and the generation of the configuration item so as to generate a corresponding test result. According to the process, the automatic test of the server is realized by the test platform, testers can be liberated from the server test, manpower consumption is reduced, the server test can be free from time limitation, namely, the server test can be carried out at night and in idle time such as weekends, the utilization rate and the test efficiency of the server are improved, all generated test cases can be covered by the test, the test comprehensiveness is realized, in addition, parallel automatic test can be carried out among different servers, and the test efficiency of the server is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a server testing method according to an embodiment of the present application;
fig. 2 is a schematic deployment topology diagram of a test platform provided in an embodiment of the present application;
FIG. 3 is a flowchart of an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating detection of operating system installation and configuration item generation of a target server under test by using a Live CD mode according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a server testing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a test platform according to an embodiment of the present application.
Detailed Description
For server vendors and server management software, each server model undergoes out-of-band installation adaptation and testing of the common operating system. Taking the management software of a wave server as an example, in order to manage a large number of server models, each model needs to be adapted to the out-of-band installation function of multiple operating systems, and a common operating system of one model, which is a small version, often has tens or even tens of operating systems, if different configurations of the operating system during installation are considered, for example: setting static IP (Internet Protocol), setting partitions, setting host names, setting installation environments, setting languages, and the like, then more cases to be tested may be used. Assuming that the number of the adapter models is n, the number of the common operating systems is m, and the configuration is k, once the code of the management software is changed, n m k installation situations theoretically need to be tested, and generally, n is greater than or equal to 10, m is greater than or equal to 20, and k is greater than or equal to 3, that is, the test installation process is not less than 600 times, and the test workload is huge. Taking a scenario of newly introduced server of a model as an example, if an operating system that can be normally adapted to the new model is to be tested, at least m × k times, that is, not less than 60 times, should be tested, which is also a complicated task.
In the prior art, a tester manually performs out-of-band installation adaptation and test work on a server, specifically, the tester uploads a system image, and installs an operating system on the server based on the system image, and then the tester detects the installed operating system to determine whether the operating system is normally installed and whether the configuration is correct. However, the foregoing process has the following significant problems: 1) once the management software code is changed, the number of tests required is more than 600, and once a new machine type is launched or re-adapted, the number of tests required is more than 60, the number is large, and manual tests are difficult to cover;
2) an out-of-band test installation Operating System is limited by the bandwidth of a BMC (Baseboard Management Controller) (a BMC network, an out-of-band network, and a Management network refer to the same network), and is often installed for a long time, taking a faster NF5280M6 as an example, a centros (Community Enterprise Operating System) of the minimum installation version is installed, and is still more than 20 minutes, let alone a GUI (Graphical User Interface) version or a slower 5280M5, so that a lot of time of a tester is consumed in the installation process, and nothing is done, which causes a lot of waste of human resources; 3) the system installation process monopolizes the test server, other personnel cannot operate the test server, so that the resource of the test server which is in shortage is more scarce, and the test can be performed only in the working time when the test personnel are in the field, so that the available test time is short, the equipment utilization rate is reduced, and the test efficiency is low; 4) after the system installation test is completed, a tester needs to check the installed operating system configuration to compare the operating system configuration with the initially set configuration to determine whether the operating system is normally installed, the process is time-consuming and labor-consuming, the tester is also capable of working repeatedly, and overall testing efficiency of the server is low; 5) for a server operating system installation scene, no matter management software or BMC, when testing multiple operating systems, different types of images need to be uploaded repeatedly each time, and the images are often very large, so that repeated work and progress are caused, time is wasted, and the testing efficiency of the server is low.
Therefore, the application provides a server testing method, a server testing device, a server testing platform and a readable storage medium, which are used for reducing the labor consumption in the testing process and realizing efficient and comprehensive testing.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1 to fig. 3, in which fig. 1 shows a flowchart of a server testing method provided in the embodiment of the present application, fig. 2 shows a deployment topology schematic diagram of a testing platform provided in the embodiment of the present application, and fig. 3 shows an overall flowchart of the testing platform provided in the embodiment of the present application. The server testing method provided by the embodiment of the application is applied to a testing platform of an out-of-band network accessing a tested server, and can comprise the following steps:
s11: and receiving a test selection command, and combining the tested server, the operating system and the configuration items corresponding to the test selection command to obtain a test case.
Firstly, a network environment is deployed, and a test platform for server test is accessed to an out-of-band network of a server under test, and a deployment topology diagram of the network environment can be specifically shown in fig. 2, where a gigabit switch in fig. 2 is connected to the out-of-band network of servers 1 to server n. After the test platform is accessed to the test platform of the server to be tested, the test platform may scan the server to be tested, obtain basic information (specifically including out-of-band IP and the like) of the server to be tested, and collect and arrange the basic information of the server to be tested together, so as to facilitate subsequent use.
In addition, before the server test is performed, the user may upload the operating system image (specifically, the image file of the ISO file) adapted to the tested server to the test platform, that is, the test platform may receive the operating system image adapted to the tested server uploaded by the user in advance, and may permanently store the received operating system image, so as to ensure that the operating system image may be reused in the server test, avoid repeatedly uploading the operating system image, save time, and facilitate improving the server test efficiency.
When the operating system image is uploaded, a user can specifically upload the operating system image by using a fragment uploading technology, correspondingly, the test platform can receive the fragments of the operating system image and combine the fragments of the operating system image after receiving the fragments of the operating system image so as to obtain the complete operating system image, and the method can shorten the uploading time of the operating system image and improve the uploading efficiency of the operating system image. And after the test platform obtains the complete operating system image, the built-in integrity check algorithm can be used for carrying out validity check on the obtained complete operating system image, and the operating system image is stored only after passing the validity check, so that the validity and the reliability of the stored operating system image are improved.
When a server test is to be performed, a user may send a test selection command to the test platform, specifically, the user may input the test selection command in the test platform, where the test selection command may specifically include a server under test, an operating system, and a configuration item of each operating system that the user should perform the test, that is, the test selection command includes which servers under test are to be tested by the user, which operating systems are to be tested, and which configuration items each operating system should test include. Taking CentOS7.9 as an example, the configuration items that can be tested include: the 7 items of a new user name password, a root password (which refers to an administrator password), a host name setting, a basic environment, a language environment, a partition setting and whether a static IP is set are added.
After receiving the test selection command input by the user, the test platform may arrange and combine the tested server, the operating system, and the configuration items of the operating system corresponding to the test selection command to obtain a plurality of test cases.
After obtaining the test cases, the test platform may group the test cases according to the model of the server under test (specifically, may be determined by the basic information of the server under test) included in the test cases, so as to obtain a plurality of test case groups. One test case group corresponds to one model, a plurality of servers to be tested may be included in the same model, each server to be tested includes a plurality of comprehensive configuration items, and specifically, see table 1, which shows a composition table of two test case groups:
TABLE 1 composition of two test case groups
Figure BDA0003625402400000081
Figure BDA0003625402400000091
The test cases corresponding to different models can be executed concurrently by grouping the test cases according to the models of the servers to be tested, and the test cases corresponding to the servers to be tested in the same model can be executed concurrently, so that the test time of the servers is shortened, and the test efficiency of the servers is improved.
S12: and acquiring a target image corresponding to the test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system.
When the test case is obtained and tested, the test platform may obtain an operating system image corresponding to the test case from a pre-stored operating system image (the operating system image is used as a target image). Then, the test platform may install a corresponding operating system in a target tested server corresponding to the test case according to the target image and the test case, and configure the operating system (specifically, configure the operating system according to a configuration item included in the test case).
After the test cases are grouped by the test platform, the test cases can be executed concurrently among the tested servers of different machine types, and the test cases can be executed concurrently among the tested servers of the same machine type. And a plurality of test cases corresponding to the same tested server need to be executed in series (namely, after one test case is executed, the next test case is executed) so as to avoid the mutual influence among the test cases and avoid the influence on the server.
S13: and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result.
For a test case, after the test platform installs and configures the operating system in the corresponding target tested server according to the test case itself and the corresponding target image, the test platform can detect the operating system installation and configuration item generation of the target tested server to generate a corresponding detection result. The detection of the installation of the operating system is to detect whether the operating system is normally installed, and the detection of the generation of the configuration item is to detect whether the configuration item generated in the target tested server is consistent with the configuration item contained in the test case.
After the corresponding test results are generated, the test results corresponding to the test cases can be displayed, so that the tester can conveniently check the test results corresponding to the test cases. The displaying of the test result corresponding to the test case may include: and summarizing the test results of the test cases to generate a test report, and displaying the test report in a graphical mode. The test report is displayed in a graphical mode, and the method comprises the following steps: the test report is graphically displayed in the compiled front-end chart display page (specifically, the test report can be displayed by using a Web page), and the test result is failure and the corresponding test case is preposed when the test report is graphically displayed, so that testers are reminded to pay attention to the test case.
As can be seen from fig. 2, the test platform in the present application may specifically include a mirror library, a configuration center, an operation module, a detection module, and a result display module. The image library is a module for permanently storing the image of the adapted operating system, the image library can use a fragment uploading technology to upload the ISO file fragments and combine the ISO file fragments after the fragment uploading technology is finished, and a built-in integrity check algorithm can be used for checking whether the uploaded file is legal or not after the combination is finished, so that the ISO file in the image library can be repeatedly used, and the repeated uploading is avoided to save time; the configuration center is a place where the test platform is used to input test data, and in the configuration center, a user can select which servers are to be tested this time and which operating systems are to be tested, and which test configuration of each operating system contains. After the user finishes the selection, the configuration center automatically arranges and combines the tested server, the operating system and the configuration items selected by the user to obtain a test case, and classifies the test case according to the type of the server to form a test case group; the running module is a real execution module and is used for acquiring a target image corresponding to the test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case and configuring the operating system; the method comprises the steps that the installation of an operating system of a target server to be tested of a detection module and the generation of configuration items are detected, and corresponding test results are generated; the result display module collects data of the results of all the test cases, displays the final result in a graphical mode, obviously marks abnormal test cases and reminds testers of paying attention to the abnormal test cases. That is, in the present application, the test platform may utilize the above five parts to implement the automation of the server test. Therefore, the model, the operating system and the configuration item of the tested server are managed in a unified mode in the testing platform, the testing platform is used for forming a set of complete out-of-band automatic system for testing, manual work is replaced as far as possible, then testers are liberated from redundant complex and boring work, and people are automatically helped to carry out system installation testing and generate testing results, and therefore the testing platform has a wide application scene.
By using the server testing method provided by the application, a server manufacturer can be helped to test the servers in large scale and in batch to install the operating systems, the configuration result can be automatically detected according to the selected configuration, and comprehensive and rapid testing can be realized. Particularly, the method and the device can comprehensively replace manual testing, a large number of test cases can be executed concurrently, the complexity of manual operation is saved, testers are liberated from boring testing work, and time and labor are saved; by the method and the device, idle time periods such as weekends, nights and the like can be fully utilized, and the tasks can be completely automatically executed after being added, so that the original available test time of 8 hours can be expanded into the available test time of 24 hours, and test resources are fully utilized; by the method and the device, whether the installation configuration meets the requirement can be automatically detected after the operating system is installed, and manual one-by-one detection work is omitted; and the application can permanently store and repeatedly utilize the image of the operating system after the image is uploaded once, thereby avoiding the complex work of uploading each test, reducing the repeated labor and improving the test efficiency.
According to the technical scheme, after the test selection command is received by the test platform of the out-of-band network accessing the tested server, the corresponding tested server, the operating system and the configuration item are combined according to the test selection command to generate the test case, then, the target image corresponding to the test case is automatically obtained from the prestored operating system image, and the operating system is installed and the configuration item is configured in the corresponding target tested server according to the target image and the test case, wherein the prestored operating system image can be repeatedly utilized in the server test, so that the operating system image is prevented from being repeatedly uploaded, the time is saved, and the test efficiency is improved. And then, detecting the installation of the operating system of the target tested server and the generation of the configuration item so as to generate a corresponding test result. According to the process, the automatic test of the server is realized by the test platform, testers can be liberated from the server test, manpower consumption is reduced, the server test can be free from time limitation, namely, the server test can be carried out at night and in idle time such as weekends, the utilization rate and the test efficiency of the server are improved, all generated test cases can be covered by the test, the test comprehensiveness is realized, in addition, parallel automatic test can be carried out among different servers, and the test efficiency of the server is further improved.
Before obtaining a target image corresponding to a test case from an operating system image, a server testing method provided in an embodiment of the present application may further include:
receiving a test case and an operation mode selection command, acquiring a corresponding target test case from the test case, and selecting a corresponding target operation mode;
acquiring a target image corresponding to the test case from the operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system, which may include:
and acquiring a target image corresponding to the target test case from the operating system image, installing an operating system in a corresponding target tested server according to the target image and the target test case and configuring the operating system according to the target operation mode.
In this application, test platform can provide different operation modes, and the user can send the test case that wants to test and with what kind of operation mode to test platform according to the demand and run, and wherein, test platform specifically can provide two kinds of operation modes: one is an automatic mode which is suitable for testing the system adaptive capacity of a direct test new machine type, the other is a third-party mode which is suitable for testing a third-party system with system installation power, such as server management software, namely, the two running modes of the test platform can cover a common test scene so as to expand the application range of the test platform. The user can specifically combine the tested server, the operating system and the configuration items corresponding to the test selection command at the test platform to obtain the test case, and sends the test case and the operation mode selection command to the test platform before acquiring the target image corresponding to the test case from the prestored operating system image, so that the test platform can operate the test case selected by the user according to the operation mode selected by the user, thereby meeting the user requirements on the basis of realizing automatic test, realizing the test on different conditions and improving the diversity and flexibility of the test.
Specifically, after receiving a test case and a running mode selection command sent by a user, the test platform selects a target test case corresponding to the command from the obtained test cases, and selects a target running mode corresponding to the command. Correspondingly, the test platform acquires a target image corresponding to the test case from the operating system image, installs the operating system in the corresponding target tested server according to the target image and the test case and configures the operating system, namely the test platform acquires the target image corresponding to the target test case from the operating system image, and installs the corresponding operating system in the target tested server corresponding to the target test case according to the target image and the target test case and configures the configured item for the installed operating system according to the selected target operation mode.
In the server testing method provided in the embodiment of the present application, if the target operation mode is the automatic mode, according to the target operation mode, installing an operating system in a corresponding target server under test according to the target image and the target test case and configuring the operating system, the method may include:
generating an automatic response file according to the target test case;
decompressing the target mirror image and inputting the decompressed target mirror image into an automatic response file to generate a new mirror image;
and mounting the new mirror image into the target server to be tested, installing an operating system in the target server to be tested according to the new mirror image, and configuring the operating system.
In the present application, if the target operation mode is the automatic mode, it indicates that the user wishes to test the function of the out-of-band installed operating system by using the test platform. Then, the test platform may specifically generate an automatic response File according to the target test case (specifically, according to the configuration item in the target test case), decompress the obtained target image corresponding to the target test case, and drive the decompressed target image into the generated automatic response File to generate a new image (specifically, an image that can be automatically booted), and start an NFS (Network File System) service. Then, the test platform can mount the generated new mirror images to a target tested server corresponding to the target test cases in sequence according to the sequence of the target test cases selected by the user, and then automatically execute installation of a corresponding operating system in the target tested server according to the new mirror images and configuration of the operating system. And the test platform can detect the installation progress of the operating system at regular time or in real time until the installation of the operating system is completed.
Through the process, the function of installing the operating system out of band by using the test platform can be realized, and the method is suitable for directly testing the system adaptive capacity of a new machine type.
In the server testing method provided in the embodiment of the present application, if the target operation mode is the third party mode, according to the target operation mode, installing an operating system in a corresponding target server under test according to the target image and the target test case and configuring the operating system, the method may include:
calling an interface of a third-party system through a pre-programmed API (application programming interface), importing the target image into the third-party system through the interface of the third-party system, installing an operating system in a corresponding target tested server by using the third-party system according to the target image and the test case, and configuring the operating system.
In the Application, if the target operation mode is the third-party mode, it indicates that the user wishes to test the installed function of the third-party software, which requires the user to write an API (Application Programming Interface) Interface for calling an Interface of the third-party system in advance at a position reserved in the test platform, including uploading a mirror image, creating a template, starting a task, detecting whether the task is finished, and the like.
Correspondingly, when the test platform installs and configures the operating system in the corresponding target tested server according to the target mirror image and the target test case according to the third-party mode, the test platform can specifically call the interface of the third-party system through the API interface which is written in advance by the user, and the test of the installed function of the third-party system is completed according to the sequential call of the process. Specifically, an interface of a third-party system is called through an API (application programming interface) pre-written by a user, a target mirror image corresponding to a target test case is imported into the third-party system through the interface of the third-party system, the third-party system is utilized to install and configure an operating system in a corresponding target tested server according to the target mirror image and the test case, and the third-party system is utilized to detect the installation progress of the operating system.
Through the process, the installed functions of the third-party software can be tested by means of the test platform, and the application range of the test platform is widened.
The server testing method provided by the embodiment of the application detects the installation of the operating system of the target tested server and the generation of the configuration item, and may include:
if the out-of-band network is communicated with the service network, detecting the installation and configuration item generation of the operating system of the target server to be tested by utilizing an SSH mode;
and if the out-of-band network is physically isolated from the service network, detecting the installation of the operating system of the target server to be detected and the generation of the configuration item by using the Live CD mode.
In the application, when the test platform detects the operating system installation and configuration item generation of the target tested server, an SSH (Struts + Spring + Hibernate) mode and a Live CD mode can be specifically adopted for detection, so that the detection quality and efficiency are ensured, and the detection accuracy is improved. The SSH mode is suitable for the condition that static IP is configured, the network is actually connected, and the service network and the out-of-band network are mutually communicated, the condition is harsh, namely the out-of-band network and the service network are communicated in the same way and the service network is configured, the SSH mode can be used for logging in and detecting the operation system installation and configuration item generation of the target tested server, the efficiency is high, and the available detection items are rich. The Live CD mode is suitable for the situation that SSH can not be connected, generally in a data center, an out-of-band network and a service network are both physically isolated, so that the use scene is common, in the situation, the built-in Live CD mode can be used for detecting the operation system installation and configuration item generation of a target tested server through a self-research script, and the application range of the Live CD mode is wider.
The server testing method provided by the embodiment of the application, which detects the operating system installation and configuration item generation of the target tested server by using the SSH mode, may include:
trying to connect a target tested server provided with the operating system by using a root password configured in the test case;
if the connection with the target server to be tested is successful, distributing a first detection script generated according to the test case to the target server to be tested so as to judge the target server to be tested by using the first detection script; the first detection script comprises a detected configuration item and a condition for judging whether the configuration item is successfully generated;
and receiving a judgment result returned by the first detection script, judging whether the test case is successfully executed according to the judgment result, and generating a corresponding test result.
In the application, a specific process of detecting, by using an SSH mode, the operating system installation and configuration item generation of a target tested server is that a test platform attempts to install the target tested server of an operating system by using a root password configured in a test case, and when the target tested server is successfully connected, a first detection script generated according to the test case is distributed to the target tested server, so as to determine the target tested server by using the first detection script, where the first detection script includes a detected configuration item and a condition for determining whether the configuration item is successfully generated, that is, the first detection script determines whether the configuration item to be detected is successfully generated for the target tested server. After the first detection script detects, the judgment result is transmitted back to the test platform. After receiving the determination result returned by the first detection script, the test platform determines whether the test case of the target server under test is successfully executed according to the determination result (specifically, if the determination result is that the configuration item to be detected is not successfully generated, it is determined that the test case is not successfully executed, and if the determination result is that the configuration item to be detected is successfully generated, it is determined that the test case is successfully executed).
Referring to fig. 4, a schematic diagram illustrating detection of operating system installation and configuration item generation of a target server under test by using a Live CD mode according to an embodiment of the present application is shown. The server testing method provided by the embodiment of the application utilizes the Live CD mode to detect the installation and configuration item generation of the operating system of the target tested server, and can include the following steps:
turning off a positioning lamp of the target server to be tested, and mounting the Live CD on the target server to be tested; the Live CD comprises an IPMI tool and a second detection script;
identifying and mounting the hard disk of the target server to be tested by using the second detection script, and detecting whether the configuration items generated in the target server to be tested are consistent with the configuration items contained in the test cases;
if the configuration item generated in the target server under test is consistent with the configuration item contained in the test case, turning on a positioning lamp of the target server under test by using an IPMI tool;
after the Live CD is successfully mounted on a target server to be tested, detecting whether a positioning lamp of the target server to be tested is turned on within a preset time;
if the positioning lamp of the target tested server is not turned on within the preset time, generating a test result of the test case failure; and if the positioning lamp of the target tested server is turned on within the preset time, generating a test result of the test case.
In the application, the specific process of detecting the operating system installation and configuration item generation of the target tested server by using the Live CD mode is as follows: the test platform first turns off the positioning lamp of the target server under test to be tested. Then, the test Platform starts a detection program, and mounts a Live CD onto a target tested server, wherein the Live CD comprises an IPMI (Intelligent Platform Management Interface) tool and a second detection script, and the target tested server executes the second detection script after mounting the Live CD, and the second detection script is slightly different from the first car script in the SSH mode. And automatically identifying and mounting the hard disk of the target server to be tested by using the second detection script, and then detecting configuration items such as partitions, user names, networks and the like (specifically, detecting whether the configuration items are consistent with the configuration items contained in the corresponding test cases). And when the detection is finished and the configuration item generated in the target tested server is consistent with the configuration item contained in the test case, turning on the positioning lamp by utilizing the IPMI tool, and if the configuration item generated in the target tested server is inconsistent with the configuration item contained in the test case, not doing any operation. Meanwhile, the test platform detects whether the positioning lamp of the target server to be tested is turned on or not after the Live CD is successfully mounted on the target server to be tested, if the positioning lamp of the target server to be tested is not turned on within preset time (specifically, the positioning lamp can be set according to experience), the test case is determined to fail, at the moment, a test result of the test case failure is generated, and the test case can be marked as a high risk to remind a tester to retry; and if the positioning lamp of the target tested server is turned on within the preset time, determining that the test case is successful, and generating a test result that the test case is successful at the moment.
An embodiment of the present application further provides a server testing apparatus, which is applied to a test platform of an out-of-band network accessing a server to be tested, and referring to fig. 5, a schematic structural diagram of the server testing apparatus provided in the embodiment of the present application is shown, where the server testing apparatus may include:
the receiving module 51 is configured to receive the test selection command, and combine the tested server, the operating system, and the configuration item corresponding to the test selection command to obtain a test case;
the obtaining module 52 is configured to obtain a target image corresponding to the test case from a prestored operating system image, install an operating system in a corresponding target tested server according to the target image and the test case, and configure the operating system;
the detecting module 53 is configured to detect the operating system installation and configuration item generation of the target tested server, and generate a corresponding test result.
The server testing device provided by the embodiment of the application can further comprise:
the selection module is used for receiving the test cases and the operation mode selection command before acquiring the target images corresponding to the test cases from the operating system images, acquiring the corresponding target test cases from the test cases and selecting the corresponding target operation modes;
the obtaining module 52 may include:
and the acquisition unit is used for acquiring a target image corresponding to the target test case from the operating system image, installing the operating system in the corresponding target tested server according to the target image and the target test case and configuring the operating system according to the target running mode.
In an embodiment of the application, if the target operation mode is the automatic mode, the obtaining unit may include:
the first generation subunit is used for generating an automatic response file according to the target test case;
the driving-in subunit is used for decompressing the target mirror image and driving the decompressed target mirror image into an automatic response file to generate a new mirror image;
and the mounting subunit is used for mounting the new mirror image into the target server to be tested, installing an operating system in the target server to be tested according to the new mirror image and configuring the operating system.
In the server testing apparatus provided in the embodiment of the present application, if the target operation mode is the third party mode, the obtaining unit may include:
and the calling subunit is used for calling an interface of a third-party system through a pre-programmed API (application program interface), importing the target image into the third-party system through the interface of the third-party system, and installing and configuring an operating system in the corresponding target tested server by using the third-party system according to the target image and the test case.
In an embodiment of the present application, the detecting module 53 may include:
the first detection unit is used for detecting the operating system installation and configuration item generation of the target server under test by using an SSH mode if the out-of-band network is communicated with the service network;
and the second detection unit is used for detecting the operating system installation and configuration item generation of the target server to be detected by using the Live CD mode if the out-of-band network is physically isolated from the service network.
In an embodiment of the application, a server testing apparatus, a first detecting unit may include:
the connection subunit is used for trying to connect the target tested server provided with the operating system by using the root password configured in the test case;
the distribution subunit is used for distributing a first detection script generated according to the test case to the target server to be tested if the target server to be tested is successfully connected, so as to judge the target server to be tested by using the first detection script; the first detection script comprises a detected configuration item and a condition for judging whether the configuration item is successfully generated;
and the receiving subunit is used for receiving the judgment result returned by the first detection script, judging whether the test case is successfully executed according to the judgment result, and generating a corresponding test result.
In an embodiment of the application, the second detecting unit may include:
the closing subunit is used for closing the positioning lamp of the target server to be tested and mounting the Live CD on the target server to be tested; the Live CD comprises an IPMI tool and a second detection script;
the identification subunit is used for identifying the hard disk of the target server under test by using the second detection script and mounting the hard disk, and detecting whether the configuration items generated in the target server under test are consistent with the configuration items contained in the test cases;
the opening subunit is used for opening a positioning lamp of the target server under test by using an IPMI tool if the configuration item generated in the target server under test is consistent with the configuration item contained in the test case;
the detection subunit is used for detecting whether a positioning lamp of the target server to be detected is turned on within a preset time after the Live CD is successfully mounted on the target server to be detected;
the second generating subunit is used for generating a test result of the test case failure if the positioning lamp of the target tested server is not turned on within the preset time; and if the positioning lamp of the target tested server is turned on within the preset time, generating a test result of the test case.
An embodiment of the present application further provides a test platform, see fig. 6, which shows a schematic structural diagram of the test platform provided in the embodiment of the present application, and the test platform may include:
a memory 61 for storing a computer program;
the processor 62, when executing the computer program stored in the memory 61, may implement the following steps:
receiving a test selection command, and combining a tested server, an operating system and configuration items corresponding to the test selection command to obtain a test case; acquiring a target image corresponding to a test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system; and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result.
An embodiment of the present application further provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps may be implemented:
receiving a test selection command, and combining a tested server, an operating system and configuration items corresponding to the test selection command to obtain a test case; acquiring a target image corresponding to a test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system; and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result.
The readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the description of the relevant parts in the server testing device, the testing platform, and the readable storage medium provided by the present application, reference may be made to the detailed description of the corresponding parts in the server testing method provided by the embodiment of the present application, and details are not repeated here.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include elements inherent in the list. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A server testing method is characterized in that the method is applied to a testing platform of an out-of-band network accessing a tested server, and comprises the following steps:
receiving a test selection command, and combining a tested server, an operating system and configuration items corresponding to the test selection command to obtain a test case;
acquiring a target image corresponding to the test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system;
and detecting the installation of the operating system of the target tested server and the generation of the configuration item, and generating a corresponding test result.
2. The server test method according to claim 1, before obtaining the target image corresponding to the test case from the operating system image, further comprising:
receiving a test case and an operation mode selection command, acquiring a corresponding target test case from the test case, and selecting a corresponding target operation mode;
acquiring a target image corresponding to the test case from the operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case, and configuring the operating system, wherein the method comprises the following steps:
and acquiring a target image corresponding to the target test case from the operating system image, installing an operating system in a corresponding target tested server according to the target image and the target test case and configuring the operating system according to the target operation mode.
3. The server test method according to claim 2, wherein if the target operation mode is an automatic mode, installing and configuring an operating system in a corresponding target tested server according to the target image and the target test case according to the target operation mode, includes:
generating an automatic response file according to the target test case;
decompressing the target mirror image and driving the decompressed target mirror image into the automatic response file to generate a new mirror image;
and mounting the new mirror image into the target server to be tested, installing an operating system in the target server to be tested according to the new mirror image, and configuring the operating system.
4. The server test method according to claim 2, wherein if the target operation mode is a third party mode, installing and configuring an operating system in a corresponding target tested server according to the target image and the target test case according to the target operation mode, includes:
calling an interface of a third-party system through a pre-programmed API (application programming interface), importing the target image into the third-party system through the interface of the third-party system, and installing and configuring an operating system in a corresponding target tested server by using the third-party system according to the target image and the test case.
5. The server test method according to claim 1, wherein detecting the os installation and configuration item generation of the target server under test comprises:
if the out-of-band network is communicated with the service network, detecting the installation and configuration item generation of the operating system of the target server to be tested by utilizing an SSH mode;
and if the out-of-band network is physically isolated from the service network, detecting the installation of the operating system and the generation of the configuration items of the target tested server by using a Live CD mode.
6. The method for testing the server according to claim 5, wherein detecting the os installation and configuration item generation of the target server under test using the SSH mode comprises:
trying to connect the target tested server provided with the operating system by using the root password configured in the test case;
if the target server to be tested is successfully connected, distributing a first detection script generated according to the test case to the target server to be tested so as to judge the target server to be tested by using the first detection script; the first detection script comprises a detected configuration item and a condition for judging whether the configuration item is successfully generated or not;
and receiving a judgment result returned by the first detection script, judging whether the test case is successfully executed according to the judgment result, and generating a corresponding test result.
7. The server test method of claim 5, wherein detecting the operating system installation and configuration item generation of the target server under test using Live CD mode comprises:
turning off a positioning lamp of the target server to be tested, and mounting the Live CD on the target server to be tested; the Live CD comprises an IPMI tool and a second detection script;
identifying and mounting the hard disk of the target server to be tested by using the second detection script, and detecting whether the configuration items generated in the target server to be tested are consistent with the configuration items contained in the test case;
if the configuration item generated in the target tested server is consistent with the configuration item contained in the test case, turning on a positioning lamp of the target tested server by using the IPMI tool;
after the Live CD is successfully mounted on the target server to be tested, detecting whether a positioning lamp of the target server to be tested is turned on within a preset time;
if the positioning lamp of the target tested server is not turned on within the preset time, generating a test result of the test case failure; and if the positioning lamp of the target tested server is turned on within the preset time, generating a successful test result of the test case.
8. A server testing device is characterized in that the device is applied to a testing platform of an out-of-band network accessing to a tested server, and comprises:
the receiving module is used for receiving the test selection command and combining the tested server, the operating system and the configuration items corresponding to the test selection command to obtain a test case;
the acquisition module is used for acquiring a target image corresponding to the test case from a prestored operating system image, installing an operating system in a corresponding target tested server according to the target image and the test case and configuring the operating system;
and the detection module is used for detecting the installation of the operating system of the target tested server and the generation of the configuration items and generating a corresponding test result.
9. A test platform, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the server testing method according to any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the server testing method according to any one of claims 1 to 7.
CN202210468227.3A 2022-04-29 2022-04-29 Server testing method and device, testing platform and readable storage medium Pending CN114817042A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210468227.3A CN114817042A (en) 2022-04-29 2022-04-29 Server testing method and device, testing platform and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210468227.3A CN114817042A (en) 2022-04-29 2022-04-29 Server testing method and device, testing platform and readable storage medium

Publications (1)

Publication Number Publication Date
CN114817042A true CN114817042A (en) 2022-07-29

Family

ID=82510398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210468227.3A Pending CN114817042A (en) 2022-04-29 2022-04-29 Server testing method and device, testing platform and readable storage medium

Country Status (1)

Country Link
CN (1) CN114817042A (en)

Similar Documents

Publication Publication Date Title
CN102880532B (en) Cloud technology-based test system and method
US20150100829A1 (en) Method and system for selecting and executing test scripts
CN104461611A (en) Method for refreshing node BIOSes of RACK cabinet in batches
CN113312064B (en) Method and device for installing and configuring physical machine and computer readable medium
US20150100831A1 (en) Method and system for selecting and executing test scripts
CN108694118A (en) A kind of application testing method and device
CN106897223A (en) A kind of software kit delivery method and device based on continuous integrating
CN112256505A (en) Server stability testing method and device and related components
CN110795356B (en) System and method for realizing one-key deployment and automatic test of software based on secure
CN109660386B (en) Software upgrading method for semiconductor memory aging test system
CN109120433B (en) Method and apparatus for containerized deployment of hosts
CN107135120B (en) Automatic test method and device for HPC cluster
CN114817042A (en) Server testing method and device, testing platform and readable storage medium
CN108365987B (en) Management system and management method of multiple servers
CN116244186A (en) Operating system test management method and device and computing equipment
CN112596750B (en) Application testing method and device, electronic equipment and computer readable storage medium
CN109286692A (en) A kind of method of configuration server IPMI static ip address
CN113656088A (en) Self-service management method and device for Internet data center server and storage medium
CN113657702A (en) Automatic operation and maintenance method and device for internet data center and readable storage medium
CN112328439A (en) Stability test method and system for hardware equipment
CN112698998A (en) Sustainable integrated ARM server delivery test method
CN112256289A (en) Automatic deployment method, device and equipment
CN114610329B (en) Solid state disk deployment method and device, readable storage medium and electronic equipment
CN102402437B (en) Data processing equipment and download control method thereof
CN117251328B (en) USB peripheral remote adaptation method and system

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