CN112416796B - Software upgrading test method and device - Google Patents

Software upgrading test method and device Download PDF

Info

Publication number
CN112416796B
CN112416796B CN202011397360.1A CN202011397360A CN112416796B CN 112416796 B CN112416796 B CN 112416796B CN 202011397360 A CN202011397360 A CN 202011397360A CN 112416796 B CN112416796 B CN 112416796B
Authority
CN
China
Prior art keywords
switch
upgrading
upgrade
software
version information
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
CN202011397360.1A
Other languages
Chinese (zh)
Other versions
CN112416796A (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.)
Kyland Technology Co Ltd
Original Assignee
Kyland 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN202011397360.1A priority Critical patent/CN112416796B/en
Publication of CN112416796A publication Critical patent/CN112416796A/en
Application granted granted Critical
Publication of CN112416796B publication Critical patent/CN112416796B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a method and a device for testing software upgrading. The method is applied to the switch and comprises the following steps: reading configuration information of a switch and version information to be tested of software to be upgraded in the switch; upgrading the software to be upgraded in the switch according to the selected upgrading parameters so as to obtain an upgrading result and target version information of the switch after upgrading; and verifying whether the switch is successfully upgraded according to the upgrading result, the target version information and the configuration information. According to the technical scheme provided by the invention, all parameters to be tested of the switch are integrated, and the compatibility verification of the version to be tested is rapidly and accurately carried out through automatic control, so that the defects that the traditional testing method needs manual intervention, is long in time consumption and is incomplete are overcome.

Description

