CN113392006A - Method and equipment for monitoring automatic test logs by using capsules - Google Patents

Method and equipment for monitoring automatic test logs by using capsules Download PDF

Info

Publication number
CN113392006A
CN113392006A CN202110674628.XA CN202110674628A CN113392006A CN 113392006 A CN113392006 A CN 113392006A CN 202110674628 A CN202110674628 A CN 202110674628A CN 113392006 A CN113392006 A CN 113392006A
Authority
CN
China
Prior art keywords
test
case
execution
log
module
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.)
Granted
Application number
CN202110674628.XA
Other languages
Chinese (zh)
Other versions
CN113392006B (en
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.)
Inspur Cisco Networking Technology Co Ltd
Original Assignee
Inspur Cisco Networking 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 Inspur Cisco Networking Technology Co Ltd filed Critical Inspur Cisco Networking Technology Co Ltd
Priority to CN202110674628.XA priority Critical patent/CN113392006B/en
Publication of CN113392006A publication Critical patent/CN113392006A/en
Application granted granted Critical
Publication of CN113392006B publication Critical patent/CN113392006B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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

Landscapes

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

Abstract

The application discloses a method for monitoring an automatic test log by using capsules, which is used for solving the technical problem of how to quickly obtain an execution log of a test case on the premise of not losing key information. The method comprises the following steps: determining a case module based on the test task; the case module comprises a plurality of test cases related to the test tasks; executing the case module and recording the execution time of the case module; when any test case under the case module is executed, recording the hierarchical structure of the test case; capturing all standard output stream data generated in the execution process of the test case based on capsys, and generating an execution log of the test case based on the standard output stream data; the naming of the execution log is related to the execution time of the case module and the hierarchical structure of the test case. The method reserves the key information in the test task, and generates the execution log of the test case after the test case is executed.

Description

