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

By automatically processing test selection commands on the server test platform and generating and executing test cases, the problems of high labor consumption and low efficiency in the existing technology are solved, efficient and comprehensive server testing is achieved, and multiple operating modes and detection methods are supported, which improves testing efficiency and equipment utilization.

CN114817042BActive Publication Date: 2025-08-19JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210468227.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2025-08-19
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

There are problems in existing server testing, such as high labor consumption, low testing efficiency and incomplete coverage. Especially when management software code changes or new models are launched, a large amount of manual testing is required, and the operating system installation process takes a long time, and there are many repetitive work for mirror uploads, resulting in low equipment utilization.

Method used

By accessing the test platform of the out-of-band network of the server under test, receiving test selection commands, combining the server under test, operating system and configuration items to generate test cases, obtaining the target image from the pre-stored operating system image, and automatically installing and configuring the operating system in the target under test server, generating test results using automated detection, supporting the operation mode of automatic mode and third-party mode, and using SSH or Live CD mode for detection.

Benefits of technology

It achieves reducing manpower consumption, improving testing efficiency and coverage, allowing testing during non-working periods, supporting parallel testing, reducing duplicate work of mirror uploads, and improving equipment utilization and testing comprehensiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817042B_ABST
    Figure CN114817042B_ABST
Patent Text Reader

Abstract

The present application discloses a server testing method, device, testing platform and readable storage medium. The method is applied to a testing platform connected to an out-of-band network of a server under test, and includes: receiving a test selection command, combining the server under test, operating system and configuration items corresponding to the test selection command to obtain a test case; obtaining a target image corresponding to the test case from a pre-stored operating system image, installing the operating system in the corresponding target server under test and configuring the operating system according to the target image and the test case; detecting the operating system installation and configuration item generation of the target server under test, and generating corresponding test results. The technical solution disclosed in the present application uses a testing platform to realize automated testing, freeing test personnel from the work, reducing manpower consumption, and making the test not time-restricted and conducting parallel testing to improve test efficiency. It can also cover all generated test cases and achieve comprehensive testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of server management technology, and more specifically, to a server testing method, device, testing platform, and readable storage medium. Background Art

[0002] For server manufacturers and server management software, every model must undergo out-of-band installation adaptation and testing for commonly used operating systems. Server management software must adapt each model to multiple operating system out-of-band installation capabilities. If a model considers both the operating system and the configuration required for the operating system installation, assuming n compatible models, m commonly used operating systems, and k configurations, then once the management software code changes, theoretically n*m*k installation scenarios need to be tested, creating a massive testing workload. For server manufacturers, testing a new model for compatible operating systems requires at least m*k tests.

[0003] Currently, out-of-band server system installation testing is performed manually by testers. Specifically, the testers upload a system image, install the operating system on the server based on the system image, and then check the installed operating system configuration to determine whether it is installed normally. However, based on the above description, the existing testing has the following problems: once the management software code changes, the number of tests required is more than n*m*k. Once a new model is launched or re-adapted, the number of tests required is more than m*k. This is a large number and difficult to cover with manual testing; when testing multiple operating systems, testers are required to repeatedly upload different types of images each time, and these images are often large, which is time-consuming; since the installation of the operating system is relatively slow, a large amount of testers' time is consumed by the installation process; testing can only be performed during working hours when the testers are present, resulting in less available testing time, reduced equipment utilization, and low testing efficiency; manual inspection of the installation configuration is time-consuming and labor-intensive.

[0004] In summary, how to reduce manpower consumption during the testing process and achieve efficient and comprehensive testing is a technical problem that currently needs to be solved urgently by those skilled in the art. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a server testing method, device, testing platform and readable storage medium to reduce manpower consumption during the testing process and achieve efficient and comprehensive testing.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] A server testing method, applied to a test platform connected to an out-of-band network of a server under test, comprising:

[0008] Receive a test selection command, and combine the tested server, operating system, and configuration items corresponding to the test selection command to obtain a test case;

[0009] Obtaining a target image corresponding to the test case from a pre-stored operating system image, installing the operating system in the corresponding target tested server according to the target image and the test case, and configuring the operating system;

[0010] The operating system installation and configuration item generation of the target tested server are detected to generate corresponding test results.

[0011] Preferably, before obtaining the target image corresponding to the test case from the operating system image, the method further includes:

[0012] Receive a test case and an operation mode selection command, obtain a corresponding target test case from the test case, and select a corresponding target operation mode;

[0013] Obtaining a target image corresponding to the test case from the operating system image, installing the operating system in the corresponding target tested server according to the target image and the test case, and configuring the operating system, including:

[0014] Obtain a target image corresponding to the target test case from the operating system image, install the operating system in the corresponding target tested server according to the target image and the target test case in accordance with the target operation mode, and configure the operating system.

[0015] Preferably, if the target operation mode is the automatic mode, then according to the target operation mode, the operating system is installed in the corresponding target server under test according to the target image and the target test case and the operating system is configured, including:

[0016] Generate an automatic response file according to the target test case;

[0017] Decompressing the target image and inserting the decompressed target image into the automatic response file to generate a new image;

[0018] The new image is mounted on the target server under test, and an operating system is installed on the target server under test according to the new image and the operating system is configured.

