CN112084000B - Container cluster testing method and device - Google Patents

Container cluster testing method and device Download PDF

Info

Publication number
CN112084000B
CN112084000B CN202010702656.3A CN202010702656A CN112084000B CN 112084000 B CN112084000 B CN 112084000B CN 202010702656 A CN202010702656 A CN 202010702656A CN 112084000 B CN112084000 B CN 112084000B
Authority
CN
China
Prior art keywords
test
container
target
component
testing
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
CN202010702656.3A
Other languages
Chinese (zh)
Other versions
CN112084000A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010702656.3A priority Critical patent/CN112084000B/en
Publication of CN112084000A publication Critical patent/CN112084000A/en
Application granted granted Critical
Publication of CN112084000B publication Critical patent/CN112084000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Landscapes

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

Abstract

The application discloses a method and a device for testing a container cluster, and relates to the technical fields of computers, internet testing and cloud computing. The specific implementation scheme is as follows: obtaining a test instruction aiming at a container cluster, wherein the test instruction comprises a test object identifier and a test parameter; judging whether all container cloud nodes in the container cluster contain target test components corresponding to the test object identifiers; and if the target test component is included, controlling the target test component to execute the test instruction according to the test parameter. Therefore, based on the matching of the test object identification and the test component in the test instruction, the corresponding visual test component in the container can be directly determined, the test of the container cloud node is realized based on the target test component, and the test based on the container cluster original ecological architecture is realized.

Description

