A server testing method, device, equipment and medium
By automatically detecting and switching the operating system version of the server under test, the problem of low efficiency and high cost of human operation verification versions in the existing technology is solved, and efficient and accurate server testing is achieved.
Patent Information
- Application Number
- CN202310327286.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-03-30
AI Technical Summary
The existing server testing solution requires the verification of the operating system version of the server under test through human operations, resulting in low efficiency, high cost and difficult to guarantee.
The call version detection script automatically detects whether the current operating system version of the tested server is the same as the test operating system version. If it is not the same, the call version switching script obtains the corresponding system file from the pre-start execution environment server, switches the operating system version, and Test the required operating system to perform the test.
Automatic detection and switching of operating system versions are realized, testing efficiency is improved, labor and time costs are reduced, and the accuracy of test results is improved.
Smart Images

Figure CN116303074B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a server testing method, device, equipment and medium. Background Art
[0002] Currently, server manufacturing factories can produce a variety of server models. For each server model, after the server is assembled, it is necessary to test the server under a specified version of the operating system to ensure that the server is fully functional, stable in performance, and correctly configured.
[0003] In the related art, the scheme for testing servers of various models is usually as follows: the technician checks whether the version of the operating system installed on the tested server is the version of the operating system that needs to be installed in the tested server when the test is performed, based on the model of the tested server. Then, after determining that the version of the operating system installed on the tested server is the version of the operating system that needs to be installed in the tested server when the test is performed, the tested server is tested to obtain the test result of the tested server. The server testing scheme in the related art requires manual operation to check the version of the operating system installed on the tested server, which is not only inefficient, but also has high labor and time costs, and the accuracy of the operation is difficult to guarantee. Summary of the invention
[0004] The present invention provides a server testing method, device, equipment and medium to solve the problem that the server testing scheme in the related art needs to be manually operated to check the version of the operating system installed on the tested server, which is not only inefficient, but also has high labor and time costs, and it is difficult to ensure the accuracy of the operation.
[0005] According to one aspect of the present invention, there is provided a server testing method, comprising:
[0006] Calling a version detection script to detect, based on the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test;
[0007] If the current operating system version is different from the test operating system version, a version switching script is called to obtain a system file corresponding to the test operating system version from the pre-start execution environment server, and according to the system file, the operating system version of the tested server is switched from the current operating system version to the test operating system version;
[0008] The test is performed according to the test instruction set to obtain the test result of the tested server.
[0009] The technical solution of the embodiment of the present invention can automatically detect whether the current operating system version of the server under test is the same as the version of the operating system that needs to be installed in the server under test when the test is performed. If the current operating system version is not the same as the version of the operating system that needs to be installed in the server under test when the test is performed, the operating system version of the server under test is automatically switched from the current operating system version to the version of the operating system that needs to be installed in the server under test when the test is performed, and then the test is performed under the operating system required for the test of the server under test to obtain correct test results, with high efficiency, low labor cost and time cost, and high accuracy.
[0010] Optionally, calling the version detection script to detect, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, includes:
[0011] The version detection script performs the following operations:
[0012] Obtain the model and current operating system version of the server under test from the configuration file;
[0013] Determine the test operating system version corresponding to the model of the server under test;
[0014] Determine whether the current operating system version is the same as the test operating system version.
[0015] The technical solution of the embodiment of the present invention can automatically determine the current operating system version of the server under test and the test operating system version corresponding to the model of the server under test through a version detection script, and automatically detect whether the current operating system version is the same as the version of the operating system that needs to be installed in the server under test when testing.
[0016] Optionally, the system files include an operating system image file and an operating system startup file;
[0017] The calling of the version switching script, obtaining a system file corresponding to the test operating system version from the pre-start execution environment server, and switching the operating system version of the tested server from the current operating system version to the test operating system version according to the system file, comprises:
[0018] The following operations are performed by the version switching script:
[0019] From the operating system image files and operating system startup files corresponding to various operating system versions stored in the pre-start execution environment server, obtain the operating system image file and operating system startup file corresponding to the test operating system version;
[0020] According to the operating system image file and the operating system startup file, the operating system version of the tested server is switched from the current operating system version to the test operating system version.
[0021] The technical solution of the embodiment of the present invention can automatically switch the operating system version of the server under test from the current operating system version to the operating system version that needs to be installed in the server under test when testing, through a version switching script, according to the operating system image file and operating system startup file corresponding to the test operating system version.
[0022] Optionally, after calling the version detection script and detecting, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, the method further includes:
[0023] If the current operating system version is the same as the test operating system version, testing is performed according to the test instruction set to obtain a test result of the tested server.
[0024] The technical solution of the embodiment of the present invention can directly perform the test and obtain the test result of the server under test when the version of the operating system installed in the server under test is the version of the operating system that needs to be installed in the server under test during the test.
[0025] Optionally, the performing the test according to the test instruction set to obtain the test result of the tested server includes:
[0026] Acquire a test instruction set corresponding to the server under test; wherein the test instruction set includes at least one test instruction;
[0027] Execute each of the test instructions to obtain the execution result of each of the test instructions;
[0028] The execution result of each of the test instructions is determined as the test result of the tested server.
[0029] The technical solution of the embodiment of the present invention can automatically perform testing according to the test instruction set corresponding to the server under test to obtain the test result of the server under test when the version of the operating system installed in the server under test is the version of the operating system that needs to be installed in the server under test during testing.
[0030] Optionally, before calling the version detection script to detect, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, the method further includes:
[0031] A version detection script and a version switching script are obtained from a pre-start execution environment server, and the version detection script and the version switching script are stored in a preset storage location.
[0032] The technical solution of the embodiment of the present invention can obtain a version detection script and a version switching script, and store the version detection script and the version switching script to a preset storage location, so as to facilitate automatic detection, through the version detection script, of whether the current operating system version of the server under test is the same as the version of the operating system that needs to be installed in the server under test when the test is performed, and facilitate automatic switching of the operating system version of the server under test from the current operating system version to the version of the operating system that needs to be installed in the server under test when the test is performed, through the version switching script, when the current operating system version is different from the version of the operating system that needs to be installed in the server under test when the test is performed.
[0033] Optionally, after performing the test according to the test instruction set to obtain the test result of the server under test, the method further includes:
[0034] The test result of the tested server is provided to the target user.
[0035] The technical solution of the embodiment of the present invention can automatically provide the test result of the tested server to the target user after the tested server is tested, so that the target user can determine the test result of the tested server.
[0036] According to another aspect of the present invention, there is provided a server testing device, comprising:
[0037] A version detection module is used to call a version detection script to detect whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test according to the model of the server under test;
[0038] A version switching module, for calling a version switching script if the current operating system version is different from the test operating system version, obtaining a system file corresponding to the test operating system version from the pre-start execution environment server, and switching the operating system version of the server under test from the current operating system version to the test operating system version according to the system file;
[0039] The server testing module is used to perform testing according to a test instruction set to obtain a test result of the tested server.
[0040] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0041] at least one processor;
[0042] and a memory connected in network communication with the at least one processor;
[0043] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the server testing method described in any embodiment of the present invention.
[0044] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the server testing method described in any embodiment of the present invention when executed.
[0045] The technical solution of the embodiment of the present invention detects whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test through a version detection script according to the model of the server under test; if the current operating system version is different from the test operating system version, a version switching script is called to obtain the system file corresponding to the test operating system version from the pre-start execution environment server, and the operating system version of the server under test is switched from the current operating system version to the test operating system version according to the system file; then, the test is performed according to the test instruction set to obtain the test result of the server under test, which solves the problem that the server testing solution in the related art needs to verify the operating system installed on the server under test through manual operation. The version of the tested server is not only inefficient, but also has high labor and time costs, and it is difficult to ensure the accuracy of operation. The method automatically detects whether the current operating system version of the tested server is the same as the version of the operating system that needs to be installed in the tested server when the test is performed. When the current operating system version is different from the version of the operating system that needs to be installed in the tested server when the test is performed, the operating system version of the tested server is automatically switched from the current operating system version to the version of the operating system that needs to be installed in the tested server when the test is performed. Then, the test is performed under the operating system required for the tested server test to obtain correct test results, which has the beneficial effects of high efficiency, low labor and time costs, and high accuracy.
[0046] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 A flowchart of a server testing method provided in Example 1 of the present invention.
[0049] Figure 2 A flow chart of a server testing method provided in Embodiment 2 of the present invention.
[0050] Figure 3 A flowchart of a server testing method provided in Embodiment 3 of the present invention.
[0051] Figure 4 A schematic diagram of the structure of a server testing device provided in Embodiment 4 of the present invention.
[0052] Figure 5 A schematic diagram of the structure of an electronic device for implementing the server testing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0054] It should be noted that the terms "target", "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprise", "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0055] Embodiment 1
[0056] Figure 1This is a flow chart of a server testing method provided in the first embodiment of the present invention. This embodiment is applicable to the case where a server is tested under a specified version of an operating system corresponding to the server model to obtain a test result of the server. The method can be executed by a server testing device, which can be implemented in the form of hardware and / or software, and can be configured in the server under test. Figure 1 As shown, the method includes:
[0057] Step 101 : calling a version detection script to detect, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test.
[0058] Optionally, the server under test is one or more servers that need to be tested. The current operating system version is the version of the operating system installed in the server under test. The test operating system version corresponding to each model is the version of the operating system that needs to be installed in the server under test of the model when the server under test of the model is tested. The test operating system version corresponding to the model of the server under test is the version of the operating system that needs to be installed in the server under test when the server under test is tested.
[0059] Optionally, the version detection script is a script written by a developer to detect whether the current operating system version of the tested server is the same as the test operating system version corresponding to the model of the tested server.
[0060] Optionally, a version switching script is written by a developer to switch the operating system version of the server under test from the current operating system version to the test operating system version corresponding to the model of the server under test when the current operating system version of the server under test is different from the test operating system version corresponding to the model of the server under test.
[0061] Optionally, before calling the version detection script and detecting, based on the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, it also includes: obtaining a version detection script and a version switching script from a pre-start execution environment server, and storing the version detection script and the version switching script to a preset storage location.
[0062] In this way, a version detection script and a version switching script can be obtained, and the version detection script and the version switching script can be stored in a preset storage location, so that the version detection script can be used to automatically detect whether the current operating system version of the server under test is the same as the version of the operating system that needs to be installed in the server under test when the test is performed. In the case where the current operating system version is different from the version of the operating system that needs to be installed in the server under test when the test is performed, the version switching script can be used to automatically switch the operating system version of the server under test from the current operating system version to the version of the operating system that needs to be installed in the server under test when the test is performed.
[0063] Optionally, the target user stores the version detection script, the version switching script, and the operating system image files and operating system startup files corresponding to each operating system version in a preboot execution environment (PXE) server. The target user may be a technician responsible for managing the test process of the server.
[0064] Optionally, the server under test establishes a communication connection with the pre-start execution environment server, and information exchange can be performed based on the established communication connection. Therefore, the version detection script and the version switching script can be obtained from the pre-start execution environment server, and the version detection script and the version switching script can be stored in a preset storage location. The preset storage location can be a script storage file set in the server under test. The script storage file is a file used to store various scripts that the server under test needs to call.
[0065] Optionally, the calling of the version detection script detects, based on the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, including: performing the following operations through the version detection script: obtaining the model and current operating system version of the server under test from a configuration file; determining the test operating system version corresponding to the model of the server under test; and determining whether the current operating system version is the same as the test operating system version.
[0066] Therefore, the version detection script can be used to automatically determine the current operating system version of the server under test and the test operating system version corresponding to the model of the server under test, and automatically detect whether the current operating system version is the same as the version of the operating system that needs to be installed in the server under test during the test.
[0067] Optionally, the configuration file is a file set in the tested server for storing configuration information of the tested server. The configuration information of the tested server includes the model and current operating system version of the tested server. Therefore, the model and current operating system version of the tested server can be obtained from the configuration file.
[0068] Optionally, determining the test operating system version corresponding to the model of the server under test includes: querying a target model that is the same as the model of the server under test among various models and test operating system versions corresponding to each model stored in the local database of the server under test; if a target model that is the same as the model of the server under test is queried, determining the test operating system version corresponding to the target model as the test operating system version corresponding to the model of the server under test.
[0069] Optionally, if the target model that is the same as the model of the server under test is not found, a preset model error prompt information is provided to the target user. The preset model error prompt information is used to prompt that the test operating system version corresponding to the model of the server under test cannot be determined. Providing the preset model error prompt information to the target user includes: sending the preset model error prompt information to the terminal device of the target user.
[0070] Step 102: If the current operating system version is different from the test operating system version, call the version switching script to obtain the system file corresponding to the test operating system version from the pre-start execution environment server, and switch the operating system version of the server under test from the current operating system version to the test operating system version according to the system file.
[0071] Optionally, if the current operating system version is different from the test operating system version, it indicates that the version of the operating system installed in the server under test is not the version of the operating system that needs to be installed in the server under test when testing the server under test, that is, the operating system installed in the server under test is not the operating system required for testing the server under test, and the operating system version of the server under test needs to be switched from the current operating system version to the test operating system version before testing.
[0072] Optionally, the system files include operating system image files and operating system startup files; the calling of the version switching script obtains the system files corresponding to the test operating system version from the pre-boot execution environment server, and switches the operating system version of the server under test from the current operating system version to the test operating system version according to the system files, including: performing the following operations through the version switching script: obtaining the operating system image file and operating system startup file corresponding to the test operating system version from the operating system image files and operating system startup files corresponding to each operating system version stored in the pre-boot execution environment server; switching the operating system version of the server under test from the current operating system version to the test operating system version according to the operating system image file and the operating system startup file.
[0073] Therefore, when the current operating system version is different from the version of the operating system that needs to be installed in the server under test when testing, the version switching script can be used to automatically switch the operating system version of the server under test from the current operating system version to the version of the operating system that needs to be installed in the server under test when testing, based on the operating system image file and operating system startup file corresponding to the test operating system version.
[0074] Optionally, the pre-start execution environment server stores operating system image files and operating system startup files corresponding to various operating system versions, each of which includes the test operating system version.
[0075] Optionally, for each operating system, the operating system image file corresponding to the operating system version is the image file of the operating system of the operating system version, and the operating system startup file corresponding to the operating system version is the startup file that matches the operating system of the operating system version. After the operating system image file and the operating system startup file corresponding to the operating system version are stored in the server, the operating system startup file corresponding to the operating system version can be used to load the operating system image file corresponding to the operating system version to complete the installation of the operating system of the operating system version.
[0076] Optionally, the server under test establishes a communication connection with the pre-boot execution environment server, and information exchange can be performed based on the established communication connection. Therefore, the operating system image file and operating system startup file corresponding to the test operating system version can be obtained from the operating system image files and operating system startup files corresponding to various operating system versions stored in the pre-boot execution environment server.
[0077] Optionally, according to the operating system image file and the operating system startup file, the operating system version of the server under test is switched from the current operating system version to the test operating system version, including: storing the operating system image file and the operating system startup file corresponding to the test operating system version in the server under test; uninstalling the operating system of the server under test; using the operating system startup file corresponding to the test operating system version to load the operating system image file corresponding to the test operating system version, and completing the installation of the operating system of the test operating system version, thereby switching the operating system version of the server under test from the current operating system version to the test operating system version.
[0078] Optionally, after calling the version detection script and detecting, based on the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, it also includes: if the current operating system version is the same as the test operating system version, testing is performed according to a test instruction set to obtain a test result of the server under test.
[0079] Therefore, when the version of the operating system installed in the tested server is the version of the operating system that needs to be installed in the tested server during the test, the test can be directly performed to obtain the test result of the tested server.
[0080] Optionally, if the current operating system version is the same as the test operating system version, it indicates that the version of the operating system installed in the server under test is the version of the operating system that needs to be installed in the server under test when testing the server under test, that is, the operating system installed in the server under test is the operating system required for testing the server under test, and the test can be started directly.
[0081] Step 103: Perform a test according to the test instruction set to obtain a test result of the server under test.
[0082] Optionally, the test instruction set corresponding to the server under test is composed of at least one test instruction corresponding to the server under test. The test instruction is an execution that the server under test needs to execute during the test process. The execution result of the test instruction is execution success or execution failure. The execution results of each of the test instructions constitute the test result of the server under test.
[0083] Optionally, the testing is performed according to a test instruction set to obtain the test result of the server under test, including: obtaining a test instruction set corresponding to the server under test; wherein the test instruction set contains at least one test instruction; executing each of the test instructions to obtain the execution result of each of the test instructions; and determining the execution result of each of the test instructions as the test result of the server under test.
[0084] Therefore, when the version of the operating system installed in the tested server is the version of the operating system that needs to be installed in the tested server during testing, testing can be automatically performed according to the test instruction set corresponding to the tested server to obtain the test result of the tested server.
[0085] Optionally, the test instruction set corresponding to the server under test is stored in a local database of the server under test. The server under test obtains the test instruction set corresponding to the server under test from the local database of the server under test, and then executes each of the test instructions respectively to obtain the execution result of each of the test instructions, and determines the execution result of each of the test instructions as the test result of the server under test.
[0086] Optionally, after performing the test according to the test instruction set to obtain the test result of the server under test, the method further includes: providing the test result of the server under test to a target user.
[0087] Therefore, after the tested server is tested, the test result of the tested server can be automatically provided to the target user, so that the target user can determine the test result of the tested server.
[0088] Optionally, providing the test result of the tested server to a target user includes: sending the test result of the tested server to a terminal device of the target user.
[0089] The technical solution of the embodiment of the present invention detects whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test through a version detection script according to the model of the server under test; if the current operating system version is different from the test operating system version, a version switching script is called to obtain a system file corresponding to the test operating system version from a pre-startup execution environment server, and according to the system file, the operating system version of the server under test is switched from the current operating system version to the test operating system version; then, the test is performed according to the test instruction set to obtain the test result of the server under test, which solves the problem that the server test solution in the related art needs to be manually operated to check the server under test. The version of the installed operating system is not only inefficient, but also has high labor and time costs, and it is difficult to ensure the accuracy of operation. The method is to automatically detect whether the current operating system version of the server under test is the same as the version of the operating system that needs to be installed in the server under test when the test is performed. When the current operating system version is different from the version of the operating system that needs to be installed in the server under test when the test is performed, the operating system version of the server under test is automatically switched from the current operating system version to the version of the operating system that needs to be installed in the server under test when the test is performed. Then, the test is performed under the operating system required for the test of the server under test to obtain correct test results. It has the beneficial effects of high efficiency, low labor and time costs, and high accuracy.
[0090] Embodiment 2
[0091] Figure 2 The flowchart of a server testing method provided in the second embodiment of the present invention. The embodiment of the present invention can be combined with each optional solution in one or more of the above embodiments. Figure 2 As shown, the method includes:
[0092] Step 201: Obtain the model and current operating system version of the server under test from the configuration file through the version detection script.
[0093] Step 202: Determine the test operating system version corresponding to the model of the server under test through the version detection script.
[0094] Step 203: Using the version detection script, determine whether the current operating system version is the same as the test operating system version.
[0095] Step 204: If the current operating system version is different from the test operating system version, call the version switching script to obtain the system file corresponding to the test operating system version from the pre-start execution environment server, and switch the operating system version of the server under test from the current operating system version to the test operating system version based on the system file.
[0096] Step 205: Perform a test according to the test instruction set to obtain a test result of the server under test.
[0097] The technical solution of the embodiment of the present invention can automatically determine the current operating system version of the server under test and the test operating system version corresponding to the model of the server under test based on the configuration file of the server under test through a version detection script, and automatically detect whether the current operating system version is the same as the version of the operating system that needs to be installed in the server under test when testing.
[0098] Embodiment 3
[0099] Figure 3 A flow chart of a server testing method provided in Embodiment 3 of the present invention includes the following steps:
[0100] Step 301: Obtain the model and current operating system version of the server under test from the configuration file through the version detection script.
[0101] Step 302: Determine the test operating system version corresponding to the model of the server under test through the version detection script.
[0102] Step 303 , through the version detection script, determine whether the current operating system version is the same as the test operating system version: if so, execute step 306 ; if not, execute step 304 .
[0103] Step 304: Obtain the operating system image file and operating system startup file corresponding to the test operating system version from the operating system image files and operating system startup files corresponding to various operating system versions stored in the pre-boot execution environment server through the version switching script.
[0104] Step 305: Using the version switching script, according to the operating system image file and the operating system startup file, the operating system version of the server under test is switched from the current operating system version to the test operating system version.
[0105] Step 306: Perform a test according to the test instruction set to obtain a test result of the server under test.
[0106] Step 307: Provide the test result of the tested server to the target user.
[0107] The technical solution of the embodiment of the present invention can test the server to ensure that the server is fully functional, stable in performance and correctly configured. In the test process, the current operating system version of the tested server is first automatically detected as to whether it is the same as the version of the operating system that needs to be installed in the tested server when the test is performed. When the version of the operating system installed in the tested server is the version of the operating system that needs to be installed in the tested server when the test is performed, the test can be automatically performed according to a test instruction set corresponding to the tested server to obtain a test result of the tested server, and the test result of the tested server is provided to a target user, so that the target user can determine the test result of the tested server. When the version of the operating system installed in the tested server is not the version of the operating system that needs to be installed in the tested server when the test is performed, the operating system version of the tested server is automatically switched to the version of the operating system that needs to be installed in the tested server when the test is performed, and then the test can be performed according to a test instruction set corresponding to the tested server to obtain a test result of the tested server, and the test result of the tested server is provided to the target user.
[0108] Embodiment 4
[0109] Figure 4 This is a schematic diagram of the structure of a server testing device provided in Embodiment 4 of the present invention. The device can be configured in an electronic device. Figure 4 As shown, the device includes: a version detection module 401, a version switching module 402 and a server testing module 403.
[0110] Among them, the version detection module 401 is used to call the version detection script to detect whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test according to the model of the server under test; the version switching module 402 is used to call the version switching script if the current operating system version is different from the test operating system version, obtain the system file corresponding to the test operating system version from the pre-start execution environment server, and switch the operating system version of the server under test from the current operating system version to the test operating system version according to the system file; the server testing module 403 is used to perform testing according to a test instruction set to obtain the test result of the server under test.
[0111] The technical solution of the embodiment of the present invention detects whether the current operating system version of the tested server is the same as the test operating system version corresponding to the model of the tested server through a version detection script according to the model of the tested server; if the current operating system version is different from the test operating system version, the version switching script is called, and the operating system version of the tested server is switched from the current operating system version to the test operating system version through the version switching script; then the test is performed according to the test instruction set to obtain the test result of the tested server, which solves the problem that the server test solution in the related art needs to check the version of the operating system installed on the tested server through manual operation, which is not only inefficient, but also has high labor and time costs, and the operation accuracy is difficult to ensure. It is achieved to automatically detect whether the current operating system version of the tested server is the same as the version of the operating system that needs to be installed in the tested server when the test is performed, and automatically switch the operating system version of the tested server from the current operating system version to the version of the operating system that needs to be installed in the tested server when the test is performed when the current operating system version is different from the version of the operating system that needs to be installed in the tested server when the test is performed, and then test is performed under the operating system required for the tested server test to obtain correct test results, which has the beneficial effects of high efficiency, low labor and time costs, and high accuracy.
[0112] In an optional implementation of an embodiment of the present invention, optionally, when the version detection module 401 executes the operation of calling a version detection script and detecting, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, it is specifically used to: perform the following operations through the version detection script: obtain the model and current operating system version of the server under test from a configuration file; determine the test operating system version corresponding to the model of the server under test; and determine whether the current operating system version is the same as the test operating system version.
[0113] In an optional implementation of an embodiment of the present invention, optionally, the system files include an operating system image file and an operating system startup file; when the version switching module 402 executes a call to a version switching script, obtains the system file corresponding to the test operating system version from the pre-boot execution environment server, and switches the operating system version of the server under test from the current operating system version to the test operating system version according to the system file, it is specifically used to: perform the following operations through the version switching script: obtain the operating system image file and the operating system startup file corresponding to the test operating system version from the operating system image files and the operating system startup files corresponding to each operating system version stored in the pre-boot execution environment server; switch the operating system version of the server under test from the current operating system version to the test operating system version according to the operating system image file and the operating system startup file.
[0114] In an optional implementation of the embodiment of the present invention, optionally, the server testing device also includes: a testing module, which is used to perform testing according to a test instruction set to obtain a test result of the tested server if the current operating system version is the same as the test operating system version.
[0115] In an optional implementation of an embodiment of the present invention, optionally, the server test module 403 is specifically used to: obtain a test instruction set corresponding to the server under test; wherein the test instruction set includes at least one test instruction; execute each of the test instructions to obtain an execution result of each of the test instructions; and determine the execution result of each of the test instructions as the test result of the server under test.
[0116] In an optional implementation of an embodiment of the present invention, optionally, the server testing device also includes: a script acquisition module, used to obtain a version detection script and a version switching script from a pre-start execution environment server, and store the version detection script and the version switching script in a preset storage location.
[0117] In an optional implementation manner of the embodiment of the present invention, optionally, the server testing device further includes: a result providing module, configured to provide the test result of the tested server to a target user.
[0118] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0119] The server testing device can execute the server testing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the server testing method.
[0120] Embodiment 5
[0121] Figure 5 The structure diagram of the electronic device 10 that can be used to implement the server testing method of the embodiment of the present invention is shown. The components, their connections and relationships, and their functions shown herein are only examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0122] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11 in network communication, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program built from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0123] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0124] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the server testing method.
[0125] In some embodiments, the server test method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is built into the RAM 13 and executed by the processor 11, one or more steps of the server test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the server test method in any other appropriate manner (e.g., by means of firmware).
[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] The computer programs for implementing the server testing method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0128] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0130] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0131] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0133] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A server testing method, characterized in that: include: Call a version detection script to detect, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test; wherein the test operating system version corresponding to each model is the version of the operating system that needs to be installed in the server under test of the model when testing the server under test of the model; the current operating system version is the version of the operating system installed in the server under test, and the test operating system version corresponding to the model of the server under test is the version of the operating system that needs to be installed in the server under test when testing the server under test; the version detection script is a script for detecting whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test; If the current operating system version is different from the test operating system version, a version switching script is called to obtain a system file corresponding to the test operating system version from the pre-start execution environment server, and according to the system file, the operating system version of the tested server is switched from the current operating system version to the test operating system version; Performing a test according to a test instruction set to obtain a test result of the server under test; The calling of the version detection script detects, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, including: If the target model that is the same as the model of the server under test is not found, a preset model error prompt information is provided to the target user, including: sending the preset model error prompt information to the terminal device of the target user.
2. The method according to claim 1, characterized in that: The calling of the version detection script detects, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, including: The version detection script performs the following operations: Obtain the model and current operating system version of the server under test from the configuration file; Determine the test operating system version corresponding to the model of the server under test; Determine whether the current operating system version is the same as the test operating system version.
3. The method according to claim 1, characterized in that The system files include operating system image files and operating system startup files; The calling of the version switching script, obtaining a system file corresponding to the test operating system version from the pre-start execution environment server, and switching the operating system version of the tested server from the current operating system version to the test operating system version according to the system file, comprises: The following operations are performed by the version switching script: From the operating system image files and operating system startup files corresponding to various operating system versions stored in the pre-start execution environment server, obtain the operating system image file and operating system startup file corresponding to the test operating system version; According to the operating system image file and the operating system startup file, the operating system version of the tested server is switched from the current operating system version to the test operating system version.
4. The method according to claim 1, characterized in that: After calling the version detection script and detecting, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, the method further includes: If the current operating system version is the same as the test operating system version, testing is performed according to the test instruction set to obtain a test result of the tested server.
5. The method according to claim 1 or 4, characterized in that: The testing is performed according to the test instruction set to obtain the test result of the tested server, including: Acquire a test instruction set corresponding to the server under test; wherein the test instruction set includes at least one test instruction; Execute each of the test instructions to obtain an execution result of each of the test instructions; The execution result of each of the test instructions is determined as the test result of the tested server.
6. The method according to claim 1, characterized in that Before calling the version detection script and detecting, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, the method further includes: A version detection script and a version switching script are obtained from a pre-start execution environment server, and the version detection script and the version switching script are stored in a preset storage location.
7. The method according to claim 1, characterized in that After testing according to the test instruction set to obtain the test result of the tested server, the method further includes: The test result of the tested server is provided to the target user.
8. A server testing device, characterized in that: include: A version detection module is used to call a version detection script to detect whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test according to the model of the server under test; wherein the test operating system version corresponding to each model is the version of the operating system that needs to be installed in the server under test of the model when testing the server under test of the model; the current operating system version is the version of the operating system installed in the server under test, and the test operating system version corresponding to the model of the server under test is the version of the operating system that needs to be installed in the server under test when testing the server under test; the version detection script is a script used to detect whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test; The calling of the version detection script detects, according to the model of the server under test, whether the current operating system version of the server under test is the same as the test operating system version corresponding to the model of the server under test, including: If the target model that is the same as the model of the server under test is not found, providing the preset model error prompt information to the target user, including: sending the preset model error prompt information to the terminal device of the target user; A version switching module, for calling a version switching script if the current operating system version is different from the test operating system version, obtaining a system file corresponding to the test operating system version from the pre-start execution environment server, and switching the operating system version of the server under test from the current operating system version to the test operating system version according to the system file; The server testing module is used to perform testing according to a test instruction set to obtain a test result of the tested server.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory connected in network communication with the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the server testing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the server testing method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Method and system for switching operating system to execute test task and medium
CN112749095A
Test machine diagnosis system updating method and system, terminal and storage medium
CN115098141A