[0019] Preferably, if the target operating mode is a third-party mode, then according to the target operating mode, installing an operating system in the corresponding target server under test according to the target image and the target test case and configuring the operating system includes:

[0020] The interface of the third-party system is called through a pre-written API interface, the target image is imported into the third-party system through the interface of the third-party system, and the third-party system is used to install the operating system in the corresponding target server under test and configure the operating system according to the target image and the test case.

[0021] Preferably, detecting the operating system installation and configuration item generation of the target server under test includes:

[0022] If the out-of-band network and the business network are interconnected, the operating system installation and configuration item generation of the target server under test are detected using SSH mode;

[0023] If the out-of-band network is physically isolated from the business network, the Live CD mode is used to detect the operating system installation and configuration item generation of the target server under test.

[0024] Preferably, the SSH mode is used to detect the operating system installation and configuration item generation of the target server under test, including:

[0025] Use the root password configured in the test case to try to connect to the target server under test with the operating system installed;

[0026] If the target server under test is successfully connected, a first detection script generated according to the test case is distributed to the target server under test, so as to use the first detection script to judge the target server under test; wherein the first detection script includes a configuration item to be tested and a condition for judging whether the configuration item is successfully generated;

[0027] Receive the judgment result returned by the first detection script, determine whether the test case is successfully executed based on the judgment result, and generate a corresponding test result.

[0028] Preferably, the Live CD mode is used to detect the operating system installation and configuration item generation of the target server under test, including:

[0029] Turn off the positioning light of the target server under test and mount a Live CD onto the target server under test; wherein the Live CD contains the IPMI tool and the second detection script;

[0030] Using the second detection script to identify the hard disk of the target server under test and mount it, and detecting whether the configuration items generated in the target server under test are consistent with the configuration items included in the test case;

[0031] If the configuration items generated in the target server under test are consistent with the configuration items included in the test case, turning on the location light of the target server under test by using the IPMI tool;

[0032] After the Live CD is successfully mounted on the target server under test, detecting whether the locating light of the target server under test is turned on within a preset time;

[0033] If the locating light of the target server under test is not turned on within the preset time, a test result indicating that the test case fails is generated; if the locating light of the target server under test is turned on within the preset time, a test result indicating that the test case succeeds is generated.

[0034] A server testing device is applied to a testing platform connected to an out-of-band network of a server under test, comprising:

[0035] A receiving module, configured to receive a test selection command, and combine the tested server, operating system, and configuration items corresponding to the test selection command to obtain a test case;

[0036] An acquisition module is used to obtain a target image corresponding to the test case from a pre-stored operating system image, install the operating system in the corresponding target tested server according to the target image and the test case, and configure the operating system;

[0037] The detection module is used to detect the operating system installation and configuration item generation of the target tested server and generate corresponding test results.

[0038] A test platform, comprising:

[0039] memory for storing computer programs;

[0040] A processor is configured to implement the steps of any one of the above-mentioned server testing methods when executing the computer program.

[0041] A readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any one of the above-mentioned server testing methods.

[0042] The present application provides a server testing method, device, testing platform and readable storage medium, wherein the method is applied to a testing platform connected to an out-of-band network of a server under test, comprising: receiving a test selection command, combining the server under test, operating system and configuration items corresponding to the test selection command to obtain a test case; obtaining a target image corresponding to the test case from a pre-stored operating system image, installing the operating system in the corresponding target server under test and configuring the operating system according to the target image and the test case; detecting the operating system installation and configuration item generation of the target server under test, and generating corresponding test results.

[0043] The above technical solution disclosed in the present application is that after receiving the test selection command, the test platform connected to the out-of-band network of the tested server combines the corresponding tested server, operating system and configuration items according to the test selection command to generate a test case, then automatically obtains the target image corresponding to the test case from the pre-stored operating system image, and installs the operating system and configures the configuration items in the corresponding target tested server according to the target image and the test case, wherein the pre-stored operating system image can be reused in the server test to avoid repeatedly uploading the operating system image, saving time and improving test efficiency. Afterwards, the operating system installation and configuration item generation of the target tested server are detected to generate corresponding test results. Through the above process, it can be seen that the present application uses the test platform to realize automated testing of the server, so that testers can be liberated from server testing to reduce manpower consumption, and server testing can be free from time constraints, that is, server testing can be carried out in idle time such as at night and on weekends to improve server utilization and test efficiency, and the test can cover all generated test cases to achieve comprehensiveness of the test. In addition, parallel automated testing can be carried out between different servers to further improve server testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0045] Figure 1 A flow chart of a server testing method provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the deployment topology of the test platform provided in the embodiment of the present application;

[0047] Figure 3 The overall flow chart of the test platform provided in the embodiment of the present application;

[0048] Figure 4 A schematic diagram of detecting the operating system installation and configuration item generation of a target server under test using the Live CD mode provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of the structure of a server testing device provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of the structure of a test platform provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] For server manufacturers and server management software, every server model must undergo out-of-band installation, adaptation, and testing for commonly used operating systems. Taking Inspur's server management software as an example, to manage a large number of server models, each model must be compatible with multiple operating system out-of-band installation capabilities. Common operating systems for a given model, including minor versions, often number a dozen or even dozens. If we also consider the different configurations required during operating system installation, such as setting a static IP (Internet Protocol), partitioning, hostname, installation environment, and language, the number of test cases increases. Assuming there are n compatible models, m commonly used operating systems, and k configurations, then once the management software code changes, theoretically, n*m*k installation scenarios need to be tested. Generally, n ≥ 10, m ≥ 20, and k ≥ 3, meaning the installation process must be tested no less than 600 times, a significant amount of testing work. In another scenario, taking a newly launched server model as an example, if you want to test whether this new model can be normally adapted to the operating system, you should test it at least m*k times, that is, no less than 60 times, which is also a complicated task.