Container cluster testing method and device
Technical Field
The application relates to the technical fields of computers, internet testing and cloud service, in particular to a method and a device for testing a container cluster.
Background
As the cloud native technology concept is practiced in the industry, service deployment of each industry gradually migrates to (Kubernetes, K8S), and container cluster services and continuous integration capability are built based on Kubernetes. The automatic test of container cluster abnormality is an important link of quality assurance work.
In the related art, the anomaly test is constructed based on a physical machine or a virtual machine, and the test is performed based on a cloud cluster architecture deployed by the Kubernetes under the condition that the cloud original ecology has the Kubernetes cluster authority.
Disclosure of Invention
The application provides a method and a device for testing a container cluster, which can directly determine a corresponding visual test assembly in a container based on the matching of a test object identifier and the test assembly in a test instruction, realize the test of a container cloud node based on a target test assembly and realize the test based on an original ecological architecture of the container cluster.
According to an aspect of the present application, there is provided a method for testing a container cluster, including: obtaining a test instruction aiming at a container cluster, wherein the test instruction comprises a test object identifier and a test parameter; and when all container cloud nodes in the container cluster contain target test components corresponding to the test object identifiers, controlling the target test components to execute the test instructions according to the test parameters.
According to another aspect of the present application, there is provided a testing apparatus for a container cluster, comprising: the device comprises an acquisition module, a test module and a storage module, wherein the acquisition module is used for acquiring a test instruction aiming at a container cluster, and the test instruction comprises a test object identifier and a test parameter; and the testing module is used for controlling the target testing component to execute the testing instruction according to the testing parameter when all the container cloud nodes in the container cluster contain the target testing component corresponding to the testing object identifier.
According to still another aspect of the present application, there is provided an electronic apparatus including: at least one processor; a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of testing a container cluster as described in the embodiments of the first aspect above.
According to a further aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method for testing a container cluster described in the embodiment of the first aspect.
According to a further aspect of the present application there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of testing a container cluster as described in the embodiments of the first aspect above.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a schematic diagram of a system architecture for performing a method of testing a cluster of containers according to a first embodiment of the application;
FIG. 2 is a flow chart of a method of testing a container cluster according to a second embodiment of the application;
FIG. 3 is a schematic diagram of a system architecture for performing a method of testing a cluster of containers according to a third embodiment of the application;
Fig. 4 is a block diagram of an abnormal service access layer structure according to a fourth embodiment of the present application;
FIG. 5 is a schematic diagram of a system architecture for performing a method of testing a cluster of containers according to a fifth embodiment of the application;
FIG. 6 is a schematic diagram of a testing apparatus for a cluster of containers according to a sixth embodiment of the application;
FIG. 7 is a schematic diagram of a testing apparatus for a cluster of containers according to a seventh embodiment of the application;
fig. 8 is a block diagram of an electronic device for implementing a method of testing a container cluster in accordance with an embodiment of the application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the technical problems that in the prior art, a physical machine or a virtual machine is constructed based on computer technology in the technical field of computers, exception testing is dependent on the physical machine or the virtual machine, and the mode cannot adapt to the architecture of a container cluster, the application provides a structure which can be deployed in a cloud primary scene based on Kubernetes in the container cloud nodes, and because a plurality of container cloud nodes possibly exist in the Kubernetes cluster and a plurality of containers can be operated on each container cloud node, the application provides an automatic exception testing scheme, based on the characteristic of container deployment, cluster configuration can be managed to an automatic exception construction service, and a test component can be deployed in the cluster through a resource object of the Kubernetes by one key, so that the test can be performed on each container cloud node.
The system for executing the testing method of the container cluster according to the present application is shown in fig. 1, and referring to fig. 1, the system comprises an abnormal service access layer, is arranged independently of the container cluster, is convenient for management of the container cluster, and the like, the container cluster comprises a plurality of nodes, each node comprises a plurality of containers (service containers in the figure), wherein one node in the container cluster comprises a testing management module for sending a corresponding testing instruction to a testing component in a middle testing component module of each node, and each testing component comprises a testing code and the like for a corresponding testing object identifier.
The method for testing a container cluster according to the embodiment of the present application is described below with reference to an embodiment, where the execution subject of the method for testing a container cluster may be an abnormal service access layer in the system described above.
FIG. 2 is a flow chart of a method of testing a cluster of containers according to one embodiment of the application, as shown in FIG. 2, the method comprising:
Step 101, obtaining a test instruction aiming at a container cluster, wherein the test instruction comprises a test object identifier and a test parameter.
The test object identifier may be any information uniquely corresponding to the test object, for example, may be a test object name (e.g., CPU), such as test object location information, etc. The test parameters correspond to the test content corresponding to the test object identifier, for example, when the test object is a CPU, the test parameters may be the occupancy rate of the CPU, and the like. For another example, when the test object is a network, then the test parameter may be a networking status flag or the like.
In one embodiment of the present application, the test instruction may be manually input by a tester at the abnormal service interface layer, and in order to improve the test efficiency and reduce the labor cost, referring to fig. 3, the candidate test instruction input by the user may be in a data exchange format (JavaScript Object Notation, JSON), and further, the candidate test instruction format is converted according to the hypertext transfer protocol (HyperText Transfer Protocol, HTTP) to generate the test instruction, where the test instruction is based on an application layer protocol for a distributed, collaborative and hypermedia information system, so that the protocol difference between devices can be shielded, and the test instruction can be ensured to be recognized and received by the abnormal service access layer.
Step 102, when all container cloud nodes in the container cluster contain target test components corresponding to the test object identifiers, controlling the target test components to execute test instructions according to the test parameters.
It can be appreciated that, based on the characteristic of container cloud deployment, a user can host the cluster configuration to an automatic exception construction service, and the service deploys a test component into the cluster through a resource object of Kubernetes by one key, so that each node can be ensured to perform testing. That is, a test component is preset at each container cloud node, and a test object of the test component may include a test component for a host machine or a test component for business service of the container cloud, where the test component may be understood as an integrated code for executing related test functions.
In one embodiment of the present application, the corresponding relationship between the test object identifier and the test component identifier may be stored in the database in advance, so as to obtain the constructed test component identifier in the pre-stored container cluster, and further determine whether the constructed test component identifier includes the test component identifier.
And if the target test component is included, controlling the target test component to execute the test instruction according to the test parameter.
In this embodiment, if the target test component is included, the target test component is controlled to execute a test instruction according to the test parameter, and as mentioned above, the target test component is an integrated code, and the test parameter is specific test content, and then a corresponding test instruction can be obtained according to the corresponding test parameter input by the integrated code corresponding to the test component, and according to the test instruction, the test on the container cluster can be realized.
For example, when the target test component is a test on the CPU, and the test parameter is the occupancy rate of 80%, the occupancy rate is directly written in the target test component and the memory test code of the CPU, and then an occupancy rate test instruction for 80% of the memory of the CPU is obtained, and the container cloud node is controlled to specify the corresponding test instruction.
For example, when the test object is related to the service, a target container corresponding to the target test component in each container cloud node is determined, for example, when the test object is a network, it is determined that the corresponding target is easily a network service container, and then the target test component is controlled to execute a test instruction on the target container according to the test parameter.
In another embodiment of the present application, when the container clusters do not include the target test component, the target test component may also be built in each container cloud node, so as to ensure that the container cloud nodes in each cluster deploy the target test component.
Therefore, the testing method of the container cluster in the embodiment is suitable for the container cluster environment, supports the cluster hosting and the automatic abnormal construction of all nodes of the hosting cluster, does not need to be manually deployed and managed by a user, has independent mirror image environments of the testing components, is not influenced by target environments, can provide HTTP service in the actual execution process, is convenient to carry out automatic testing based on JSON testing instructions, is independent of service itself for abnormal service network, ensures to take effect in different service environments, and does not need to be changed by service programs.
In summary, the method for testing a container cluster according to the embodiment of the present application obtains a test instruction for the container cluster, where the test instruction includes a test object identifier and a test parameter, determines whether all container cloud nodes in the container cluster include a target test component corresponding to the test object identifier, and further, if the container cloud nodes include the target test component, controls the target test component to execute the test instruction according to the test parameter. Therefore, based on the matching of the test object identification and the test component in the test instruction, the corresponding visual test component in the container can be directly determined, the test of the container cloud node is realized based on the target test component, and the test based on the container cluster original ecological architecture is realized.
In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the following description is made in connection with a specific test scenario.
In some possible embodiments, as shown in fig. 4, the abnormal service access layer provides, as a component deployed outside the cluster, a capability function module for cluster management, intra-cluster test component management, test management, and test status query. The abnormal service access layer can convert the test instruction into a format which can be understood by the container cluster, for example, after the user hosts the cluster to the abnormal service, the cluster records and manages in the abnormal service access layer. The test personnel can send a test instruction to an access layer in a JSON mode through an HTTP request, the abnormal service access layer can detect whether a test component corresponding to the test instruction exists in the cluster, the abnormal access layer analyzes JSON information of a user and converts the JSON information into description information (test parameters) corresponding to an abnormal user-defined resource object (CustomResourceDefinition, CRD) (test object), and the description information (test parameters) is issued to the cluster according to the abnormal test parameters specified by the user. And a test management module in the cluster monitors the change of the abnormal CRD and executes the test operation corresponding to the corresponding test instruction. In one embodiment of the application, the types of test parameters may be build parameter types, delete parameter types, and query parameter types.
When the test parameters are deleting parameters, the control target test component deletes the test process of the test object identifier, that is, referring to fig. 5, the abnormal service access layer deletes the corresponding abnormal CRD, the test management module monitors the test instruction with the type of deletion, queries the details of the CRD, including the test parameters and the test object, generates a test stop instruction, and sends the test stop instruction to the target test component of the corresponding container to stop the test.
When the test parameters are query parameters, the control target test component obtains a test result corresponding to the test object identifier, and with continued reference to fig. 5, when the tester performs abnormal state query, the abnormal service access layer sends a test instruction for querying the abnormal CRD to the container cluster, and the test management module queries the detailed information (test result) of the abnormal CRD in the persistent information and returns the detailed information. The persistence information stores historical test results uploaded by each container cloud node through the corresponding target test component.
When the test parameters are construction parameters, the control target test component constructs a test process corresponding to the test object identifier, and with continued reference to fig. 5, in this embodiment, when a tester builds a test instruction, the abnormal service access layer sends the test instruction to the corresponding container cloud cluster, and after the test management module of the container cloud node monitors the test instruction, sends the abnormal instruction to the target test component of the corresponding container according to the test object and the test parameters, and executes the test operation of the test instruction object.
In summary, the testing method of the container cluster in the embodiment of the application can realize common testing services such as increasing and stopping testing based on the original ecological architecture of the container cloud cluster server, and has important significance on the application prospect of the container cloud.
In order to realize the embodiment, the application further provides a device for testing the container cluster. Fig. 6 is a schematic structural view of a testing apparatus of a container cluster according to an embodiment of the present application, and as shown in fig. 6, the testing apparatus of a container cluster includes: an acquisition module 10, a test module 20, wherein,
The acquisition module 10 is configured to acquire a test instruction for a container cluster, where the test instruction includes a test object identifier and a test parameter;
And the test module 20 is configured to control the target test component to execute the test instruction according to the test parameter when all the container cloud nodes in the container cluster include the target test component corresponding to the test object identifier.
In one embodiment of the present application, as shown in fig. 7, the apparatus further comprises, on the basis of that shown in fig. 6: a query module 30 and a determination module 40, wherein,
The query module 30 is used for querying a preset database to obtain a test component identifier corresponding to the test object identifier;
The acquisition module 10 is further configured to acquire a constructed test component identifier in a pre-stored container cluster;
The determining module 40 is configured to, when the built test component identifier includes the test component identifier, determine that all container cloud nodes in the container cluster include the target test component corresponding to the test object identifier in one embodiment of the present application, and specifically is configured to:
Inquiring a preset database to obtain a test component identifier corresponding to the test object identifier;
Acquiring a constructed test component identifier in a pre-stored container cluster;
and judging whether the constructed test component identifier comprises the test component identifier or not.
In summary, the testing device for a container cluster in the embodiment of the application obtains a testing instruction for the container cluster, wherein the testing instruction comprises a testing object identifier and a testing parameter, judges whether all container cloud nodes in the container cluster contain target testing components corresponding to the testing object identifier, and further controls the target testing components to execute the testing instruction according to the testing parameter if the target testing components are contained. Therefore, based on the matching of the test object identification and the test component in the test instruction, the corresponding visual test component in the container can be directly determined, the test of the container cloud node is realized based on the target test component, and the test based on the container cluster original ecological architecture is realized.
In one embodiment of the application, the test module 30 is specifically configured to:
When the test parameters are deleting parameters, the target test component is controlled to delete the test process of the test object identifier;
when the test parameters are query parameters, the control target test component obtains a test result corresponding to the test object identifier;
And when the test parameters are construction parameters, controlling the target test component to construct a test process corresponding to the test object identifier.
It should be noted that, the foregoing method for testing a container cluster is also applicable to the device for testing a container cluster according to the embodiments of the present application, and the implementation principle is similar and will not be described herein.
In summary, the testing device for the container cluster can realize common testing services such as increasing and stopping testing based on the original ecological architecture of the container cloud cluster server, and has important significance on the application prospect of container cloud.
According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
Fig. 8 is a block diagram of an electronic device according to a method for testing a container cluster according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 8, the electronic device includes: one or more processors 801, memory 802, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 801 is illustrated in fig. 8.
Memory 802 is a non-transitory computer readable storage medium provided by the present application. Wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of testing a container cluster provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the method of testing a container cluster provided by the present application.
The memory 802 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the acquisition module 10, the test module 20 shown in fig. 5) corresponding to the method of testing a container cluster in an embodiment of the present application. The processor 801 executes various functional applications of the server and data processing, i.e., a method of implementing the testing of container clusters in the above-described method embodiment, by running non-transitory software programs, instructions, and modules stored in the memory 802.
Memory 802 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created from the use of the electronic device for testing of the container clusters, and the like. In addition, memory 802 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 802 may optionally include memory located remotely from processor 801, which may be connected to the tested electronic devices of the container cluster via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the method of testing a container cluster may further include: an input device 803 and an output device 804. The processor 801, memory 802, input devices 803, and output devices 804 may be connected by a bus or other means, for example in fig. 8.
The input device 803 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the tested electronic device of the container cluster, such as input devices for a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, etc. The output device 804 may include a display apparatus, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: the application also proposes a computer program which, when executed by a processor, implements the method of testing a container cluster described in the above embodiments, the one or more computer programs being executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special purpose or general purpose programmable processor, being capable of receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual PRIVATE SERVER" or simply "VPS") are overcome.
The server may also be a server of a distributed system or a server that incorporates a blockchain.
According to the technical scheme provided by the embodiment of the application, the test instruction for the container cluster is obtained, wherein the test instruction comprises the test object identifier and the test parameter, whether all the container cloud nodes in the container cluster contain the target test component corresponding to the test object identifier is judged, and if the target test component is contained, the target test component is controlled to execute the test instruction according to the test parameter. Therefore, based on the matching of the test object identification and the test component in the test instruction, the corresponding visual test component in the container can be directly determined, the test of the container cloud node is realized based on the target test component, and the test based on the container cluster original ecological architecture is realized.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed embodiments are achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (10)

