A method and terminal for automatic testing of cloud desktop peripheral redirection
By using automated scripts to acquire and compare information about cloud desktop peripherals, the problem of low efficiency in cloud desktop peripheral redirection testing has been solved, achieving efficient and reliable automated testing.
Patent Information
- Application Number
- CN202310208168.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-03-07
AI Technical Summary
Existing technologies for testing cloud desktop peripheral redirection are inefficient, manual testing is time-consuming and of low quality, script recording is inflexible, consumes a lot of storage space, and is prone to errors.
The first script obtains local peripheral information, the second script obtains cloud desktop peripheral redirection information, and the third script compares the consistency of the three types of information, simulates the use of peripheral devices, and outputs test results.
Automated testing has been achieved, which has improved testing efficiency and quality, reduced manpower input, ensured the consistency and repeatability of tests, and reduced storage space usage.
Smart Images

Figure CN116467165B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud desktop technology, and in particular to an automatic testing method and terminal for cloud desktop peripheral redirection. Background Technology
[0002] Currently, cloud desktops based on domestically developed operating systems mainly include USB redirection, disk redirection, camera redirection, and printer redirection. Verification of whether peripherals are redirected to the cloud desktop and whether they can be used normally within it is done through manual testing. This involves first connecting the peripheral device to the terminal and confirming that the local system can recognize it. Next, the peripheral redirection software is opened within the cloud desktop, and each peripheral device is checked to see if it is redirected. Then, the functionality of the connected peripheral device is verified within the desktop. For example, if a USB flash drive is connected and can be opened and used correctly, it indicates that the redirected peripheral device is working properly within the desktop.
[0003] However, verification through manual testing is time-consuming. As versions are updated, more types of redirection will gradually be added. It is necessary to ensure the correctness of peripheral redirection during each version update test. Long-term repetitive operations will cause fatigue of testers, resulting in low test quality and efficiency.
[0004] Currently, it can also analyze whether the currently recorded script can identify the menu tools of each test object in the specified software system. If the currently recorded script cannot identify the menu tools in the target test object in the specified software system, the object operation plugin is invoked. The object operation plugin pre-encapsulates commands that simulate external operation plugins to execute on the menu tools of the target test object. By using the object operation plugin to execute commands on the menu tools of the target test object and combining them with the test case results of the recorded test cases, a system automated test report is obtained.
[0005] However, script recording requires computer storage space, and if the process is complex, it can lead to significant storage consumption. Maintaining recorded scripts is difficult; if a checkpoint is changed, the entire script needs to be re-recorded, resulting in extremely low flexibility and posing a major obstacle to later maintenance. Furthermore, information retrieval using script recording is unstable; errors may occur due to accidental mouse or keyboard clicks, or the movement of system windows may cause incorrect target positioning, leading to unexpected results. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide an automatic testing method and terminal for cloud desktop peripheral redirection, which can improve the testing efficiency and quality of cloud desktop peripheral redirection.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0008] An automated testing method for cloud desktop peripheral redirection includes the following steps:
[0009] The first script obtains the locally connected peripheral devices and saves the first peripheral information of the peripheral devices to the first local path.
[0010] The second script obtains a list of peripheral device information for redirecting internal and external devices on the cloud desktop, and saves the second peripheral device information in the list to the second path of the cloud desktop.
[0011] Obtain peripheral device information after redirection of internal and external devices on the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop;
[0012] Determine whether the information of the first peripheral device, the second peripheral device, and the third peripheral device are consistent. If they are, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed.
[0013] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0014] An automatic test terminal for redirecting cloud desktop peripherals includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor, when executing the computer program, performs the following steps:
[0015] The first script obtains the locally connected peripheral devices and saves the first peripheral information of the peripheral devices to the first local path.
[0016] The second script obtains a list of peripheral device information for redirecting internal and external devices on the cloud desktop, and saves the second peripheral device information in the list to the second path of the cloud desktop.
[0017] Obtain peripheral device information after redirection of internal and external devices on the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop;
[0018] Determine whether the information of the first peripheral device, the second peripheral device, and the third peripheral device are consistent. If they are, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed.
[0019] The beneficial effects of this invention are as follows: It automatically obtains a list of locally connected peripheral devices and automatically retrieves a list of peripheral devices redirected from the cloud desktop via scripts; it then obtains the peripheral device information after redirection from the cloud desktop, compares these three types of information, and performs simulated usage tests on the peripheral devices when they match. Therefore, automated testing via scripts reduces manpower, improves testing efficiency, and ensures test consistency and repeatability. The quality of the script determines the test quality. Automating repetitive tasks improves accuracy, testing efficiency, and the motivation of testers, which is beneficial for later test maintenance and does not require a large storage space. Attached Figure Description
[0020] Figure 1 This is a flowchart of an automatic testing method for redirecting cloud desktop peripherals according to an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of an automatic test terminal for cloud desktop peripheral redirection according to an embodiment of the present invention;
[0022] Figure 3 This is a flowchart illustrating the specific steps of an automatic testing method for redirecting cloud desktop peripherals according to an embodiment of the present invention.
[0023] Label Explanation:
[0024] 1. An automatic test terminal for redirecting cloud desktop peripherals; 2. Memory; 3. Processor. Detailed Implementation
[0025] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0026] Please refer to Figure 1 This invention provides an automatic testing method for cloud desktop peripheral redirection, including the following steps:
[0027] The first script obtains the locally connected peripheral devices and saves the first peripheral information of the peripheral devices to the first local path.
[0028] The second script obtains a list of peripheral device information for redirecting internal and external devices on the cloud desktop, and saves the second peripheral device information in the list to the second path of the cloud desktop.
[0029] Obtain peripheral device information after redirection of internal and external devices on the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop;
[0030] Determine whether the information of the first peripheral device, the second peripheral device, and the third peripheral device are consistent. If they are, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed.
[0031] As described above, the beneficial effects of this invention are as follows: It automatically acquires locally connected peripheral devices and a list of peripheral devices redirected to the cloud desktop via scripts; it acquires the peripheral device information after redirection to the cloud desktop, and then compares these three types of information. When the comparison matches, it performs a simulated usage test of the peripheral devices. Therefore, automated testing via scripts reduces manpower input, improves testing efficiency, and ensures test consistency and repeatability. The quality of the script determines the test quality. Automating repetitive tasks improves accuracy, testing efficiency, and the motivation of testers, which is beneficial for later testing and maintenance without requiring a large storage space.
[0032] Furthermore, the step of obtaining locally connected peripheral devices through a first script and saving the first peripheral information of the peripheral devices to a first local path includes:
[0033] Use the first script to automatically execute command lines and obtain locally connected peripheral devices;
[0034] After the first script is executed, it obtains the first peripheral information of the identified peripheral device and saves the first peripheral information to the first local path.
[0035] As described above, the step of automatically acquiring and saving peripheral information locally can be repeated, which facilitates subsequent information comparison and makes it easier to acquire peripheral information again.
[0036] Furthermore, the step of obtaining the list of peripheral device information for cloud desktop internal and external device redirection via the second script, and saving the second peripheral device information in the list to the second path of the cloud desktop, includes:
[0037] The second script obtains the interface for the list of peripheral devices in the cloud desktop, iterates through the peripheral information corresponding to each interface, removes duplicate peripheral information to obtain the second peripheral information, and saves the second peripheral information to the second path of the cloud desktop.
[0038] As described above, the peripheral information corresponding to each interface in the cloud desktop is automatically obtained from the peripheral device information list. This step can be repeated to facilitate subsequent information comparison.
[0039] Furthermore, determining whether the first peripheral information, the second peripheral information, and the third peripheral information are consistent includes:
[0040] Send the second peripheral information and the third peripheral information stored in the second path to the first path;
[0041] In the first path, keyword recognition is performed on the first peripheral information, the second peripheral information, and the third peripheral information. If the recognition is consistent, the first peripheral information, the second peripheral information, and the third peripheral information are consistent; otherwise, the first peripheral information, the second peripheral information, and the third peripheral information are inconsistent.
[0042] As described above, by placing the information of the three peripheral devices in the first local path for comparison and judging whether the information is consistent based on keywords, a quick judgment result can be obtained.
[0043] Furthermore, the peripheral device is simulated on the cloud desktop, and the test results are output after the simulation is completed, including:
[0044] According to the type of peripheral device, the device is redirected accordingly. After each simulated redirection of the peripheral device, the test results are recorded and saved to the first path.
[0045] As described above, storing the information of the three peripheral devices and the test results of simulating peripheral device usage locally enables automatic testing of peripheral device redirection on the cloud desktop.
[0046] Please refer to Figure 2 Another embodiment of the present invention provides an automatic test terminal for cloud desktop peripheral redirection, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0047] The first script obtains the locally connected peripheral devices and saves the first peripheral information of the peripheral devices to the first local path.
[0048] The second script obtains a list of peripheral device information for redirecting internal and external devices on the cloud desktop, and saves the second peripheral device information in the list to the second path of the cloud desktop.
[0049] Obtain peripheral device information after redirection of internal and external devices on the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop;
[0050] Determine whether the information of the first peripheral device, the second peripheral device, and the third peripheral device are consistent. If they are, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed.
[0051] As described above, the script automatically retrieves information on locally connected peripheral devices and a list of peripheral devices redirected from the cloud desktop. It then retrieves the information on the redirected peripheral devices and compares these three types of information. If they match, a simulated usage test of the peripheral device is performed. Therefore, automated testing via scripts reduces manpower, improves testing efficiency, and ensures consistency and repeatability of tests. The quality of the script directly determines the test quality. Automating repetitive tasks improves accuracy, testing efficiency, and the motivation of testers, which is beneficial for later test maintenance and does not require a large storage space.
[0052] Furthermore, the step of obtaining locally connected peripheral devices through a first script and saving the first peripheral information of the peripheral devices to a first local path includes:
[0053] Use the first script to automatically execute command lines and obtain locally connected peripheral devices;
[0054] After the first script is executed, it obtains the first peripheral information of the identified peripheral device and saves the first peripheral information to the first local path.
[0055] As described above, the step of automatically acquiring and saving peripheral information locally can be repeated, which facilitates subsequent information comparison and makes it easier to acquire peripheral information again.
[0056] Furthermore, the step of obtaining the list of peripheral device information for cloud desktop internal and external device redirection via the second script, and saving the second peripheral device information in the list to the second path of the cloud desktop, includes:
[0057] The second script obtains the interface for the list of peripheral devices in the cloud desktop, iterates through the peripheral information corresponding to each interface, removes duplicate peripheral information to obtain the second peripheral information, and saves the second peripheral information to the second path of the cloud desktop.
[0058] As described above, the peripheral information corresponding to each interface in the cloud desktop is automatically obtained from the peripheral device information list. This step can be repeated to facilitate subsequent information comparison.
[0059] Furthermore, determining whether the first peripheral information, the second peripheral information, and the third peripheral information are consistent includes:
[0060] Send the second peripheral information and the third peripheral information stored in the second path to the first path;
[0061] In the first path, keyword recognition is performed on the first peripheral information, the second peripheral information, and the third peripheral information. If the recognition is consistent, the first peripheral information, the second peripheral information, and the third peripheral information are consistent; otherwise, the first peripheral information, the second peripheral information, and the third peripheral information are inconsistent.
[0062] As described above, by placing the information of the three peripheral devices in the first local path for comparison and judging whether the information is consistent based on keywords, a quick judgment result can be obtained.
[0063] Furthermore, the peripheral device is simulated on the cloud desktop, and the test results are output after the simulation is completed, including:
[0064] According to the type of peripheral device, the device is redirected accordingly. After each simulated redirection of the peripheral device, the test results are recorded and saved to the first path.
[0065] As described above, storing the information of the three peripheral devices and the test results of simulating peripheral device usage locally enables automatic testing of peripheral device redirection on the cloud desktop.
[0066] The above-described automatic testing method and terminal for cloud desktop peripheral redirection of the present invention are applicable to automated testing schemes for cloud desktop peripheral redirection via scripts, thereby solving repetitive manual testing, improving testing accuracy, and reducing manpower input. The specific implementation methods are described below:
[0067] Example 1
[0068] Please refer to Figure 1 and Figure 3 An automated testing method for cloud desktop peripheral redirection includes the following steps:
[0069] S1. Obtain locally connected peripheral devices through the first script, and save the first peripheral information of the peripheral devices to the first local path.
[0070] In this embodiment, the premise is that after the terminal connects to the corresponding peripheral device, it is confirmed that the local system can normally recognize the connected peripheral device. The local system of the terminal can use scripts to automatically test whether the connected peripheral device can be used normally, confirm that the local system of the terminal can normally recognize the connected peripheral device, and write the usage feedback into a file and save it to the first path of the local system of the terminal.
[0071] In this embodiment, a first script is used to automatically execute command lines to obtain locally connected peripheral devices. After the first script is executed, the first peripheral information of the identified peripheral devices is obtained and the first peripheral information is saved to a first path on the local machine.
[0072] Specifically, the system obtains information about connected devices by automatically executing a Linux command line through a first script on the local terminal, writes the returned peripheral information to a file, and saves it to the first path of the local terminal system.
[0073] S2. Obtain the list of peripheral device information for redirection of internal and external devices on the cloud desktop through the second script, and save the second peripheral device information in the list of peripheral device information to the second path of the cloud desktop.
[0074] Specifically, step S2 includes the following steps:
[0075] The second script obtains the interface for the list of peripheral devices in the cloud desktop, iterates through the peripheral information corresponding to each interface, removes duplicate peripheral information to obtain the second peripheral information, and saves the second peripheral information to the second path of the cloud desktop.
[0076] S21. Using automated scripts, information is obtained from the cloud desktop's peripheral redirection list interfaces. By calling the interface corresponding to each function in the peripheral redirection list, the system iterates through each interface to obtain device information for USB redirection, disk redirection, camera redirection, and printer redirection lists, thus completing the operation of obtaining peripheral redirection list information. Using interfaces to obtain information is more stable, and the results will not be interfered with by external human factors.
[0077] S22. Filter duplicate peripheral devices. The USB redirection list contains all external USB devices connected to the terminal. At the same time, the disk redirection list contains the terminal's local system disk and USB storage devices, the camera redirection list contains USB cameras, and the printer redirection list contains USB printers. If the USB storage devices, USB cameras, and USB printers are duplicates of the devices in the USB redirection list, they are filtered out and grouped into one item.
[0078] S23. Return the peripheral information after filtering.
[0079] S24. Write the returned peripheral information to a file and save it to the second path of the cloud desktop.
[0080] S3. Obtain peripheral device information after redirection of internal and external devices in the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop.
[0081] S4. Determine whether the first peripheral information, the second peripheral information, and the third peripheral information are consistent. If so, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed.
[0082] S41. Send the second peripheral information and the third peripheral information stored in the second path to the first path.
[0083] Specifically, the third script automatically sends the second peripheral information and the third peripheral information stored in the second path to the first path.
[0084] S42. In the first path, keyword recognition is performed on the first peripheral information, the second peripheral information and the third peripheral information. If the recognition is consistent, the first peripheral information, the second peripheral information and the third peripheral information are consistent; otherwise, the first peripheral information, the second peripheral information and the third peripheral information are inconsistent.
[0085] Specifically, if the keyword "camera" is added to the camera, the keyword can be added according to the specific test type. If the keywords of the first peripheral information, the second peripheral information, and the third peripheral information are consistent, then return true and continue to the next step of the test; if they are inconsistent, return false, the test ends, the comparison result is output, and the comparison result document is saved to the first path of the terminal's local system.
[0086] When the first peripheral information, the second peripheral information, and the third peripheral information are consistent, the device is redirected according to the type of the peripheral device. After each simulated redirection of the peripheral device, the test results are recorded and saved to the first path.
[0087] Specifically, the use of peripheral devices is simulated within the cloud desktop, mainly simulating the use of USB keyboards and mice, USB storage devices, terminal local system disks, USB cameras, and USB printers within the cloud desktop; each simulated operation forms a separate function module, which is convenient for the main program to call, as well as for subsequent maintenance and modification.
[0088] In this embodiment, USB redirection is as follows: create a new document in the cloud desktop, specify the input content, save the document, and simulate keyboard input using the "k.tap_key" or "keybd_event" function and other functions;
[0089] Disk redirection is performed as follows: a file within the specified cloud desktop is copied, and the local system disk of the USB drive / terminal is opened for pasting. The "pexpect" library in Python is used to automatically execute the Linux "cp" command to copy the file and return whether the copy was successful. Different comparison methods are used to compare the file types. For example, when copying a folder, the number of files in the folder and the overall size are compared to determine if it is consistent with the source file. When copying a single file, the MD5 value is compared to determine if it is consistent with the source file.
[0090] Camera redirection is as follows: Open the camera software in the cloud desktop, simulate taking photos and recording screens respectively, read the placement path of photos and videos, and output them to the test results document. The camera can be automatically invoked to perform simulated operations by calling the cv2 library of Python.
[0091] Printer redirection is as follows: Open a specified file in the cloud desktop, perform a regular printing operation, and the cloud desktop will transfer the print job to the physical print driver of the local terminal system. The simulated printing operation can be accomplished by calling the "ShellExecute" library in Python.
[0092] Complete the peripheral redirection simulation test, output the test result document, and save the test result document to the first path of the terminal's local system. Then, confirm whether the corresponding file is output and verify its correctness. After the program finishes running, read the target address to confirm whether the corresponding file has been generated. If not, report an error and terminate the program, recording the error in the log. If so, read the test result document and compare it with the test program's execution results. If they match, save the test result document; otherwise, correct the errors to ensure the file's correctness.
[0093] Therefore, this technical solution can produce the following beneficial effects:
[0094] 1. Automate repetitive tests through scripts to reduce manpower and improve testing efficiency.
[0095] 2. The tests are consistent and repeatable; by using scripts for repeatable testing, the consistency of test results and execution content in subsequent versions can be guaranteed, thus achieving the effect of repeatable testing.
[0096] 3. Increase software trustworthiness; repeatable testing via scripts means that oversights and errors during execution depend entirely on the quality of the test script design; once the software passes robust automated testing, its trustworthiness will naturally increase.
[0097] 4. Facilitates later testing and maintenance. If new functions are added for peripheral redirection in the future, the addition can be completed by adding relevant functions and calling them in the main function. Compared with the original technology 2, there is no need to record scripts repeatedly.
[0098] 5. Reduce storage space usage: Using this solution to simulate cumbersome operation steps, the overall script file remains lightweight; compared with the original technology 2, it does not require recording operations to simulate redirection operations, thus significantly reducing the space occupied by the test program.
[0099] Example 2
[0100] The difference between this embodiment and Embodiment 1 is that it provides a specific application scenario:
[0101] In this embodiment, the test is conducted to determine whether the redirection is successful. Therefore, each redirection connects only one type of peripheral device: USB redirection connects to a USB keyboard and mouse, disk redirection connects to a USB flash drive and the terminal's local system disk, camera redirection connects to a USB camera, and printer redirection connects to a USB printer.
[0102] The local terminal system uses scripts to automatically test whether the connected peripheral devices can be used normally, confirm that the local terminal system can correctly recognize the connected peripheral devices, and write the usage feedback into a file and save it to the first path of the local terminal system.
[0103] Once the peripheral device information matches, proceed to the next step: simulate the use of the peripheral device within the cloud desktop.
[0104] 1. USB Redirection: Create a new document in the cloud desktop, specify the input content, save the document, and simulate keyboard input using the "k.tap_key" or "keybd_event" functions, as well as other functions:
[0105] If the specified content is entered in the document, it means that the USB redirected peripheral device can be used normally on the desktop;
[0106] If the document is saved successfully, return true, output the document save path, test process, and results to the test results document, and continue to the next step; if saving fails or other errors occur, return false and output the error information to the test results document, and continue to the next step.
[0107] 2. Disk Redirection: Specify a file within the cloud desktop for copying. Open the USB drive / terminal local system disk and paste the file. Use Python's "pexpect" library to automatically execute Linux's "cp" command to copy the file and return whether the copy was successful. Different comparison methods are used to compare the file types. For example, when copying a folder, the number of files in the folder and the overall size are compared to determine if it is consistent with the source file. When copying a single file, the MD5 value is compared to determine if it is consistent with the source file.
[0108] If the specified file exists on the USB flash drive / terminal local system disk and the file content size is the same, it means that the peripheral device that the disk is redirected can be used normally on the desktop.
[0109] If the copy and paste operation is successful, return true, output the test process and results to the test results document, and proceed to the next step; if the copy and paste operation fails or other errors occur, return false, output the error message to the test results document, and proceed to the next step.
[0110] 3. Camera Redirection: Open the camera software in the cloud desktop and simulate taking photos and recording screens. Read the location paths of the photos and videos and output them to the test results document. You can use the cv2 library in Python to automatically call the camera to perform simulated operations.
[0111] If there are corresponding photos or videos in the path of the test results document, it means that the peripheral device for camera redirection can be used normally on the desktop;
[0112] If the photo or screen recording is successful, return true, output the test process, test results, and photo / video placement path to the test results document, and continue to the next step; if the photo or screen recording fails or other errors occur, return false and output the error information to the test results document, and continue to the next step.
[0113] 4. Printer Redirection: Open a specified file in the cloud desktop and perform a regular printing operation. The cloud desktop will transfer the print job to the physical print driver of the local terminal system. The printing operation can be simulated by calling the "ShellExecute" library in Python.
[0114] If the printer connected to the local terminal can print the specified file, it means that the peripheral device that the printer is redirected to can be used normally on the desktop.
[0115] After receiving the task from the cloud desktop, the local printer driver performs the printing operation and returns the result (success / failure) to the cloud desktop after completing the printing operation.
[0116] If the cloud desktop receives a successful printing result from the local printing driver, it returns true, outputs the test process and results to the test result document, and continues to the next step; if the cloud desktop receives a printing failure result from the local printing driver or encounters other errors, it returns false and outputs the error information to the test result document, and continues to the next step.
[0117] Complete the peripheral redirection simulation test, output the test result document, and save the test result document to the first path of the terminal's local system; set the number of traversal loop tests for each device redirection according to the specific test situation, record the test results of each traversal loop test, output the test result document, and save the test result document to the first path of the terminal's local system.
[0118] After the initial testing, redirection tests for each device should be conducted to confirm whether the corresponding files are output. Specifically, for USB redirection, the correctness of saved documents should be confirmed; for disk redirection, the correctness and consistency of copied and pasted files should be confirmed; for camera redirection, the correctness and consistency of photos and videos should be confirmed; and for printer redirection, the correctness of the printer outputting paper documents should be confirmed.
[0119] After the program finishes running, it reads the target address to check if the corresponding file has been generated. If not, it reports an error and terminates, recording the error in the log. If the file has been generated, it reads the test result document and compares it with the test program's running results. If they match, it saves the test result document; otherwise, it corrects the errors to ensure the file's correctness.
[0120] Example 3
[0121] Please refer to Figure 2 An automatic test terminal 1 for cloud desktop peripheral redirection includes a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, it implements the various steps of an automatic test method for cloud desktop peripheral redirection according to Embodiment 1 or 2.
[0122] In summary, the present invention provides an automated testing method and terminal for cloud desktop peripheral redirection. Through scripts, it automatically acquires locally connected peripheral devices and a list of peripheral devices after redirection within the cloud desktop. It then acquires the peripheral device information after redirection and compares these three pieces of information. If they match, a simulated usage test of the peripheral device is performed. Therefore, automated testing via scripts reduces manpower, improves testing efficiency, and ensures test consistency and repeatability. The quality of the script determines the test quality. Automating repetitive tasks improves accuracy, testing efficiency, and the motivation of testers, which is beneficial for later testing and maintenance without requiring significant storage space.
[0123] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. An automatic testing method for cloud desktop peripheral redirection, characterized in that, Including the following steps: The first script is used to obtain locally connected peripheral devices and save the first peripheral information of the peripheral devices to a first local path: The first script is used to automatically execute command lines to obtain locally connected peripheral devices. After the first script is executed, the first peripheral information of the identified peripheral devices is obtained and the first peripheral information is saved to a first local path. The second script retrieves a list of peripheral device information for redirecting internal and external devices on the cloud desktop, and saves the second peripheral information from the list to a second path on the cloud desktop. Specifically, the script obtains the interface for retrieving the list of internal and external device information for the cloud desktop, iterates through the peripheral information corresponding to each interface, removes duplicates from the traversed peripheral information to obtain the second peripheral information, and saves the second peripheral information to a second path on the cloud desktop. This is achieved by calling the interface corresponding to each function in the peripheral redirection list, thereby iterating through each interface to obtain the device information for USB redirection, disk redirection, camera redirection, and printer redirection, thus completing the operation of obtaining the peripheral redirection list information. Obtain peripheral device information after redirection of internal and external devices on the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop; Determine whether the information of the first peripheral device, the second peripheral device, and the third peripheral device are consistent. If they are, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed. The peripheral device is simulated on the cloud desktop. After the simulation is completed, the test results are output, including: redirecting the use of the device according to the type of the peripheral device; recording the test results after each simulated redirection of the peripheral device; and saving the test results to the first path. Specifically, the use of peripheral devices is simulated within the cloud desktop, and each simulated operation forms a separate function module, which is easy for the main program to call.
2. The automatic testing method for cloud desktop peripheral redirection according to claim 1, characterized in that, The determination of whether the first peripheral information, the second peripheral information, and the third peripheral information are consistent includes: Send the second peripheral information and the third peripheral information stored in the second path to the first path; In the first path, keyword recognition is performed on the first peripheral information, the second peripheral information, and the third peripheral information. If the recognition is consistent, the first peripheral information, the second peripheral information, and the third peripheral information are consistent; otherwise, the first peripheral information, the second peripheral information, and the third peripheral information are inconsistent.
3. An automatic test terminal for cloud desktop peripheral redirection, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: The first script is used to obtain locally connected peripheral devices and save the first peripheral information of the peripheral devices to a first local path: The first script is used to automatically execute command lines to obtain locally connected peripheral devices. After the first script is executed, the first peripheral information of the identified peripheral devices is obtained and the first peripheral information is saved to a first local path. The second script retrieves a list of peripheral device information for redirecting internal and external devices on the cloud desktop, and saves the second peripheral information from the list to a second path on the cloud desktop. Specifically, the script obtains the interface for retrieving the list of internal and external device information for the cloud desktop, iterates through the peripheral information corresponding to each interface, removes duplicates from the traversed peripheral information to obtain the second peripheral information, and saves the second peripheral information to a second path on the cloud desktop. This is achieved by calling the interface corresponding to each function in the peripheral redirection list, thereby iterating through each interface to obtain the device information for USB redirection, disk redirection, camera redirection, and printer redirection, thus completing the operation of obtaining the peripheral redirection list information. Obtain peripheral device information after redirection of internal and external devices on the cloud desktop, and save the redirected third peripheral device information to the second path of the cloud desktop; Determine whether the information of the first peripheral device, the second peripheral device, and the third peripheral device are consistent. If they are, simulate the peripheral device on the cloud desktop and output the test results after the simulation is completed. The peripheral device is simulated on the cloud desktop. After the simulation is completed, the test results are output, including: redirecting the use of the device according to the type of the peripheral device; recording the test results after each simulated redirection of the peripheral device; and saving the test results to the first path. Specifically, the use of peripheral devices is simulated within the cloud desktop, and each simulated operation forms a separate function module, which is easy for the main program to call.
4. The automatic test terminal for cloud desktop peripheral redirection according to claim 3, characterized in that, The determination of whether the first peripheral information, the second peripheral information, and the third peripheral information are consistent includes: Send the second peripheral information and the third peripheral information stored in the second path to the first path; In the first path, keyword recognition is performed on the first peripheral information, the second peripheral information, and the third peripheral information. If the recognition is consistent, the first peripheral information, the second peripheral information, and the third peripheral information are consistent; otherwise, the first peripheral information, the second peripheral information, and the third peripheral information are inconsistent.
Citation Information
Patent Citations
Virtual desktop USB (Universal Serial Bus) storage peripheral management and control method and system
CN105069383A
Equipment access processing method, equipment access processing device and mobile terminal
CN107341122A