[go: up one dir, main page]

CN110011877A - A kind of switch test method and apparatus - Google Patents

A kind of switch test method and apparatus Download PDF

Info

Publication number
CN110011877A
CN110011877A CN201910332225.XA CN201910332225A CN110011877A CN 110011877 A CN110011877 A CN 110011877A CN 201910332225 A CN201910332225 A CN 201910332225A CN 110011877 A CN110011877 A CN 110011877A
Authority
CN
China
Prior art keywords
virtual machine
onie
nos
virtual
physical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910332225.XA
Other languages
Chinese (zh)
Other versions
CN110011877B (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent 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 Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910332225.XA priority Critical patent/CN110011877B/en
Publication of CN110011877A publication Critical patent/CN110011877A/en
Application granted granted Critical
Publication of CN110011877B publication Critical patent/CN110011877B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of switch test method and apparatus, comprising: multiple virtual machines is established on physical host, ONIE virtual machine, Dynamic Host Configuration Protocol server virtual machine and HTTP server virtual machine including being tested interchanger;Multiple virtual machines are connected with the shared network equipment and configure virtual environment;ONIE virtual machine is set to access Dynamic Host Configuration Protocol server virtual machine in virtual environment to obtain dynamic IP addressing;ONIE virtual machine is set to access HTTP server virtual machine in virtual environment by dynamic IP addressing to obtain ONIE self refresh file and/or NOS mirror image;The function of updating ONIE, the new NOS of installation, and/or the existing NOS of unloading is tested according to ONIE self refresh file and/or NOS mirror image.Technical solution of the present invention can carry out ONIE test to different interchangers or different types of interchanger, reduce the testing time, reduce resource occupation, improve resource utilization.

Description

一种交换机测试方法和装置A switch testing method and device

技术领域technical field

本发明涉及虚拟机领域,并且更具体地,特别是涉及一种交换机测试方法与装置。The present invention relates to the field of virtual machines, and more particularly, to a switch testing method and device.

背景技术Background technique

白盒交换机在出厂时必须要配备ONIE系统。ONIE是一个运行在裸机交换机上面的基于LINUX的引导系统,最主要的作用是在白盒交换机所在的网络中查找并发现NOS,并将找到的NOS传输到白盒交换机本地然后安装该NOS。在白盒交换机安装成功之后,用户通过NOS操控白盒交换机来实现对网络资源的管理和控制。所以,设计开发一个健壮的ONIE系统是白盒交换机厂家必须实现的目标之一。具体来说,ONIE需要实现的功能包括“查找并安装NOS”、“卸载NOS”、“查找并更新ONIE”。测试ONIE功能时需要把交换机置于一个网络环境中,使用交换机和若干服务器来进行测试。用实际的交换机和服务器搭建物理测试验证环境需要占用较多硬件设备资源;ONIE功能的测试过程大都包含重启交换机等操作,耗时很长;而且同一时间使用实际的物理环境只能验证一种功能,资源利用率低。The white box switch must be equipped with the ONIE system when it leaves the factory. ONIE is a Linux-based boot system running on bare metal switches. Its main function is to find and discover NOS in the network where the white box switch is located, and transmit the found NOS to the white box switch and then install the NOS. After the white-box switch is successfully installed, the user controls the white-box switch through the NOS to manage and control network resources. Therefore, designing and developing a robust ONIE system is one of the goals that white box switch manufacturers must achieve. Specifically, the functions that ONIE needs to implement include "find and install NOS", "uninstall NOS", and "find and update ONIE". When testing the ONIE function, the switch needs to be placed in a network environment, and the switch and several servers are used for testing. Building a physical test and verification environment with actual switches and servers takes up a lot of hardware equipment resources; the ONIE function test process mostly involves restarting switches and other operations, which takes a long time; and only one function can be verified using the actual physical environment at the same time , resource utilization is low.

针对现有技术中交换机ONIE测试耗时长、资源占用高、资源利用率低的问题,目前尚未有有效的解决方案。Aiming at the problems of long time-consuming, high resource occupation, and low resource utilization rate of switch ONIE testing in the prior art, there is currently no effective solution.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例的目的在于提出一种交换机测试方法与装置,能够对不同交换机或不同类型的交换机进行ONIE测试,降低测试时间、减少资源占用、提高资源利用率。In view of this, the purpose of the embodiments of the present invention is to provide a switch testing method and apparatus, which can perform ONIE testing on different switches or switches of different types, reduce testing time, reduce resource occupation, and improve resource utilization.

基于上述目的,本发明实施例的一方面提供了一种交换机测试方法,包括以下步骤:Based on the above purpose, an aspect of the embodiments of the present invention provides a method for testing a switch, including the following steps:

在物理主机上建立多个虚拟机,包括被测交换机的ONIE虚拟机、DHCP服务器虚拟机和HTTP服务器虚拟机;Create multiple virtual machines on the physical host, including the ONIE virtual machine, DHCP server virtual machine and HTTP server virtual machine of the switch under test;

用共享网络设备连接多个虚拟机并配置虚拟环境;Connect multiple virtual machines with shared network devices and configure virtual environments;

使ONIE虚拟机在虚拟环境中访问DHCP服务器虚拟机以获得动态IP地址;Make the ONIE virtual machine access the DHCP server virtual machine in the virtual environment to obtain a dynamic IP address;

使ONIE虚拟机通过动态IP地址在虚拟环境中访问HTTP服务器虚拟机以获得ONIE自更新文件和/或NOS镜像;Enable ONIE virtual machine to access HTTP server virtual machine in virtual environment through dynamic IP address to obtain ONIE self-updating file and/or NOS image;

根据ONIE自更新文件和/或NOS镜像来测试更新ONIE、安装新的NOS、和/或卸载现有的NOS的功能。The ability to update ONIE, install new NOS, and/or uninstall existing NOS is tested against ONIE self-update files and/or NOS mirrors.

在一些实施方式中,建立ONIE虚拟机包括:In some embodiments, establishing the ONIE virtual machine includes:

编译KVM可用的虚拟机固件和ONIE系统;Compile KVM-available virtual machine firmware and ONIE system;

在KVM中使用虚拟机固件和ONIE系统来启动ONIE虚拟机。Use the virtual machine firmware and ONIE system in KVM to start the ONIE virtual machine.

在一些实施方式中,共享网络设备为设置在物理主机上的物理网桥。In some embodiments, the shared network device is a physical bridge provided on a physical host.

在一些实施方式中,配置虚拟环境包括:In some implementations, configuring the virtual environment includes:

为物理网桥设置名称和IP地址;Set the name and IP address for the physical bridge;

将DHCP服务器虚拟机和HTTP服务器虚拟机所使用的共享网络设备确定为物理网桥的名称和IP地址;Identify the shared network device used by the DHCP server virtual machine and the HTTP server virtual machine as the name and IP address of the physical bridge;

将ONIE虚拟机的后端连接配置为桥接模式,并且将物理网桥的名称和IP地址作为桥接模式的参数。Configure the backend connection of the ONIE virtual machine to bridge mode, and use the name and IP address of the physical bridge as the parameters of bridge mode.

在一些实施方式中,DHCP服务器虚拟机上部署有DHCP、DNS、TFTP、HTTP服务。In some embodiments, DHCP, DNS, TFTP, and HTTP services are deployed on the DHCP server virtual machine.

在一些实施方式中,HTTP服务器虚拟机上部署有HTTP服务。In some implementations, an HTTP service is deployed on the HTTP server virtual machine.

在一些实施方式中,物理主机为linux主机;DHCP服务器虚拟机和HTTP服务器虚拟机为linux服务器的虚拟机。In some embodiments, the physical host is a linux host; the DHCP server virtual machine and the HTTP server virtual machine are virtual machines of a linux server.

在一些实施方式中,ONIE虚拟机为多个;其中,多个ONIE虚拟机并行执行相同的测试。In some embodiments, there are multiple ONIE virtual machines; wherein the multiple ONIE virtual machines execute the same test in parallel.

本发明实施例的另一方面,还提供了一种交换机测试装置,包括:Another aspect of the embodiments of the present invention further provides a switch testing device, including:

处理器;和processor; and

存储器,存储有处理器可运行的程序代码,其中程序代码在由处理器运行时执行上述的交换机测试方法。The memory stores program codes executable by the processor, wherein the program codes execute the above-mentioned switch testing method when executed by the processor.

本发明实施例的另一方面,还提供了一种物理主机,包括上述的交换机测试装置。Another aspect of the embodiments of the present invention further provides a physical host, including the above-mentioned switch testing apparatus.

本发明具有以下有益技术效果:本发明实施例提供的交换机测试方法与装置,通过在物理主机上建立多个虚拟机,包括被测交换机的ONIE虚拟机、DHCP服务器虚拟机和HTTP服务器虚拟机,用共享网络设备连接多个虚拟机并配置虚拟环境,使ONIE虚拟机在虚拟环境中访问DHCP服务器虚拟机以获得动态IP地址,使ONIE虚拟机通过动态IP地址在虚拟环境中访问HTTP服务器虚拟机以获得ONIE自更新文件和/或NOS镜像,根据ONIE自更新文件和/或NOS镜像来测试更新ONIE、安装新的NOS、和/或卸载现有的NOS的功能的技术方案,能够对不同交换机或不同类型的交换机进行ONIE测试,降低测试时间、减少资源占用、提高资源利用率。The present invention has the following beneficial technical effects: the switch testing method and device provided by the embodiments of the present invention, by establishing multiple virtual machines on a physical host, including ONIE virtual machines, DHCP server virtual machines and HTTP server virtual machines of the tested switch, Connect multiple virtual machines with shared network devices and configure the virtual environment so that the ONIE virtual machine can access the DHCP server virtual machine in the virtual environment to obtain a dynamic IP address, and enable the ONIE virtual machine to access the HTTP server virtual machine in the virtual environment through the dynamic IP address In order to obtain ONIE self-update files and/or NOS images, and test technical solutions for updating ONIE, installing new NOS, and/or uninstalling existing NOS functions according to the ONIE self-update files and/or NOS images, it is possible to test the technical solutions for the functions of different switches. Or different types of switches to conduct ONIE test, reduce test time, reduce resource occupation, and improve resource utilization.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can also be obtained according to these drawings without creative efforts.

图1为本发明提供的交换机测试方法的流程示意图;1 is a schematic flowchart of a switch testing method provided by the present invention;

图2为本发明提供的交换机测试方法的物理主机的结构示意图。FIG. 2 is a schematic structural diagram of a physical host of the switch testing method provided by the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention will be further described in detail below with reference to the specific embodiments and the accompanying drawings.

需要说明的是,本发明实施例中所有使用“第一”和“第二″的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”、“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities with the same name but not the same or non-identical parameters. " is only for the convenience of expression, and should not be construed as a limitation on the embodiments of the present invention, and subsequent embodiments will not describe them one by one.

基于上述目的,本发明实施例的第一个方面,提出了一种能够对不同交换机或不同类型的交换机进行ONIE测试的方法的实施例。图1示出的是本发明提供的交换机测试方法的实施例的流程示意图。Based on the above objective, in the first aspect of the embodiments of the present invention, an embodiment of a method for performing ONIE testing on different switches or switches of different types is proposed. FIG. 1 shows a schematic flowchart of an embodiment of a switch testing method provided by the present invention.

所述交换机测试方法,包括以下步骤:The switch testing method includes the following steps:

步骤S101,在物理主机上建立多个虚拟机,包括被测交换机的ONIE虚拟机、DHCP服务器虚拟机和HTTP服务器虚拟机;Step S101, establishing multiple virtual machines on the physical host, including the ONIE virtual machine, the DHCP server virtual machine and the HTTP server virtual machine of the switch under test;

步骤S103,用共享网络设备连接多个虚拟机并配置虚拟环境;Step S103, using a shared network device to connect multiple virtual machines and configure a virtual environment;

步骤S105,使ONIE虚拟机在虚拟环境中访问DHCP服务器虚拟机以获得动态IP地址;Step S105, enabling ONIE virtual machine to access the DHCP server virtual machine in the virtual environment to obtain a dynamic IP address;

步骤S107,使ONIE虚拟机通过动态IP地址在虚拟环境中访问HTTP服务器虚拟机以获得ONIE自更新文件和/或NOS镜像;Step S107, making the ONIE virtual machine access the HTTP server virtual machine in the virtual environment through the dynamic IP address to obtain the ONIE self-updating file and/or the NOS image;

步骤S109,根据ONIE自更新文件和/或NOS镜像来测试更新ONIE、安装新的NOS、和/或卸载现有的NOS的功能。In step S109, the functions of updating ONIE, installing a new NOS, and/or uninstalling an existing NOS are tested according to the ONIE self-update file and/or the NOS image.

本发明实施例把虚拟环境用于交换机的测试,把和交换机硬件配置无关的ONIE功能转移到虚拟环境下进行测试,从而使得测试过程变得灵活高效,脱离了硬件的限制;同时还阐述了虚拟环境的配置方法,通过使用共享网络设备,使各个虚拟机和虚拟交换机构建成一个小型网络,可以模拟实际的测试情景。In the embodiment of the present invention, the virtual environment is used for the test of the switch, and the ONIE function irrelevant to the hardware configuration of the switch is transferred to the virtual environment for testing, so that the test process becomes flexible and efficient, and is free from the limitation of hardware; The configuration method of the environment, through the use of shared network equipment, makes each virtual machine and virtual switch build a small network, which can simulate the actual test situation.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。所述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. , may include the flow of the above-mentioned method embodiments. The storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM), or the like. The embodiments of the computer program can achieve the same or similar effects as any of the foregoing method embodiments corresponding thereto.