Method and equipment for monitoring automatic test logs by using capsules
Technical Field
The application relates to the technical field of log monitoring, in particular to a method and equipment for monitoring an automatic test log by using capsules.
Background
During the automated testing of switches, the entire task generates a large number of test logs, often in megabytes and above. The test logs are generally stored in a server where jenkins are located, and all logs of the whole test task can be acquired and backed up in an incremental manner.
However, when a log generated by executing a certain test case is obtained, the log generated by the test case may be searched or regularly matched in all logs by presetting a keyword. However, this method is too cumbersome to search and adds a lot of extra work, which makes it very difficult to obtain the operation condition of the equipment and locate the position where the problem occurs. Therefore, how to enable a developer or a manager to quickly obtain an execution log of a test case on the premise of ensuring effective information so as to improve the efficiency of positioning is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the application provides a method and equipment for monitoring an automatic test log by using capsules, which are used for solving the technical problem of how to enable a developer or a manager to quickly obtain an execution log of a test case on the premise of keeping effective information.
In one aspect, an embodiment of the present application provides a method for monitoring an automated test log using capsys, including: determining a case module based on the test task; the case module comprises a plurality of test cases related to the test tasks; executing the use case module and recording the execution time of the use case module; when any test case under the case module is executed, recording the hierarchical structure of the test case; the hierarchical structure of the test case is related to the name of the test case and the directory of the test case; capturing all standard output stream data generated by the test case in the execution process based on capsys, and generating an execution log of the test case based on the standard output stream data; and the naming of the execution log is related to the execution time of the case module and the hierarchical structure of the test case.
The method for monitoring the log of the automated test provided by the embodiment of the application realizes that one test case is executed, namely the execution log corresponding to one test case is generated instead of the log of the whole test task, so that the test problem is positioned more quickly and accurately. In addition, key information such as command configuration of the automatic test of the switch and content concerned by test management personnel is reserved in the execution log of the test case, and the effect of quickly acquiring the execution log of the test case on the premise of ensuring the key information of the execution log is achieved. In addition, the execution log naming of the test cases in the embodiment of the application is related to the execution time of the case module and the hierarchical structure (name, directory and the like of the test cases) of the test cases, so that the execution log of each test case corresponds to each test case and has uniqueness.
In an implementation manner of the present application, before executing the use case module, the method further includes: carrying out initial configuration check on a test environment corresponding to the test task; and when it is determined that the initial configuration file config.bak does not exist in the test environment, configuring the test environment to generate a config.bak file.
In an implementation manner of the present application, after the use case module is executed, the method further includes: calculating test resources required by the case module during execution; wherein the test resources include at least any one or more of test instruments, test equipment, and test ports.
In one implementation manner of the present application, after computing the test resources required by the use case module when executed, the method further includes: carrying out topology inspection by taking the use case module as a unit; under the condition that the topology check fails, skipping the case module and generating topology abnormal information; wherein the topology check includes connection checks between the test equipment and the test equipment, and between the test equipment and the test meter.
In one implementation of the present application, the method further comprises: determining that the checking result of the topology checking is a pass checking; performing configuration check on the test equipment by taking the test case as a unit, and if the configuration check is passed, executing the test case; and otherwise, after the configuration of the test equipment is modified to an initial configuration file config.
In an implementation manner of the present application, capturing all standard output stream data generated by the test case in an execution process based on capsys, and generating an execution log of the test case based on the standard output stream data specifically includes: generating a capture log coroutine at the outermost layer of the test case based on capsys; wherein, the scope of the log capturing coroutine is all the testing steps of the test case; when the test case is monitored to start to execute, controlling the capture log routine to start to capture standard output stream data and standard error stream data generated in the execution process of the test case, and caching the standard output stream data and the standard error stream data; after monitoring that all the test steps in the test case are executed, ending the log capturing coroutine; and writing the cached standard output stream data and standard error stream data into an execution log of the test case.
According to the method for monitoring the log of the automated test, the cut test case execution log can be obtained locally when the test case is executed directly, so that the execution of the test case and the execution log generation of the test case are performed locally and synchronously; the quality of the product can be known quickly, the efficiency of automatic test result positioning is improved, and the test cost is reduced. And the execution log of the test case can be independently obtained according to the hierarchical structure of the test case, wherein the execution log comprises test equipment configuration, test instrument configuration, test case execution result, executed test topology and the like, and the key information of the test case, such as the execution process, the configuration details and the like, is completely stored.
In one implementation of the present application, the method further comprises: judging whether all test cases under the case module are executed completely; under the condition that all test cases under the case module are completely executed, generating a test report of the case module; and uploading the test report of the case module and the execution logs of all the test cases to a test website.
In one implementation of the present application, the method further comprises: determining the test case number which fails to be executed in the test report of the case module; and inquiring an execution log corresponding to the test case with execution failure on the test website based on the test case number.
In one implementation manner of the present application, the script design level of the test case is a class; the design level of all test steps in the use case is a function.
In another aspect, an embodiment of the present application further provides an apparatus for monitoring an automated test log using caps, including: a processor; and a memory having executable code stored thereon that, when executed, causes the processor to perform a method of monitoring automated test logs using capsys as described above.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flowchart of a method for monitoring an automated test log using capsys according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for generating a test case execution log according to an embodiment of the present disclosure;
fig. 3 is a schematic internal structural diagram of a device for monitoring an automated test log by using capsys according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In automated testing of switches, the completion of the entire task execution results in a large test log, often in megabytes and above. The logs of the test cases are generally stored in a server where jenkins are located, all logs of the whole test task can be acquired and backed up by an incremental method, but the logs are large in file size and complex in data, so that managers and developers are not facilitated to quickly acquire the execution process of the test cases, and the efficiency of positioning problems is reduced.
Although the subject term can be preset, and then a certain log generated by executing a test case can be obtained by searching or regular matching in all logs, the searching is too tedious and the workload is additionally increased, so that the operation condition of the equipment is very difficult to obtain and the position where the problem occurs is difficult to locate, and the follow-up problem tracking, locating and maintaining are not facilitated. The execution process of the scheme comprises the steps of obtaining a log file of the whole test task in an incremental mode in a remote synchronous rsync mode, and then obtaining the log file corresponding to each type of theme by adding the theme words to execute a clustering algorithm. There are two disadvantages to this process: firstly, a test log file is synchronously acquired, a network communication state is constantly kept in the synchronization process depending on a backup server and a log generating server, and the log generated in the process is possibly lost; secondly, the number and accuracy of the subject terms and the characteristics of the selected clustering algorithm influence the actual convergence effect, so that the obtained logs are incomplete or redundant.
Moreover, the automatic testing of the switch is often performed in a rolling manner, each testing task generates a large amount of log information every day, and how to present the key information to the relevant personnel in the most intuitive manner on the premise of keeping the valid information is a problem to be solved urgently.
The embodiment of the application provides a method and equipment for monitoring an automatic test log by using capsules, wherein by designing a log capture protocol, an execution log corresponding to a test case is generated after the execution of the test case is finished, and key information such as equipment configuration, port configuration and the like is reserved in the log. The technical effect that the test management personnel can quickly acquire the execution log of the test case on the premise of ensuring the key information in the test task is achieved.
The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for monitoring an automated test log by using capsys according to an embodiment of the present disclosure. It should be noted that the log monitoring process of the automatic test is performed in real time in the automatic test process of the equipment such as the switch, and therefore, the embodiment of the present application describes the monitoring process of the test case execution log in detail based on the automatic test process.
As shown in fig. 1, the basic flow of monitoring the case execution log in the automated testing process is as follows:
1) jenkins starts a test task and executes a specified use case module according to requirements.
Jenkins is an open source software project, and is a continuous integration tool developed based on Java for monitoring continuous and repeated work. The automatic testing process of the switch in the embodiment of the application is realized under the Jenkins project.
It should be noted that the case module in the embodiment of the present application includes a plurality of test cases related to a test task. That is, one case module corresponds to a plurality of test cases, and the automatic testing of the switch is completed based on the plurality of test cases. It should be further noted that one or more use case modules may be used in the automatic test process of the switch, which is determined according to a specific test task.
2) After a test task starts, firstly, carrying out initial configuration check on a test environment, and mainly checking whether an initial configuration file, namely a config. If yes, executing the next step; and otherwise, correspondingly configuring the test environment to generate an initial configuration file config.
Bak file contains configuration information under test environment corresponding to test task, i.e. information of test equipment version number, test port information, adaptation system, etc. In the case of lacking configuration information, the test task cannot be completed, and therefore, in the embodiment of the application, after the use case module is determined, whether the configuration information is complete, that is, whether an initial configuration file exists is detected, and in the case of not having the initial configuration file, the test environment is configured to generate the configuration file.
It will be apparent to those skilled in the art that the file with the suffix bak is a backup file, and after the content of the original configuration file is modified, the modified content is saved, so that the content before modification is automatically saved as the backup file with the suffix bak (if the backup function is set). If the content before modification is to be viewed or restored, the bak file is needed. bak backed-up files, which are auxiliary files created, typically automatically or by command, that contain the most recent version of a file and have the same file name as the file, are typically securely deletable.
3) The test case is executed by using the case module as a unit, the execution time of the case module is recorded, and then the test resources required by the module are occupied by calculation.
After determining that the initial configuration file exists, it is determined that a testing task may be performed. The test case in the embodiment of the application is executed by using the case module as a unit, so that the execution time of the case module is recorded when the case module is executed, and the execution time is kept consistent with the case module in the execution log of the subsequently generated test case.
Further, after the use case module starts to be executed, the test resources occupied by the use case module are calculated or determined, so that the subsequent topology check can be conveniently carried out. In one embodiment of the application, the test resources include at least any one or more of: test equipment, test instruments, test ports and the like.
4) Using the case module as a unit to carry out topology check; if the test passes, executing all test cases under the case module; otherwise, skipping the case module, throwing out the exception and giving out the detailed information of the failure of the topology check.
After the test resources are determined in the above steps, the topology inspection is performed on the test resources by taking the use case module as a unit. It should be noted that, the topology inspection in the embodiment of the present application is mainly a topology inspection between the test device and the test device, and between the test device and the test instrument, so as to determine that the connection relationship of the test resource is correct, and a test task can be performed under the test resource.
Specifically, if the topology check is passed, the test case under the case module is started to be executed, and an actual test process is performed; if the topology check fails, it indicates that there is an erroneous connection between the test equipment and/or between the test equipment and the test instrument, and at this time, the test task cannot be performed, or the test result of the test task is easily inaccurate.
Further, under the condition that the topology check between the test equipment and/or between the test equipment and the test instrument is not passed, the case module is skipped, namely, the case module is refused to be executed, abnormal information is generated, and detailed information of topology check failure is given, so that a test manager can modify the connection mode or the communication path in time.
5) Taking a test case as a unit for configuration inspection; and if the test case passes the check, executing the test case, otherwise, after the configuration of the test equipment is modified to configure the initial configuration, executing the test case.
In the embodiment of the application, configuration inspection is performed twice, wherein one time is to use a use case module as a unit, and is mainly to inspect initial configuration information so as to determine that the use case module can be executed under the configuration information; the other time is to perform configuration check by taking the test case as a unit. Before the test case is executed, configuration check is firstly carried out, and if the check is passed, the test case can be executed under the current configuration information or configuration file; if the check is not passed, the test case cannot be executed, and at this time, the configuration information of the test equipment or the test environment needs to be modified to modify the current configuration information into the initial configuration information, so that the execution of the test case can be realized.
6) And recording the hierarchical structure of the test case when the test case is started to be executed, and taking the hierarchical structure of the test case, the execution time of a case module and the like as the components for naming the execution log to ensure the uniqueness of the execution log, namely one log corresponds to one test case, so that the result of a test report is strongly supported, and the follow-up problems are conveniently tracked and positioned. And after the test case is executed, sequentially writing the captured standard output stream data into an execution log of the test case.
And after the initial test environment inspection, the topology inspection of the test equipment and the test instrument and the test case configuration inspection are passed, starting to execute a plurality of test cases under the case module. It should be noted that a plurality of test cases under the case module may be executed in sequence.
Furthermore, when any test case under the case module is executed, the hierarchical structure of the test case is recorded. The hierarchical structure of the test case in the embodiment of the application mainly refers to information such as the name of the test case, the directory of the test case, and the like. The naming composition of the execution log in the embodiment of the application comprises the execution time of the case module and the hierarchical structure of the test case, so that the execution log corresponding to the test case in the same case module is consistent with the case module; moreover, naming is performed by considering the hierarchical structure of the test cases, so that the execution logs of the test cases can be in one-to-one correspondence with the test cases. It should be noted that the names of the test cases in the embodiment of the present application are unique, that is, each of the plurality of test cases in one case module has a different name, so that the execution logs corresponding to the plurality of test cases in one case module are not confused.
Furthermore, after a test case under the reuse case module is executed, writing the standard output stream data captured by the capsys into the execution log corresponding to the test case to obtain the execution log of the test case. For a detailed generation process of the execution log of the test case, refer to fig. 2 and related description, which are not described herein again in this embodiment of the present application.
7) And judging whether the test cases under the case module are all executed, if the test cases are executed, executing the next step, and otherwise, circulating the step 5 and the step 6.
After a test case is executed, whether the test cases under the one-time case module are all executed is judged. If the execution is finished, continuing to execute the next step; and if the execution is not completed, the other test cases of the case module are continuously executed until all the test cases under the case module are executed.
It should be noted that, in the embodiment of the present application, after a test case is executed, an execution log of the test case is generated. That is to say, the execution log in the embodiment of the application is not the execution log corresponding to the whole test task or the whole case module, but the execution log corresponding to a plurality of test cases one by one, so that a test manager can conveniently and quickly search the execution log of a certain test case, and the efficiency of positioning test problems is further improved.
8) And generating a test report of the case module.
After the multiple test cases under the case module are all executed, a test report corresponding to the case module is generated. It should be noted that the test report herein is used to characterize the completion of the test task and the problems existing in the test process, and is not the same as the execution log corresponding to the test case.
9) And uploading all test results, such as test reports and execution logs of test cases, to a test website by using a test tool.
After the test report of the case module pair and the execution logs corresponding to the plurality of test cases are obtained, the test report is used as a test result and is uploaded to a test website together, so that test managers can record and check the execution condition of the test task conveniently.
10) And inquiring a test result.
And checking the whole test result in the test website according to the test report, and searching an execution log of the corresponding test case according to the test case number which fails to execute.
It should be noted that, in the embodiment of the present application, the naming of the execution log of the test case is related to the hierarchical structure of the test case, that is, a test manager may determine, according to the execution log, which test case is generated when the log is executed, or which test case corresponds to the execution log. Therefore, when a certain test case fails to execute, the execution log of the test case failing to execute can be determined according to the number or name of the test case failing to execute, so that the reason of the failure is determined, and the test task can be completed better.
In the embodiment of the application, a capsys method is used for acquiring the execution log part of the test case, the capsys can capture all standard output streams and all standard error streams, and the captured data streams can be written into the execution log in sequence. The original stream is recovered after the test task is completed, so that by using the capsys, the test does not need to additionally set or reset the output stream, good interaction can be carried out at each test capture, and the execution log of the test case is completely stored without abnormal conditions such as loss or redundancy.
Fig. 2 is a flowchart of a method for generating a test case execution log according to an embodiment of the present application. Based on fig. 2, how to generate an execution log corresponding to a test case by using a capsys method after the test case is executed is described in detail.
In an embodiment of the present application, generating an execution log of a test case mainly includes the following processes:
1) and defining a capture log coroutine at the outermost layer of the test case, wherein the scope of the capture log coroutine is all the test steps of the test case. It should be noted that the log coroutine capture in the embodiment of the present application may be implemented by using an existing algorithm or technology, and the embodiment of the present application does not limit this. In addition, the log capturing protocol in the embodiment of the application has a monitoring function and is used for monitoring whether the test case is executed or not all the time.
2) Recording the execution time when the case module starts executing, recording the hierarchical structure when the test case starts executing, and predefining the execution log path of the test case by using the two values.
3) When the execution of the case step is started, the capture log routine starts to work, all standard output stream data and standard error stream data in the test case execution process are continuously captured, and the captured data are sequentially stored in the cache.
4) After the execution of the case step is finished, the log capturing routine finishes work, and all the standard output stream data and the standard error stream data in the cache are sequentially written into the execution log.
5) Judging whether all the test steps of the test case are executed, if so, generating a test report; if the execution is not complete, the testing step continues.
It should be noted that a certain functional point test of the switch may verify the integrity of the function from multiple angles. That is, sometimes there is more than one test step in a test case, and each test step in the test case has a strong dependency relationship. Therefore, in the embodiment of the application, the script design level of the test case is class; also, the design level of each test step in the test case is the function.
In addition, the test case in the embodiment of the present application will clear all configuration information issued by the test case after the execution is finished. Therefore, the multiple test cases in the embodiment of the application are independent from each other, and the configurations do not affect each other.
In a possible implementation manner of the embodiment of the application, when the environment to be tested is a plurality of test devices, configuration and cleaning are issued in a multi-thread manner, and the captured log can stagger the configuration of the plurality of test devices, so that the log reading effect is influenced. Therefore, the configuration of each test device can be stored in the queue in sequence by using the queue, and after the configuration is completed, the data in the queue is printed in sequence, so that the execution logs of the subsequently generated test cases are configured according to the sequence of the test devices in the queue.
Based on the same inventive concept, the embodiment of the method provided by the embodiment of the present application further provides a device for monitoring an automated test log by using caps, and the internal structure of the device is shown in fig. 3.
Fig. 3 is a schematic internal structural diagram of a device for monitoring an automated test log by using capsys according to an embodiment of the present application. As shown in fig. 3, the apparatus includes a processor 301; and a memory 302 having executable code stored thereon that, when executed, causes the processor 301 to perform a method of monitoring automated test logs using capsys as described above.
In an embodiment of the present application, the processor 301 is configured to determine a use case module based on a test task; the case module comprises a plurality of test cases related to the test tasks; the system is used for executing the use case module and recording the execution time of the use case module; the hierarchical structure is used for recording the test case when any test case under the case module is executed; the hierarchical structure of the test case is related to the name of the test case and the directory of the test case; the system is also used for capturing all standard output stream data generated by the test case in the execution process based on capsys and generating an execution log of the test case based on the standard output stream data; and the naming of the execution log is related to the execution time of the case module and the hierarchical structure of the test case.
The method and the equipment for monitoring the automatic test logs by using the capsules have the following beneficial effects that:
1. and capturing the logs of the test cases by using capsys, and generating an execution log of the test cases instead of the log of the whole test task after the test cases are executed. The method can directly obtain the cut case logs locally when the test cases are executed, can quickly obtain the test case logs and quickly know the product quality, improves the efficiency of automatic test result positioning, and reduces the test cost.
2. The captured log can be used for independently obtaining an execution log of the test case according to the hierarchical structure of the test case, wherein the execution log comprises equipment configuration, instrument configuration, the result of the execution case, the executed test topology and the like, the execution process and the configuration details of the test case are completely saved, and the key information in the test task is reserved.
3. And setting a corresponding debugging switch, and displaying the configuration information to be displayed in the execution log of the test case according to the requirement.
4. And the corresponding execution log can be directly called according to the use case with failed execution.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for monitoring automated test logs using capsys, the method comprising:
determining a case module based on the test task; the case module comprises a plurality of test cases related to the test tasks;
executing the use case module and recording the execution time of the use case module;
when any test case under the case module is executed, recording the hierarchical structure of the test case; the hierarchical structure of the test case is related to the name of the test case and the directory of the test case;
capturing all standard output stream data generated by the test case in the execution process based on capsys, and generating an execution log of the test case based on the standard output stream data; and the naming of the execution log is related to the execution time of the case module and the hierarchical structure of the test case.
2. The method of claim 1, wherein prior to executing the use case module, the method further comprises:
carrying out initial configuration check on a test environment corresponding to the test task;
and when it is determined that the initial configuration file config.bak does not exist in the test environment, configuring the test environment to generate a config.bak file.
3. The method for monitoring automated test logs using capsys as recited in claim 1, wherein after executing the use case module, the method further comprises:
calculating test resources required by the case module during execution;
wherein the test resources include at least any one or more of test instruments, test equipment, and test ports.
4. The method of claim 3, wherein after computing the test resources required by the use case modules during execution, the method further comprises:
carrying out topology inspection by taking the use case module as a unit;
under the condition that the topology check fails, skipping the case module and generating topology abnormal information;
wherein the topology check includes connection checks between the test equipment and the test equipment, and between the test equipment and the test meter.
5. The method for monitoring automated test logs using capsys as recited in claim 4, further comprising:
determining that the checking result of the topology checking is a pass checking;
performing configuration check on the test equipment by taking the test case as a unit, and if the configuration check is passed, executing the test case;
and otherwise, after the configuration of the test equipment is modified to an initial configuration file config.
6. The method according to claim 1, wherein capturing all standard output stream data generated by the test cases during the execution process based on the capsys and generating the execution log of the test cases based on the standard output stream data comprises:
generating a capture log coroutine at the outermost layer of the test case based on capsys; wherein, the scope of the log capturing coroutine is all the testing steps of the test case;
when the test case is monitored to start to execute, controlling the capture log routine to start to capture standard output stream data and standard error stream data generated in the execution process of the test case, and caching the standard output stream data and the standard error stream data;
after monitoring that all the test steps in the test case are executed, ending the log capturing coroutine;
and writing the cached standard output stream data and standard error stream data into an execution log of the test case.
7. The method for monitoring automated test logs using capsys as recited in claim 1, further comprising:
judging whether all test cases under the case module are executed completely;
under the condition that all test cases under the case module are completely executed, generating a test report of the case module;
and uploading the test report of the case module and the execution logs of all the test cases to a test website.
8. The method for monitoring automated test logs using capsys as recited in claim 7, further comprising:
determining the test case number which fails to be executed in the test report of the case module;
and inquiring an execution log corresponding to the test case with execution failure on the test website based on the test case number.
9. The method for monitoring automated test logs using capsys according to claim 1, wherein the script design level of the test case is class; the design level of all test steps in the use case is a function.
10. An apparatus for monitoring automated test logs using capsys, the apparatus comprising:
a processor;
and a memory having executable code stored thereon, that when executed, causes the processor to perform a method of monitoring automated test logs using capsys as claimed in any one of claims 1 to 9.
CN202110674628.XA 2021-06-17 2021-06-17 Method and equipment for monitoring automatic test logs by using capsules Active CN113392006B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110674628.XA CN113392006B (en) 2021-06-17 2021-06-17 Method and equipment for monitoring automatic test logs by using capsules

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110674628.XA CN113392006B (en) 2021-06-17 2021-06-17 Method and equipment for monitoring automatic test logs by using capsules