Software upgrading test method and device
Technical Field
The present invention relates to the field of network communication technologies and software testing technologies, and in particular, to a method and an apparatus for testing software upgrade.
Background
A switch is a network device used for electrical (optical) signal forwarding. It can provide an unshared electrical signal path for any two network nodes of the access switch.
Once the software version of the switch product is released, the software version can be continuously updated to repair the problem of the existing network or realize the newly increased requirement of the client. In order to ensure the upgrading reliability of the network switch, a tester needs to upgrade the software version of the interaction machine for testing. The test requires to cover the compatibility of each history version and the new version, various upgrading modes (usb, ftp, tftp, sftp, http), various version upgrading and downgrading combinations, and verification of flash partitions (main and spare partitions) of the switch respectively, and synchronous checking of configuration loading conditions.
For the above test requirements, testers often need to select main and standby partitions, upgrading modes, versions to be tested and the like one by one in a client and a server in a purely manual mode for repeated verification. The method consumes a great deal of manpower and time cost, and can not ensure the test omission of human subjectivity.
Disclosure of Invention
The embodiment of the invention aims to solve the waste of time cost and labor cost caused by manually performing the switch software upgrading test and ensure the whole coverage of the test.
To solve the above problem, in a first aspect, an embodiment of the present invention provides a method for testing software upgrade, applied to a switch, the method includes:
reading configuration information of a switch and version information to be tested of software to be upgraded in the switch;
upgrading the software to be upgraded in the switch according to the selected upgrading parameters so as to obtain an upgrading result and target version information of the switch after upgrading;
and verifying whether the switch is successfully upgraded according to the upgrading result, the target version information and the configuration information.
Optionally, the upgrade parameters include upgrade mode parameters and flash partition parameters;
the step of upgrading the software to be upgraded in the switch according to the selected upgrade parameters to obtain an upgrade result and target version information after the switch is upgraded comprises the following steps:
determining the combination condition of the version information to be tested, the upgrade mode parameter and the flash partition parameter;
upgrading the software to be upgraded in the switch one by one according to different combination conditions;
and acquiring an upgrading result and target version information after each upgrading.
Optionally, the upgrading the software to be upgraded in the switch one by one according to different combination conditions includes:
after selecting version information to be tested, an upgrading mode parameter and a flash partition parameter, upgrading the software to be upgraded in the switch;
judging whether the flash partition parameters are traversed;
if the flash partition parameter is traversed, judging whether the version information to be tested is traversed;
if the version information to be tested is traversed, judging whether the upgrading mode parameter is traversed;
and if the parameter traversal of the upgrading mode is completed, ending the software upgrading test.
Optionally, the method further comprises:
if the flash partition parameters are not traversed, keeping the selected version information to be tested and the selected upgrade mode parameters unchanged, and selecting the other flash partition parameters which are not traversed to upgrade the software to be upgraded in the switch.
Optionally, the method further comprises:
if the version information to be tested is not traversed, keeping the selected flash partition parameters and the upgrade mode parameters unchanged, and selecting the other version information to be tested which is not traversed to upgrade the software to be upgraded in the switch.
Optionally, the method further comprises:
if the upgrading mode parameter is not traversed, keeping the selected flash partition parameter and the version information to be tested unchanged, and selecting another non-traversed upgrading mode parameter to upgrade the software to be upgraded in the switch.
Optionally, verifying whether the switch is successfully upgraded according to the upgrade result, the target version information and the configuration information includes:
when the upgrading result is successful, judging whether the target version information is correct or not;
when the target version information is correct, judging whether the configuration information is correct or not;
and when the configuration information is correct, determining that the switch is successfully upgraded.
Optionally, when the upgrade result is failure, determining that the switch upgrade fails.
Optionally, when the target version information is wrong, determining that the switch upgrade fails.
Optionally, when the configuration information is wrong, determining that the switch upgrade fails.
Optionally, generating an operation log in real time when the software to be upgraded in the switch is upgraded each time;
and generating an operation log in real time each time whether the switch is successfully upgraded or not is verified.
In a second aspect, an embodiment of the present invention provides an apparatus for testing software upgrade, including:
the information reading module is used for reading configuration information of the switch and version information to be tested of the software to be upgraded in the switch;
the upgrade execution module is used for upgrading the software to be upgraded in the switch according to the selected upgrade parameters so as to obtain an upgrade result and target version information of the switch after upgrade;
and the upgrade verification module is used for verifying whether the switch is successfully upgraded according to the upgrade result, the target version information and the configuration information.
According to the technical scheme provided by the invention, all parameters to be tested of the switch are integrated, and the compatibility verification of the version to be tested is rapidly and accurately carried out through automatic control, so that the defects that the traditional testing method needs manual intervention, is long in time consumption and is incomplete are overcome.
Drawings
FIG. 1 is a flowchart of a method for testing software upgrades provided in embodiment 1 of the present invention;
fig. 2 is a flowchart of a method for upgrading software to be upgraded in the switch according to selected upgrade parameters provided in embodiment 1 of the present invention;
fig. 3 is a flowchart of a method for upgrading software to be upgraded in a switch one by one according to different combination conditions provided in embodiment 1 of the present invention;
fig. 4 is a flowchart of a method for verifying whether an upgrade of a switch is successful according to embodiment 1 of the present invention;
FIG. 5 is a software flow chart of a method for testing software upgrades provided in embodiment 1 of the present invention;
fig. 6 is a block diagram of a device for testing software upgrade provided in embodiment 2 of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a method for testing software upgrade provided in embodiment 1 of the present invention. The method is applied to a scene of upgrading software in the switch.
Compared with other software upgrades, the software upgrade of the switch has the following characteristics: firstly, the switch comprises a flash partition, and when the software of the switch is upgraded, the main partition and the standby partition need to be distinguished. Second, the upgrade file of the switch may include only the software version, or may include both the software version and the boot version. When the switch is started, the redboost is started first, and then a boot file is needed, and the software version can be loaded after boot is started. Third, the switch covers multiple upgrade forms, such as ftp mode, tftp mode, usb mode, and http mode. Fourth, when judging whether the switch is successfully upgraded, the configuration information of the switch equipment is checked in addition to the version information during upgrading like other software, and the integrity of the configuration file is checked.
FTP (File Transfer Protocol ) is one of the protocols in the TCP/IP protocol suite. The FTP protocol includes two components, one is an FTP server and the other is an FTP client. The FTP server is used for storing files, and a user can access resources located on the FTP server through an FTP protocol by using the FTP client.
TFTP (Trivial File Transfer Protocol, simple file transfer protocol) is a protocol in the TCP/IP family of protocols for simple file transfer between a client and a server, providing a less complex, less expensive file transfer service.
USB (Universal Serial Bus ), which is an external bus standard, is used to regulate the connection and communication between a computer and external devices.
http is a simple request-response protocol that typically runs on top of TCP. It specifies what messages the client might send to the server and what responses it gets.
Referring to fig. 1, the method of software upgrade testing includes the steps of:
s10, reading configuration information of the switch and version information to be tested of software to be upgraded in the switch.
When configuring the switch, a local configuration mode and a remote configuration mode are included. The local configuration generally includes physical connections and software configuration. The local configuration mode of the switch is communicated by directly connecting the computer with a 'Console' port of the switch. The software configuration generally includes a main configuration menu, an IP address, etc. configuration, and a control password configuration. The remote configuration mode may be performed by a Telnet mode or a Web browser mode. The Telnet protocol is a remote access protocol with which a remote computer, network device or private TCP/IP network can be logged in. The Windows 95/98 and the following Windows systems, UNIX/Linux and other systems are all built with Telnet client programs, which can be used to realize the communication with the remote switch. When the IP address information is set for the switch by using the Console port and the HTTP service is started, the switch can be accessed by a Web browser supporting JAVA, and various parameters of the switch can be modified by the Web browser and managed. In fact, through the Web interface, many important parameters of the switch can be modified and set, and the running state of the switch can be checked in real time.
The management information base (MIB, management Information Base) is one of the contents of the TCP/IP network management protocol standard framework, and defines the data items that the managed device must store, the operations that are allowed to be performed on each data item, and their meanings, that is, the data variables such as control and status information of the managed device that are accessible to the management system are all stored in the MIB.
And reading the configuration information and the version information to be tested of the software to be upgraded through the MIB. The configuration information may include startup-config. The version information to be tested is the version information of the software in the switch, such as V1, V2, V3 and V4.
S20, upgrading the software to be upgraded in the switch according to the selected upgrading parameters so as to obtain an upgrading result and target version information of the switch after upgrading.
The upgrade parameters comprise upgrade mode parameters and flash partition parameters. The upgrade mode parameter includes at least one of the following: a usb mode; ftp mode; a tftp mode; an sftp mode; an http manner; the flash partition parameters include at least one of the following: a main partition; and (5) preparing the partition.
Verification software also needs to be provided when the software to be upgraded is upgraded. The software to be upgraded in the switch needs to be upgraded to the verification software, for example, the verification software can be determined as V5.
And the software to be upgraded in the switch can be upgraded by selecting all or part of modes from the upgrade mode parameters and the flash partition parameters so as to be upgraded into verification software.
After the software to be upgraded in the switch is upgraded, an upgrading result and target version information are obtained. The upgrade result refers to a result of judging whether the software to be upgraded in the switch is upgraded into the verification software. The target version information refers to the software currently running in the switch after the upgrade is completed. If the upgrade of the switch is not abnormal, the target version information is consistent with the information of the verification software (i.e., the target version information is correct). If there is an anomaly, it may result in the target version information not being consistent with the information of the verification software (i.e., the target version information is erroneous).
Specifically, the step S20 with reference to fig. 2 may include the following specific steps:
s21, determining the combination condition of the version information to be tested, the upgrade mode parameter and the flash partition parameter.
The version information to be tested comprises V1, V2, V3 and V4; upgrade mode parameters usb mode, ftp mode, tftp mode, sftp mode, and http mode; the flash partition parameters comprise a main partition and a standby partition.
And the user selects required contents from the version information to be tested, the upgrade mode parameters and the flash partition parameters according to the selection of the user, and tests the switch. The version information to be tested, the upgrade mode parameter and the flash partition parameter can be executed partially or completely.
S22, upgrading the software to be upgraded in the switch one by one according to different combination conditions.
And performing traversal test on each combination of the version information to be tested, the upgrade mode parameter and the flash partition parameter according to the selection of a user. If the number of version information to be tested is n1, the number of upgrade mode parameters is n2, and the number of flash partition parameters is 2. Then it is necessary to doSecondary upgrade operations.
After the single upgrade is executed, the device can be read to actually return a result to judge whether the upgrade is successful or not (namely, whether the upgrade is successful or not is judged), and then the upgrade result is further judged according to the parameters and the configuration file information which are configured before the upgrade is executed (namely, whether the target version information is correct or not and whether the configuration information is correct or not) and the complete matching is required during comparison.
On the basis, each time the software to be upgraded in the switch is upgraded, an operation log is generated in real time; and generating an operation log in real time each time whether the switch is successfully upgraded or not is verified.
It is understood that the process is performedAnd when the upgrading operation is performed for the second time, generating an operation log from the combination condition, the upgrading result and the verification result of each upgrading operation, and facilitating the checking.
Specifically, referring to fig. 3, step S22 may include the following specific steps:
s221, after the version information to be tested, the upgrade mode parameter and the flash partition parameter are selected, upgrading the software to be upgraded in the switch.
And according to the selection of a user, performing traversal test on each combination of the version information to be tested, the upgrade mode parameter and the flash partition parameter. Firstly, after selecting version information to be tested, an upgrading mode parameter and a flash partition parameter, upgrading software to be upgraded in the switch.
After the upgrade is completed, an upgrade result is obtained, and the upgrade result comprises upgrade success and upgrade failure. Target version information and configuration information after upgrading can be obtained.
S222, judging whether the flash partition parameters are traversed. If yes, go to step S223; if not, step S226 is performed.
After one upgrade is completed, judging whether the flash partition parameters are traversed. I.e., determine if the main partition and the spare partition are traversed. If the traversal is completed, judging whether the traversal of the version information to be tested is completed or not. If the traversal is not completed, keeping the selected version information to be tested and the selected upgrade mode parameter unchanged, and selecting another non-traversed flash partition parameter to upgrade the software to be upgraded in the switch.
S223, judging whether the version information to be tested is traversed. If yes, go to step S224; if not, step S227 is performed.
After the flash partition parameter is traversed, judging whether the version information to be tested is traversed. That is, if version information to be tested in the switch includes V1, V2, V3, V4, it is determined whether V1, V2, V3, V4 are all upgraded to the verification version V5. If the upgrade mode parameters are all upgraded to the verification version V5, judging whether the upgrade mode parameters are traversed. If the version information is not updated to the verification version V5, keeping the parameters of the selected flash partition and the parameters of the updating mode unchanged, and selecting the other version information to be tested which is not traversed to update the software to be updated in the switch.
S224, judging whether the upgrading mode parameter is traversed. If yes, go to step S225; if not, step S228 is performed.
After the traversal of the version information to be tested is completed, judging whether the traversal of the upgrade mode parameter is completed or not. Namely judging whether the parameters of the upgrading modes, such as a usb mode, an ftp mode, a tftp mode, an sftp mode and an http mode, are completely traversed. If traversed, the software upgrade test is ended. If the software to be upgraded in the switch is not traversed, keeping the selected flash partition parameters and the version information to be tested unchanged, and selecting another non-traversed upgrading mode parameter to upgrade the software to be upgraded in the switch.
S225, ending the software upgrading test.
And finishing the software upgrading test after traversing each combination condition of the version information to be tested, the upgrading mode parameter and the flash partition parameter.
S226, keeping the selected version information to be tested and the selected upgrade mode parameters unchanged, and selecting another non-traversed flash partition parameter to upgrade the software to be upgraded in the switch.
And S227, keeping the parameters of the selected flash partition and the parameters of the upgrade mode unchanged, and selecting the other version information to be tested which is not traversed to upgrade the software to be upgraded in the switch.
S228, keeping the selected flash partition parameters and the version information to be tested unchanged, and selecting another non-traversed upgrading mode parameter to upgrade the software to be upgraded in the switch.
S23, upgrading the software to be upgraded in the switch one by one according to different combination conditions.
S30, verifying whether the switch is successfully upgraded according to the upgrading result, the target version information and the configuration information.
The upgrade result includes upgrade success and upgrade failure, the target version information includes target version information correct and target version information error, the configuration information includes configuration information after upgrade consistent with configuration information before upgrade (configuration information correct) and configuration information after upgrade inconsistent with configuration information before upgrade (configuration information error).
And comprehensively considering the upgrading result, the target version information and the configuration information to determine whether the switch is successfully upgraded.
Specifically, referring to fig. 4, step S30 may include the following specific steps:
s31, judging whether the upgrading result is successful. If successful, execute step S32; if it fails, step S35 is performed.
And after the software to be upgraded is upgraded into the verification software, determining that the upgrading result of the version information to be tested is successful. If so, judging whether the target version information is correct. And when the software to be upgraded is not upgraded into the verification software, determining that the upgrading result of the version information to be tested is failure, and determining that the switch is failed to upgrade.
S32, judging whether the target version information is correct or not. If so, executing step S33; if so, step S35 is performed.
And after the upgrading result is determined to be successful, judging whether the information of the currently operated software and the verification software in the switch after the upgrading is finished is consistent. If the information is consistent, the target version information is correct, and whether the configuration information is correct is judged. If the target version information is inconsistent, the target version information is wrong, and the switch upgrading failure is determined.
S33, judging whether the configuration information is correct. If so, executing step S34; if so, step S35 is performed.
And after the target version information is determined to be correct, judging whether the updated configuration information is consistent with the configuration information before updating. And if the configuration information is consistent, the configuration information is correct, and the switch upgrading is determined to be successful. If the configuration information is inconsistent, the configuration information is wrong, and the switch upgrading failure is determined. S34, determining that the switch is successfully upgraded.
S35, determining that the switch upgrade fails.
With reference to fig. 5, the following is specifically described as an example.
Version information to be tested in a switch comprises V1, V2, V3 and V4, upgrade mode parameters usb mode, ftp mode, tftp mode, sftp mode and http mode, and flash partition parameters comprise a main partition and a standby partition. The software in the switch needs to be upgraded to the verification version V5.
Based on this, the user selects a portion of the parameters for testing. The version information to be tested which participates in the test is selected to comprise V1 and V2, upgrade mode parameters usb mode and ftp mode, and flash partition parameters comprise a main partition.
First, a combination of V1, usb mode, and main partition is used for testing.
And judging whether the upgrading result is successful. If so, judging whether the target version information is correct; and if the switch fails, determining that the switch fails to upgrade. The results of this combination of case, upgrade failure and verification failure are written to a log.
If the target version information is correct, judging whether the configuration information is correct; and if the switch is wrong, determining that the switch fails to upgrade. The results of this combination of case, upgrade success and verification failure are written to a log.
And if the configuration information is correct, determining that the switch is successfully upgraded. The results of this combination of case, upgrade success, and validation success are written to a log. And if the switch is wrong, determining that the switch fails to upgrade. The results of this combination of case, upgrade success and verification failure are written to a log.
Whether the verification is successful or failed, it is necessary to perform a walk whether the walk is completed, in which case a total of 4 determinations are made 2 x 1.
Firstly judging whether the flash partition parameter is traversed or not, and judging that the flash partition parameter is traversed because the flash partition parameter only comprises a main partition in the situation.
And judging whether the version information to be tested is traversed. In this case, the version information to be tested includes V1 and V2, so the version information to be tested is not traversed, and under the condition that the flash partition parameter is the main partition, the version information to be tested is V2, and the upgrade mode parameter is usb mode, the upgrade of the switch is verified again.
Therefore, in such a selection, four combinations of V1, usb system, main partition, V2, usb system, main partition, V1, ftp system, main partition, V2, ftp system, and main partition need to be verified to obtain four logs.
After the traversal is completed, the verification is ended.
According to the technical scheme provided by the embodiment of the invention, various parameters to be tested of the switch are integrated, and the compatibility verification of the version to be tested is rapidly and accurately carried out through automatic control, so that the defects of manual intervention, long time consumption, incomplete performance and the like of the traditional testing method are overcome.
Example 2
Fig. 6 is a block diagram of a device for testing software upgrade provided in embodiment 2 of the present invention. Referring to fig. 6, the apparatus for software upgrade test includes:
the information reading module 10 is used for reading configuration information of the switch and version information to be tested of the software to be upgraded in the switch;
the upgrade execution module 20 is configured to upgrade software to be upgraded in the switch according to the selected upgrade parameter, so as to obtain an upgrade result and target version information after the switch is upgraded;
and the upgrade verification module 30 is configured to verify whether the switch is upgraded successfully according to the upgrade result, the target version information and the configuration information.
According to the technical scheme provided by the embodiment of the invention, various parameters to be tested of the switch are integrated, and the compatibility verification of the version to be tested is rapidly and accurately carried out through automatic control, so that the defects of manual intervention, long time consumption, incomplete performance and the like of the traditional testing method are overcome.
On this basis, the upgrade parameters include upgrade mode parameters and flash partition parameters, and the upgrade execution module 20 includes:
the combination determination submodule is used for determining the combination condition of the version information to be tested, the upgrade mode parameter and the flash partition parameter;
the software upgrading sub-module is used for upgrading the software to be upgraded in the switch one by one according to different combination conditions;
the result acquisition sub-module is used for acquiring the upgrading result and the target version information after each upgrading.
On this basis, the software upgrading submodule comprises:
the parameter selection unit is used for upgrading the software to be upgraded in the switch after selecting the version information to be tested, an upgrading mode parameter and a flash partition parameter;
the first judging unit is used for judging whether the flash partition parameters are traversed;
the second judging unit is used for judging whether the traversal of the version information to be tested is completed or not if the traversal of the flash partition parameter is completed;
the third judging unit is used for judging whether the upgrade mode parameter is traversed or not if the version information to be tested is traversed;
and the fourth judging unit is used for ending the software upgrading test if the upgrading mode parameter traversal is completed.
On the basis, the device also comprises:
and the first execution unit is used for keeping the selected version information to be tested and the selected upgrade mode parameter unchanged if the flash partition parameter is not traversed, and selecting another flash partition parameter which is not traversed to upgrade the software to be upgraded in the switch.
On the basis, the device also comprises:
and the second execution unit is used for keeping the parameters of the selected flash partition and the parameters of the upgrade mode unchanged if the version information to be tested is not traversed, and selecting the other version information to be tested which is not traversed to upgrade the software to be upgraded in the switch.
On the basis, the device also comprises:
a third execution unit, configured to, if the upgrade mode parameter is not traversed, keep the selected flash partition parameter and the version information to be tested unchanged, and select another upgrade mode parameter that is not traversed to upgrade the software to be upgraded in the switch
On this basis, the upgrade verification module 30 includes:
the first judging sub-module is used for judging whether the target version information is correct or not when the upgrading result is successful;
the second judging sub-module is used for judging whether the configuration information is correct or not when the target version information is correct;
and the third judging sub-module is used for determining that the switch is successfully upgraded when the configuration information is correct.
On the basis, the device also comprises:
and the first execution sub-module is used for determining that the switch upgrade fails when the upgrade result is failure.
On the basis, the device also comprises:
and the second execution sub-module is used for determining that the switch upgrade fails when the target version information is wrong.
The third execution sub-module is used for being based on the third execution sub-module, and further comprises:
and when the configuration information is wrong, determining that the switch upgrade fails.
On the basis, the device also comprises:
the first log generation module is used for generating an operation log in real time when the software to be upgraded in the switch is upgraded each time;
and the second log generation module is used for generating an operation log in real time each time when verifying whether the switch is successfully upgraded.
The device for testing software upgrade provided in this embodiment can be used to execute the method for testing software upgrade provided in embodiment 1, and has corresponding functions and beneficial effects.
While the invention has been described in detail in the foregoing general description, embodiments and experiments, it will be apparent to those skilled in the art that modifications and improvements can be made thereto. Accordingly, such modifications or improvements may be made without departing from the spirit of the invention and are intended to be within the scope of the invention as claimed.