在一些实施方式中,建立ONIE虚拟机包括:In some embodiments, establishing the ONIE virtual machine includes:

编译KVM可用的虚拟机固件和ONIE系统;Compile KVM-available virtual machine firmware and ONIE system;

在KVM中使用虚拟机固件和ONIE系统来启动ONIE虚拟机。Use the virtual machine firmware and ONIE system in KVM to start the ONIE virtual machine.

在一些实施方式中,共享网络设备为设置在物理主机上的物理网桥。In some embodiments, the shared network device is a physical bridge provided on a physical host.

在一些实施方式中,配置虚拟环境包括:In some implementations, configuring the virtual environment includes:

为物理网桥设置名称和IP地址;Set the name and IP address for the physical bridge;

将DHCP服务器虚拟机和HTTP服务器虚拟机所使用的共享网络设备确定为物理网桥的名称和IP地址;Identify the shared network device used by the DHCP server virtual machine and the HTTP server virtual machine as the name and IP address of the physical bridge;

将ONIE虚拟机的后端连接配置为桥接模式,并且将物理网桥的名称和IP地址作为桥接模式的参数。Configure the backend connection of the ONIE virtual machine to bridge mode, and use the name and IP address of the physical bridge as the parameters of bridge mode.

在一些实施方式中,DHCP服务器虚拟机上部署有DHCP、DNS、TFTP、HTTP服务。In some embodiments, DHCP, DNS, TFTP, and HTTP services are deployed on the DHCP server virtual machine.