Publications (2)

Publication Number Publication Date
CN113392006A true CN113392006A (en) 2021-09-14
CN113392006B CN113392006B (en) 2022-07-12

Family

ID=77621855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110674628.XA Active CN113392006B (en) 2021-06-17 2021-06-17 Method and equipment for monitoring automatic test logs by using capsules

Country Status (1)

Country Link
CN (1) CN113392006B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138725A (en) * 2021-12-08 2022-03-04 北京志凌海纳科技有限公司 Hierarchical log storage processing method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU1879088A (en) * 1987-07-10 1989-01-12 Tandem Computers Incorporated Method and apparatus for measuring program execution
CN101093514A (en) * 2007-08-20 2007-12-26 中兴通讯股份有限公司 Processing system for automated testing log
CN101246439A (en) * 2008-03-18 2008-08-20 中兴通讯股份有限公司 Automatized test method and system based on task scheduling
US20110093749A1 (en) * 2007-07-02 2011-04-21 Honeywell International Inc. Apparatus and method for troubleshooting a computer system
CN110941544A (en) * 2018-09-21 2020-03-31 大唐移动通信设备有限公司 Automatic testing method and framework
CN111078567A (en) * 2019-12-19 2020-04-28 广州品唯软件有限公司 Report generation method, terminal and storage medium of automatic test platform
CN111240974A (en) * 2020-01-06 2020-06-05 支付宝实验室(新加坡)有限公司 Log output method and device, electronic equipment and medium
CN112416803A (en) * 2020-12-07 2021-02-26 上海欣方智能***有限公司 Automatic testing method and device
CN112732587A (en) * 2021-01-21 2021-04-30 腾讯科技(深圳)有限公司 Method and device for acquiring automatic test log, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU1879088A (en) * 1987-07-10 1989-01-12 Tandem Computers Incorporated Method and apparatus for measuring program execution
US20110093749A1 (en) * 2007-07-02 2011-04-21 Honeywell International Inc. Apparatus and method for troubleshooting a computer system
CN101093514A (en) * 2007-08-20 2007-12-26 中兴通讯股份有限公司 Processing system for automated testing log
CN101246439A (en) * 2008-03-18 2008-08-20 中兴通讯股份有限公司 Automatized test method and system based on task scheduling
CN110941544A (en) * 2018-09-21 2020-03-31 大唐移动通信设备有限公司 Automatic testing method and framework
CN111078567A (en) * 2019-12-19 2020-04-28 广州品唯软件有限公司 Report generation method, terminal and storage medium of automatic test platform
CN111240974A (en) * 2020-01-06 2020-06-05 支付宝实验室(新加坡)有限公司 Log output method and device, electronic equipment and medium
CN112416803A (en) * 2020-12-07 2021-02-26 上海欣方智能***有限公司 Automatic testing method and device
CN112732587A (en) * 2021-01-21 2021-04-30 腾讯科技(深圳)有限公司 Method and device for acquiring automatic test log, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WOLFGANG DEKANT: "《Metal salts with low oral bioavailability and considerable exposures from ubiquitous background: Inorganic aluminum salts as an example for issues in toxicity testing and data interpretation》", 《TOXICOLOGY LETTERS》 *
张磐: "《面向一体化监控***智能告警高级应用的注入测试***的测试用例设计》", 《电力***保护与控制》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138725A (en) * 2021-12-08 2022-03-04 北京志凌海纳科技有限公司 Hierarchical log storage processing method