[0052] Existing out-of-band server installation, adaptation, and testing are performed manually by testers. Specifically, the tester uploads a system image and installs the operating system on the server based on the system image. The tester then verifies the installed operating system to determine whether it is installed properly and configured correctly. However, this process has the following significant issues: 1) Whenever the management software code changes, over 600 tests are required. Whenever a new model is released or re-adapted, over 60 tests are required. This large number of tests is difficult to cover manually;

[0053] 2) Out-of-band testing and installing the operating system are often very time-consuming due to the bandwidth limitations of the BMC (Baseboard Management Controller) (the BMC network, out-of-band network, and management network all refer to the same network). For example, on the faster NF5280M6, installing the minimum installation version of CentOS (Community Enterprise Operating System) takes more than 20 minutes, not to mention the GUI (Graphical User Interface). 3) The system will monopolize the test server during installation and other personnel cannot operate it, making the already tight test server resources even more scarce. Testing can only be performed during working hours when the testers are present, resulting in less available testing time, reduced equipment utilization, and low testing efficiency. 4) After the system installation test is completed, the tester must check the installed operating system configuration to compare it with the originally set configuration to determine whether it is installed normally. This process is time-consuming and labor-intensive, and is repetitive work for the tester, and will lead to relatively low overall server testing efficiency. 5) For server operating system installation scenarios, whether it is management software or BMC, when testing multiple operating systems, different types of images need to be uploaded repeatedly each time. These images are often large, resulting in repeated work over and over again, wasting time, and leading to relatively low server testing efficiency.

[0054] To this end, the present application provides a server testing method, device, testing platform and readable storage medium for reducing manpower consumption during the testing process and achieving efficient and comprehensive testing.

[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] See also Figures 1 to 3 ,in, Figure 1 A flow chart of a server testing method provided in an embodiment of the present application is shown. Figure 2 The following is a schematic diagram showing the deployment topology of the test platform provided in the embodiment of the present application. Figure 3The overall flow chart of the test platform provided by the embodiment of the present application is shown. A server testing method provided by the embodiment of the present application is applied to a test platform connected to an out-of-band network of a server under test, and may include:

[0057] S11: Receive a test selection command, and combine the tested server, operating system, and configuration items corresponding to the test selection command to obtain a test case.

[0058] First, deploy the network environment and connect the test platform used for server testing to the out-of-band network of the server under test. The deployment topology diagram can be found in Figure 2 As shown, Figure 2 The gigabit switch in Figure 1 is connected to the out-of-band network of Servers 1 through N. After accessing the test platform of the server under test, the test platform can scan the server under test to obtain basic information about the server under test (including the out-of-band IP address). This information is then collected and organized for subsequent use.

[0059] In addition, before conducting server testing, users can upload an operating system image that is compatible with the server being tested (specifically, upload an ISO file (an image file of a CD)) to the testing platform. That is, the testing platform can pre-receive the operating system image that is compatible with the server being tested uploaded by the user, and can permanently store the received operating system image to ensure that the operating system image can be reused in server testing, avoiding repeated uploading of the operating system image, saving time, and improving server testing efficiency.

[0060] When uploading an operating system image, users can utilize fragmented upload technology. The test platform can then receive the fragments of the operating system image and merge them together to obtain a complete operating system image. This approach can shorten the upload time and improve upload efficiency. After obtaining the complete operating system image, the test platform can also use a built-in integrity verification algorithm to verify the legitimacy of the completed operating system image. Only after passing the verification will the image be stored, thereby improving the legitimacy and reliability of the stored operating system image.

[0061] When conducting a server test, the user can send a test selection command to the test platform. Specifically, the user can enter the test selection command in the test platform, wherein the test selection command can specifically include the tested server, operating system, and configuration items of each operating system that the user wants to test this time. That is, the test selection command includes which tested servers the user wants to test this time, which operating systems to test, and which configuration items to test for each operating system. Taking CentOS 7.9 as an example, the testable configuration items include: newly added username and password, root password (referring to the administrator password), hostname settings, basic environment, language environment, partition settings, and whether to set a static IP.

[0062] After receiving the test selection command input by the user, the test platform can arrange and combine the tested server, operating system, and configuration items of the operating system corresponding to the test selection command to obtain multiple test cases.

[0063] After obtaining the test cases, the test platform can group the test cases according to the models of the tested servers contained in the test cases (specifically, this can be determined by the basic information of the tested servers) to obtain multiple test case groups. Among them, one test case group corresponds to one model. The same model may contain multiple tested servers, and each tested server contains multiple comprehensive configuration items. For details, please refer to Table 1, which shows the composition table of two test case groups:

[0064] Table 1 Composition of two test case groups

[0065]

[0066]