Claims (8)

1. A method of software upgrade testing, for use with a switch, the method comprising:
reading configuration information of a switch and version information to be tested of software to be upgraded in the switch;
upgrading the software to be upgraded in the switch according to the selected upgrading parameters so as to obtain an upgrading result and target version information of the switch after upgrading;
verifying whether the switch is successfully upgraded according to the upgrading result, the target version information and the configuration information;
the upgrade parameters comprise upgrade mode parameters and flash partition parameters; the upgrade mode parameters comprise a usb mode, an ftp mode, a tftp mode, an sftp mode and an http mode; the flash partition parameters comprise a main partition and a standby partition;
the step of upgrading the software to be upgraded in the switch according to the selected upgrade parameters to obtain an upgrade result and target version information after the switch is upgraded comprises the following steps:
determining the combination condition of the version information to be tested, the upgrade mode parameter and the flash partition parameter;
upgrading the software to be upgraded in the switch one by one according to different combination conditions;
obtaining an upgrading result and target version information after each upgrading;
the step of upgrading the software to be upgraded in the switch one by one according to different combination conditions comprises the following steps:
after selecting version information to be tested, an upgrading mode parameter and a flash partition parameter, upgrading the software to be upgraded in the switch;
judging whether the flash partition parameters are traversed;
if the flash partition parameter is traversed, judging whether the version information to be tested is traversed;
if the version information to be tested is traversed, judging whether the upgrading mode parameter is traversed;
and if the parameter traversal of the upgrading mode is completed, ending the software upgrading test.
2. The method as recited in claim 1, further comprising:
if the flash partition parameters are not traversed, keeping the selected version information to be tested and the selected upgrade mode parameters unchanged, and selecting the other flash partition parameters which are not traversed to upgrade the software to be upgraded in the switch.
3. The method as recited in claim 1, further comprising:
if the version information to be tested is not traversed, keeping the selected flash partition parameters and the upgrade mode parameters unchanged, and selecting the other version information to be tested which is not traversed to upgrade the software to be upgraded in the switch.
4. The method as recited in claim 1, further comprising:
if the upgrading mode parameter is not traversed, keeping the selected flash partition parameter and the version information to be tested unchanged, and selecting another non-traversed upgrading mode parameter to upgrade the software to be upgraded in the switch.
5. The method of claim 1, wherein verifying whether the switch was successfully upgraded based on the upgrade result, the target version information, and the configuration information comprises:
when the upgrading result is successful, judging whether the target version information is correct or not;
when the target version information is correct, judging whether the configuration information is correct or not;
and when the configuration information is correct, determining that the switch is successfully upgraded.
6. The method as recited in claim 5, further comprising:
and when the configuration information is wrong, determining that the switch upgrade fails.
7. The method of any one of claims 1-6, further comprising:
generating an operation log in real time when upgrading the software to be upgraded in the switch each time;
and generating an operation log in real time each time whether the switch is successfully upgraded or not is verified.
8. An apparatus for software upgrade testing, comprising:
the information reading module is used for reading configuration information of the switch and version information to be tested of the software to be upgraded in the switch;
the upgrade execution module is used for upgrading the software to be upgraded in the switch according to the selected upgrade parameters so as to obtain an upgrade result and target version information of the switch after upgrade;
the upgrade verification module is used for verifying whether the switch is successfully upgraded according to the upgrade result, the target version information and the configuration information;
the upgrading parameters comprise upgrading mode parameters and flash partition parameters, wherein the upgrading mode parameters comprise a usb mode, an ftp mode, a tftp mode, an sftp mode and an http mode; the flash partition parameters comprise a main partition and a standby partition;
the upgrade execution module includes:
the combination determination submodule is used for determining the combination condition of the version information to be tested, the upgrade mode parameter and the flash partition parameter;
the software upgrading sub-module is used for upgrading the software to be upgraded in the switch one by one according to different combination conditions; the software upgrading submodule comprises:
the parameter selection unit is used for upgrading the software to be upgraded in the switch after selecting the version information to be tested, an upgrading mode parameter and a flash partition parameter;
the first judging unit is used for judging whether the flash partition parameters are traversed;
the second judging unit is used for judging whether the traversal of the version information to be tested is completed or not if the traversal of the flash partition parameter is completed;
the third judging unit is used for judging whether the upgrade mode parameter is traversed or not if the version information to be tested is traversed;
a fourth judging unit, configured to end the software upgrade test if the upgrade mode parameter traversal is completed;
the result acquisition sub-module is used for acquiring the upgrading result and the target version information after each upgrading.
CN202011397360.1A 2020-12-03 2020-12-03 Software upgrading test method and device Active CN112416796B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011397360.1A CN112416796B (en) 2020-12-03 2020-12-03 Software upgrading test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011397360.1A CN112416796B (en) 2020-12-03 2020-12-03 Software upgrading test method and device