Also Published As

Publication number Publication date
CN113392006B (en) 2022-07-12

Similar Documents

Publication Publication Date Title
US9471474B2 (en) Cloud deployment infrastructure validation engine
US7698691B2 (en) Server application state
KR101331935B1 (en) Method and system of fault diagnosis and repair using based-on tracepoint
US8930761B2 (en) Test case result processing
CN110008129B (en) Reliability test method, device and equipment for storage timing snapshot
CN111108481B (en) Fault analysis method and related equipment
US11429574B2 (en) Computer system diagnostic log chain
CN112241370B (en) API interface class checking method, system and device
CN113392006B (en) Method and equipment for monitoring automatic test logs by using capsules
US8327189B1 (en) Diagnosing an incident on a computer system using a diagnostics analyzer database
US20100251029A1 (en) Implementing self-optimizing ipl diagnostic mode
CN112261114A (en) Data backup system and method
CN111694724B (en) Test method and device of distributed form system, electronic equipment and storage medium
CN111400128A (en) Log management method and device, computer equipment and storage medium
CN109684220A (en) A kind of browser compatibility analysis method based on event replay
CN106970860B (en) System and method for reproducing centros 7 operating system fault
CN111475320A (en) High-availability detection method of computing platform, computing platform and storage medium
CN114253846B (en) Automatic test abnormality positioning method, device, equipment and readable storage medium
CN114356643B (en) Automatic task discovery failure and recovery method in remote sensing satellite processing system
CN117591490A (en) Audit log data processing method, audit log data processing device, audit log data processing equipment and storage medium
CN115185784A (en) Method, device, equipment and storage medium for collecting abnormal logs
JPH09265415A (en) Abnormality diagnostic method and abnormality diagnostic device
CN117349383A (en) Data synchronization method and device, electronic equipment and storage medium
Punia et al. Systematic Diagnostics for C4I Systems: A Conceptual Framework
Ranchal et al. Diagnosing Failures of Cloud Management Actions

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
GR01 Patent grant
GR01 Patent grant