在一些实施方式中,HTTP服务器虚拟机上部署有HTTP服务。In some implementations, an HTTP service is deployed on the HTTP server virtual machine.

在一些实施方式中,物理主机为linux主机;DHCP服务器虚拟机和HTTP服务器虚拟机为linux服务器的虚拟机。In some embodiments, the physical host is a linux host; the DHCP server virtual machine and the HTTP server virtual machine are virtual machines of a linux server.

在一些实施方式中,ONIE虚拟机为多个;其中,多个ONIE虚拟机并行执行相同的测试。In some embodiments, there are multiple ONIE virtual machines; wherein the multiple ONIE virtual machines execute the same test in parallel.

根据本发明实施例公开的方法还可以被实现为由CPU执行的计算机程序,该计算机程序可以存储在计算机可读存储介质中。在该计算机程序被CPU执行时,执行本发明实施例公开的方法中限定的上述功能。上述方法步骤也可以利用控制器以及用于存储使得控制器实现上述步骤的计算机程序的计算机可读存储介质实现。The methods disclosed according to the embodiments of the present invention may also be implemented as a computer program executed by the CPU, and the computer program may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above-mentioned functions defined in the methods disclosed in the embodiments of the present invention are executed. The above-mentioned method steps can also be implemented using a controller and a computer-readable storage medium storing a computer program for causing the controller to implement the above-mentioned steps.