[0067] By grouping test cases according to the model of the server under test, test cases corresponding to different models can be executed concurrently, and test cases corresponding to each server under test in the same model can be executed concurrently, so as to shorten server testing time and improve server testing efficiency.

[0068] S12: Obtain a target image corresponding to the test case from pre-stored operating system images, install the operating system in the corresponding target tested server according to the target image and the test case, and configure the operating system.

[0069] After obtaining a test case and testing it, the test platform can retrieve the operating system image corresponding to the test case from pre-stored operating system images (using this operating system image as the target image). The test platform can then install the corresponding operating system on the target tested server corresponding to the test case based on the target image and the test case and configure the operating system (specifically, configuring the operating system based on the configuration items included in the test case).

[0070] After the test platform groups test cases, test cases can be executed concurrently between servers of different models, and between multiple servers of the same model. However, multiple test cases for the same server must be executed serially (that is, one test case must be executed before the next) to avoid mutual interference between test cases and any impact on the server.

[0071] S13: Detect the operating system installation and configuration item generation of the target server under test, and generate corresponding test results.

[0072] For a test case, after installing and configuring the operating system on the target server under test based on the test case and its corresponding target image, the test platform can then test the operating system installation and configuration item generation on the target server under test to generate corresponding test results. Testing the operating system installation verifies whether the operating system is installed properly, and testing the configuration item generation verifies whether the configuration items generated on the target server under test are consistent with the configuration items included in the test case.

[0073] After generating the corresponding test results, the test results corresponding to the test cases can also be displayed to facilitate testers to view the test results corresponding to each test case. Among them, displaying the test results corresponding to the test cases can include: aggregating the test results of each test case, generating a test report, and displaying the test report in a graphical manner. Displaying the test report in a graphical manner can include: graphically displaying the test report in a prepared front-end chart display page (specifically, it can be displayed using a web page), and when performing the graphical display, the test result of failure and the corresponding test case can be placed in front to remind the tester to focus on it.

[0074] Among them, combined Figure 2It can be seen that the test platform in this application can specifically include an image library, a configuration center, an operation module, a detection module, and a result display module. Among them, the image library is a module for permanently storing adapted operating system images. It can use the fragmented upload technology to upload ISO files in pieces and merge them after completion. After the merger is completed, it will use the built-in integrity verification algorithm to verify whether the uploaded files are legal, ensuring that the ISO files in the image library can be reused, avoiding repeated uploading to save time; the configuration center is where the test platform is used to input test data. In the configuration center, users can choose which servers to test this time, which operating systems to test, and what the test configuration of each operating system includes. When the user completes the selection, the configuration center will automatically arrange and combine the tested server, operating system and configuration items selected by the user to obtain test cases, and classify them according to the server model to form a test case group; the operation module is the actual execution module, which is used to obtain the target image corresponding to the test case from the pre-stored operating system image, install the operating system in the corresponding target tested server according to the target image and test case, and configure the operating system; the detection module detects the operating system installation and configuration item generation of the target tested server and generates corresponding test results; the result display module summarizes the results of each test case, displays the final result in a graphical way, and clearly marks the abnormal test cases to remind the testers to focus on them. That is, in this application, the test platform can use the above five parts to realize the automation of server testing. It can be seen from this that this application unifies the model, operating system and configuration items of the tested server into a test platform, uses the test platform to form a complete out-of-band automation system for testing, replaces human work as much as possible, and then liberates testers from redundant, complex and boring work, automatically helps people to perform system installation tests and generate test results. Therefore, this application has a relatively broad application scenario.

[0075] The server testing method provided by this application can help server manufacturers to test the server installation operating system on a large scale, and automatically detect the configuration results according to the selected configuration, and realize comprehensive and rapid testing. Specifically, this application can completely replace manual testing, and a large number of test cases can be executed concurrently, eliminating the tedious manual operation, freeing testers from boring testing work, saving time and effort; this application can make full use of idle time periods such as weekends and nights, and tasks can be automatically executed after adding them, so that the original 8 hours of available testing time can be expanded to 24 hours of available testing time, making full use of testing resources; this application can automatically check whether the installation configuration meets the requirements after the operating system is installed, eliminating the work of manual inspection one by one; and this application can permanently save and reuse the operating system image after uploading it once, avoiding the complicated work of uploading it for each test, reducing duplication of work, and improving testing efficiency.

[0076] The above technical solution disclosed in the present application is that after receiving the test selection command, the test platform connected to the out-of-band network of the tested server combines the corresponding tested server, operating system and configuration items according to the test selection command to generate a test case, then automatically obtains the target image corresponding to the test case from the pre-stored operating system image, and installs the operating system and configures the configuration items in the corresponding target tested server according to the target image and the test case, wherein the pre-stored operating system image can be reused in the server test to avoid repeatedly uploading the operating system image, saving time and improving test efficiency. Afterwards, the operating system installation and configuration item generation of the target tested server are detected to generate corresponding test results. Through the above process, it can be seen that the present application uses the test platform to realize automated testing of the server, so that testers can be liberated from server testing to reduce manpower consumption, and server testing can be free from time constraints, that is, server testing can be carried out in idle time such as at night and on weekends to improve server utilization and test efficiency, and the test can cover all generated test cases to achieve comprehensiveness of the test. In addition, parallel automated testing can be carried out between different servers to further improve server testing efficiency.