1. A method of testing a cluster of containers, comprising:
Obtaining a test instruction aiming at a container cluster, wherein the test instruction comprises a test object identifier and a test parameter;
When all container cloud nodes in the container cluster contain target test components corresponding to the test object identifiers, controlling the target test components to execute the test instructions according to the test parameters;
wherein before said controlling said target test component to execute said test instruction according to said test parameter, comprising;
inquiring a preset database to obtain a test component identifier corresponding to the test object identifier;
acquiring a pre-stored constructed test component identifier in the container cluster;
When the built test component identifier comprises the test component identifier, all container cloud nodes in the container cluster comprise target test components corresponding to the test object identifier;
and if each container cloud node comprises a plurality of containers, controlling the target test component to execute the test instruction according to the test parameters, wherein the method comprises the following steps:
Determining a target container corresponding to the target test component in each container cloud node;
And controlling the target test assembly to execute the test instruction on the target container according to the test parameter.
2. The method of claim 1, wherein the obtaining test instructions for a cluster of containers comprises:
Acquiring a candidate test instruction in a lightweight data exchange format;
and converting the format of the candidate test instruction according to a hypertext transfer protocol, and generating the test instruction.
3. The method of claim 1, wherein the controlling the target test component to execute the test instruction according to the test parameter comprises:
When the test parameters are deleting parameters, controlling the target test component to delete the test process of the test object identifier;
when the test parameters are query parameters, controlling the target test assembly to acquire a test result corresponding to the test object identifier;
And when the test parameters are construction parameters, controlling the target test component to construct a test process corresponding to the test object identifier.
4. The method of claim 1, further comprising:
and when container cloud nodes which do not contain the target test components exist in the container cluster, constructing the target test components in each container cloud node.
5. A device for testing a cluster of containers, comprising:
the device comprises an acquisition module, a test module and a storage module, wherein the acquisition module is used for acquiring a test instruction aiming at a container cluster, and the test instruction comprises a test object identifier and a test parameter;
The testing module is used for controlling the target testing component to execute the testing instruction according to the testing parameter when all container cloud nodes in the container cluster contain the target testing component corresponding to the testing object identifier;
The query module is used for querying a preset database to obtain a test component identifier corresponding to the test object identifier;
the acquisition module is further used for acquiring a pre-stored constructed test component identifier in the container cluster;
the determining module is used for determining whether all container cloud nodes in the container cluster contain target test components corresponding to the test object identifiers when the built test component identifiers contain the test component identifiers;
Each container cloud node comprises a plurality of containers, and the testing module is specifically configured to:
Determining a target container corresponding to the target test component in each container cloud node;
And controlling the target test assembly to execute the test instruction on the target container according to the test parameter.
6. The apparatus of claim 5, wherein the obtaining module is specifically configured to:
Acquiring a candidate test instruction in a lightweight data exchange format;
and converting the format of the candidate test instruction according to a hypertext transfer protocol, and generating the test instruction.
7. The apparatus of claim 5, wherein the test module is specifically configured to:
When the test parameters are deleting parameters, controlling the target test component to delete the test process of the test object identifier;
when the test parameters are query parameters, controlling the target test assembly to acquire a test result corresponding to the test object identifier;
And when the test parameters are construction parameters, controlling the target test component to construct a test process corresponding to the test object identifier.
8. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of testing a container cluster according to any one of claims 1-4.
9. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of testing a container cluster of any one of claims 1-4.
10. A computer program product comprising a computer program which, when executed by a processor, implements a method of testing a container cluster according to any of claims 1-4.
CN202010702656.3A 2020-07-20 2020-07-20 Container cluster testing method and device Active CN112084000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010702656.3A CN112084000B (en) 2020-07-20 2020-07-20 Container cluster testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010702656.3A CN112084000B (en) 2020-07-20 2020-07-20 Container cluster testing method and device