如图2所示,在一个物理Linux workstation(即物理主机)中建立多个虚拟机,这些虚拟机都连接到Linux workstation的同一个配置好的物理网桥(即图中的共享网络设备)上。ONIE_kvm表示虚拟的白盒交换机,它的实现方式是首先编译出基于KVM的虚拟机固件和ONIE系统,然后用kvm命令启动虚拟机,在命令行选项中指定使用编译得到的固件和ONIE系统,这样启动的kvm虚拟机就代表了实际交换机上的ONIE系统,使得绝大部分ONIE系统的功能都可以用这个ONIE_kvm进行测试。As shown in Figure 2, multiple virtual machines are established in a physical Linux workstation (ie, a physical host), and these virtual machines are connected to the same configured physical network bridge (ie, the shared network device in the figure) of the Linux workstation. . ONIE_kvm represents a virtual white-box switch. It is implemented by first compiling the KVM-based virtual machine firmware and ONIE system, then using the kvm command to start the virtual machine, and specifying the compiled firmware and ONIE system in the command line options, so that The activated kvm virtual machine represents the ONIE system on the actual switch, so that most of the functions of the ONIE system can be tested with this ONIE_kvm.

ONIE_kvm通过共享网络设备,即Linux workstation的物理网桥连入虚拟的网络。可以在虚拟网络内部署多个虚拟机。部署了两个Linux虚拟机:分别叫做Linux server(即前述的DHCP服务器)和HTTP server(即前述的HTTP服务器)。Linux Server上部署DHCP、DNS、TFTP、HTTP等服务,HTTP Server上只部署HTTP服务。通过两个虚拟Linux服务器的不同服务的不同组合,可以验证ONIE系统在多种不同情况下的功能实现情况。ONIE_kvm connects to the virtual network through the shared network device, that is, the physical bridge of the Linux workstation. Multiple virtual machines can be deployed within a virtual network. Two Linux virtual machines are deployed: respectively called Linux server (ie the aforementioned DHCP server) and HTTP server (ie the aforementioned HTTP server). Deploy services such as DHCP, DNS, TFTP, and HTTP on Linux Server. Only HTTP services are deployed on HTTP Server. Through the different combinations of different services of the two virtual Linux servers, the functional realization of the ONIE system in many different situations can be verified.