Publications (2)

Publication Number Publication Date
CN112416796A CN112416796A (en) 2021-02-26
CN112416796B true CN112416796B (en) 2023-11-17

Family

ID=74829871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011397360.1A Active CN112416796B (en) 2020-12-03 2020-12-03 Software upgrading test method and device

Country Status (1)

Country Link
CN (1) CN112416796B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115237816B (en) * 2022-09-22 2022-12-27 深圳市明源云科技有限公司 System function verification method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338127A (en) * 2013-07-18 2013-10-02 上海大亚科技有限公司 Method for realizing automatic configuration update of switch and system upgrade control
CN105094875A (en) * 2014-05-19 2015-11-25 中兴通讯股份有限公司 Software upgrading method and device
WO2017190547A1 (en) * 2016-05-06 2017-11-09 中兴通讯股份有限公司 Method for upgrading apparatus, device, and configuration point
CN108540344A (en) * 2018-03-29 2018-09-14 四川斐讯信息技术有限公司 A kind of router upgrade test method and system
CN111147314A (en) * 2019-12-30 2020-05-12 深圳市丰润达科技有限公司 Switch upgrading method, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338127A (en) * 2013-07-18 2013-10-02 上海大亚科技有限公司 Method for realizing automatic configuration update of switch and system upgrade control
CN105094875A (en) * 2014-05-19 2015-11-25 中兴通讯股份有限公司 Software upgrading method and device
WO2017190547A1 (en) * 2016-05-06 2017-11-09 中兴通讯股份有限公司 Method for upgrading apparatus, device, and configuration point
CN108540344A (en) * 2018-03-29 2018-09-14 四川斐讯信息技术有限公司 A kind of router upgrade test method and system
CN111147314A (en) * 2019-12-30 2020-05-12 深圳市丰润达科技有限公司 Switch upgrading method, device and storage medium