Publications (2)

Publication Number Publication Date
CN112084000A CN112084000A (en) 2020-12-15
CN112084000B true CN112084000B (en) 2024-05-28

Family

ID=73735473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010702656.3A Active CN112084000B (en) 2020-07-20 2020-07-20 Container cluster testing method and device

Country Status (1)

Country Link
CN (1) CN112084000B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114915571A (en) * 2021-02-10 2022-08-16 中国电信股份有限公司 Method, equipment and storage medium for automatically testing k8s cluster network quality
US20230409710A1 (en) * 2022-05-26 2023-12-21 Microsoft Technology Licensing, Llc Allow list of container images based on deployment configuration at a container orchestration service

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8082362B1 (en) * 2006-04-27 2011-12-20 Netapp, Inc. System and method for selection of data paths in a clustered storage system
CN108737468A (en) * 2017-04-19 2018-11-02 中兴通讯股份有限公司 Cloud platform service cluster, construction method and device
US10223242B1 (en) * 2018-08-27 2019-03-05 Capital One Services, Llc Testing an application in a production infrastructure temporarily provided by a cloud computing environment
CN109583223A (en) * 2017-09-29 2019-04-05 北京国双科技有限公司 A kind of detection method and device of pair of big data security deployment
CN110297766A (en) * 2019-06-03 2019-10-01 合肥移瑞通信技术有限公司 Method for testing software and software testing system based on distributed test node cluster

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8082362B1 (en) * 2006-04-27 2011-12-20 Netapp, Inc. System and method for selection of data paths in a clustered storage system
CN108737468A (en) * 2017-04-19 2018-11-02 中兴通讯股份有限公司 Cloud platform service cluster, construction method and device
CN109583223A (en) * 2017-09-29 2019-04-05 北京国双科技有限公司 A kind of detection method and device of pair of big data security deployment
US10223242B1 (en) * 2018-08-27 2019-03-05 Capital One Services, Llc Testing an application in a production infrastructure temporarily provided by a cloud computing environment
CN110297766A (en) * 2019-06-03 2019-10-01 合肥移瑞通信技术有限公司 Method for testing software and software testing system based on distributed test node cluster

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于弹性伸缩集群的云负载测试技术;颜硕彦;晋文明;李昌建;;现代信息科技;20200125(02);全文 *