其中,配置虚拟环境包括:首先在物理Linux Workstation上面配置一个物理的网桥br0,IP地址为192.168.1.100/24;在构建虚拟Linux server时,指定使用共享网络设备br0;然后在用kvm命令启动虚拟交换机时,指定交换机后端使用桥接模式,并指定参数br=br0。Among them, configuring the virtual environment includes: first, configure a physical bridge br0 on the physical Linux Workstation with an IP address of 192.168.1.100/24; when building a virtual Linux server, specify the use of a shared network device br0; then use the kvm command to start When virtual switch, specify the switch backend to use bridge mode, and specify the parameter br=br0.

本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现所述的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those skilled in the art will also appreciate that the various exemplary steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, various illustrative steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends on the specific application and design constraints imposed on the overall system. Those skilled in the art may implement the described functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.

从上述实施例可以看出,本发明实施例提供的交换机测试方法,通过在物理主机上建立多个虚拟机,包括被测交换机的ONIE虚拟机、DHCP服务器虚拟机和HTTP服务器虚拟机,用共享网络设备连接多个虚拟机并配置虚拟环境,使ONIE虚拟机在虚拟环境中访问DHCP服务器虚拟机以获得动态IP地址,使ONIE虚拟机通过动态IP地址在虚拟环境中访问HTTP服务器虚拟机以获得ONIE自更新文件和/或NOS镜像,根据ONIE自更新文件和/或NOS镜像来测试更新ONIE、安装新的NOS、和/或卸载现有的NOS的功能的技术方案,能够对不同交换机或不同类型的交换机进行ONIE测试,降低测试时间、减少资源占用、提高资源利用率。It can be seen from the above embodiments that the switch testing method provided by the embodiments of the present invention establishes multiple virtual machines on a physical host, including the ONIE virtual machine, the DHCP server virtual machine and the HTTP server virtual machine of the switch under test, and uses a shared The network device connects multiple virtual machines and configures the virtual environment so that the ONIE virtual machine accesses the DHCP server virtual machine in the virtual environment to obtain a dynamic IP address, and enables the ONIE virtual machine to access the HTTP server virtual machine in the virtual environment through the dynamic IP address to obtain the dynamic IP address. ONIE self-update file and/or NOS mirror, according to the ONIE self-update file and/or NOS mirror to test the technical solution of updating ONIE, installing new NOS, and/or uninstalling the existing NOS function, which can be used for different switches or different Types of switches are tested for ONIE, which reduces test time, reduces resource occupation, and improves resource utilization.

需要特别指出的是,上述交换机测试方法的各个实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于交换机测试方法也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在所述实施例之上。It should be particularly pointed out that each step in each embodiment of the above-mentioned switch testing method can be mutually intersected, replaced, added, and deleted. Therefore, these reasonable permutations and combinations should also belong to the protection of the present invention for the switch testing method. scope, and should not limit the scope of protection of the present invention to the described embodiments.

基于上述目的,本发明实施例的第二个方面,提出了一种能够对不同交换机或不同类型的交换机进行ONIE测试的装置的实施例。所述装置包括:Based on the above objective, a second aspect of the embodiments of the present invention provides an embodiment of an apparatus capable of performing ONIE testing on different switches or switches of different types. The device includes:

处理器;和processor; and

存储器,存储有处理器可运行的程序代码,其中程序代码在由处理器运行时执行上述的交换机测试方法。The memory stores program codes executable by the processor, wherein the program codes execute the above-mentioned switch testing method when executed by the processor.