[0077] A server testing method provided in an embodiment of the present application may further include, before obtaining a target image corresponding to a test case from an operating system image:

[0078] Receive a test case and an operation mode selection command, obtain a corresponding target test case from the test case, and select a corresponding target operation mode;

[0079] Obtain the target image corresponding to the test case from the operating system image, install the operating system on the corresponding target server under test based on the target image and test case, and configure the operating system. This may include:

[0080] Obtain the target image corresponding to the target test case from the operating system image, install the operating system in the corresponding target tested server according to the target image and the target test case in accordance with the target operation mode and configure the operating system.

[0081] In the present application, the test platform can provide different operating modes. Users can send the test cases they want to test and the operating mode they want to use to the test platform according to their needs. The test platform can specifically provide two operating modes: one is an automatic mode, which is suitable for testing the system adaptability of new models directly, and the other is a third-party mode, which is suitable for testing third-party systems such as server management software that have their own system installation power. That is, these two operating modes of the test platform can cover commonly used test scenarios to expand the scope of application of the test platform. Among them, the user can specifically combine the tested server, operating system and configuration items corresponding to the test selection command on the test platform to obtain the test case, and before obtaining the target image corresponding to the test case from the pre-stored operating system image, send the test case and the operating mode selection command to the test platform, so that the test platform can run the test case selected by the user in accordance with the operating mode selected by the user, thereby meeting user needs on the basis of realizing automated testing, and realizing testing of different situations to improve the diversity and flexibility of testing.

[0082] Specifically, after receiving the test case and operation mode selection command sent by the user, the test platform selects the target test case corresponding to the aforementioned command from the obtained test cases, and selects the target operation mode corresponding to the aforementioned command. Accordingly, the test platform obtains the target image corresponding to the test case from the operating system image, installs the operating system in the corresponding target server under test according to the target image and the test case, and configures the operating system. Specifically, the test platform obtains the target image corresponding to the aforementioned target test case from the operating system image, and installs the corresponding operating system in the target server under test corresponding to the target test case according to the selected target operation mode according to the target image and the target test case, and configures the configuration items of the installed operating system.

[0083] An embodiment of the present application provides a server testing method. If the target operating mode is automatic mode, then according to the target operating mode, the operating system is installed and configured in the corresponding target server under test according to the target image and target test case. The method may include:

[0084] Generate automatic answer files based on target test cases;

[0085] Decompress the target image and insert the decompressed target image into the automatic response file to generate a new image;

[0086] Mount the new image to the target server under test, install the operating system in the target server under test based on the new image, and configure the operating system.

[0087] In the present application, if the target operation mode is automatic mode, it means that the user wishes to use the test platform to test the function of installing the operating system out of band. Next, the test platform can generate an automatic response file specifically according to the target test case (specifically, according to the configuration items in the target test case), and can decompress the target image corresponding to the target test case obtained, and insert the decompressed target image into the aforementioned generated automatic response file to generate a new image (specifically, a mirror that can be automatically guided for installation), and start NFS (Network File System, Network File System) service. Then, the test platform can mount the generated new image to the target tested server corresponding to the target test case in the order in which the user selects the target test case, and then automatically execute the installation of the corresponding operating system in the target tested server according to the new image and configure the operating system. And the test platform can detect the operating system installation progress regularly or in real time until the operating system is installed.

[0088] The above process can realize the function of testing the out-of-band installation operating system using the test platform, and is applicable to the situation of directly testing the system adaptability of new models.

[0089] An embodiment of the present application provides a server testing method. If the target operating mode is the third-party mode, then according to the target operating mode, the operating system is installed and configured in the corresponding target server under test according to the target image and the target test case. The method may include:

[0090] The interface of the third-party system is called through a pre-written API interface, the target image is imported into the third-party system through the interface of the third-party system, and the third-party system is used to install the operating system and configure the operating system in the corresponding target server under test according to the target image and test cases.

[0091] In this application, if the target operating mode is third-party mode, it means that the user wants to test the installation function of the third-party software. This requires the user to write an API (Application Programming Interface) interface that calls the interface of the third-party system in the reserved location on the test platform in advance, including uploading images, creating templates, starting tasks, and detecting whether the task is completed.

[0092] Accordingly, when the test platform installs the operating system and configures the operating system in the corresponding target server under test according to the target image and target test case in accordance with the third-party mode, it can specifically call the interface of the third-party system through the API interface pre-written by the user, and call them in sequence according to the process to complete the test of the installation function of the third-party system. Specifically, the interface of the third-party system is called through the API interface pre-written by the user, the target image corresponding to the target test case is imported into the third-party system through the interface of the third-party system, the third-party system is used to install and configure the operating system in the corresponding target server under test according to the target image and test case, and the third-party system is used to detect the progress of the operating system installation.

[0093] Through the above process, the installation function of third-party software can be tested with the help of the test platform, thereby improving the scope of application of the test platform.

[0094] An embodiment of the present application provides a server testing method for detecting the installation of an operating system and the generation of configuration items on a target server under test, which may include:

[0095] If the out-of-band network and the business network are interconnected, the SSH mode is used to detect the operating system installation and configuration item generation of the target server under test;

