A test method, apparatus, device and readable storage medium
By automating client-side testing of BMC KVM's permission switching function, and utilizing cyclical access from different clients and log analysis, the problem of low testing efficiency for BMC KVM's permission switching function was solved, achieving efficient and stable test results and reducing manual costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2022-07-22
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, the permission switching function of BMC KVM has low testing efficiency and a limited number of tests, making it difficult to expose problems and consuming a lot of time and energy for testers.
A testing method and apparatus are provided to automatically test the permission switching function of BMC KVM through a client. Different clients are used to access BMC KVM in a loop until a set number of times are reached, and access logs and BMC logs are automatically obtained to find problematic log entries.
It improves the testing efficiency and stability of BMC KVM permission switching function, reduces the time and effort consumed by testers, can expose problems more comprehensively, and ensures the reliability of remote control.
Smart Images

Figure CN115220982B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of device function testing technology, and more specifically, to a testing method, apparatus, device, and readable storage medium. Background Technology
[0002] KVM over IP, also known as digital KVM (Keyboard, Video, Mouse), is a KVM switch with remote management capabilities. It allows remote control of multiple computers using a local keyboard, monitor, and mouse. It captures video signals from the local computer, converts them from analog to digital, compresses them into IP packets, and transmits them over the internet or a dedicated network. The remote control console receives the IP packets, unpacks and converts them, and displays them on its screen. Administrators then use these packets to control the keyboard and mouse, issuing a series of commands that are combined into IP packets and sent back to the local machine. These packets are then unpacked and converted back into keyboard and mouse signals, enabling the local computers to perform corresponding actions and achieve remote control. KVM is a feature provided by the BMC (Baseboard Management Controller). Knowing in advance whether there are any problems with the BMC KVM's permission switching function and locating the source of any issues can improve the reliability of remote control.
[0003] In conclusion, how to test the permission switching function of BMC KVM is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a testing method, apparatus, device and readable storage medium for testing the permission switching function of BMC KVM.
[0005] To achieve the above objectives, this application provides the following technical solution:
[0006] A testing method, applied to the client, includes:
[0007] Access the BMC KVM of the server under test based on the test information;
[0008] Enter access information into the BMC KVM and determine whether the access information was entered successfully.
[0009] If so, another client is controlled to access the BMC KVM. The other client waits for a preset time to allow the BMC to switch access permissions, then enters access information into the BMC KVM and returns a success message upon successful input.
[0010] Upon receiving the successful input message, execute the step of controlling another client to access the BMC KVM until the number of times the BMC KVM is accessed reaches the set number;
[0011] Obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and search for problem log entries in the access logs and the BMC logs.
[0012] Preferably, when determining whether the access information has been successfully entered, the method further includes:
[0013] If it is determined that the access information was not entered successfully, the steps of obtaining the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and BMC logs are executed.
[0014] If a message indicating unsuccessful input is received from the other client, the following also applies:
[0015] Perform the steps of obtaining the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and the BMC logs.
[0016] Preferably, accessing the BMC KVM of the server under test based on test information includes:
[0017] Determine whether this is the first time accessing the BMC KVM of the server under test;
[0018] If it is determined to be the first access, then determine whether the client and other clients support the test runtime environment corresponding to the KVM access method contained in the test information; the other clients specifically refer to other clients participating in the test.
[0019] If supported, configure the test runtime environment corresponding to the KVM access method in itself and the other clients;
[0020] If not supported, install tools for configuring the test runtime environment in itself and the other clients, and configure the test runtime environment corresponding to the KVM access method in itself and the other clients;
[0021] Based on the BMC login information of the server under test contained in the test information, access the BMCWEB of the server under test, and access the BMC KVM in the BMC WEB;
[0022] If it is determined that this is not the first time accessing the site, close the currently running KVM page and access the BMC KVM within the BMC WEB.
[0023] Preferably, before controlling another client's access to the BMC KVM, the method further includes:
[0024] Obtain the IP address of the specified client and check the connectivity with the specified client's IP address;
[0025] If the connection to the specified client's IP is not established, a message to switch clients is sent, and the IP of the new client is obtained, until the connection to the new client's IP is established.
[0026] The client with the changed IP address is used as the client participating in the test. The login information of the client participating in the test is obtained, and the connection is established with the client participating in the test based on the login information.
[0027] Preferably, the access information is entered into the BMC KVM, including:
[0028] Enter access information into the access log in the BMC KVM.
[0029] Preferably, determining whether the access information was entered successfully includes:
[0030] Determine whether the number of lines in the access log has increased;
[0031] If so, then the access information was entered successfully.
[0032] Preferably, the access information is entered into the BMC KVM, including:
[0033] The access information was entered into the BMC KVM by simulating a mouse and keyboard using libXtst.
[0034] A testing device, applied to a client, includes:
[0035] The access module is used to access the BMC KVM of the server under test based on the test information.
[0036] The judgment module is used to determine whether the access information is successfully entered into the BMC KVM.
[0037] The control module is used to control another client to access the BMC KVM if the access information is successfully entered. The other client waits for a preset time to allow the BMC to switch access permissions before entering the access information into the BMC KVM and returning a message indicating successful input after successful input.
[0038] The first execution module is used to obtain the input success message and execute the step of controlling another client to access the BMC KVM until the number of times the BMC KVM is accessed reaches a set number.
[0039] The lookup module is used to obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and to look up problem log entries from the access logs and the BMC logs.
[0040] A testing device, comprising:
[0041] Memory, used to store computer programs;
[0042] A processor for executing the computer program to implement the steps of the test method as described in any of the preceding claims.
[0043] A readable storage medium storing a computer program that, when executed by a processor, implements the steps of the test method as described in any of the preceding claims.
[0044] This application provides a testing method, apparatus, device, and readable storage medium. The method, applied to a client, includes: accessing the BMC KVM of the server under test based on test information; inputting access information into the BMC KVM and determining whether the access information was successfully input; if so, controlling another client to access the BMC KVM, whereby the other client waits for a preset time length to allow the BMC to switch access permissions, then inputs access information into the BMC KVM and returns a success message upon successful input; obtaining the success message and executing the steps of controlling another client to access the BMC KVM until the number of accesses to the BMC KVM reaches a set number; obtaining the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and BMC logs.
[0045] The technical solution disclosed in this application involves a client first accessing the BMC KVM of the server under test based on test information and inputting access information into the BMC KVM. Once the access information is confirmed to be successfully input, another client is controlled to access the BMC KVM. This client waits for a preset time period to allow the BMC to switch access permissions before inputting access information into the BMC KVM, ensuring that only one client performs input operations on the BMC KVM at a time. After receiving a successful input message from the controlled client, the step of controlling another client to access the BMC KVM is executed, resulting in different clients repeatedly accessing the BMC KVM and inputting access information into it, until the number of accesses to the BMC KVM reaches a set number. Afterward, the client automatically obtains the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and automatically searches for problem log entries in the access logs and BMC logs for analysis and appropriate processing, thereby improving the reliability of remote control. As can be seen from the above process, this application not only utilizes the client to automate the testing of the BMC KVM access permission switching function, but also performs multiple tests on the BMC KVM access permission switching, and automatically checks the test results. Therefore, it can improve testing efficiency and stability, and reduce the time and effort consumed by testers, thereby reducing labor costs. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0047] Figure 1 A flowchart of a testing method provided in an embodiment of this application;
[0048] Figure 2 This is a schematic diagram of the structure of a testing device provided in an embodiment of this application;
[0049] Figure 3 This is a schematic diagram of the structure of a testing device provided in an embodiment of this application. Detailed Implementation
[0050] Currently, testing of BMC KVM is limited to manual operation, where testers log into the BMC KVM under test from different machines. However, manual testing has a limited number of attempts to test the BMC KVM permission switching on the server, which is insufficient to expose BMC KVM problems. Moreover, manual testing consumes a lot of time and energy of testers and results in low testing efficiency.
[0051] Therefore, this application provides a testing method, apparatus, device, and readable storage medium for automating the testing of the permission switching function of BMC KVM.
[0052] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] See Figure 1 The diagram illustrates a flowchart of a testing method provided in an embodiment of this application. This testing method, applied to a client, may include:
[0054] S11: Access the BMC KVM of the server under test based on the test information.
[0055] It should be noted that all clients mentioned in this application can be clients using Linux systems, or clients using operating systems such as Windows. Furthermore, the client to which this application applies contains a main program, which specifically includes a control module, an access module, and an authentication module (for clarity, the client to which this application applies can be referred to as the main client). The main client can specify the IP addresses (Internet Protocol) and login information (specifically, username and password) of the other clients assisting in access (i.e., other clients participating in the test besides the main client) to facilitate communication with other participating clients, perform subroutine copying, and control the other participating clients. The subroutines within the other participating clients include access modules and authentication modules. The number of other participating clients can be one or more; this application does not limit this.
[0056] When testing the permission switching function of the BMC KVM on the server under test, firstly, the control module in the main client can run a local access module to access the BMC KVM on the server under test based on the test information. This test information may specifically include the IP address, username, and password of the BMC on the server under test, as well as the set number of tests. Specifically, access to the BMC KVM on the server under test can be achieved using the IP address, username, and password of the BMC contained in the test information.
[0057] S12: Input access information into BMC KVM and determine whether the access information was entered successfully; if so, proceed to step S13.
[0058] After the main client accesses the BMC KVM of the server under test, it can use the control module to control the access module to input access information into the BMC KVM. This access information can specifically include the access time, the client's ID (identity number, also known as a serial number or account), and other information. Then, the verification module in the main client can locally determine whether the access information was successfully entered.
[0059] If the access information is confirmed to be entered successfully, a success message can be returned to the control module and access module in the main client.
[0060] S13: Control another client to access BMC KVM. The other client waits for a preset time to allow BMC to switch access permissions, then enters access information into BMC KVM and returns a success message upon successful input.
[0061] After confirming successful input of access information, the control module in the main client can control the access module of another client (one of the other clients participating in the test during the first execution of step S13) to access the BMC KVM. Simultaneously, the control module of the main client can time and wait for a preset time period to allow the BMC to switch access permissions (specifically, switching access permissions to the BMC KVM from one client to another). Then, it can control the access module of the controlled client (the aforementioned other client) to input access information (including access time, client ID, etc.) into the BMC KVM. Alternatively, after the control module in the main client controls the access module of another client to access the BMC KVM, that client itself can time and wait for a preset time period to allow the BMC to switch access permissions before using its own internal access module to input access information into the BMC KVM. After the client controlled by the master client enters access information into the BMC KVM, the verification module in that client can determine whether the access information was entered successfully. If successful, it returns a success message to the master client. It should be noted that the preset time length can be determined based on the time spent by the BMC performing the BMC KVM access permission switch; for example, it could be 30 seconds.
[0062] S14: Obtain a message indicating successful input, and execute the steps to control another client to access the BMC KVM until the set number of accesses to the BMC KVM is reached.
[0063] Based on step S13, the master client can receive a success message from the controlled client. Afterward, the master client can execute the step of controlling another client to access the BMC KVM; that is, the master client can return to executing step S13 until the number of accesses to the BMC KVM reaches the set number. It should be noted that the client accessing the BMC KVM in two consecutive instances is not the same; that is, when step S13 is executed repeatedly, the "other client" referred to in two consecutive steps S13 is not the same client.
[0064] When only two clients participate in the test (i.e., the number of other participating clients is 1), the main client and this other client take turns accessing and inputting information into the BMC KVM in the manner described above (i.e., operations are performed in the order of main client → client → main client → client → ...) until the set number of accesses to the BMC KVM is reached. When two or more clients participate in the test (i.e., the number of other participating clients is ≥2), the main client and other participating clients take turns accessing and inputting information into the BMC KVM in the manner described above until the set number of accesses to the BMC KVM is reached. Taking three clients as an example, namely client A (main client), client B, and client C, these three clients access and input information into the BMC KVM in the order of client A → client B → client C → client A until the set number of accesses to the BMC KVM is reached. Specifically, after executing steps S11 and S12, client A controls client B to access the BMC KVM. Client B waits for a preset time to allow the BMC to switch access permissions before entering access information into the BMC KVM and returning a success message upon successful input. Client A, upon receiving the success message, controls client C to access the BMC KVM. Client C waits for the preset time to allow the BMC to switch access permissions before entering access information into the BMC KVM and returning a success message upon successful input. Client A, upon receiving the success message, then controls itself to access the BMC KVM. Client A waits for the preset time to allow the BMC to switch access permissions before entering access information into the BMC KVM and returning a success message upon successful input. Client A, upon receiving the success message, controls client B to access the BMC KVM, and so on, until the set number of accesses to the BMC KVM is reached.
[0065] To reduce testing costs, two clients can be used preferentially. In this case, steps S12 to S14 are as follows: Input access information into the BMC KVM and determine whether the access information is successfully input. If so, control the other client to access the BMC KVM. The client waits for a preset time length to allow the BMC to switch access permissions, then inputs access information into the BMC KVM and returns a success message after successful input. After receiving the success message, control itself to access the BMC KVM, and after waiting for a preset time length to allow the BMC to switch access permissions, inputs access information into the BMC KVM and returns a success message to itself after successful input (specifically, the main client's verification module returns a success message to the main client's control module). After receiving the success message, execute the steps to control the other client to access the BMC KVM until the number of times the BMC KVM is accessed reaches the set number.
[0066] The above method allows for multiple tests of the BMC KVM permission switching function using different clients, thereby exposing any problems with BMC KVM.
[0067] S15: Obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and find the problem log entries from the access logs and BMC logs.
[0068] After the set number of accesses to the BMC KVM is reached, the main client can obtain the access logs corresponding to the BMC KVM (relevant information is recorded in the access logs each time the BMC KVM is accessed, generating the corresponding access logs for the BMC KVM), and can also obtain the BMC logs of the server under test (which are the logs of the BMC itself on the server under test). Then, the main client can use scripts to query the access logs corresponding to the BMC KVM and the BMC logs of the server under test to find problem log entries (specifically, problem log entries related to BMC KVM access). This allows relevant personnel to analyze the problem log entries and take appropriate measures to improve the stability and reliability of the BMC KVM, thereby enhancing the reliability of remote control using the BMC KVM.
[0069] As demonstrated by the above process, this application utilizes different clients to automate and stabilize the BMC KVM access permission switching function. Furthermore, the clients can automatically check the test results without requiring manual intervention in the BMC KVM access permission switching function testing. Therefore, it improves testing efficiency and stability, reduces the time and effort required by testers, and lowers labor costs. In addition, this method allows for extensive testing of the BMC KVM access permission function, sufficiently exposing BMC KVM problems and facilitating subsequent problem-solving to ensure the reliability of remote control.
[0070] The technical solution disclosed in this application involves a client first accessing the BMC KVM of the server under test based on test information and inputting access information into the BMC KVM. Once the access information is confirmed to be successfully input, another client is controlled to access the BMC KVM. This client waits for a preset time period to allow the BMC to switch access permissions before inputting access information into the BMC KVM, ensuring that only one client performs input operations on the BMC KVM at a time. After receiving a successful input message from the controlled client, the step of controlling another client to access the BMC KVM is executed, resulting in different clients repeatedly accessing the BMC KVM and inputting access information into it, until the number of accesses to the BMC KVM reaches a set number. Afterward, the client automatically obtains the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and automatically searches for problem log entries in the access logs and BMC logs for analysis and appropriate processing, thereby improving the reliability of remote control. As can be seen from the above process, this application not only utilizes the client to automate the testing of the BMC KVM access permission switching function, but also performs multiple tests on the BMC KVM access permission switching, and automatically checks the test results. Therefore, it can improve testing efficiency and stability, and reduce the time and effort consumed by testers, thereby reducing labor costs.
[0071] The testing method provided in this application embodiment, when determining whether access information has been successfully entered, may further include:
[0072] If it is determined that the access information was not entered successfully, proceed to obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and find the problem log entries in the access logs and BMC logs;
[0073] If a message indicating unsuccessful input is received from another client, it may also include:
[0074] Perform the steps to obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and then search for problematic log entries in the access logs and BMC logs.
[0075] In this application, if the verification module in the main client determines that the access information was not successfully entered, it can directly return a message indicating unsuccessful input to the control module and access module in the main client. After receiving the message from the verification module on its local machine, the control module in the main client executes the step of retrieving the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and BMC logs. This is step S15, which helps determine why the access information was not successfully entered based on the problem log entries, thus facilitating appropriate processing by testers.
[0076] Furthermore, when the main client controls another client to access the BMC KVM, and the other client waits for a preset time to allow the BMC to switch access permissions before entering access information into the BMC KVM, if the verification module inside the other client determines that the access information entered on its own machine has not been successfully entered, it can return a message indicating that the input was unsuccessful to the control module of the main client. After receiving the message indicating that the input was unsuccessful from the other client, the control module of the main client can also execute the steps of retrieving the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and BMC logs, i.e., executing step S15, so as to determine why the access information was not successfully entered based on the problem log entries, thereby facilitating the testers to take appropriate actions.
[0077] This application provides a testing method that accesses the BMC KVM of the server under test based on test information, which may include:
[0078] Determine if this is the first time accessing the BMC KVM of the server under test;
[0079] If it is determined to be the first access, then determine whether the client and other clients support the test runtime environment corresponding to the KVM access method contained in the test information; other clients specifically refer to other clients participating in the test.
[0080] If supported, configure the test runtime environment corresponding to the KVM access method in itself and other clients;
[0081] If not supported, install the tools for configuring the test runtime environment on itself and other clients, and configure the test runtime environment corresponding to the KVM access method on itself and other clients;
[0082] Based on the BMC login information of the server under test contained in the test information, access the BMC WEB of the server under test, and access the BMC KVM in the BMC WEB.
[0083] If it is determined that this is not the first time accessing the site, close the currently running KVM page and access BMCKVM in BMC WEB.
[0084] In this application, when the main client accesses the BMC KVM of the server under test based on the test information, it can first determine whether it is the first time accessing the BMC KVM of the server under test.
[0085] If it is determined that this is the first time accessing the BMC KVM of the server under test, it is possible to determine whether the client itself and other clients (i.e., other clients participating in the test) support the test runtime environment corresponding to the KVM access method contained in the test information. If the client itself and other clients support the test runtime environment corresponding to the KVM access method, the test runtime environment corresponding to the KVM access method can be configured in the client itself and other clients. The KVM access method mentioned here can specifically be H5Viewer or JViewer. If the client itself and other clients do not support the test runtime environment corresponding to the KVM access method, the tools for configuring the test runtime environment can be installed in the client itself and other clients first (i.e., configure and install the relevant tools to ensure the smooth configuration of the corresponding test runtime environment), and then the test runtime environment corresponding to the KVM access method can be configured in the client itself and other clients. After configuring the test environment corresponding to the KVM access method, the client can access the BMC WEB of the server under test (BMC) based on the login information of the BMC server included in the test information. Then, the main client accesses the BMC KVM within the BMC WEB; that is, it can first log in to the BMC WEB page of the server under test, and then access the BMC KVM within the WEB page. Other clients can access the BMC WEB of the server under test along with the main client. Of course, other clients can also access the BMC WEB of the server under test while the main client is controlling it; this application does not limit this. The BMC WEB allows multiple clients to access it simultaneously. The BMC KVM is a feature within the BMC WEB, and only one client is allowed to access the BMC KVM at a time. By determining whether the client and other clients support the test environment corresponding to the KVM access method, different measures are taken to configure the corresponding test environment to ensure that each client can successfully and reliably access the BMC KVM according to the KVM access method specified in the test information.
[0086] If it is determined that this is not the first time accessing the BMC KVM of the server under test, the main client can first close the currently running KVM page (that is, close the KVM page that has been running all along), and then access the BMC KVM in the BMC WEB to ensure that this access to the BMC KVM proceeds normally.
[0087] In this scenario, after the main client configures the test environment for other clients using the KVM access method, when other clients access the BMC KVM, they only need to determine whether it's the first time accessing the BMC KVM on the server under test. If so, they can first access the BMC WEB on the server under test, and then access the BMC KVM within the BMC WEB. If not, they close the currently running KVM page and access the BMC KVM within the BMC WEB. Furthermore, whether it's the main client or other clients, when accessing the BMC KVM on the server under test, they all follow the KVM access method included in the test information.
[0088] An embodiment of this application provides a testing method that, before controlling another client to access the BMC KVM, may further include:
[0089] Get the IP address of the specified client and check the connectivity with the specified client's IP address;
[0090] If the connection to the specified client's IP is not established, a message to switch clients is sent, and the IP of the new client is obtained, until the connection to the new client's IP is established.
[0091] The client whose IP address has been changed is used as another client participating in the test. The login information of the other clients participating in the test is obtained, and the connection is established with the other clients based on the login information.
[0092] In this application, before the main client controls another client to access the BMC KVM (i.e., before executing step S13), it can first obtain the IP address of a specified client and check the connectivity with that specified client's IP address, that is, check whether the main client's IP address is connected to the specified client's IP address. If it is determined that the IP address is connected to the specified client's IP address, then the specified client can be used as a client participating in the test (specifically, other clients participating in the test). Then, the main client can obtain the login information of the clients participating in the test and establish a connection with the clients participating in the test based on the login information, thereby ensuring that the main client can normally copy the subroutine to other clients participating in the test and can control other clients participating in the test.
[0093] If it's determined that connectivity with the specified client's IP is lost, the main client can send a message to switch clients. Upon receiving this message, the tester can then proceed with the client switch. Accordingly, the main client can obtain the IP address of the new client and check connectivity with it. If connectivity fails, the process of sending the new client message and obtaining the new client's IP address continues until connectivity is established. The new client, now connected to the new client's IP, is then selected as the participating client in the test. The main client can then obtain the login information of the participating client and establish connectivity based on this information. This ensures that the main client can successfully copy subroutines to other participating clients and control them.
[0094] After establishing a connection with the client participating in the test based on the login information, the main client can execute step S13.
[0095] It should be noted that when only the main client and one other client participate in the test, the main client can connect to one client through the above process. When the main client and N other clients (N≥2) participate in the test, the main client can first connect to the N clients through the above process, and then execute step S13.
[0096] The testing method provided in this application embodiment, which involves inputting access information in the BMC KVM, may include:
[0097] Enter access information into the access log in BMC KVM.
[0098] In this application, when the main client enters access information in BMC KVM, it can specifically enter the access information into the access log in BMC KVM, so that the corresponding access log is generated during the access to BMC KVM, which facilitates the subsequent retrieval of the access log at any time.
[0099] In addition, other clients participating in the test besides the main client can also use the above method to input access information in BMC KVM.
[0100] This application provides a testing method for determining whether access information has been successfully entered, which may include:
[0101] Check if the number of lines in the access log has increased;
[0102] If so, then the access information was entered successfully.
[0103] In this application, the verification module of the main client determines whether the access information was entered successfully by checking if the number of lines in the access log has increased. Specifically, it checks the current access log and compares it with previous access logs to determine if the previous log had an increased number of lines. If the number of lines in the access log has increased, the access information is considered successfully entered; otherwise, it is considered unsuccessfully entered. This method provides a convenient way to determine whether the access information was entered successfully.
[0104] In addition, other clients participating in the test besides the main client can also use the above method to determine whether the input information was entered successfully.
[0105] It should be noted that both the verification module in the main client and the verification modules in other clients participating in the test can access the server under test to copy the access logs to their local machines, thus facilitating local access log retrieval. Specifically, the verification module can use the SCP (secure copy) command to copy the access logs.
[0106] The testing method provided in this application embodiment, which involves inputting access information in the BMC KVM, may include:
[0107] Access information is entered in BMC KVM by simulating mouse and keyboard input using libXtst.
[0108] In this application, when the access module in the main client inputs access information into the BMC KVM, it can specifically utilize libXtst to simulate mouse and keyboard operations, and input the access information into the BMC KVM through libXtst's simulated mouse and keyboard. Additionally, when closing the currently running KVM page, it can also utilize libXtst to simulate mouse and keyboard operations, and close the currently running KVM page through libXtst's simulated mouse and keyboard.
[0109] In addition, other clients participating in the test besides the main client can also use the same method to enter access information in BMC KVM.
[0110] The specific implementations of the modules mentioned above are as follows:
[0111] Implementation of the control module: The control module uses status instructions to control which client's access module is running, calculates the number of accesses, and finally obtains access logs and BMC logs. Initially, it runs the local access module; upon receiving information from the verification module, it determines whether to proceed to the next loop, and then controls the access module of another client.
[0112] The access module implementation: At runtime, the access module checks the value of the status command. If it's true, it runs; otherwise, it waits. If this is the first time accessing BMC KVM, it configures the H5Viewer or JViewer runtime environment, then runs a browser to access the BMC of the server under test (i.e., accessing the BMC WEB). After that, it runs KVM (accessing BMC KVM). If the access module has already run KVM (i.e., this is not the first time accessing BMC KVM), it first closes the previously run KVM page, then runs KVM. After running, it waits for a preset time (e.g., 30 seconds), obtains the local time and client SN (series number), and inputs this information into the access log of the server under test via KVM. Finally, after the access module completes, the verification module runs. The graphical interface can use libXtst to simulate mouse and keyboard operations.
[0113] Verification module implementation: Access the server under test and copy the access logs to the local machine (using the SCP command); check the access logs and compare them with previous access logs to see if the number of lines has increased. If so, return a success message to the control module; otherwise, return a failure message to the control module.
[0114] In this application, different clients are connected through an access module to uniformly access the server under test, BMC KVM. After access, the verification module verifies whether the input is successful by entering specific text in KVM and on the client's local machine. After a successful access, the system switches to another client to access the server, waits for a period of time for BMC to switch access permissions and verify the access success again. The above operation is repeated until the set number of times is reached.
[0115] This application also provides a testing device for use on a client side, see [link to relevant documentation]. Figure 2 It shows a schematic diagram of the structure of a testing device provided in an embodiment of this application, which may include:
[0116] Access module 21 is used to access the BMC KVM of the server under test based on the test information;
[0117] The judgment module 22 is used to determine whether the access information is successfully entered into the BMC KVM.
[0118] Control module 23 is used to control another client to access BMC KVM if the access information is successfully entered. The other client waits for a preset time to allow BMC to switch access permissions, then enters the access information in BMC KVM and returns a message indicating successful input after successful input.
[0119] The first execution module 24 is used to obtain a message indicating successful input and execute steps to control another client to access the BMC KVM until the number of times the BMC KVM is accessed reaches a set number.
[0120] The lookup module 25 is used to obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and to look for problem log entries in the access logs and BMC logs.
[0121] The testing apparatus provided in this application embodiment may further include:
[0122] The second execution module is used to determine whether the access information was entered successfully. If it is determined that the access information was not entered successfully, the module executes the steps of obtaining the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and BMC logs.
[0123] The third execution module is used to retrieve the access logs corresponding to BMCKVM and the BMC logs of the server under test if a message indicating that the input was unsuccessful is received from another client, and then search for problem log entries in the access logs and BMC logs.
[0124] The testing apparatus provided in this application embodiment includes an access module 21 that may include:
[0125] The first judgment unit is used to determine whether it is the first time accessing the BMC KVM of the server under test.
[0126] The second judgment unit is used to determine, if it is determined to be the first access, whether it and other clients support the test runtime environment corresponding to the KVM access method contained in the test information; other clients specifically refer to other clients participating in the test.
[0127] The first configuration unit is used to configure the test runtime environment corresponding to the KVM access method in itself and other clients, if supported.
[0128] The second configuration unit is used to install tools for configuring the test runtime environment in itself and other clients if not supported, and to configure the test runtime environment corresponding to the KVM access method in itself and other clients.
[0129] The first access unit is used to access the BMC WEB of the server under test based on the BMC login information of the server under test contained in the test information, and to access the BMC KVM in the BMC WEB.
[0130] The second access unit is used to close the currently running KVM page and access the BMC KVM in the BMC WEB if it is determined that this is not the first access.
[0131] The testing apparatus provided in this application embodiment may further include:
[0132] The acquisition module is used to acquire the IP address of a specified client and check the connectivity with the specified client's IP address before controlling another client to access the BMC KVM.
[0133] The feedback module is used to send a message to switch clients if the connection to the specified client's IP is not established, and to obtain the IP of the new client until the connection to the new client's IP is established.
[0134] As a module, it is used to connect the replaced client with the IP address as another client participating in the test, obtain the login information of the participating clients, and establish a connection with the participating clients based on the login information.
[0135] The testing apparatus provided in this application embodiment includes a judgment module 22 that may include:
[0136] The first input unit is used to input access information into the access log in BMC KVM.
[0137] The testing apparatus provided in this application embodiment includes a judgment module 22 that may include:
[0138] The third judgment unit is used to determine whether the number of rows in the access log has increased;
[0139] The determination unit is used to determine that the access information input was successful if the number of lines in the access log increases.
[0140] The testing apparatus provided in this application embodiment includes a judgment module 22 that may include:
[0141] The second input unit is used to input access information in BMC KVM by simulating a mouse and keyboard using libXtst.
[0142] This application also provides a testing device, see [link to relevant documentation] Figure 3 It shows a schematic diagram of the structure of a testing device provided in an embodiment of this application, which may include:
[0143] Memory 31 is used to store computer programs;
[0144] When processor 32 executes a computer program stored in memory 31, it can perform the following steps:
[0145] Access the BMC KVM of the server under test according to the test information; enter access information in the BMC KVM and determine whether the access information is entered successfully; if so, control another client to access the BMC KVM. The other client waits for a preset time length to allow the BMC to switch access permissions, then enters access information in the BMC KVM and returns a success message after successful input; obtain the success message and execute the steps to control another client to access the BMC KVM until the number of accesses to the BMC KVM reaches the set number; obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and search for problem log entries in the access logs and BMC logs.
[0146] This application embodiment also provides a readable storage medium storing a computer program, which, when executed by a processor, can perform the following steps:
[0147] Access the BMC KVM of the server under test according to the test information; enter access information in the BMC KVM and determine whether the access information is entered successfully; if so, control another client to access the BMC KVM. The other client waits for a preset time length to allow the BMC to switch access permissions, then enters access information in the BMC KVM and returns a success message after successful input; obtain the success message and execute the steps to control another client to access the BMC KVM until the number of accesses to the BMC KVM reaches the set number; obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and search for problem log entries in the access logs and BMC logs.
[0148] The readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0149] For a description of the relevant parts of the testing apparatus, device and readable storage medium provided in this application, please refer to the detailed description of the corresponding parts in the testing method provided in the embodiments of this application, and will not be repeated here.
[0150] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.
[0151] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A testing method, characterized in that, Applied to the client side, including: Access the BMC KVM of the server under test based on the test information; Enter access information into the BMC KVM and determine whether the access information was entered successfully. If so, another client is controlled to access the BMC KVM. The other client waits for a preset time to allow the BMC to switch access permissions, then enters access information into the BMC KVM and returns a success message upon successful input. Upon receiving the successful input message, execute the step of controlling another client to access the BMC KVM until the number of times the BMC KVM is accessed reaches the set number; Obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and search for problem log entries in the access logs and the BMC logs.
2. The test method according to claim 1, characterized in that, When determining whether the access information was entered successfully, the method also includes: If it is determined that the access information was not entered successfully, the steps of obtaining the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and BMC logs are executed. If a message indicating unsuccessful input is received from the other client, the following also applies: Perform the steps of obtaining the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and searching for problem log entries in the access logs and the BMC logs.
3. The test method according to claim 1, characterized in that, Access the BMCKVM of the server under test based on the test information, including: Determine whether this is the first time accessing the BMC KVM of the server under test; If it is determined to be the first access, then determine whether the client and other clients support the test runtime environment corresponding to the KVM access method contained in the test information; the other clients specifically refer to other clients participating in the test. If supported, configure the test runtime environment corresponding to the KVM access method in itself and the other clients; If not supported, install tools for configuring the test runtime environment in itself and the other clients, and configure the test runtime environment corresponding to the KVM access method in itself and the other clients; Based on the BMC login information of the server under test contained in the test information, access the BMCWEB of the server under test, and access the BMC KVM in the BMC WEB; If it is determined that this is not the first time accessing the site, close the currently running KVM page and access the BMC KVM within the BMC WEB.
4. The test method according to claim 1, characterized in that, Before controlling another client's access to the BMC KVM, the following is also included: Obtain the IP address of the specified client and check the connectivity with the specified client's IP address; If the connection to the specified client's IP is not established, a message to switch clients is sent, and the IP of the new client is obtained, until the connection to the new client's IP is established. The client with the changed IP address is used as the client participating in the test. The login information of the client participating in the test is obtained, and the connection is established with the client participating in the test based on the login information.
5. The test method according to claim 1, characterized in that, Enter access information in the BMC KVM, including: Enter access information into the access log in the BMC KVM.
6. The test method according to claim 1, characterized in that, Determining whether the access information was entered successfully includes: Determine whether the number of lines in the access log has increased; If so, then the access information was entered successfully.
7. The test method according to claim 1, characterized in that, Enter access information in the BMC KVM, including: The access information was entered into the BMC KVM by simulating a mouse and keyboard using libXtst.
8. A testing apparatus, characterized in that, Applied to the client side, including: The access module is used to access the BMC KVM of the server under test based on the test information. The judgment module is used to determine whether the access information is successfully entered into the BMC KVM. The control module is used to control another client to access the BMC KVM if the access information is successfully entered. The other client waits for a preset time to allow the BMC to switch access permissions before entering the access information into the BMC KVM and returning a message indicating successful input after successful input. The first execution module is used to obtain the input success message and execute the step of controlling another client to access the BMC KVM until the number of accesses to the BMC KVM reaches a set number. The lookup module is used to obtain the access logs corresponding to the BMC KVM and the BMC logs of the server under test, and to look up problem log entries from the access logs and the BMC logs.
9. A testing device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the test method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the test method as described in any one of claims 1 to 7.