本发明实施例公开所述的装置、设备等可为各种电子终端设备,例如手机、个人数字助理(PDA)、平板电脑(PAD)、智能电视等,也可以是大型终端设备,如服务器等,因此本发明实施例公开的保护范围不应限定为某种特定类型的装置、设备。本发明实施例公开所述的客户端可以是以电子硬件、计算机软件或两者的组合形式应用于上述任意一种电子终端设备中。The apparatuses, devices, etc. disclosed in the embodiments of the present invention may be various electronic terminal devices, such as mobile phones, personal digital assistants (PDAs), tablet computers (PADs), smart TVs, etc., or large-scale terminal devices, such as servers, etc. Therefore, the protection scope disclosed by the embodiments of the present invention should not be limited to a certain type of apparatus or equipment. The clients disclosed in the embodiments of the present invention may be applied to any of the foregoing electronic terminal devices in the form of electronic hardware, computer software, or a combination of the two.

基于上述目的,本发明实施例的第三个方面,提出了一种能够对不同交换机或不同类型的交换机进行ONIE测试的物理主机的实施例。所述物理主机使用上述的交换机测试装置来测试交换机的ONIE。Based on the above objective, in a third aspect of the embodiments of the present invention, an embodiment of a physical host capable of performing ONIE tests on different switches or switches of different types is provided. The physical host uses the above-mentioned switch testing device to test the ONIE of the switch.

从上述实施例可以看出,本发明实施例提供的交换机测试装置和物理主机,通过在物理主机上建立多个虚拟机,包括被测交换机的ONIE虚拟机、DHCP服务器虚拟机和HTTP服务器虚拟机,用共享网络设备连接多个虚拟机并配置虚拟环境,使ONIE虚拟机在虚拟环境中访问DHCP服务器虚拟机以获得动态IP地址,使ONIE虚拟机通过动态IP地址在虚拟环境中访问HTTP服务器虚拟机以获得ONIE自更新文件和/或NOS镜像,根据ONIE自更新文件和/或NOS镜像来测试更新ONIE、安装新的NOS、和/或卸载现有的NOS的功能的技术方案,能够对不同交换机或不同类型的交换机进行ONIE测试,降低测试时间、减少资源占用、提高资源利用率。It can be seen from the above embodiments that the switch testing device and the physical host provided by the embodiments of the present invention establish multiple virtual machines on the physical host, including the ONIE virtual machine, the DHCP server virtual machine, and the HTTP server virtual machine of the switch under test. , Connect multiple virtual machines with a shared network device and configure the virtual environment, so that the ONIE virtual machine can access the DHCP server virtual machine in the virtual environment to obtain a dynamic IP address, and enable the ONIE virtual machine to access the HTTP server virtual machine in the virtual environment through the dynamic IP address. obtain ONIE self-update files and/or NOS images, and test technical solutions for updating ONIE, installing new NOS, and/or uninstalling existing NOS functions according to the ONIE self-update files and/or NOS images. Switches or different types of switches perform ONIE testing to reduce test time, reduce resource occupation, and improve resource utilization.

需要特别指出的是,上述交换机测试装置和物理主机的实施例采用了所述交换机测试方法的实施例来具体说明各模块的工作过程,本领域技术人员能够很容易想到,将这些模块应用到所述交换机测试方法的其他实施例中。当然,由于所述交换机测试方法实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于所述交换机测试装置和物理主机也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在所述实施例之上。It should be particularly pointed out that the above embodiments of the switch testing device and the physical host use the embodiments of the switch testing method to specifically describe the working process of each module. Those skilled in the art can easily imagine that these modules are applied to all modules. in other embodiments of the switch testing method. Of course, since each step in the embodiment of the switch testing method can be crossed, replaced, added, and deleted, these reasonable permutations and combinations should also belong to the present invention for the switch testing device and the physical host. protection scope, and should not limit the scope of protection of the present invention to the described embodiments.

以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are exemplary embodiments of the present disclosure, but it should be noted that various changes and modifications may be made without departing from the scope of the disclosure of the embodiments of the present invention as defined in the claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements disclosed in the embodiments of the present invention may be described or claimed in the singular, unless explicitly limited to the singular, the plural may also be construed.

应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。It should be understood that, as used herein, the singular form "a" is intended to include the plural form as well, unless the context clearly supports an exception. It will also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The serial numbers of the embodiments disclosed in the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上所述的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope (including the claims) disclosed by the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention , the technical features of the above embodiments or different embodiments can also be combined, and there are many other variations of the different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention should be included within the protection scope of the embodiments of the present invention.