[0096] If the out-of-band network is physically isolated from the business network, the Live CD mode is used to test the operating system installation and configuration item generation of the target server under test.

[0097] In this application, when the test platform detects the operating system installation and configuration item generation of the target server under test, it can specifically use the SSH (Struts+Spring+Hibernate) mode and the Live CD mode for detection to ensure the quality and efficiency of detection and improve the accuracy of detection. Among them, the SSH mode is suitable for the situation where a static IP is configured and the network is actually connected and the business network and the out-of-band network are interconnected. The conditions are relatively harsh. That is, for the situation where the out-of-band network and the business network are connected and the business network has been configured, the SSH mode can be used to log in and detect the operating system installation and configuration item generation of the target server under test. It is efficient and has rich available detection items. The Live CD mode is suitable for situations where SSH cannot be connected. Generally, in a data center, the out-of-band network and the business network are physically isolated. Therefore, this usage scenario is more common. In this case, the built-in Live CD mode can be used to detect the operating system installation and configuration item generation of the target server under test through self-developed scripts, and its scope of application is wider.

[0098] An embodiment of the present application provides a server testing method that uses SSH mode to detect the operating system installation and configuration item generation of a target server under test, which may include:

[0099] Use the root password configured in the test case to try to connect to the target server under test with the operating system installed;

[0100] If the target server under test is successfully connected, the first detection script generated according to the test case is distributed to the target server under test, so as to use the first detection script to judge the target server under test; wherein the first detection script includes the configuration items to be tested and the conditions for judging whether the configuration items are generated successfully;

[0101] Receive the judgment result returned by the first detection script, determine whether the test case is successfully executed based on the judgment result, and generate a corresponding test result.

[0102] In the present application, the specific process of detecting the operating system installation and configuration item generation of the target tested server using the SSH mode is that the test platform uses the root password configured in the test case to try to install the target tested server of the operating system, and when the target tested server is successfully connected, the first detection script generated according to the test case will be distributed to the target tested server to use the first detection script to judge the target tested server, wherein the first detection script contains the configuration items to be detected and the conditions for judging whether the configuration items are generated successfully, that is, the first detection script will judge whether the configuration items to be detected are generated successfully on the target tested server. After the first detection script is detected, the judgment result will be transmitted back to the test platform. After receiving the judgment result returned by the first detection script, the test platform will judge whether this test case of the target tested server is successfully executed according to the judgment result (specifically, if the judgment result is that the configuration item to be detected is not generated successfully, then it is determined that this test case is not successfully executed, and if the judgment result is that the configuration item to be detected is generated successfully, then it is determined that this test case is successfully executed).

[0103] See also Figure 4 , which shows a schematic diagram of using the Live CD mode to detect the operating system installation and configuration item generation of the target server under test, provided by an embodiment of the present application. A server testing method provided by an embodiment of the present application, using the Live CD mode to detect the operating system installation and configuration item generation of the target server under test, may include:

[0104] Turn off the locator light on the target server and mount the Live CD onto the target server. The Live CD contains the IPMI tool and the second test script.

[0105] Using the second detection script to identify the hard disk of the target server under test and mount it, and detecting whether the configuration items generated in the target server under test are consistent with the configuration items included in the test case;

[0106] If the configuration items generated in the target server under test are consistent with the configuration items included in the test case, use the IPMI tool to turn on the location light of the target server under test;

[0107] After successfully mounting the Live CD to the target server under test, check whether the locator light of the target server under test is turned on within the preset time;

[0108] If the locating light of the target server under test is not turned on within the preset time, a test result indicating that the test case failed is generated; if the locating light of the target server under test is turned on within the preset time, a test result indicating that the test case passed is generated.

[0109] In this application, the specific process of using the Live CD mode to test the operating system installation and configuration item generation of the target server under test is as follows: the test platform first turns off the locator light of the target server under test. Then, the test platform starts the detection program and mounts a Live CD onto the target server under test. The Live CD contains the IPMI (Intelligent Platform Management Interface) tool and a second detection script. After the target server under test is mounted on the Live CD, the second detection script will be executed. The second detection script is slightly different from the first detection script in the SSH mode. The second detection script automatically identifies the hard disk of the target server under test and mounts it. Then, configuration items such as partitions, usernames, and networks are tested (specifically, whether these configuration items are consistent with the configuration items included in the corresponding test case). Once the detection is completed and the configuration items generated in the target server under test are consistent with the configuration items included in the test case, the IPMI tool is used to turn on the locator light. If the configuration items generated in the target server under test are inconsistent with the configuration items included in the test case, no action is taken. At the same time, after the Live CD is successfully mounted on the target server under test, the test platform will detect whether the locating light of the target server under test is turned on. If the locating light of the target server under test is not turned on within the preset time (which can be set based on experience), the test case is determined to have failed. At this time, a test result indicating that the test case failed is generated, and this test case can be marked as high risk to remind the tester to try again; if the locating light of the target server under test is turned on within the preset time, the test case is determined to have succeeded. At this time, a test result indicating that the test case succeeded is generated.

[0110] The embodiment of the present application also provides a server testing device, which is applied to a testing platform for accessing an out-of-band network of a server under test, see Figure 5 , which shows a schematic structural diagram of a server testing device provided in an embodiment of the present application, which may include:

