CN114385500A - Serial port based test automation method and electronic equipment - Google Patents

Serial port based test automation method and electronic equipment Download PDF

Info

Publication number
CN114385500A
CN114385500A CN202210030952.2A CN202210030952A CN114385500A CN 114385500 A CN114385500 A CN 114385500A CN 202210030952 A CN202210030952 A CN 202210030952A CN 114385500 A CN114385500 A CN 114385500A
Authority
CN
China
Prior art keywords
serial port
test
system software
target machine
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210030952.2A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongling Zhixing Chengdu Technology Co ltd
Original Assignee
Zhongling Zhixing Chengdu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongling Zhixing Chengdu Technology Co ltd filed Critical Zhongling Zhixing Chengdu Technology Co ltd
Priority to CN202210030952.2A priority Critical patent/CN114385500A/en
Publication of CN114385500A publication Critical patent/CN114385500A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0002Serial port, e.g. RS232C

Landscapes

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

Abstract

The invention relates to a serial port-based test automation method and electronic equipment, wherein the method is applied to a test system, the test system runs on a test machine, and the test machine is connected with a serial port of a target machine; the method comprises the following steps: the test system reads the serial port data of the target machine and obtains the full life cycle information of the system software of the target machine; and the test system writes serial port data to control the target machine system software and detects the execution result of the target machine system software. The technical scheme is used for solving the problem that the existing automatic execution method of the test agent cannot well meet the requirements of the system test of the embedded system software, realizing the sensing and control of the whole life cycle of the system software and realizing the system test execution automation system facing the complex embedded system software.

Description