Claims (10)

1. a kind of switch test method, which comprises the following steps:
Multiple virtual machines are established on physical host, including be tested the ONIE virtual machine of interchanger, Dynamic Host Configuration Protocol server virtual machine and HTTP server virtual machine;
The multiple virtual machine is connected with the shared network equipment and configures virtual environment;
The ONIE virtual machine is set to access Dynamic Host Configuration Protocol server virtual machine in the virtual environment to obtain dynamic IP addressing;
Make the ONIE virtual machine accessed in the virtual environment by the dynamic IP addressing HTTP server virtual machine with Obtain ONIE self refresh file and/or NOS mirror image;
It is tested according to the ONIE self refresh file and/or NOS mirror image and updates ONIE, the new NOS of installation, and/or unload existing The function of some NOS.
2. the method according to claim 1, wherein establishing the ONIE virtual machine and including:
Compile the available virtual machine firmware of KVM and ONIE system;
Start the ONIE virtual machine using the virtual machine firmware and the ONIE system in KVM.
3. the method according to claim 1, wherein the shared network equipment is to be arranged in the physical host On physical bridge.
4. according to the method described in claim 3, it is characterized in that, configuration virtual environment includes:
For the physical bridge, title and IP address are set;
The shared network equipment used in the Dynamic Host Configuration Protocol server virtual machine and the HTTP server virtual machine is determined For the title and IP address of the physical bridge;
Bridge mode is configured by the connection of the rear end of the ONIE virtual machine, and by the title and IP address of the physical bridge Parameter as bridge mode.
5. the method according to claim 1, wherein be deployed on the Dynamic Host Configuration Protocol server virtual machine DHCP, DNS, TFTP, HTTP service.
6. the method according to claim 1, wherein being deployed with HTTP clothes on the HTTP server virtual machine Business.
7. the method according to claim 1, wherein the physical host is linux host;The DHCP service Device virtual machine and the HTTP server virtual machine are the virtual machine of linux server.
8. the method according to claim 1, wherein the ONIE virtual machine is multiple;Wherein, the multiple institute It states ONIE virtual machine and executes identical test parallel.
9. a kind of switch test device characterized by comprising
Processor;With
Memory is stored with the program code that processor can be run, and wherein said program code by the processor when being run Execute the switch test method as described in any one of claim 1-8.
10. a kind of physical host, which is characterized in that including switch test device as claimed in claim 9.
CN201910332225.XA 2019-04-24 2019-04-24 A switch testing method and device Active CN110011877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910332225.XA CN110011877B (en) 2019-04-24 2019-04-24 A switch testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910332225.XA CN110011877B (en) 2019-04-24 2019-04-24 A switch testing method and device

Publications (2)

Publication Number Publication Date
CN110011877A true CN110011877A (en) 2019-07-12
CN110011877B CN110011877B (en) 2021-05-07

Family

ID=67173823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910332225.XA Active CN110011877B (en) 2019-04-24 2019-04-24 A switch testing method and device

Country Status (1)