[0111] The receiving module 51 is used to receive a test selection command, and combine the tested server, operating system and configuration items corresponding to the test selection command to obtain a test case;

[0112] An acquisition module 52 is configured to acquire a target image corresponding to the test case from pre-stored operating system images, install the operating system in the corresponding target server under test according to the target image and the test case, and configure the operating system;

[0113] The detection module 53 is used to detect the operating system installation and configuration item generation of the target server under test and generate corresponding test results.

[0114] A server testing device provided in an embodiment of the present application may further include:

[0115] A selection module is used to receive a test case and an operation mode selection command before obtaining a target image corresponding to the test case from the operating system image, obtain a corresponding target test case from the test case, and select a corresponding target operation mode;

[0116] The acquisition module 52 may include:

[0117] The acquisition unit is used to obtain the target image corresponding to the target test case from the operating system image, install the operating system in the corresponding target tested server according to the target operation mode, the target image and the target test case, and configure the operating system.

[0118] In a server testing device provided by an embodiment of the present application, if the target operating mode is the automatic mode, the acquiring unit may include:

[0119] The first generating subunit is used to generate an automatic response file according to the target test case;

[0120] The import subunit is used to decompress the target image and import the decompressed target image into the automatic response file to generate a new image;

[0121] The mounting subunit is used to mount the new image to the target server under test, install the operating system in the target server under test according to the new image, and configure the operating system.

[0122] In a server testing device provided in an embodiment of the present application, if the target operating mode is a third-party mode, the acquiring unit may include:

[0123] The calling subunit is used to call the interface of the third-party system through a pre-written API interface, import the target image into the third-party system through the interface of the third-party system, and use the third-party system to install the operating system in the corresponding target server under test and configure the operating system according to the target image and test cases.

[0124] In an embodiment of the present application, a server testing device is provided, wherein the detection module 53 may include:

[0125] The first detection unit is configured to detect the operating system installation and configuration item generation of the target server under test using the SSH mode if the out-of-band network and the business network are interconnected;

[0126] The second detection unit is used to detect the operating system installation and configuration item generation of the target tested server using the Live CD mode if the out-of-band network is physically isolated from the business network.

[0127] In an embodiment of the present application, a server testing device is provided, wherein a first detection unit may include:

[0128] The connection subunit is used to try to connect to the target server under test with the operating system installed using the root password configured in the test case;

[0129] a distribution subunit, configured to distribute a first detection script generated according to the test case to the target server under test if the target server under test is successfully connected, so as to use the first detection script to judge the target server under test; wherein the first detection script includes a configuration item to be tested and a condition for judging whether the configuration item is successfully generated;

[0130] The receiving subunit is used to receive the judgment result returned by the first detection script, determine whether the test case is successfully executed based on the judgment result, and generate a corresponding test result.

[0131] In a server testing device provided in an embodiment of the present application, the second detection unit may include:

[0132] The shutdown subunit is used to turn off the positioning light of the target server under test and mount the Live CD onto the target server under test; wherein the Live CD contains the IPMI tool and the second detection script;

[0133] an identification subunit, configured to identify the hard disk of the target server under test using the second detection script and mount it, and to detect whether the configuration items generated in the target server under test are consistent with the configuration items included in the test case;

[0134] The opening subunit is used to turn on the positioning light of the target server under test by using the IPMI tool if the configuration items generated in the target server under test are consistent with the configuration items included in the test case;

[0135] The detection subunit is used to detect whether the positioning light of the target server under test is turned on within a preset time after the Live CD is successfully mounted on the target server under test;

[0136] The second generating subunit is used to generate a test result indicating that the test case failed if the positioning light of the target server under test is not turned on within a preset time; and to generate a test result indicating that the test case succeeded if the positioning light of the target server under test is turned on within the preset time.

[0137] The present application also provides a test platform. Figure 6 , which shows a schematic structural diagram of a test platform provided in an embodiment of the present application, which may include:

[0138] Memory 61, for storing computer programs;

[0139] The processor 62, when used to execute the computer program stored in the memory 61, can implement the following steps:

[0140] Receive a test selection command, combine the server under test, operating system and configuration items corresponding to the test selection command to obtain a test case; obtain the target image corresponding to the test case from the pre-stored operating system image, install the operating system in the corresponding target server under test and configure the operating system according to the target image and test case; detect the operating system installation and configuration item generation of the target server under test, and generate corresponding test results.

[0141] The present application also provides a readable storage medium, which stores a computer program. When the computer program is executed by a processor, the following steps can be implemented:

[0142] Receive a test selection command, combine the server under test, operating system and configuration items corresponding to the test selection command to obtain a test case; obtain the target image corresponding to the test case from the pre-stored operating system image, install the operating system in the corresponding target server under test and configure the operating system according to the target image and test case; detect the operating system installation and configuration item generation of the target server under test, and generate corresponding test results.

[0143] The readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0144] The description of the relevant parts of a server testing device, a testing platform and a readable storage medium provided in this application can be found in the detailed description of the corresponding parts in a server testing method provided in an embodiment of this application, and will not be repeated here.

[0145] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements are inherent to the elements. In the absence of further restrictions, the elements limited by the statement "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device comprising the elements. In addition, the above-mentioned technical solutions provided in the embodiments of the present application are not described in detail in accordance with the corresponding technical solutions in the prior art to achieve the same principle, so as to avoid excessive elaboration.

