CN113360386B - Method and device for testing driving of switching chip, electronic equipment and storage medium - Google Patents

Method and device for testing driving of switching chip, electronic equipment and storage medium Download PDF

Info

Publication number
CN113360386B
CN113360386B CN202110669644.XA CN202110669644A CN113360386B CN 113360386 B CN113360386 B CN 113360386B CN 202110669644 A CN202110669644 A CN 202110669644A CN 113360386 B CN113360386 B CN 113360386B
Authority
CN
China
Prior art keywords
unit
scd
service
test
client
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.)
Active
Application number
CN202110669644.XA
Other languages
Chinese (zh)
Other versions
CN113360386A (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN202110669644.XA priority Critical patent/CN113360386B/en
Publication of CN113360386A publication Critical patent/CN113360386A/en
Application granted granted Critical
Publication of CN113360386B publication Critical patent/CN113360386B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

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

Abstract

The application provides a method and a device for testing driving of an exchange chip, electronic equipment and a storage medium, and relates to the technical field of data communication testing. According to the application, the SCD API information corresponding to the SCD service is converted into the structural body data in the set format, and the test module for being installed on the client device and the service module for being installed on the server device are respectively generated based on the structural body data. The connection between the server and the client using different programming languages is established through the structural body data with the set format, so that function-level interface test is realized based on the test script, all SCD APIs related to the SCD service can be tested, and the test coverage rate is improved.

Description

Method and device for testing driving of switching chip, electronic equipment and storage medium
Technical Field
The present application relates to the field of data communication testing technologies, and in particular, to a method and apparatus for testing a driving of an exchange chip, an electronic device, and a storage medium.
Background
With the continuous development of network technology, network products can realize a plurality of functions through layering and modularization. The software of different layers makes function calls through the application programming interface.
In the switch domain, SCD (SWITCH CHIP DRIVER ) services may provide unified APIs (Application Programming Interface ) to upper layer applications, interfacing down to different ASICs (Application SPECIFIC INTEGRATED circuits ) so that SONiC (Software for Open Networking in the Cloud, cloud platform open software) and upper layer APPs (applications) can run on different hardware platforms. The naming and implementation modes of the chip operation interfaces of different chip manufacturers are greatly different, and the SCD can abstract the chip operation and provide uniform interface definition so as to shield the difference among the manufacturers. To ensure that SCD performs its function properly, the SCD API needs to be tested.
In the existing switch test method, the test is performed by configuring a command line mode, and each SCD API is only tested at a time, so that each SCD API cannot be tested.
Disclosure of Invention
In order to solve the existing technical problems, the embodiment of the application provides a method, a device, electronic equipment and a storage medium for testing the driving of an exchange chip.
In order to achieve the above object, the technical solution of the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a method for testing a driving of a switching chip, where the method includes:
acquiring SCD Application Programming Interface (API) information corresponding to a switching chip driving SCD service associated with network service;
converting SCD API information corresponding to the SCD service into structural body data in a set format;
Generating a client unit conforming to a client programming language and a server unit conforming to a server programming language based on the structural body data respectively;
Generating a test module for being installed on the client device based on the client unit, and generating a service module for being installed on the server device based on the server unit;
and generating a test script based on the client unit and the set flow data, and running the test script based on the test module and the service module to test the SCD API.
In an optional embodiment, the SCD API information includes a function and a function parameter corresponding to the SCD API; the obtaining the SCD API information corresponding to the SCD service driven by the switching chip associated with the network service includes:
acquiring an SCD header file corresponding to the SCD service;
And acquiring a function and a function parameter corresponding to the SCD API contained in the SCD header file.
In an alternative embodiment, the generating, based on the structure data, a client unit conforming to a client programming language and a server unit conforming to a server programming language, respectively, includes:
converting the structural body data into client data conforming to a client programming language, or acquiring a designated function as a public function library, and generating the client unit based on the client data and the public function library;
And converting the structural body data into server-side data conforming to a server-side programming language, and adding SCD API call processing logic into a function in the server-side data to obtain the server-side unit.
In an alternative embodiment, the generating a test module for installation on a client device based on the client unit includes:
acquiring a transmission service unit, a test frame unit and a flow unit in a set format;
And generating the test module based on the client unit, the transmission service unit, the test framework unit and the flow unit.
In an alternative embodiment, the generating, based on the server unit, a service module for being installed on a server device includes:
Acquiring an interactive chip driving unit, a transmission service unit with a set format and a default processing unit; the default processing unit is used for performing preset processing on default functions;
and generating the service module based on the server side unit, the interaction chip driving unit, the transmission service unit and the default processing unit.
In an alternative embodiment, the set format is an interface description language IDL format; the transport service unit employs a remote procedure call RPC framework.
In a second aspect, an embodiment of the present application provides a switching chip driving test apparatus, including:
the data conversion unit is used for acquiring SCD API information corresponding to the SCD service driven by the switching chip associated with the network service; converting SCD API information corresponding to the SCD service into structural body data in a set format;
A test module generating unit for generating client units conforming to a client programming language based on the structural body data, respectively, and generating a test module for being installed on a client device based on the client units;
The service module generating unit is used for respectively generating service end units conforming to a service end programming language based on the structural body data and generating service modules for being installed on service end equipment based on the service end units;
And the test script generating unit is used for generating a test script based on the client unit and the set flow data, running the test script based on the test module and the service module and testing the SCD API.
In an optional embodiment, the SCD API information includes a function and a function parameter corresponding to the SCD API; the data conversion unit is specifically configured to:
acquiring an SCD header file corresponding to the SCD service;
And acquiring a function and a function parameter corresponding to the SCD API contained in the SCD header file.
In an alternative embodiment, the test module generating unit is specifically configured to:
Converting the structural body data into client data conforming to a client programming language, acquiring a designated function as a public function library, and generating the client unit based on the client data and the public function library;
the service module generating unit is specifically configured to:
And converting the structural body data into server-side data conforming to a server-side programming language, and adding SCD API call processing logic into a function in the server-side data to obtain the server-side unit.
In an alternative embodiment, the test module generating unit is specifically configured to:
acquiring a transmission service unit, a test frame unit and a flow unit in a set format;
And generating the test module based on the client unit, the transmission service unit, the test framework unit and the flow unit.
In an alternative embodiment, the service module generating unit is specifically configured to:
Acquiring an interactive chip driving unit, a transmission service unit with a set format and a default processing unit; the default processing unit is used for performing preset processing on default functions;
and generating the service module based on the server side unit, the interaction chip driving unit, the transmission service unit and the default processing unit.
In an alternative embodiment, the set format is an interface description language IDL format; the transport service unit employs a remote procedure call RPC framework.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, the memory having stored thereon a computer program executable on the processor, the computer program, when executed by the processor, implementing the method of any of the first aspects.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements the method of any of the first aspects.
In a fifth aspect, an embodiment of the present application provides a testing system for driving a switching chip, including a client device and a server device; the test module in the first aspect is installed on the client device, and the service module in the first aspect is installed on the server device.
In an alternative embodiment, the client device and the server device communicate via an RPC framework.
According to the method, the device, the system and the storage medium for testing the drive of the exchange chip, SCD API information corresponding to SCD service is converted into structural body data in a set format, and a test module for being installed on client equipment and a service module for being installed on server equipment are respectively generated based on the structural body data. The connection between the server and the client using different programming languages is established through the structural body data with the set format, so that function-level interface test is realized based on the test script, all SCD APIs related to the SCD service can be tested, and the test coverage rate is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an application scenario of an SCD;
FIG. 2 is a flow chart of a method for testing driving of a switching chip according to an embodiment of the present application;
FIG. 3 is a flowchart of another method for testing driving of a switching chip according to an embodiment of the present application;
Fig. 4 is a schematic flow chart of a method for testing driving of an exchange chip according to an embodiment of the present application;
FIG. 5 is a block diagram of a test device for driving a switching chip according to an embodiment of the present application;
FIG. 6 is a block diagram of a test system for driving a switching chip according to an embodiment of the present application;
Fig. 7 is a block diagram of an electronic device 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 present application will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the terms "comprises" and "comprising," along with their variants, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The word "exemplary" is used hereinafter to mean "serving as an example, embodiment, or illustration. Any embodiment described as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The terms "first," "second," and the like herein are used for descriptive purposes only and are not to be construed as either explicit or implicit relative importance or to indicate the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Fig. 1 shows a schematic view of an application scenario of an SCD, as shown in fig. 1, where the SCD provides a unified API interface for each adapter host upwards, and interfaces different application specific integrated circuits downwards through the adapter and the proxy element. As the chip operation interfaces of different chip manufacturers are named and have larger realization difference, the SCD abstracts the chip operation and provides uniform interface definition, and the difference among chips of all the manufacturers can be shielded.
To ensure that SCD performs its function properly, the SCD API needs to be tested. SCD APIs are typically implemented in the C language and mainly comprise three types:
first, the necessary functions: refers to the "core" API of the basic forwarding operations required by the Control stack. All Adapter implementations must support these functions, and absent any one, control stack will not be able to load the Adapter normally.
Second, optional function: refers to a set of additional functions defined in a compatible SCD ADAPTER implementation, but not required. Optional functions are enabled in a standard manner for non-core forwarding functions that are only needed for Control stack implementations using these functions.
Third, the user custom function: refers to a compatible SCD ADAPTER implementation, neither defined nor required additional functionality.
In the traditional switching chip driving test method, the test is performed in a mode of configuring a command line, a service component is issued through a network operating system to trigger test conditions, and each time, only individual SCD APIs are tested, so that each SCD API cannot be tested.
Based on the above, the embodiment of the application provides a method for testing the driving of a switching chip, which can be applied to electronic equipment for configuring a testing environment for the driving test of the switching chip. As shown in fig. 2, the method comprises the steps of:
step S201, SCD API information corresponding to the SCD service associated with the network service is obtained.
The SCD service associated with the network traffic may be, for example, an add-drop service of a Vlan (local area network) interface, a service of querying and modifying a Vlan interface, or the like. The SCD API information includes functions and function parameters corresponding to the SCD API. Specifically, the SCD header file corresponding to the SCD service may be obtained from a database storing SCD HEADER (SCD header file) corresponding to the SCD service, and the function parameter corresponding to the SCD API may be obtained from the SCD header file.
Step S202, converting SCD API information corresponding to the SCD service into structural body data with a set format.
The configuration format may be IDL (INTERFACE DESCRIPTION LANGUAGE ) format, and the configuration data of the configuration format may be IDL file. The IDL file may be generated according to functions and function parameters corresponding to SCD APIs obtained from the SCD header file.
In some embodiments, the functions and function parameters corresponding to the SCD API included in the SCD header file, the data structure, and the like may be fabricated into an IDL file.
In step S203, a client unit conforming to the client programming language and a server unit conforming to the server programming language are generated based on the structure data, respectively.
Specifically, the structural body data is converted into client data conforming to a client programming language, a designated function is obtained as a public function library, and a client unit is generated based on the client data and the public function library. And converting the structural body data into server data conforming to a server programming language, and adding SCD API call processing logic into a function in the server data to obtain a server unit.
Wherein the client unit may also be referred to as SCD CLIENT unit and the server unit may also be referred to as SCD SERVER unit. Specifically, since the client and the server may use different programming languages, the IDL file may be converted into multiple programming languages by the IDL conversion tool, resulting in codes of SCD SERVER units and SCD CLIENT units, respectively.
Step S204, a test module for installation on the client device is generated based on the client unit, and a business module for installation on the server device is generated based on the server unit.
Specifically, the test module may be generated as follows: and acquiring a transmission service unit, a test frame unit and a flow unit in a set format, and generating a test module based on the client unit, the transmission service unit, the test frame unit and the flow unit.
The transmission service unit, the test frame unit and the flow unit are all stored in a database, and can be acquired from the database and are associated through class functions in a programming language to be integrated into a test module.
The test module is used for verifying and testing the SCD framework infrastructure. Wherein, the transmission service unit adopts an RPC (Remote Procedure Call ) framework based on IDL protocol; the test framework unit integrates test case management, test case execution and topology configuration, and a test plug-in expansion framework; the flow unit is used for processing the encapsulation and analysis of the network message protocol in the test case, and sending and receiving.
The traffic module may be generated as follows: the method comprises the steps of obtaining an interactive chip driving unit, a transmission service unit with a set format and a default processing unit for performing preset processing on default functions, and generating a service module based on the service end unit, the interactive chip driving unit, the transmission service unit and the default processing unit.
The transmission service unit, the interaction chip driving unit and the default processing unit are all stored in a database, and can be acquired from the database and are associated through class functions in a programming language to be integrated into a service module.
It should be noted that, the transmission service unit, the interaction chip driving unit and the default processing unit and the SCD header file, the test frame unit and the flow unit in the foregoing may be stored in the same database, or may be stored in different databases. If each of them is stored in a different database, its code may be obtained from the database in which each of the above units is stored.
Specifically, the transport services unit employs an IDL protocol-based RPC (Remote Procedure Call ) framework. The default handling unit, which may also be referred to as a Mock unit, is used to pile up certain default functions of the SCD SERVER unit. The interactive chip driving unit may also be referred to as a network chip driving framework, i.e. SCD framework. The service end unit can also be called a service unit, is a service process related to the network equipment, is a process under Linux, and is a binary file. The service module may also include a chip unit under test, such as a security chip, a network chip, etc.
The embodiment of the application solves the problem of difficult on-line service testing of the chip drive by the RPC technology, the chip drive test is generally off-line or has more unit tests, the scene test verification is insufficient, remote service can be called like local call, on-line service scene test is effectively and accurately supplemented, and the quality of the chip drive software is enhanced.
According to the embodiment of the application, piling is carried out through the MOCK unit, a default function can be returned to a contracted result, the problem that development and test cannot be simultaneously developed in parallel is solved, an effective technical support is provided for left shift of the test, and the product development period is shortened.
Step S205, a test script is generated based on the client unit and the set flow data, and the SCD API is tested by running the test script based on the test module and the service module.
Executing the test script, and testing SCD service by the test module and the business module under the IDL-based protocol RPC framework.
Specifically, according to the test script, under the IDL-based protocol RPC framework, the test module sends a test request for the target SCD service to the service module, the service module tests the SCD APIs corresponding to the target SCD service according to the test request, test results corresponding to the SCD APIs are respectively obtained, and the test results are returned to the test module, so that the test of the SCD service is completed.
According to the SCD-RTF (Remote Testing Framework, remote test framework) -based switching chip driving test method provided by the embodiment of the application, function-level interface-based test is realized through IDL, a 'bridge' is provided to connect a server side and a client side, the effect of 100% of test coverage rate of an SCD API interface can be achieved, and the test coverage rate of codes of an SCD header file is improved to more than 95%; the method solves the problems that in the prior art, the driving problem of a chip is tested in a mode of configuring command lines, the testing accuracy and the code coverage rate of SCD API and SCD header files cannot be independently verified, and the testing and total regression cycle is long, and the problems of automatic testing accuracy and the code coverage rate are improved.
According to the embodiment of the application, the SCD header files of the same version are used, so that the problem that the compatibility and consistency of multiple SCD drivers are difficult to test is solved by the test frame and the test script, the time for adapting test development of different drivers and repeated development of the script is saved, and the SCD frame, which is a unified interface frame formed by multiple chip drivers, is further promoted.
Fig. 3 shows a flow chart of a specific embodiment. As shown in fig. 3, the method for testing the driving of the switching chip provided by the embodiment of the application comprises the following steps:
Step S301, an SCD header file corresponding to the SCD service is obtained.
In step S302, the function and the function parameter corresponding to the SCD API included in the SCD header file, the data structure, and the like are created into an IDL file.
Illustratively, table 1 shows the data structure in the partial SCD header file, and the correspondence between functions and function parameters and the structure body data in the IDL file.
TABLE 1
In step S303, the IDL file is converted into SCD SERVER units and SCD CLIENT units, respectively, by an IDL converting tool.
Through the IDL conversion tool, the IDL file can be converted into a plurality of programming languages, resulting in SCD SERVER units and SCD CLIENT units of code, respectively. Illustratively, table 2 shows the code of SCD SERVER units and SCD CLIENT units derived from the IDL file in Table 1.
TABLE 2
In step S304, SCD SERVER units, mock units, interactive chip driving units and RPC frames based on IDL protocol are integrated into the service module.
In step S305, SCD CLIENT units, an IDL protocol-based RPC frame, a test frame unit, and a traffic unit are integrated into a test module.
Step S306, generating a test script based on SCD CLIENT units and the set flow data.
Illustratively, table 3 shows test scripts built based on client units and traffic data.
TABLE 3 Table 3
Step S307, executing the test script, the test module and the service module test the SCD service under the IDL-based protocol RPC framework.
Fig. 4 shows a flow of a method for testing driving of a switching chip according to an embodiment of the present application from another angle. As shown in fig. 4, after obtaining the IDL file based on the SCD header file, the IDL file is converted into SCD SERVER units and SCD CLIENT units respectively by the conversion module, a service module is generated based on SCD SERVER units, a test module is generated based on SCD CLIENT units, and the service module and the test module communicate through the transmission service module. The service module comprises a service unit, a Mock unit, an interactive chip driving unit and a tested chip unit; the test module includes a test frame unit and a flow unit. The transmission service module is used for the mutual network communication of the service module and the test module and the conversion of communication data, is an RPC framework based on IDL protocol and is used for providing on-line remote service.
Based on the same inventive concept as the above-mentioned exchange chip driving test method, the embodiment of the application also provides an exchange chip driving test device. As shown in fig. 5, the switching chip driving test apparatus includes a data conversion unit 501, a test module generation unit 502, a service module generation unit 503, and a test script generation unit 504. Wherein,
A data conversion unit 501, configured to obtain SCD API information corresponding to a SCD service driven by a switching chip associated with a network service; converting SCD API information corresponding to the SCD service into structural body data in a set format;
a test module generating unit 502, configured to generate client units according to a client programming language based on the structure data, and generate test modules for being installed on a client device based on the client units, respectively;
A service module generating unit 503, configured to generate service end units according with a service end programming language based on the structure body data, and generate service modules for being installed on a service end device based on the service end units;
and the test script generating unit 504 is configured to generate a test script based on the client unit and the set flow data, run the test script based on the test module and the service module, and test the SCD API.
In an optional embodiment, the SCD API information includes a function and a function parameter corresponding to the SCD API; the data conversion unit 501 is specifically configured to:
acquiring an SCD header file corresponding to the SCD service;
And acquiring a function and a function parameter corresponding to the SCD API contained in the SCD header file.
In an alternative embodiment, the test module generating unit 502 is specifically configured to:
Converting the structural body data into client data conforming to a client programming language, acquiring a designated function as a public function library, and generating the client unit based on the client data and the public function library;
The service module generating unit 503 is specifically configured to:
And converting the structural body data into server-side data conforming to a server-side programming language, and adding SCD API call processing logic into a function in the server-side data to obtain the server-side unit.
In an alternative embodiment, the test module generating unit 502 is specifically configured to:
acquiring a transmission service unit, a test frame unit and a flow unit in a set format;
And generating the test module based on the client unit, the transmission service unit, the test framework unit and the flow unit.
In an alternative embodiment, the service module generating unit 503 is specifically configured to:
Acquiring an interactive chip driving unit, a transmission service unit with a set format and a default processing unit; the default processing unit is used for performing preset processing on default functions;
and generating the service module based on the server side unit, the interaction chip driving unit, the transmission service unit and the default processing unit.
In an alternative embodiment, the set format is an interface description language IDL format; the transport service unit employs a remote procedure call RPC framework.
Based on the same inventive concept as the above-mentioned exchange chip driving test method, the embodiment of the application also provides an exchange chip driving test system. As shown in fig. 6, the system includes a client device 610 and a server device 620. The test module is installed on the client device 610, and the service module is installed on the server device 620. Client device 610 and server device 620 may communicate using an RPC framework.
Based on the same inventive concept as the above-mentioned exchange chip driving test method, the embodiment of the application also provides an electronic device. The architecture of the electronic device may be represented by the architecture shown in fig. 7, including a memory 701, a communication module 703, and one or more processors 702.
Memory 701 for storing a computer program for execution by processor 702. The memory 701 may mainly include a memory program area and a memory data area, where the memory program area may store an operating system, a program required for running an instant messaging function, and the like, such as the test module or the service module described above; the storage data area can store various instant messaging information, operation instruction sets and the like.
The memory 701 may be a volatile memory (RAM), such as a random-access memory (RAM); the memory 701 may also be a non-volatile memory (non-volatile memory), such as a read-only memory, a flash memory (flash memory), a hard disk (HARD DISK DRIVE, HDD) or a Solid State Disk (SSD), or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. Memory 701 may be a combination of the above.
The processor 702 may include one or more central processing units (central processing unit, CPUs) or digital processing units, or the like. A processor 702 for running the above-described test method when calling the computer program stored in the memory 701.
The communication module 703 is used for communicating with other devices.
The specific connection medium between the memory 701, the communication module 703 and the processor 702 is not limited in the embodiment of the present application. The embodiments of the present disclosure are illustrated in fig. 7 by a bus 704 between a memory 701 and a processor 702, where the bus 704 is indicated by a bold line in fig. 7, and the connection between other components is merely illustrative and not limiting. The bus 704 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus.
It will be appreciated that the architecture shown in fig. 7 is merely illustrative, and that a client device or server device may also include more or fewer components than shown in fig. 7, or have a different configuration than shown in fig. 7. The components shown in fig. 7 may be implemented in hardware, software, or a combination thereof.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the switch chip drive test method in the above-described embodiment. The program product may take the form of any combination of one or more readable media, which may be readable signal media or readable storage media.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (7)

1. A method for testing the drive of a switching chip, comprising:
acquiring an SCD header file corresponding to a network service-associated switching chip driving SCD service, and acquiring a function and a function parameter corresponding to an included SCD API from the SCD header file;
Converting the functions and function parameters corresponding to the SCD API into structural body data in a set format;
converting the structural body data into client data conforming to a client programming language, acquiring a designated function as a public function library, and generating a client unit based on the client data and the public function library; generating a test module for installation on a client device based on the client unit;
Converting the structural body data into service end data conforming to a service end programming language, and adding SCD API call processing logic into a function in the service end data to obtain a service end unit; generating a service module for being installed on a server device based on the server unit;
and generating a test script based on the client unit and the set flow data, and running the test script based on the test module and the service module to test the SCD API.
2. The method of claim 1, wherein the generating a test module for installation on a client device based on the client unit comprises:
acquiring a transmission service unit, a test frame unit and a flow unit in a set format;
And generating the test module based on the client unit, the transmission service unit, the test framework unit and the flow unit.
3. The method of claim 1, wherein the generating a traffic module for installation on a server device based on the server unit comprises:
Acquiring an interactive chip driving unit, a transmission service unit with a set format and a default processing unit; the default processing unit is used for performing preset processing on default functions;
and generating the service module based on the server side unit, the interaction chip driving unit, the transmission service unit and the default processing unit.
4. A method according to claim 2 or 3, wherein the set format is an interface description language IDL format; the transport service unit employs a remote procedure call RPC framework.
5. A switching chip drive test apparatus, the apparatus comprising:
The data conversion unit is used for acquiring an SCD header file corresponding to the SCD service driven by the exchange chip associated with the network service, and acquiring a function and a function parameter corresponding to the SCD API from the SCD header file; converting the functions and function parameters corresponding to the SCD API into structural body data in a set format;
The test module generating unit is used for converting the structural body data into client data conforming to a client programming language, acquiring a designated function as a public function library and generating a client unit based on the client data and the public function library; generating a test module for installation on a client device based on the client unit;
The service module generating unit is used for converting the structural body data into service end data conforming to a service end programming language, and adding SCD API calling processing logic in a function in the service end data to obtain a service end unit; generating a service module for being installed on a server device based on the server unit;
And the test script generating unit is used for generating a test script based on the client unit and the set flow data, running the test script based on the test module and the service module and testing the SCD API.
6. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, the computer program, when executed by the processor, implementing the method of any of claims 1-4.
7. A computer-readable storage medium having a computer program stored therein, characterized in that: the computer program, when executed by a processor, implements the method of any of claims 1-4.
CN202110669644.XA 2021-06-17 2021-06-17 Method and device for testing driving of switching chip, electronic equipment and storage medium Active CN113360386B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110669644.XA CN113360386B (en) 2021-06-17 2021-06-17 Method and device for testing driving of switching chip, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110669644.XA CN113360386B (en) 2021-06-17 2021-06-17 Method and device for testing driving of switching chip, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113360386A CN113360386A (en) 2021-09-07
CN113360386B true CN113360386B (en) 2024-06-14

Family

ID=77534798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110669644.XA Active CN113360386B (en) 2021-06-17 2021-06-17 Method and device for testing driving of switching chip, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113360386B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114238179A (en) * 2021-11-26 2022-03-25 锐捷网络股份有限公司 Data transmission system, method, device and medium
CN114430385A (en) * 2022-01-17 2022-05-03 锐捷网络股份有限公司 Network equipment detection method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106919509A (en) * 2017-03-09 2017-07-04 腾讯科技(深圳)有限公司 A kind of client generation method, device and electronic equipment
CN109032920A (en) * 2018-06-05 2018-12-18 北京奇安信科技有限公司 A kind of method and device for being tested protocol interface

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100389572C (en) * 2005-04-11 2008-05-21 华为技术有限公司 System and method for long-distance calling communication assembly
EP2088506A1 (en) * 2008-02-06 2009-08-12 Software AG Method and system for calling services from a remote client
CN110162468B (en) * 2019-04-26 2024-07-09 腾讯科技(深圳)有限公司 Test method, test device and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106919509A (en) * 2017-03-09 2017-07-04 腾讯科技(深圳)有限公司 A kind of client generation method, device and electronic equipment
CN109032920A (en) * 2018-06-05 2018-12-18 北京奇安信科技有限公司 A kind of method and device for being tested protocol interface

Also Published As

Publication number Publication date
CN113360386A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN110752947B (en) K8s cluster deployment method and device, and deployment platform
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
CN106776313B (en) Method and device for simulating service and centralized management platform
CN113360386B (en) Method and device for testing driving of switching chip, electronic equipment and storage medium
US9442822B2 (en) Providing a visual representation of a sub-set of a visual program
CN106713469B (en) Dynamic loading method, device and system for distributed container
WO2016082476A1 (en) Service testing method and apparatus
US8589381B2 (en) Resource management program, resource management process, and resource management apparatus
CN114741060A (en) Business system development method and device based on middle platform
CN111064626A (en) Configuration updating method, device, server and readable storage medium
WO2016180237A1 (en) Northbound interface test apparatus and test method for northbound interface
CN109460222A (en) Modularization method, apparatus, equipment and the storage medium of application program
CN112765246B (en) Task processing method, device, electronic equipment and storage medium
CN111176989A (en) Fault injection test scenario case model and framework based on service arrangement
CN112698930B (en) Method, device, equipment and medium for obtaining server identification
WO2016197688A1 (en) Data collection method and device
US20060106863A1 (en) System and/or method for implementing efficient techniques for testing common information model providers
CN111597020A (en) Application Programming Interface (API) debugging method and debugging terminal
CN111353880B (en) Transaction service packaging method, device and system
CN101251824B (en) Method for testing public objects request proxy structure and tools
CN116560756B (en) Service orchestration method, electronic device, computer-readable storage medium
CN114398082B (en) Compatible operation method and device for frame type block chain application
CN118092982B (en) Multi-cluster operation and maintenance method, equipment and medium for cloud native application
CN110798384B (en) Protocol simulation test system and method based on protocol layering
CN114225384B (en) Communication method, system, equipment and storage medium based on combinable GM instruction

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