Country Link
CN (1) CN110011877B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704160A (en) * 2019-09-26 2020-01-17 苏州浪潮智能科技有限公司 Dual-computer hot standby test method and device
CN112968800A (en) * 2021-02-20 2021-06-15 山东英信计算机技术有限公司 Switch batch test method, system and equipment based on Loongson platform
CN113821226A (en) * 2021-09-17 2021-12-21 锐捷网络股份有限公司 A kind of ONIE system installation method, device, equipment and medium
CN116095049A (en) * 2022-12-28 2023-05-09 联想(北京)有限公司 Floating IP transfer method and device
CN117014341A (en) * 2023-04-07 2023-11-07 北京勤慕数据科技有限公司 Virtual switch testing method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677962A (en) * 2013-12-20 2014-03-26 上海电机学院 System and method for achieving desktop delivery device based on virtualization technology
CN105045614A (en) * 2015-06-29 2015-11-11 浪潮(北京)电子信息产业有限公司 Operating system installation method and system
CN107370623A (en) * 2017-07-20 2017-11-21 郑州云海信息技术有限公司 A kind of method and device for realizing system installation
US20170371683A1 (en) * 2016-06-22 2017-12-28 HGST Netherlands B.V. Provisioning the hyper-converged infrastructure bare metal systems from the top of the rack switch
CN107995064A (en) * 2017-12-14 2018-05-04 云南电网有限责任公司玉溪供电局 Test platform building method based on virtualization technology
CN108696458A (en) * 2017-03-31 2018-10-23 慧与发展有限责任合伙企业 Network switch system including logical switch
CN109558142A (en) * 2019-01-14 2019-04-02 郑州云海信息技术有限公司 A kind of open network installation environment transplantation method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677962A (en) * 2013-12-20 2014-03-26 上海电机学院 System and method for achieving desktop delivery device based on virtualization technology
CN105045614A (en) * 2015-06-29 2015-11-11 浪潮(北京)电子信息产业有限公司 Operating system installation method and system
US20170371683A1 (en) * 2016-06-22 2017-12-28 HGST Netherlands B.V. Provisioning the hyper-converged infrastructure bare metal systems from the top of the rack switch
CN107528801A (en) * 2016-06-22 2017-12-29 西部数据技术公司 Super fusion architecture bare machine system is provided from frame top formula interchanger
CN108696458A (en) * 2017-03-31 2018-10-23 慧与发展有限责任合伙企业 Network switch system including logical switch
CN107370623A (en) * 2017-07-20 2017-11-21 郑州云海信息技术有限公司 A kind of method and device for realizing system installation
CN107995064A (en) * 2017-12-14 2018-05-04 云南电网有限责任公司玉溪供电局 Test platform building method based on virtualization technology
CN109558142A (en) * 2019-01-14 2019-04-02 郑州云海信息技术有限公司 A kind of open network installation environment transplantation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DELL EMC,: ""S4112- ON Series Installation Guide"", 《HTTP://TOPICS-CDN.DELL.COM/PDF/NETWORKING-S4112F-ON_INSTALL-GUIDE_EN-US.PDF》 *
半天妖,: ""ONIE用户指南"", 《WWW.JIANSHU.COM/P/CE578BB205DE》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704160A (en) * 2019-09-26 2020-01-17 苏州浪潮智能科技有限公司 Dual-computer hot standby test method and device
CN112968800A (en) * 2021-02-20 2021-06-15 山东英信计算机技术有限公司 Switch batch test method, system and equipment based on Loongson platform
CN113821226A (en) * 2021-09-17 2021-12-21 锐捷网络股份有限公司 A kind of ONIE system installation method, device, equipment and medium
CN116095049A (en) * 2022-12-28 2023-05-09 联想(北京)有限公司 Floating IP transfer method and device
CN116095049B (en) * 2022-12-28 2025-12-19 联想(北京)有限公司 Floating IP transfer method and device
CN117014341A (en) * 2023-04-07 2023-11-07 北京勤慕数据科技有限公司 Virtual switch testing method and system
CN117014341B (en) * 2023-04-07 2024-05-10 北京勤慕数据科技有限公司 Virtual switch testing method and system

Also Published As

Publication number Publication date
CN110011877B (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN110011877A (en) A kind of switch test method and apparatus
US10838747B2 (en) Virtual appliances
CN112783646B (en) Stateful application containerized deployment method and device
CN108121654B (en) A large-scale software testing method based on Docker
CN104572372A (en) System and method for building server performance testing environment
CN114024853B (en) A method, system and related components for collecting hardware information of bare metal nodes
CN104168160B (en) Server-compatible method of testing and system
CN110262893B (en) Method, device and computer storage medium for configuring mirrored memory
CN111143023B (en) A method, device, equipment and storage medium for changing resources
US9515882B2 (en) Managing imaging of computing devices
CN109445801A (en) A kind of method and apparatus detecting bare machine network interface card information
CN105653338A (en) Application updating method and device
CN107360042A (en) A kind of server management method and device
CN108319492B (en) Method, device and system for resetting a physical machine
CN106559267A (en) The master-slave switching method of Redis, device and redis systems
CN108052444A (en) A kind of method and apparatus of performance test for mobile application
CN110442351A (en) A physical machine network card binding method and device
CN108959082A (en) A kind of the hardware compatibility test method and system of Openstack
CN108737202A (en) A kind of host batch dispositions method, device and system
CN107370623A (en) A kind of method and device for realizing system installation
CN114490588B (en) Database deployment method, device, electronic device and computer readable medium
CN116633989A (en) Server control method and device, storage medium and electronic device
JP2021118452A (en) Information processing device, information processing system, and network communication confirmation method
JP5975003B2 (en) Virtualization control device, virtualization system, virtualization method, and virtualization control program.
CN107147712B (en) Update the method and device of web application

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
CP03 Change of name, title or address

Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after: China

Address before: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address