Also Published As

Publication number Publication date
CN112084000A (en) 2020-12-15

Similar Documents

Publication Publication Date Title
CN112000365B (en) Service grid configuration method, device, equipment and medium based on micro-service architecture
CN110765024B (en) Simulation test method, simulation test device, electronic equipment and computer readable storage medium
CN110995480B (en) Block chain network deployment method, device, electronic equipment and medium
CN111277647B (en) Block chain network member management method, device, equipment and medium
CN112084000B (en) Container cluster testing method and device
CN111752843A (en) Method, device, electronic equipment and readable storage medium for determining influence surface
CN111913998B (en) Data processing method, device, equipment and storage medium
CN111913884A (en) Distributed test method, device, equipment, system and readable storage medium
CN112052185B (en) Exception handling method and device for applet, electronic equipment and storage medium
CN111770176B (en) Traffic scheduling method and device
CN111767089A (en) Method, device and equipment for loading file and storage medium
CN111835592A (en) Method, apparatus, electronic device and readable storage medium for determining robustness
CN112491617A (en) Link tracking method, device, electronic equipment and medium
JP2010128597A (en) Information processor and method of operating the same
CN112532528B (en) Message routing method and device for rule engine
CN112379951A (en) Service interface access method, device, electronic equipment and medium
CN111767149A (en) Scheduling method, device, equipment and storage equipment
CN112559808B (en) Data processing method and device and electronic equipment
CN112671665B (en) Intelligent traffic scheduling method, device, equipment and storage medium
CN113778973B (en) Data storage method and device
CN111581049B (en) Distributed system running state monitoring method, device, equipment and storage medium
CN115277428A (en) Method and apparatus for configuring a network
CN112527635B (en) Fault injection method and device, electronic equipment and storage medium
CN112153754B (en) Point-to-point connection method and device, electronic equipment and storage medium
CN111597026A (en) Method and device for acquiring information

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