Also Published As

Publication number Publication date
CN112416796A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
US7392148B2 (en) Heterogeneous multipath path network test system
CN110888414B (en) Test method for upgrading vehicle controller
US20050071838A1 (en) System-updating method and computer system adopting the method
CN210380880U (en) Vehicle-mounted Ethernet test system
MXPA03004289A (en) Online diagnosing of computer hardware and software.
Dunagan et al. Towards a self-managing software patching process using black-box persistent-state manifests
CN106648762B (en) Method and device for building development environment
CN112416796B (en) Software upgrading test method and device
CN111324365A (en) Method and equipment for upgrading super-converged system
CN110928556A (en) Automatic program burning method and device for railway vehicle, and testing method and system
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN112543478B (en) WiFi module automatic test method and device, computer equipment and storage medium
CN110198222B (en) Plug-and-play test method and test master station for power distribution automation terminal
CN114490746B (en) Equipment testing method and device, equipment to be tested and storage medium
CN116483416A (en) Firmware online upgrading method, server and storage medium
CN107612786B (en) Method and system for testing router
CN115437925A (en) Functional automation test tool for operating system
CN115455431A (en) Method, device, terminal and medium for automatic code security detection and vulnerability repair
CN113886274A (en) Stability testing method, device, equipment and storage medium for Internet of vehicles terminal
CN114924546A (en) Calibration system and method for hardware-in-loop test
CN114741273A (en) Remote real mobile terminal testing method, device, storage medium and equipment
CN114791832B (en) IOS system repairing method and device when equipment space is insufficient and related components
CN114461470B (en) Memory power consumption testing method, system, equipment and storage medium
CN113094281B (en) Test method and device for hybrid App
CN117749626A (en) Verification method and device for parameter configuration

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