Serial port based test automation method and electronic equipment
Technical Field
The present disclosure relates to the field of automatic testing, and in particular, to a serial port-based test automation method and an electronic device.
Background
The system software refers to a system for controlling and coordinating hardware equipment and supporting the running of application software, and comprises an operating system, a Hypervisor and the like. With the increasing complexity of embedded systems, especially the development of embedded virtualization technologies, the basic role of system software becomes more and more prominent.
At present, the test execution automation of the embedded system software system mostly adopts a test agent method. And the test main body is operated on the opposite terminal machine and is responsible for test environment management, test case analysis, test logic issuing, test result analysis and the like. And running a test agent in the target machine, performing test execution according to the test logic issued by the test main body, and collecting and reporting an execution result. The two communicate through a network or data line.
Usually, the operation of the test agent depends on the system software, so the test agent is not known and controllable to the system software before the test agent is started, and the full life cycle of the system software cannot be covered. Such as ssh (secure Shell protocol) service based test agents, are limited in operating system programming and kernel loading periods. In addition, when the system software has a serious failure and crash, the test agent is already killed, so that the real-time crash abnormal information cannot be captured, and the positioning and analysis of the failure are not facilitated. Thirdly, the situation that a plurality of system software runs simultaneously in the embedded system is increasingly common, and the test agent cannot be well expanded and adapted to all the system software.
Therefore, the automatic execution method of the test agent at present cannot well meet the requirement of the embedded system software system test.
Disclosure of Invention
The invention aims to provide a serial port-based test automation method and electronic equipment, which are used for solving the problem that the existing automatic execution method of a test agent cannot well meet the requirements of system test of an embedded system software, realizing sensing and control of the whole life cycle of the system software and realizing a system test execution automation system facing complex embedded system software.
In order to achieve the above object, a first aspect of the present disclosure provides a serial port-based test automation method, which is applied to a test system, where the test system runs on a test machine, and the test machine is connected to a serial port of a target machine; the method comprises the following steps:
the test system reads the serial port data of the target machine and obtains the full life cycle information of the system software of the target machine;
and the test system writes serial port data to control the target machine system software and detects the execution result of the target machine system software.
Optionally, the reading, by the test system, of the serial port data of the target machine to obtain the full life cycle information of the system software of the target machine includes:
and the test system collects real-time abnormal information when the system software of the target machine fails and crashes through the serial port data.
Optionally, the writing of serial port data into the test system to control the target machine system software and detecting the execution result of the target machine system software includes:
the test system writes a command into a serial port;
and after the test system writes the command into the serial port, acquiring a command execution result of the target machine system software, and judging the command execution result of the target machine system software.
Optionally, a timeout mechanism is introduced when the command execution result of the target machine system software is obtained, and whether the target machine system software command execution is timeout is determined.
Optionally, the command sequentially includes a power-on command, a bootloader command, a hypervisor command, a Linux shell command, a Linux binary program, and a Linux script command of the target machine.
Optionally, in the process of reading the serial port data each time, judging whether the serial port data has a system software abnormal characteristic character string, thereby judging whether the target machine system software is abnormal; wherein, different system software corresponds to different abnormal characteristic character strings.
Optionally, the writing of serial port data into the test system to control the target machine system software and detecting the execution result of the target machine system software includes:
when executing commands in different system software of the target machine, writing a switching command to switch the serial port terminal;
and checking whether the serial port data has a new characteristic character string of the system software or not so as to judge whether the switching of the serial port terminal is completed or not.
Optionally, the method further includes:
and storing the serial port data to form a test execution record.
A second aspect of the disclosure provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect.
A third aspect of the present disclosure provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect.
The technical scheme provided by the disclosure realizes the automation of the test execution of the embedded system software system, overcomes the defects of the prior art in the aspects of the whole life cycle and the reliability of the system software, and realizes the system test automation system facing the complex embedded system software. The Hypervisor multi-virtual machine system software oriented system test execution automation system based on the technical scheme of the disclosure realizes system test automation including bootloader, Hypervisor and a plurality of Linux virtual machine operating systems (including android).
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a schematic diagram illustrating an implementation of a test system and a target machine connection in accordance with an exemplary embodiment;
FIG. 2 is a schematic flow diagram illustrating a serial-based test automation method in accordance with an illustrative embodiment;
FIG. 3 is a schematic diagram of a test flow shown in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
In the embodiment of the disclosure, the system test execution of the embedded system software is performed by using the serial port terminal, and the test execution behavior is automated.
In the embodiment of the present disclosure, an implementation of a test system is first described.
FIG. 1 is a schematic diagram illustrating an implementation of a test system and connection to a target machine according to an exemplary embodiment. The test system runs on a test machine, and the test machine is connected with a serial port of a target machine; the test system comprises a plurality of module functions, and in the specification, implementation schemes of relevant parts of the disclosure are described and divided into a communication layer, a logic layer and a case layer.
The communication layer realizes the operation methods of the serial port, such as connection, disconnection, reading, writing and the like of the serial port.
The logic layer realizes methods of system software selection, command execution, command result acquisition, abnormal state judgment and the like. In addition, auxiliary functions such as timeout mechanisms, log persistence, etc. are also implemented herein.
The use case layer realizes a method facing user operation affairs, such as restarting a single board, programming mirror images, logging in Linux, downloading files, executing commands to obtain execution results and the like. Therefore, the test personnel can conveniently edit the test cases.
In the embodiment of the disclosure, the system software includes bootloader, Hypervisor, and a plurality of Linux virtual machine operating systems (including android).
Fig. 2 is a schematic flowchart of a serial port-based test automation method according to an exemplary embodiment, and includes the following steps.
Step 201, the test system reads the serial port data of the target machine and obtains the full life cycle information of the system software of the target machine.
The full life cycle information includes, but is not limited to, information of an operating system programming and kernel loading period, and crash exception information when system software is in a serious failure crash.
Step 202, the test system writes serial port data to control the target machine system software and detects the execution result of the target machine system software.
In the embodiment of the disclosure, the serial port is the standard configuration of the embedded system software, and the test system based on the serial port can be well expanded to adapt to the complex embedded system software. The Hypervisor multi-virtual machine system software oriented system test execution automation system based on the technical scheme of the disclosure realizes system test automation including bootloader, Hypervisor and a plurality of Linux virtual machine operating systems (including android).
In addition, the test case script can be conveniently packaged, the result is a manual operation process similar to a serial port, and the test case script is very easy to understand and maintain.
Next, the interaction of the test system with the target machine will be explained. The interaction between the test system and the target machine includes the following actions, which are only illustrative and not limiting in the embodiments of the present disclosure.
In an exemplary embodiment, the commands are executed in the target machine system software: and writing the command character string into the serial port.
Acquiring the execution result of the system software command of the target machine: and reading new data from the serial port.
Judging the execution result of the system software command of the target machine: and checking whether the serial port data has a result characteristic character string.
Judging the overtime of the execution of the system software command of the target machine: and introducing a time-out mechanism when the command execution result is obtained.
In another exemplary embodiment, determining whether the target machine system software is abnormal: and checking whether the serial port data has abnormal characteristic character strings.
In another exemplary embodiment, the commands are executed in different system software of the target: and executing the command after switching the serial port terminal (writing the switching character string into the serial port, and writing the command character string into the serial port after the execution is finished).
Judging whether the switching of the serial port terminal is completed: and checking whether the serial port data has the characteristic character string of the new system software (each system software has different characteristic character strings).
In the embodiment of the disclosure, the test system stores the serial port data in the test process to form a complete test execution record.
In the embodiment of the disclosure, the system software can be controlled in the whole life cycle by matching with the programmable power supply controller and the mirror image programming tool.
Next, by way of example, a serial port-based test automation method in the embodiment of the present disclosure is described, and in an interaction process between a test system and a target machine, commands sequentially include a power-on command, a bootloader command, a hypervisor command, a Linux shell command, a Linux binary program, and a Linux script command of the target machine. In the embodiment of the present disclosure, a test flow "power on- _ bootloader burning- _ reboot single board- _ Linux starting- _ execute the diameter-a command- _ determine whether the version matches the expectation" is taken as an example for explanation. As shown in fig. 3, the following steps are included.
Step 1, sending a power-on command to a power supply controller.
And 2, reading serial port data until a bootloader prompting characteristic character string appears.
And 3, writing the carriage return symbol into the serial port.
And 4, reading the serial port data until the bootloader shell characteristic character string appears.
And 5, writing the burning mode command character string into the serial port.
And 6, calling a mirror image programming tool to perform programming.
And 7, writing Ctrl + C into the serial port, and ending the burning mode command.
And 8, reading the serial port data until the bootloader shell characteristic character string appears.
And 9, writing the reset into the serial port.
And step 10, reading serial port data until a Linux login characteristic character string appears.
And 11, writing the password into the serial port.
And step 12, reading the serial port data until a Linux shell characteristic character string appears.
And step 13, writing the serial port into the diameter-a.
And step 14, reading the serial port data until a Linux shell characteristic character string appears.
Step 15, extracting version information from the serial port data of the previous step,
step 16, comparison with expected results.
It should be noted that, the steps including reading the serial port data all have timeout judgment, and once the step is overtime, the test is finished and fails.
It should be noted that, in the step of reading the serial port data, it is determined whether the serial port data has a system software abnormal characteristic character string. Of course, bootloader and linux have different exception characteristic strings.
Through the scheme, the key point of the method is that the method for automatically testing and executing the embedded system software system based on the serial port and the implementation scheme of the testing system are provided, the defects of the prior art in the aspects of the whole life cycle and the reliability of the system software are overcome, and the system testing automation system facing the complex embedded system software is implemented. The Hypervisor multi-virtual machine system software oriented system test execution automation system based on the technical scheme of the disclosure realizes system test automation including bootloader, Hypervisor and a plurality of Linux virtual machine operating systems (including android).
Fig. 4 is a block diagram illustrating an electronic device 400 according to an example embodiment. As shown in fig. 4, the electronic device 400 may include: a processor 401 and a memory 402. The electronic device 400 may also include one or more of a multimedia component 403, an input/output (I/O) interface 404, and a communications component 405.
The processor 401 is configured to control the overall operation of the electronic device 400, so as to complete all or part of the steps in the serial port-based test automation method. The memory 402 is used to store various types of data to support operation at the electronic device 400, such as instructions for any application or method operating on the electronic device 400 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 402 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 403 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 402 or transmitted through the communication component 405. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 404 provides an interface between the processor 401 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 405 is used for wired or wireless communication between the electronic device 400 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 405 may therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the serial port based test automation methods described above.
In another exemplary embodiment, a computer readable storage medium is also provided that includes program instructions which, when executed by a processor, implement the steps of the serial-based test automation method described above. For example, the computer readable storage medium may be the memory 402 described above that includes program instructions that are executable by the processor 401 of the electronic device 400 to perform the serial port based test automation method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the serial-based test automation method described above when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A serial port based test automation method is applied to a test system and is characterized in that the test system runs on a test machine, and the test machine is connected with a serial port of a target machine; the method comprises the following steps:
the test system reads the serial port data of the target machine and obtains the full life cycle information of the system software of the target machine;
and the test system writes serial port data to control the target machine system software and detects the execution result of the target machine system software.
2. The method of claim 1, wherein the step of reading the serial port data of the target machine by the test system to obtain the full life cycle information of the system software of the target machine comprises:
and the test system collects real-time abnormal information when the system software of the target machine fails and crashes through the serial port data.
3. The method of claim 1, wherein the test system writes serial data to control the target machine system software and detects the execution result of the target machine system software, comprising:
the test system writes a command into a serial port;
and after the test system writes the command into the serial port, acquiring a command execution result of the target machine system software, and judging the command execution result of the target machine system software.
4. The method of claim 3, wherein a timeout mechanism is introduced when the command execution result of the target machine system software is obtained, and whether the target machine system software command execution is timeout is determined.
5. The method of claim 3, wherein the commands comprise, in order, a power-up of the target machine, a bootloader command, a hypervisor command, a Linux shell command, a Linux binary program, and a Linux script command.
6. The method of claim 1, wherein in the process of reading the serial port data each time, whether a system software abnormal characteristic character string exists in the serial port data is judged, so that whether the system software of the target machine is abnormal is judged; wherein, different system software corresponds to different abnormal characteristic character strings.
7. The method of claim 1, wherein the test system writes serial data to control the target machine system software and detects the execution result of the target machine system software, comprising:
when executing commands in different system software of the target machine, writing a switching command to switch the serial port terminal;
and checking whether the serial port data has a new characteristic character string of the system software or not so as to judge whether the switching of the serial port terminal is completed or not.
8. The method of any one of claims 1-7, further comprising:
and storing the serial port data to form a test execution record.
9. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 8.
CN202210030952.2A 2022-01-12 2022-01-12 Serial port based test automation method and electronic equipment Pending CN114385500A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210030952.2A CN114385500A (en) 2022-01-12 2022-01-12 Serial port based test automation method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210030952.2A CN114385500A (en) 2022-01-12 2022-01-12 Serial port based test automation method and electronic equipment