[0146] The above description of the disclosed embodiments will enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A server testing method, characterized in that: A test platform for out-of-band network access to the server under test, including: Receive a test selection command, and combine the tested server, operating system, and configuration items corresponding to the test selection command to obtain a test case; Obtaining a target image corresponding to the test case from a pre-stored operating system image, installing the operating system in the corresponding target tested server according to the target image and the test case, and configuring the operating system; Detecting the operating system installation and configuration item generation of the target server under test and generating corresponding test results; Before obtaining the target image corresponding to the test case from the operating system image, the method further includes: Receive a test case and an operation mode selection command, obtain a corresponding target test case from the test case, and select a corresponding target operation mode; Obtaining a target image corresponding to the test case from the operating system image, installing the operating system in the corresponding target tested server according to the target image and the test case, and configuring the operating system, including: Obtaining 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 in accordance with the target operation mode, and configuring the operating system; If the target operation mode is the automatic mode, then according to the target operation mode, installing the operating system in the corresponding target server under test according to the target image and the target test case and configuring the operating system, including: Generate an automatic response file according to the target test case; Decompressing the target image and inserting the decompressed target image into the automatic response file to generate a new image; Mounting the new image to the target server under test, installing an operating system in the target server under test according to the new image and configuring the operating system; If the target operating mode is the third-party mode, then according to the target operating mode, installing the operating system in the corresponding target server under test according to the target image and the target test case and configuring the operating system, including: The interface of the third-party system is called through a pre-written API interface, the target image is imported into the third-party system through the interface of the third-party system, and the third-party system is used to install the operating system in the corresponding target server under test and configure the operating system according to the target image and the test case.

2. The server testing method according to claim 1, wherein: Detecting the operating system installation and configuration item generation of the target server under test, including: If the out-of-band network and the business network are interconnected, the operating system installation and configuration item generation of the target server under test are detected using SSH mode; If the out-of-band network is physically isolated from the business network, the Live CD mode is used to detect the operating system installation and configuration item generation of the target server under test.

3. The server testing method according to claim 2, wherein: Use SSH mode to detect the operating system installation and configuration item generation of the target server under test, including: Use the root password configured in the test case to try to connect to the target server under test with the operating system installed; If the target server under test is successfully connected, a first detection script generated according to the test case is distributed to the target server under test, so as to use the first detection script to judge the target server under test; wherein the first detection script includes a configuration item to be tested and a condition for judging whether the configuration item is successfully generated; Receive the judgment result returned by the first detection script, determine whether the test case is successfully executed based on the judgment result, and generate a corresponding test result.

4. The server testing method according to claim 2, wherein: Use Live CD mode to test the operating system installation and configuration item generation of the target server under test, including: Turn off the positioning light of the target server under test and mount a Live CD onto the target server under test; wherein the Live CD contains the IPMI tool and the second detection script; Using the second detection script to identify the hard disk of the target server under test and mount it, and detecting whether the configuration items generated in the target server under test are consistent with the configuration items included in the test case; If the configuration items generated in the target server under test are consistent with the configuration items included in the test case, turning on the location light of the target server under test by using the IPMI tool; After the Live CD is successfully mounted on the target server under test, detecting whether the locating light of the target server under test is turned on within a preset time; If the locating light of the target server under test is not turned on within the preset time, a test result indicating that the test case fails is generated; if the locating light of the target server under test is turned on within the preset time, a test result indicating that the test case succeeds is generated.

5. A server testing device, characterized in that: A test platform for out-of-band network access to the server under test, including: A receiving module, configured to receive a test selection command, and combine the tested server, operating system, and configuration items corresponding to the test selection command to obtain a test case; An acquisition module is used to obtain a target image corresponding to the test case from a pre-stored operating system image, install the operating system in the corresponding target tested server according to the target image and the test case, and configure the operating system; A detection module is used to detect the operating system installation and configuration item generation of the target tested server and generate corresponding test results; Also includes: A selection module is used to receive a test case and an operation mode selection command before obtaining a target image corresponding to the test case from the operating system image, obtain a corresponding target test case from the test case, and select a corresponding target operation mode; Get modules, including: An acquisition unit is used to obtain a target image corresponding to a target test case from an operating system image, install the operating system in the corresponding target server under test according to the target image and the target test case in accordance with the target operation mode, and configure the operating system; If the target operating mode is the automatic mode, the acquiring unit includes: The first generating subunit is used to generate an automatic response file according to the target test case; The import subunit is used to decompress the target image and import the decompressed target image into the automatic response file to generate a new image; The mounting subunit is used to mount the new image to the target server under test, install the operating system in the target server under test according to the new image, and configure the operating system; If the target operating mode is the third-party mode, the acquiring unit includes: The calling subunit is used to call the interface of the third-party system through a pre-written API interface, import the target image into the third-party system through the interface of the third-party system, and use the third-party system to install the operating system in the corresponding target server under test and configure the operating system according to the target image and test cases.

6. A test platform, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the server testing method according to any one of claims 1 to 4 when executing the computer program.

7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the server testing method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Platform test method and system based on cloud sea operation system

    CN107124335A

  • Test method and test device

    CN110471809A