Blockchain testing method, device, equipment and storage medium
By obtaining the logical topology and configuration information of the blockchain, starting the blockchain and conducting test cases, the problem of the lack of integrity and compatibility of existing test tools is solved, the automation testing capabilities are improved, and the blockchain functions are realized. Comprehensive test.
Patent Information
- Application Number
- CN202111552322.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-12-17
AI Technical Summary
The existing blockchain testing tools lack integrity and compatibility, cannot effectively test the overall functions of the blockchain system, and have low automation capabilities, which makes the testing process time-consuming and requires a lot of manpower.
By obtaining the logical topology and configuration information of the blockchain, starting the blockchain based on this information, and testing its functionality using test cases, including writing and converting test scripts, running scripts and analyzing logs to identify errors, using pre-trained Network models analyze test logs to improve testing efficiency.
Testing of different blockchain functions is realized, improving the automation capabilities and efficiency of the test, reducing manpower needs, and enhancing the compatibility and integrity of the test.
Smart Images

Figure CN114385488B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain, and in particular to a blockchain testing method, device, equipment and storage medium. Background Art
[0002] Due to the particularity of blockchain system testing, in order to test the functions of blockchain systems, if only based on a general test framework, it cannot meet the testing requirements, and the framework can only be modified in a targeted manner, which takes a lot of time. Most of the existing blockchain testing tools are aimed at a specific test of their own system, lacking integrity and compatibility. In order to test the overall functions, a lot of manpower is required, so they do not have high automation capabilities. Summary of the invention
[0003] The present application provides a blockchain testing method, apparatus, device and storage medium to solve the problem of poor compatibility of current testing systems.
[0004] In a first aspect, a blockchain testing method is provided, comprising:
[0005] Obtaining a logical topology matched by a blockchain and configuration information for starting the blockchain, wherein the logical topology is used to indicate node types and relationships between nodes of the blockchain;
[0006] Obtaining a test case for testing a blockchain function of the blockchain;
[0007] The blockchain is started based on the logical topology and the configuration information, and after starting the blockchain, the blockchain function is tested according to the test case.
[0008] Optionally, before obtaining a test case for testing a blockchain function of the blockchain, the method further includes:
[0009] Obtaining a writing rule for writing a test script indicating the test case;
[0010] Determining a conversion rule corresponding to the writing rule;
[0011] The test script is converted according to the conversion rule, and the test cases in the converted test script are used as test cases for testing the blockchain function.
[0012] Optionally, testing the blockchain function according to the test case includes:
[0013] Obtaining behavior configuration parameters corresponding to the test script indicating the test case;
[0014] The test script is run according to the behavior configuration parameters to implement the test of the blockchain function.
[0015] Optionally, the behavior configuration parameter includes at least one of the following:
[0016] Multithreaded scheduling;
[0017] Script error retry;
[0018] Log echo structure and level.
[0019] Optionally, starting the blockchain based on the logical topology and the configuration information includes:
[0020] Based on the logical topology and the configuration information, determine the behavior description and implementation interface of the blockchain;
[0021] The implementation interface is called to start the blockchain according to the behavior description.
[0022] Optionally, after testing the blockchain function according to the test case, the method further includes:
[0023] Collecting test logs in the test script;
[0024] The test log is analyzed using a pre-trained network model to obtain errors that occur during the running of the test script.
[0025] In a second aspect, a blockchain testing device is provided, comprising:
[0026] A logical topology module, used to obtain a logical topology matched by a blockchain and configuration information for starting the blockchain, wherein the logical topology is used to indicate the node type and the relationship between nodes of the blockchain;
[0027] A test script module, used to obtain test cases for testing the blockchain function of the blockchain;
[0028] A built-in framework module is used to start the blockchain based on the logical topology and the configuration information, and after starting the blockchain, test the blockchain function according to the test case.
[0029] In a third aspect, a blockchain testing system is provided, including:
[0030] Blockchain and blockchain testing devices;
[0031] The blockchain testing device is used to obtain a logical topology matching a blockchain and configuration information for starting the blockchain, wherein the logical topology is used to indicate the node type of the blockchain and the relationship between the nodes; obtain a test case for testing the blockchain function of the blockchain; start the blockchain based on the logical topology and the configuration information, and after starting the blockchain, test the blockchain function according to the test case.
[0032] In a fourth aspect, an electronic device is provided, comprising: a processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus;
[0033] The memory is used to store computer programs;
[0034] The processor is used to execute the program stored in the memory to implement the blockchain testing method described in the first aspect.
[0035] In a fifth aspect, a computer-readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the blockchain testing method described in the first aspect.
[0036] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: in the technical solution provided by the embodiment of the present application, the logical topology matched by the blockchain and the configuration information for starting the blockchain are obtained, and the logical topology is used to indicate the node type and the relationship between the nodes of the blockchain; a test case for testing the blockchain function of the blockchain is obtained; the blockchain is started based on the logical topology and the configuration information, and after the blockchain is started, the blockchain function is tested according to the test case. Since the present embodiment can obtain the logical topology of the blockchain and the configuration information for starting the blockchain, and can start the blockchain based on the logical topology and the configuration information, it realizes the testing of the blockchain functions of different blockchains. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A flowchart of a blockchain testing method in an embodiment of the present application;
[0040] Figure 2 This is a schematic diagram of the structure of the test system in the embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of the structure of the built-in framework in the embodiment of the present application;
[0042] Figure 4 This is another flowchart of the blockchain testing method in the embodiment of the present application;
[0043] Figure 5 This is a schematic diagram of the structure of the blockchain testing device in the embodiment of the present application;
[0044] Figure 6 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0047] The present application embodiment provides a blockchain testing method, which can be applied to any electronic device;
[0048] The electronic devices described in the embodiments of the present application may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, video matrices, monitoring platforms, mobile Internet devices (MID, Mobile Internet Devices) or wearable devices, etc. The above are only examples and not exhaustive, including but not limited to the above devices. Of course, the above electronic devices can also be servers, for example, cloud servers.
[0049] like Figure 1 As shown, the method may include the following steps:
[0050] Step 101: Obtain the logical topology matching the blockchain and the configuration information for starting the blockchain. The logical topology is used to indicate the node type of the blockchain and the relationship between the nodes.
[0051] In this embodiment, the node types of the blockchain may include consensus nodes, forwarding nodes, light nodes, and custom nodes.
[0052] In this embodiment, the configuration information for starting the blockchain includes a series of required node operations such as startup file information and port opening information required for blockchain node startup.
[0053] Step 102: Obtain a test case for testing the blockchain function of the blockchain.
[0054] In the application, the test cases for testing the blockchain functions of the blockchain are expressed by test scripts. The test script is the specific content of the script written by the tester. It supports writing in yaml format through configuration files, and also supports writing in different languages such as python, java, go, etc. Various interfaces and standard library calls are implemented in the built-in framework of the basic layer. These contents in the script will be unified in format through subsequent converters and SDKs, which is convenient for testers in different languages to write test cases.
[0055] The converter implementation defines some rules and script reviews. Each language needs to write scripts according to pre-designed rules, and then output them in a fixed format according to the internal conversion code. If the script review fails, the location where the problem occurs will be marked and the script will be marked as failed. Finally, all scripts will be uploaded to the smart platform through the configured webhook.
[0056] In a specific embodiment, before obtaining a test case for testing a blockchain function of a blockchain, a writing rule for writing a test script indicating the test case is obtained; a conversion rule corresponding to the writing rule is determined; the test script is converted according to the conversion rule, and the test case in the converted test script is used as a test case for testing the blockchain function.
[0057] Step 103: Start the blockchain based on the logical topology and configuration information, and after starting the blockchain, test the blockchain function according to the test case.
[0058] In the application, the normal operation of the test script requires the support of the behavior configuration parameters corresponding to the test script. Therefore, when testing the blockchain function according to the test case, obtain the behavior configuration parameters corresponding to the test script indicating the test case; run the test script according to the behavior configuration parameters to implement the test of the blockchain function.
[0059] The behavior configuration parameters corresponding to the test script include, but are not limited to, multi-thread scheduling, script error retry, log echo structure and level, etc.
[0060] In this embodiment, when starting the blockchain based on the logical topology and configuration information, the capabilities of the node and cluster are first described in terms of behavior and interfaces through configuration, and then the specific implementation of the behavior and interface is described in detail in terms of code. Common functions implemented here include node start / stop and connection, cluster start / stop, and exception simulation. If other customized behaviors are required, the corresponding interfaces and descriptions are written in the configuration and implemented in the code.
[0061] In a specific embodiment, based on the logical topology and configuration information, the behavior description and implementation interface of the blockchain are determined; the implementation interface is called to start the blockchain according to the behavior description.
[0062] In the technical solution provided in the embodiment of the present application, the logical topology matched by the blockchain and the configuration information for starting the blockchain are obtained, and the logical topology is used to indicate the node type of the blockchain and the relationship between the nodes; a test case for testing the blockchain function of the blockchain is obtained; the blockchain is started based on the logical topology and the configuration information, and after the blockchain is started, the blockchain function is tested according to the test case. Since this embodiment can obtain the logical topology of the blockchain and the configuration information for starting the blockchain, and can start the blockchain based on the logical topology and the configuration information, it realizes the testing of the blockchain functions of different blockchains.
[0063] In another embodiment of the present application, after testing the blockchain function, the testing process can also be analyzed by collecting logs.
[0064] In a specific embodiment, after testing the blockchain function according to the test case, the test log in the test script is collected; the test log is analyzed using a pre-trained network model to obtain errors that occur during the running of the test script.
[0065] The following describes the blockchain testing method in this application by taking a specific testing system deployed in an electronic device as an example.
[0066] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of the test system proposed in the embodiment of the present application. The test system includes four parts: intelligent platform, script layer, system layer and basic layer.
[0067] The following is an introduction to these four parts:
[0068] About the Smart Platform:
[0069] As the upper-level design of the entire system, the intelligent platform mainly provides some statistical and intelligent analysis capabilities.
[0070] Log collection is based on the configuration file, selecting the log level and call stack information to display, and uniformly collecting the logs in each script and uploading them to the intelligent platform database for subsequent data analysis.
[0071] AI analysis uses reinforcement learning and GMM algorithms to train machine learning based on the errors in each script, and determines the corresponding version problems, script problems, environment problems, etc., and finally displays them in the visualization framework, and the tester conducts a second confirmation based on the log results. At the same time, AI analysis provides an external interface, through which customized analysis capabilities can be realized.
[0072] The statistical result is that all log results are displayed in the visualization framework according to AI analysis classification, and the historical record query function is supported. In addition, at the beginning of the call, you can configure the collection and result display of script coverage according to the configuration file or collect the required data according to the customized tracking point, and finally connect it to the visualization framework or third-party test report application.
[0073] The visualization framework displays the front-end page through service binding. It can display the specific echo of a script or related historical echo. In addition, the overview page counts the number of all scripts per day, the number of errors, the cause of the errors, and some custom options. If you want to use a third-party application to directly display the test report, such as allure, pytest-html, jest-html-reporters, etc., you can also customize the configuration during the service binding stage.
[0074] About the script layer:
[0075] The script layer is a layer where testers set up test cases according to each blockchain system and implement test functions through configuration files or codes.
[0076] A trigger consists of a series of configuration files, which are mainly used to define some behavioral configurations of script running, such as multi-threaded scheduling, script error retry, log echo structure and level, etc.
[0077] The test script is the specific content of the script written by the tester. It supports writing in YAML format through configuration files, and also supports writing in different languages such as Python, Java, and Go. The calls of various interfaces and standard libraries are implemented in the built-in framework of the basic layer. These contents in the script will be unified in format through subsequent converters and SDKs to facilitate testers of different languages to write use cases.
[0078] The converter implementation defines some rules and script reviews. Each language needs to write scripts according to pre-designed rules, and then output them in a fixed format according to the internal conversion code. If the script review fails, the location where the problem occurs will be marked and the script will be marked as failed. Finally, all scripts will be uploaded to the smart platform through the configured webhook.
[0079] About the system layer:
[0080] The system layer is a series of target systems under test. The deployment and configuration of the systems under test mainly depend on the implementation of the basic layer.
[0081] About the base layer:
[0082] The basic layer is the most important layer in the test system, which mainly provides some underlying logic implementation and interface.
[0083] Logical topology is the initial step in designing the system under test. According to the specified logical topology and configuration items, the node types and the relationships between nodes are divided. For example, some nodes can be defined as consensus nodes, forwarding nodes, light nodes, and custom nodes. In each node, the required startup file information, port opening information, and a series of required node operations are configured through configuration items. After completing the logical topology and configuration items according to the rules, the system rules will be checked, and the places that do not pass will be marked. If the check passes, the content will be introduced into the built-in framework or extended framework for the next step.
[0084] The built-in framework is the core of the basic layer, which encapsulates many interfaces and methods. Figure 3 , Figure 3 The internal structure of the built-in framework is divided into:
[0085] The built-in framework includes configuration items, management center (Manager) and interface (Helper).
[0086] In addition to converting the contents of the logical topology into corresponding configurations for preparation before starting the node and chain, the configuration items can also specify additional paths to add more detailed custom configuration contents. During the startup process, the configuration contents will be read from the files specified by the path, making it easier for different types of blockchain systems to access them.
[0087] Manager is an encapsulation of nodes and clusters. First, the capabilities of nodes and clusters are described in terms of behavior and interfaces through configuration, and then the specific implementation of the behavior and interfaces is described in detail in code. Common functions implemented here include node start / stop and connection, cluster start / stop, and exception simulation. If other customized behaviors are required, the corresponding interfaces and descriptions are written in the configuration, and then they can be implemented in the code.
[0088] Helper provides a large number of methods and interfaces for writing test scripts, including a unified standard library, on-chain methods (such as jsonrpc, grpc, websocket, etc.), contract compilation, deployment, calling, and SDK packages in various languages. For extension methods, they can also be written into different modules according to their functions, and then unified inspection and compilation will be performed to test script calls.
[0089] The extended framework is an additional method provided based on the built-in framework. In order to meet the needs of different testers, it can integrate test frameworks such as Pytest, Httprunner, Robot Framework, and Jest.
[0090] The specific process based on the above test system is as follows Figure 4 As shown:
[0091] (1) Initialize and preload the configuration according to the logical topology and trigger configuration.
[0092] (2) Load the script that needs to be scheduled through the preloaded configuration. The loading of the SDK will be identified according to the script language.
[0093] (3) Run the test script. The test script will run the content of preparing and cleaning the environment according to the setup and teardown in the script structure. In the preparation environment, the node and chain startup depends on the preloaded configuration. All script commands are run and implemented by ssh, ftp, and interface calls (rpc, websocket, etc.). The script echo and part of the call stack will be displayed and archived according to the trigger configuration, and if an error occurs, it can be rerun according to the trigger configuration.
[0094] (4) After all scripts are scheduled, the log results will be sent to the intelligent platform for analysis and processing.
[0095] (5) Testers check the scheduling status and specific log content through the intelligent platform, and confirm the AI analysis results based on the cause of the error. If the analysis is incorrect, they can manually re-fill it and then attach the corresponding BUG bill of lading link to the remarks.
[0096] In this embodiment, a set of test frameworks and systems are used to test various functions in the blockchain system. Through the customized topology and configuration files, the nodes, networks, consensus, contracts, storage and other functions of the blockchain system can be comprehensively tested. The relevant templates and interfaces are adapted according to the characteristics of the blockchain system, and the customized log system is connected to make the test process visual and abnormal problems can be found in time. For example: if you want to test the function of a blockchain (Ethereum or fabric), use the customized topology and configuration files of the framework, associate and bind the relevant nodes, and according to the introduction of the script template, you can use the configuration file or code language to run the test case. The execution process and result display can be defined in the case configuration. Finally, the framework's customized log system or the external log system specified through the configuration interface outputs the relevant log documents to achieve the overall functional test of the blockchain system.
[0097] Based on the same concept, a blockchain testing device is provided in the embodiment of the present application. The specific implementation of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 5 As shown, the device mainly includes:
[0098] Logical topology module 501, used to obtain the logical topology matched by the blockchain and the configuration information for starting the blockchain, the logical topology is used to indicate the node type of the blockchain and the relationship between the nodes;
[0099] A test script module 502 is used to obtain a test case for testing the blockchain function of the blockchain;
[0100] The built-in framework module 503 is used to start the blockchain based on the logical topology and configuration information, and after starting the blockchain, test the blockchain function according to the test case.
[0101] Optionally, the device is also used for:
[0102] Before obtaining a test case for testing a blockchain function of a blockchain, obtaining a writing rule for writing a test script indicating the test case;
[0103] Determine the transformation rules corresponding to the written rules;
[0104] The test script is converted according to the conversion rules, and the test cases in the converted test script are used as test cases for testing the blockchain function.
[0105] Optionally, the built-in framework module 503 is used to:
[0106] Obtaining behavior configuration parameters corresponding to a test script indicating a test case;
[0107] Run the test script according to the behavior configuration parameters to test the blockchain function.
[0108] Optionally, the behavior configuration parameter includes at least one of the following:
[0109] Multithreaded scheduling;
[0110] Script error retry;
[0111] Log echo structure and level.
[0112] Optionally, the built-in framework module 503 is used to:
[0113] Determine the behavior description and implementation interface of the blockchain based on the logical topology and configuration information;
[0114] Call the implementation interface and start the blockchain according to the behavior description.
[0115] Optionally, the device is also used for:
[0116] After testing the blockchain functions according to the test cases, collect the test logs in the test scripts;
[0117] Use the pre-trained network model to analyze the test logs and obtain the errors that occurred during the running of the test script.
[0118] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 6 As shown, the electronic device mainly includes: a processor 601, a memory 602 and a communication bus 603, wherein the processor 601 and the memory 602 communicate with each other through the communication bus 603. The memory 602 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps:
[0119] Obtain the logical topology matching the blockchain and the configuration information used to start the blockchain. The logical topology is used to indicate the node type and relationship between nodes of the blockchain.
[0120] Obtain test cases for testing the blockchain functionality of the blockchain;
[0121] Start the blockchain based on the logical topology and configuration information, and after starting the blockchain, test the blockchain functions according to the test cases.
[0122] The communication bus 603 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 603 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0123] The memory 602 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor 601.
[0124] The above-mentioned processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0125] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the blockchain testing method described in the above embodiment.
[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape, etc.), an optical medium (e.g., a DVD) or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0127] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0128] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A blockchain testing method, characterized in that: include: Obtaining a logical topology matched by a blockchain and configuration information for starting the blockchain, wherein the logical topology is used to indicate node types and relationships between nodes of the blockchain; Obtaining a test case for testing a blockchain function of the blockchain; Starting the blockchain based on the logical topology and the configuration information, and after starting the blockchain, testing the blockchain function according to the test case; The blockchain function is tested according to the test case, including: Obtaining behavior configuration parameters corresponding to the test script indicating the test case; Run the test script according to the behavior configuration parameters to implement the test of the blockchain function; Wherein, starting the blockchain based on the logical topology and the configuration information includes: Based on the logical topology and the configuration information, determine the behavior description and implementation interface of the blockchain; The implementation interface is called to start the blockchain according to the behavior description.
2. The method according to claim 1, characterized in that Before obtaining a test case for testing the blockchain function of the blockchain, it also includes: Obtaining a writing rule for writing a test script indicating the test case; Determining a conversion rule corresponding to the writing rule; The test script is converted according to the conversion rule, and the test cases in the converted test script are used as test cases for testing the blockchain function.
3. The method according to claim 1, characterized in that The behavior configuration parameters include at least one of the following: Multithreaded scheduling; Script error retry; Log echo structure and level.
4. The method according to claim 1, characterized in that: After testing the blockchain function according to the test case, it also includes: Collecting test logs in the test script; The test log is analyzed using a pre-trained network model to obtain errors that occur during the running of the test script.
5. A blockchain testing device, characterized in that: include: A logical topology module, used to obtain a logical topology matched by a blockchain and configuration information for starting the blockchain, wherein the logical topology is used to indicate the node type and the relationship between nodes of the blockchain; A test script module, used to obtain test cases for testing the blockchain function of the blockchain; A built-in framework module is used to start the blockchain based on the logical topology and the configuration information, and after starting the blockchain, test the blockchain function according to the test case; wherein, starting the blockchain based on the logical topology and the configuration information includes: determining the behavior description and implementation interface of the blockchain based on the logical topology and the configuration information; calling the implementation interface to start the blockchain according to the behavior description; wherein, testing the blockchain function according to the test case includes: obtaining the behavior configuration parameters corresponding to the test script indicating the test case; running the test script according to the behavior configuration parameters to implement the test of the blockchain function.
6. A blockchain testing system, characterized in that: include: Blockchain and blockchain testing devices; The blockchain testing device is used to obtain a logical topology matched by a blockchain and configuration information for starting the blockchain, wherein the logical topology is used to indicate a node type and a relationship between nodes of the blockchain; and obtain a test case for testing a blockchain function of the blockchain; The blockchain is started based on the logical topology and the configuration information, and after starting the blockchain, the blockchain function is tested according to the test case; wherein, the blockchain function is tested according to the test case, including: obtaining the behavior configuration parameters corresponding to the test script indicating the test case; running the test script according to the behavior configuration parameters to implement the test of the blockchain function; wherein, the blockchain is started based on the logical topology and the configuration information, including: determining the behavior description and implementation interface of the blockchain based on the logical topology and the configuration information; calling the implementation interface to start the blockchain according to the behavior description.
7. An electronic device, characterized in that: include: A processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the blockchain testing method described in any one of claims 1 to 4.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the blockchain testing method described in any one of claims 1 to 4 is implemented.