Publications (1)

Publication Number Publication Date
CN114385500A true CN114385500A (en) 2022-04-22

Family

ID=81201440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210030952.2A Pending CN114385500A (en) 2022-01-12 2022-01-12 Serial port based test automation method and electronic equipment

Country Status (1)

Country Link
CN (1) CN114385500A (en)

Similar Documents

Publication Publication Date Title
CN104794014A (en) System operation method and intelligent terminal
CN108431781B (en) Self-diagnosis and automatic diagnostic data collection of device driver detected errors
EP3572933B1 (en) Updating firmware via a remote device
CN114237676B (en) FPGA logic updating method, device, equipment and readable storage medium
CN112199284A (en) Program automation testing method and corresponding device, equipment and medium
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
CN112015587B (en) Method and device for enhancing reliability of operating system
CN110459260B (en) Automatic test switching device, method and system
CN109491825B (en) Method, device, storage medium and terminal for positioning abnormal starting problem
CN114385500A (en) Serial port based test automation method and electronic equipment
CN114116034B (en) Distributed brushing method and device
CN115168146A (en) Anomaly detection method and device
CN113051088B (en) Program loading method, device, equipment and computer readable medium
CN111026651B (en) Test method, device, storage medium and electronic equipment
CN114496053A (en) Data anomaly detection method, device and equipment and computer readable storage medium
CN107220149B (en) Method and system for capturing debugging data of wireless communication module in Linux system under Windows
CN111309358A (en) CPLD (Complex programmable logic device) firmware upgrading method, device, equipment and readable storage medium
US11714744B2 (en) System and method for diagnosing a computing device in safe mode
CN113641524B (en) Reset method, device and equipment for single board starting overtime and readable storage medium
CN113986635B (en) BIOS testing method, system, storage medium and device
CN111562956B (en) Theme switching method and device for terminal, storage medium and electronic equipment
TWI757923B (en) Pre-boot execution environment determination system and method thereof
US20230050723A1 (en) Device testing arrangement
CN115129517A (en) BIOS option fault recovery method, device, equipment and storage medium
CN115774627A (en) System crash processing method and device for managed and controlled equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination