Upgrading and downgrading test method and device, electronic equipment and nonvolatile storage medium
Through automated detection and triggering lift and downgrade operations, the problem of repeated lift and downgrade testing in the existing technology is solved, and a fully automated test process is realized, which improves the testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411381376.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
When conducting repeated upgrade and downgrade tests, the test efficiency is low, and a large number of manual simulation version upgrades and resource construction is required, which leads to cumbersome and time-consuming.
By configuring the configuration information file, the relationship between the current version and the version to be lifted is automatically detected, and the automatic upgrade or downgrade operation is triggered, fully automated repeated upgrade and downgrade testing is realized, and manpower is released.
It effectively improves the efficiency of repeated upgrades and downgrades, reduces the complexity of test operations, and is suitable for online upgrades of storage systems in complex scenarios, ensuring the accuracy and efficiency of tests.
Smart Images

Figure CN119271559A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to an upgrade and downgrade testing method, device, electronic equipment and non-volatile storage medium. Background Art
[0002] To ensure that storage products are up to date, the storage system needs to be continuously upgraded online. During the online upgrade of storage products, repeated upgrades and upgrades are a means of testing the reliability of version installation.
[0003] When conducting repeated upgrade and downgrade tests, related technologies require testers to repeatedly simulate version upgrades and simulate application construction resources to compare whether the resources built after the upgrade are complete and free of abnormalities. The process is cumbersome and the testing efficiency is low.
[0004] In view of this, improving the efficiency of repeated upgrade and downgrade testing is a technical problem that technical personnel in this field need to solve.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The present invention provides an upgrade and downgrade test method, device, electronic equipment and non-volatile storage medium, which can release manpower and effectively improve the efficiency of repeated upgrade and downgrade tests.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] In one aspect, the present invention provides a method for upgrading and downgrading test, comprising:
[0009] When receiving a test instruction, reading a test configuration information file; the test configuration information file at least includes storage system configuration information and version upgrade and downgrade information; the version upgrade and downgrade information includes version upgrade times and resource construction information;
[0010] Fill the storage system configuration information and version upgrade and downgrade information of the test configuration information file into the host common resource structure and upgrade and downgrade version information structure of the device under test accordingly;
[0011] Logging into the device under test based on the host public resource structure, and obtaining the current host version of the device under test;
[0012] When the version upgrade times are not reached, the upgrade sub-process or the downgrade sub-process is triggered by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and the corresponding sub-process is executed on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure.
[0013] In a first exemplary implementation, the test configuration information file includes a plurality of devices to be tested, and after reading the test configuration information file, the method further includes:
[0014] Obtaining the starting position of each line of the test configuration information file;
[0015] Count the number of rows whose starting positions are at the preset positions to determine the total number of devices under test;
[0016] A corresponding number of test processes are created based on the total number of devices under test, so as to perform repeated upgrade and downgrade tests on each device under test simultaneously.
[0017] In a second exemplary implementation, the step of filling the storage system configuration information and the version upgrade and downgrade information of the test configuration information file into the host common resource structure and the upgrade and downgrade version information structure of the device under test includes:
[0018] Fill the cluster address, cluster password, node address, and node password read from the storage system configuration information into the host common resource structure, and fill the file server login information, installation package download address, version upgrade times, upgrade version to be tested, and downgrade version to be tested read from the version upgrade and downgrade information into the host common resource structure;
[0019] Fill the version file name, checkpoint instruction and upgrade delay value read from the version upgrade and downgrade information into the upgrade version information structure;
[0020] The version file name, resource setting information and downgrade delay value read from the version upgrade and downgrade information are filled into the downgrade version information structure.
[0021] In a third exemplary implementation, the determining whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and executing a corresponding sub-process on the device to be tested according to the upgrade and downgrade version information structure and the host common resource structure, includes:
[0022] When the current host version is consistent with the upgrade version to be tested, or the current host version is inconsistent with both the upgrade version to be tested and the downgrade version to be tested, the downgrade sub-process is triggered;
[0023] Determine the downgrade installation package based on the host public resource structure, and install it into each node of the device under test;
[0024] When the downgrade installation package is successfully installed on each node of the device under test, and the node status of each node of the device under test is a candidate status, a master node is selected from each node, and a cluster is created on the master node;
[0025] When the cluster is created, corresponding resources are created for the device under test based on the resource setting information of the upgrade and downgrade version information structure.
[0026] In a fourth exemplary implementation, the step of filling each node of the device under test includes:
[0027] splicing the installation package download address read from the host public resource structure with the downgraded version to be tested, and querying whether there is a downgraded version to be tested according to the splicing result;
[0028] When the downgraded version to be tested exists, the cluster is split, and the total number of devices installed with the downgraded version to be tested is determined according to the total number of nodes of the device to be tested, and the downgrade installation package is installed on each node in turn until the number of installations reaches the total number of devices;
[0029] The installation process of the downgrade installation package for a single node is as follows:
[0030] Storing the downgrade installation package corresponding to the downgraded version to be tested in a preset file package installation location of the target node of the device to be tested, and installing the downgrade installation package to the target node;
[0031] Execute an Internet packet explorer command on the target node, and if the status of the target node after the command execution is pass, remotely log in to the target node, and when it is determined that the version of the current node is consistent with the downgraded version to be tested, execute the installation package installation process for the next node;
[0032] If the state of the target node after the command execution is not connected, then after the first preset sleep time ends, the Internet packet explorer command is executed to the target node again, and the command is executed in a loop within the degradation delay until the state of the target node after the command execution is connected.
[0033] In a fifth exemplary implementation, the determining whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and executing a corresponding sub-process on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure, includes:
[0034] When the current host version is consistent with the downgraded version to be tested, the upgrade sub-process is triggered;
[0035] splicing the installation package download address read from the host public resource structure with the upgrade version to be tested, and querying whether there is an upgrade version to be tested according to the splicing result;
[0036] When the upgraded version to be tested exists, determining the total number of devices on which the upgraded version to be tested is installed according to the total number of nodes of the device to be tested;
[0037] Start the installation count timer, copy the upgrade installation package corresponding to the upgraded version to be tested from the file server to the preset installation package storage location of one of the current nodes of the device to be tested, remotely log in to the current node, and install the upgrade installation package online to the target node, complete the installation operation of the upgrade installation package of the current node, and install the upgrade installation package on the next node of the device to be tested, and execute it in a loop until the number of installations reaches the total number of devices;
[0038] Log in to the cluster address of the host public resource structure, execute the node status query instruction, and count the total number of nodes in the valid state; if the total number of nodes in the valid state is the same as the total number of devices, the installation process of the upgrade installation package of the device to be tested is completed;
[0039] If the total number of nodes in a valid state is less than the total number of devices, the delay time is started, and after the second preset sleep time is reached, the total number of nodes in a valid state is counted again. If the total number of nodes in a valid state is less than the total number of devices, and the current delay time is less than the upgrade delay, the total number of nodes in a valid state is counted again after the second preset sleep time is reached. When the current delay time is less than the upgrade delay, the loop is executed until the total number of nodes in a valid state is the same as the total number of devices. In a sixth exemplary embodiment, after executing the corresponding sub-process on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure, it also includes:
[0040] If the parameter type is an upgrade parameter, the current version upgrade times are updated, and the cluster information is checked at the same time. The resource information of the device under test is checked to see if it is normal according to the checkpoint instruction in the upgrade version information structure. The version information of the device under test is checked to see if it is the upgrade version to be tested, and the log information contains information such as warnings or error codes.
[0041] If the parameter type is a downgrade parameter, check whether the version information of the device under test is the downgrade version to be tested, and check whether the log information contains information such as an alarm or an error code.
[0042] Another aspect of the present invention provides a upgrading and downgrading testing device, comprising:
[0043] A file reading module is used to read a test configuration information file when receiving a test instruction; the test configuration information file at least includes storage system configuration information and version upgrade and downgrade information; the version upgrade and downgrade information includes version upgrade times and resource construction information;
[0044] A data processing module, used to fill the storage system configuration information and version upgrade and downgrade information of the test configuration information file into the host common resource structure and upgrade and downgrade version information structure of the device under test;
[0045] A version acquisition module, used to log in to the device under test based on the host public resource structure and obtain the current host version of the device under test;
[0046] The automatic upgrade and downgrade test module is used to determine whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested when the number of version upgrades has not been reached, and execute the corresponding sub-process on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure.
[0047] The present invention also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of the upgrade and downgrade test method as described in any of the preceding items when executing a computer program stored in a memory.
[0048] Finally, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the upgrade and downgrade test method as described in any of the preceding items are implemented.
[0049] The advantage of the technical solution provided by the present invention is that the connection information of the device to be tested, the version to be upgraded, the downgraded version, the resources to be built, the checkpoints and inspection methods, the number of upgrades and downgrades, and other information are configured into a test configuration information file, and the relationship between the current version and the version to be upgraded and upgraded is automatically detected, and automatic upgrade of the upgrade version not to be tested is triggered, and the upgrade and resource construction are automatically performed after the downgraded version is automatically filled, so as to realize fully automated repeated upgrade and downgrade testing, release human operations, and effectively improve the efficiency of repeated upgrade and downgrade testing.
[0050] In addition, the present invention also provides a corresponding implementation device, electronic device and non-volatile storage medium for the upgrade and downgrade test method, which further makes the method more practical, and the device, electronic device and non-volatile storage medium have corresponding advantages.
[0051] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be arbitrarily combined with each other, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this article. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features. It should be understood that the above general description and the detailed description below are only exemplary and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 A schematic diagram of a flow chart of an upgrade and downgrade test method provided by the present invention;
[0054] Figure 2 A schematic diagram of a flow chart of an upgrade and downgrade test method provided by the present invention;
[0055] Figure 3 A schematic diagram of a degradation test sub-process provided by the present invention;
[0056] Figure 4 A schematic diagram of an upgrade test sub-process provided by the present invention;
[0057] Figure 5 A schematic diagram of a data check sub-process provided by the present invention;
[0058] Figure 6 A structural diagram of a specific implementation of the upgrade and downgrade test device provided by the present invention;
[0059] Figure 7 A structural diagram of a specific implementation of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0060] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, the terms "first", "second", "third", "fourth", etc. in the specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations of the two are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described here as "exemplary" is not necessarily interpreted as being superior or better than other embodiments.
[0061] Storage system online upgrade refers to the process of upgrading the storage system software by uploading or downloading update files online. The original programs, data, and settings will not be changed. There are also relatively few problems in this regard. Users do not need to go to maintenance points for manual upgrades. At the same time, version upgrades can be performed without losing user business data. This process ensures that the software or system is in the latest state. It can be applied to a variety of devices and systems, including but not limited to software systems, operating systems, smart phones and automobile control systems.
[0062] Currently, online upgrades of storage systems are completed manually through the management page. During the storage test process, the reliability of online upgrades needs to be ensured, and repeated upgrade and upgrade tests are a means of testing the reliability of version installation. During repeated upgrade and upgrade tests, testers not only need to repeatedly simulate version upgrades, but also need to simulate application construction resources to compare whether the resources built after the upgrade are complete and without abnormalities. It takes more than half an hour to complete a single upgrade action on multiple nodes. Not only is the test process cumbersome and time-consuming, but the reliability check of resources before and after the upgrade in complex scenarios will also be missed.
[0063] In order to solve the shortcomings of the related art that relies on manual repeated upgrade and downgrade tests, the present invention configures the connection information of the device to be tested, the version to be upgraded, the downgraded version, the resources to be built, the checkpoints and the inspection method, the number of upgrades and downgrades, and other information into a test configuration information file, automatically detects the relationship between the current version and the version to be upgraded, and triggers the automatic upgrade of the non-tested upgrade version, the automatic filling of the downgraded version and the construction of resources, so as to realize the automated testing of complex upgrade scenarios, release manpower, and flexibly apply to the online upgrade of the storage system under various usage scenarios. After introducing the technical scheme of the present invention, various non-limiting embodiments of the present invention are described in detail below. In order to better illustrate the present invention, numerous specific details are given in the specific embodiments below. Those skilled in the art should understand that the present invention can also be implemented without these specific details. In other examples, the methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present invention.
[0064] First see Figure 1 , Figure 1 A flowchart of a method for upgrading and downgrading a test is provided in this embodiment. This embodiment may include the following contents:
[0065] S101: When a test instruction is received, a test configuration information file is read.
[0066] In this embodiment, the test instruction is used to trigger repeated upgrade and downgrade tests. For storage products, the object of the upgrade system operation is a cluster, so starting the system upgrade means starting the upgrade of all nodes in the cluster. For example, when the topology is a multi-input and output group or a dual-active, it is a system upgrade within the cluster. When the topology is remote replication between clusters, it is a system upgrade for multiple clusters. Since the remote replication function supports remote replication between different system versions, one or more clusters can be upgraded according to demand, so the test configuration information file includes the basic information of the test in addition to the basic information of the test, and the basic information of the storage system is reflected by the storage system configuration information, which includes but is not limited to public configuration information, such as cluster and node related data, and the basic information of the test is reflected by the version upgrade and downgrade information, which includes but is not limited to the number of version upgrades, the resource information required to be built, the version name, the path location of the file server where the version is located, the resource creation instruction, and the resource check item information, which is to check which checkpoints are checked and the inspection method adopted. As a method with rich expression ability, scalability and easy to use, the format of the test configuration information file can be a yaml (data markup language) file. The test configuration information file of this step simulates the filling downgrade and upgrade test process by replacing the operation complexity with the configuration complexity, which can effectively reduce the complexity of the test operation and is conducive to improving the test efficiency and accuracy of the upgrade and downgrade simulation test in complex scenarios.
[0067] S102: Fill the storage system configuration information and version upgrade and downgrade information of the test configuration information file into the host common resource structure and upgrade and downgrade version information structure of the device under test accordingly.
[0068] Among them, the device under test is a storage system that needs to be repeatedly upgraded and upgraded. It can be a single node, a cluster including multiple nodes, or a system including multiple clusters, each cluster including multiple nodes, which does not affect the implementation of the present invention. The host common resource structure and the upgrade and upgrade version information structure are pre-constructed, and are used to store the data type required for the device under test to perform version upgrade and upgrade tests. It is a structural data composed of a batch of data, which are all read from the test configuration information file. The host common resource structure includes relevant data of the host resource information, including but not limited to cluster information, upgrade and upgrade versions to be tested, the address of downloading the installation package corresponding to the version, and the number of version upgrades. The upgrade and upgrade version information structure includes detailed information of the upgrade and upgrade, including but not limited to the upgrade and upgrade version name, resource creation information, and resource inspection items.
[0069] S103: Log in to the device under test based on the host public resource structure, and obtain the current host version of the device under test.
[0070] In this embodiment, the host public resource structure includes host system configuration information, such as a cluster IP (Internet Protocol Address) address and a node address, so that the device under test can be logged in by logging in to the cluster IP address. After logging in to the device under test, the current host version information can be queried. In order to facilitate subsequent process processing, the current host version can be saved as a variable.
[0071] S104: When the number of version upgrades has not been reached, determine whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and execute the corresponding sub-process for the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure.
[0072] The number of version upgrades will be pre-configured in the test configuration information file of S101. Each time a version upgrade sub-process for the device to be tested is completed, the current number of version upgrades will be increased by 1. As long as the number of version upgrades has not been reached, this step will be executed in a loop until the number of version upgrades is reached. Correspondingly, the current host version of this step refers to the version installed on the device to be tested that is obtained before each step during the process of looping this step. As for whether to trigger an upgrade sub-process or a downgrade sub-process, it can be achieved by pre-setting the relationship between the current host version, the upgrade version to be tested, and the downgrade version to be tested. For example, if the current host version is consistent with the upgrade version to be tested, the downgrade sub-process is triggered; if the current host version is consistent with the downgrade version to be tested, the upgrade sub-process is triggered; if the current host version is different from the upgrade version to be tested and the downgrade version to be tested, the downgrade sub-process is triggered.
[0073] In the technical solution provided in this embodiment, the connection information of the device to be tested, the version to be upgraded, the downgraded version, the resources to be built, the checkpoints and inspection methods, the number of upgrades and downgrades, and other information are configured into a test configuration information file, which automatically detects the relationship between the current version and the version to be upgraded and upgraded, and triggers the automatic upgrade of the upgrade version not to be tested, the automatic filling of the downgraded version and then the upgrade and resource construction, to achieve fully automated repeated upgrade and downgrade testing, freeing up manual operations and effectively improving the efficiency of repeated upgrade and downgrade testing.
[0074] In order to further improve the test efficiency, based on the above embodiment, the test configuration information file includes multiple devices under test. The present invention also provides an implementation method for performing upgrade and downgrade tests on multiple devices under test in parallel, which may include the following contents:
[0075] The starting position of each line of the test configuration information file is obtained; the number of lines with the starting position at the preset position is counted to determine the total number of devices under test; and a corresponding number of test processes are created based on the total number of devices under test to perform repeated upgrade and downgrade tests on each device under test at the same time.
[0076] In this embodiment, the row where the device to be tested is stored in the test configuration information file can be formatted differently than the rows where other information is stored, and one row records one device to be tested. For example, the device to be tested can be uniquely identified by the device identifier. When the test is started, the device identifier can be followed by reading the test configuration information file, and the total number of devices currently under test and upgraded can be calculated. Different processes can be created based on the number to perform parallel testing. For example, the row where the device to be tested is stored can be set to be written in fixed format, while other information is not written in fixed format. In this way, the number of devices to be tested can be counted by judging the indentation relationship between the rows. For example, the content of the test configuration information file is as follows:
[0077] scort_g2_part1 (first device under test identification)
[0078] Public configuration information
[0079] Upgrade and downgrade version information
[0080] scort_g5_part2 (second device under test identification)
[0081] Upgrade and downgrade version information
[0082] Among them, the total number of test processes may be the same as the total number of devices under test, or may be different. This can be determined based on the computing resources and storage resources of the test execution device. Of course, when the resources of the test execution device permit, the total number of test processes is the same as the total number of devices under test. In this way, a test process can perform repeated upgrade and downgrade tests on a device under test.
[0083] From the above, it can be seen that this embodiment can configure multiple devices at one time by setting the file format of the test configuration information file. The devices are segmented by device names, and multiple test processes can be created by automatically counting the number of devices to be tested, thereby supporting the upgrade and downgrade testing of multiple devices at the same time, effectively improving the effect of repeated upgrade and downgrade testing.
[0084] The above embodiment does not limit how to fill the information into the upgrade and downgrade version information structure. This embodiment also provides an exemplary implementation method, which may include the following content:
[0085] The cluster address, cluster password, node address, and node password read from the storage system configuration information are filled into the host common resource structure; the file server login information, installation package download address, version upgrade times, upgraded version to be tested, and downgraded version to be tested read from the version upgrade and downgrade information are filled into the host common resource structure; the version file name, checkpoint instructions, and upgrade delay value read from the version upgrade and downgrade information are filled into the upgrade version information structure; the version file name, resource setting information, and downgrade delay value read from the version upgrade and downgrade information are filled into the downgrade version information structure.
[0086] In this embodiment, the storage system configuration information of the test configuration information file may include cluster ipclusterip, cluster password clusterpasswd, node ip node1ip and node password node1passwd. If the device under test has multiple nodes, there are multiple corresponding node ips, and the cluster ip is clusterip = 100.2.86.60. The version upgrade and downgrade information may include the installation package download address and file server login information. If the file server is ftp (File Transfer Protocol), the file server login information may be the user name ftpuser and the login password ftppasswd. The installation package download address may be, for example, ftp_path = In addition, it may also include the version upgrade number up_num, such as up_num=10, the downgrade version to be tested, such as [v3.5.1.10], the upgrade version to be tested, such as [v3.5.1.17], the version file name, that is, the resource creation item, such as filename = 1813_180823_2128.tgz.gpg, the resource setting information setmsg, the resource check item, such as filename=1813_180823_2128.tgz.gpg, and the checkpoint instruction querymsg.
[0087] Among them, the host public resource structure and the upgrade and downgrade version information structure can be pre-created according to the test configuration information file format. The upgrade and downgrade version information structure may include the upgrade version information structure and the downgrade version information structure. The test configuration information file is loaded, and the parameter information of the device under test, that is, the host public resources, the upgrade version information, and the downgrade version information, are stored in these three structures. Correspondingly, the host public resource structure can correspond to: host=[{clusterip: 10.*.*, clusterpasswd: *, node1ip: 10.*.*, node1passwd: *, ftp_path: *, ftp_pw: *, up_vs:'v3.5.1.10',
[0088] [down_ves:'v3.5.1.17'}, up_num=10]; the upgrade version information structure can correspond to: up_v=={filename:*, querymsg:[,*,], timeout:1200}; the downgrade version information structure can correspond to: down_v={filename:*, setmsg:[,*,], timeout:600}, where timeout represents the delay. For the sake of ease of description, the delay of the upgrade version information structure is defined as the upgrade delay, and the delay of the downgrade version information structure is defined as the downgrade delay.
[0089] From the above, it can be seen that this embodiment simulates the filling downgrade and upgrade test process by replacing the operation complexity with the configuration complexity, which can effectively reduce the complexity of the test operation and is conducive to improving the test efficiency and accuracy of the upgrade and downgrade simulation test in complex scenarios.
[0090] In the above embodiment, there is no limitation on how to perform step S104. In this embodiment, an exemplary implementation method of the device under test performing repeated upgrade and downgrade tests is provided, which may include the following contents:
[0091] like Figure 2 As shown in , when the current host version is consistent with the upgrade version to be tested, or the current host version is inconsistent with both the upgrade version to be tested and the downgrade version to be tested, the downgrade sub-process is triggered. When the current host version is consistent with the downgrade version to be tested, the upgrade sub-process is triggered. Figure 2 and 3 As shown, the execution process of the downgrade sub-process can be as follows: determine the downgrade installation package based on the host public resource structure, and install it into each node of the device under test; when the downgrade installation package is successfully installed into each node of the device under test, and the node status of each node of the device under test is all in the alternative status, select the main node from each node, and create a cluster on the main node; when the cluster is created, create corresponding resources for the device under test based on the resource setting information of the upgrade and downgrade version information structure.
[0092] Among them, Figure 2 and 4As shown, the execution process of the upgrade sub-process can be as follows: splicing the installation package download address read from the host public resource structure and the upgrade version to be tested, and querying whether there is an upgrade version to be tested based on the splicing result; when there is an upgrade version to be tested, determining the total number of devices that install the upgrade version to be tested based on the total number of nodes of the device to be tested; starting the installation count timer, copying the upgrade installation package corresponding to the upgrade version to be tested from the file server to the preset installation package storage location of one of the current nodes of the device to be tested, remotely logging in to the current node, and installing the upgrade installation package online to the target node, completing the installation operation of the upgrade installation package on the current node, and installing the upgrade installation package on the next node of the device to be tested, and executing the cycle until the number of installations reaches the total number of devices number; log in to the cluster address of the host public resource structure, execute the node status query instruction, and count the total number of nodes in the valid state at the same time; if the total number of nodes in the valid state is the same as the total number of devices, the installation process of the upgrade installation package of the device under test is completed; if the total number of nodes in the valid state is less than the total number of devices, the delay time is started, and after the second preset sleep time is reached, the total number of nodes in the valid state is counted again. If the total number of nodes in the valid state is less than the total number of devices, and the current delay time is less than the upgrade delay, the second preset sleep time is continued to arrive, and the total number of nodes in the valid state is counted again. When the current delay time is less than the upgrade delay, the loop is executed until the total number of nodes in the valid state is the same as the total number of devices.
[0093] Among them, after logging into the device to be tested, query the current host version information and save it as a variable now_v, use now_v to compare with up_vs and down_ves values, if now_v is consistent with the upgrade version to be tested or inconsistent with both the upgrade and downgrade versions to be tested, trigger the downgrade sub-process, automatically fill the downgrade version to be tested for each node of the device to be tested, and judge whether the version installed on the current node is consistent with the downgrade version to be tested being installed. If they are consistent, continue to install the next node. If they are inconsistent, return the installation failure to exit the sub-process. When all nodes of the device to be tested are installed, check whether the node status is an alternative status. If so, a node can be randomly selected, such as the first node can be selected as the main node, and the cluster creation instruction is executed on the node. After the cluster is created, according to the resource creation statement in setmsg[N] in the downgrade version information structure in the upgrade and downgrade version information structure, the resource creation instruction is executed cyclically, where N is the total number of instruction statements for creating different resources in setmsg. In order to ensure that the original business remains unchanged and the data before the upgrade is kept, a data verification sub-process can also be executed. Accordingly, a parameter is passed to the data verification sub-process, and the parameter passed is downgrade.
[0094] Exemplarily, the automatic filling process may be as follows: splicing the installation package download address read from the host public resource structure and the downgraded version to be tested, and querying whether the downgraded version to be tested exists based on the splicing result; if the downgraded version to be tested exists, the cluster is split, and the total number of devices to be installed with the downgraded version to be tested is determined based on the total number of nodes of the devices to be tested, and the downgrade installation package is installed on each node in turn until the number of installations reaches the total number of devices. This embodiment can read host.ftp and down_v.filename for splicing, and query whether the installation package of the downgraded version to be tested exists. If it does not exist, it directly returns that the query failed, the test failed, and it exits directly. If the installation package of the downgraded version to be tested exists, in order to reduce errors, the cluster can be split, and accordingly, clusterip will no longer be accessible.
[0095] Among them, the installation process of the downgrade installation package of a single node is as follows: the downgrade installation package corresponding to the downgraded version to be tested is stored in the preset file package installation position of the target node of the device to be tested, and the downgrade installation package is installed to the target node; the Internet package explorer command is executed on the target node, if the state of the target node after the command execution is connected, the target node is remotely logged in, and when it is determined that the version of the current node is consistent with the downgraded version to be tested, the installation package installation process is executed on the next node; if the state of the target node after the command execution is not connected, after the first preset sleep time ends, the Internet package explorer command is executed again to the target node, and the command execution is cyclically executed within the downgrade delay until the state of the target node after the command execution is connected. In this embodiment, the number of node numbers of the host in the host public resource structure represents the number of nodes that need to install the downgraded version to be tested, and this number is used as a loop control to copy the installation package downloaded from the installation package download address to the node, for example, it can be copied to the specified installation position of the current node through the remote copy instruction SCP. Then log in to the node through the remote connection tool to execute the overwrite installation instruction. In order to detect whether the node has successfully installed the downgraded version to be tested, the node can be tested for network faults, such as executing a ping (Packet Internet Groper) command on the node IP of the node. If it is not connected, the ping command can be continuously sent. For example, it can sleep for a period of time, such as 60 seconds, and then send a ping command, while accumulating the waiting time time=time+60, and judging whether time is greater than the downgrade delay down_v.timeout. If it is greater, the version installation failure information is returned. If it is less, the network fault is checked in the above manner until it can be pinged. In order to further improve the test efficiency, node filling can also be executed in parallel for all nodes. The version can be copied to the specified path in a loop first, and after executing the installation command, the node status can be pinged again to see if all nodes are accessible to determine whether the installation is complete.
[0096] In this embodiment, after logging into the device to be tested, if now_v is consistent with the downgraded version to be tested, the upgrade sub-process is triggered. Similarly, the number of host node numbers in the host public resource structure represents the number of nodes that need to install the downgraded version to be tested. This number is used as a loop control to copy the installation package downloaded from the installation package download address to the node, for example, it can be copied to the specified installation location of the current node through the remote copy instruction SCP, for example, it can be copied to the specified installation location of the current node through the remote copy instruction SCP. Then log in to the node through the remote connection tool to execute the version upgrade installation instruction, and the loop ends. Log in to clusterip, then query the validity of each node status, and count the number of nodes with valid status, and determine whether the number of valid nodes is equal to the number of upgraded nodes. If the number of valid nodes is less than the number of upgraded nodes, it means that there are still nodes that have not been upgraded and added back to the cluster, and they can sleep for a period of time, such as 60 seconds. At the same time, the accumulated waiting time time=time+60 is added to determine whether time is greater than up_v.timeout. If it is greater, the version installation failure information is returned. If it is less, continue to execute the above steps until the number of valid nodes queried under the cluster is equal to the number of upgraded nodes, confirming that the upgrade is complete. At this time, the upgraded version to be tested of each node of the device to be tested is installed. In order to ensure that the original business remains unchanged and the data before the upgrade is maintained, the data verification sub-process can also be executed. Correspondingly, the parameter passing operation is performed to the data verification sub-process, and the parameter passing parameter is the upgrade.
[0097] As can be seen from the above, this embodiment automatically detects the relationship between the current version and the version to be upgraded, and after determining whether to trigger a downgrade or upgrade, it can automatically fill the downgraded version and then perform the upgrade and resource construction, and after completing the upgrade action, perform resource verification according to the inspection requirements. This reduces the complexity of the test operation and provides an effective test method for complex upgrade and downgrade simulation tests, thereby improving test efficiency and accuracy.
[0098] In order to ensure that the original business remains unchanged and the data before the detection upgrade is not lost, this embodiment also provides a data verification implementation process, such as Figure 5 As shown, it may include the following:
[0099] If the parameter type is an upgrade parameter, the current version upgrade times are updated, and the cluster information is checked at the same time. The resource information of the device under test is checked according to the checkpoint instructions in the upgrade version information structure to see if it is normal; check whether the version information of the device under test is the upgrade version to be tested, and check whether the log information contains information such as warnings or error codes; if the parameter type is a downgrade parameter, check whether the version information of the device under test is the downgrade version to be tested, and check whether the log information contains information such as warnings or error codes.
[0100] In this embodiment, it is determined whether the currently executed sub-process is an upgrade sub-process or a downgrade sub-process according to the received parameter transmission parameters. If it is an upgrade sub-process, the current upgrade number num is updated to num+1, and the cluster information is checked. According to all resource check statements of up_v.querymsg[N], the resource information is checked to see if it is normal. It is also necessary to check whether the version information is the current version. Finally, it is checked whether the log information contains information such as alarms or error codes. If there are no abnormalities in the above four checks, the data verification is normal, and the data verification success is returned. If there is an abnormality in any of the above four items, the check failure is returned, and the program exits. If it is a downgrade sub-process, the version information is checked to see if it is the current version, and the log information is checked to see if it contains information such as alarms or error codes, and the corresponding inspection results are returned. If the data verification sub-process returns successfully, it is determined whether the current upgrade number num is greater than or equal to the version upgrade number. If it is less than the version upgrade number, step S104 is continued. If it is greater than or equal to the version upgrade number, the test is terminated and the corresponding test results are returned.
[0101] As can be seen from the above, this embodiment can ensure that the host under test can run the previously running business normally after the upgrade or downgrade through the data verification sub-process, and the original data is not lost, thereby ensuring the test stability of the host under test.
[0102] When performing repeated upgrade and downgrade tests, in order to effectively record and manage test results and ensure the effectiveness and efficiency of repeated upgrade and downgrade tests, the present invention also provides an implementation method for recording and managing test results, which may include the following contents:
[0103] Before performing repeated upgrade and downgrade tests, a comprehensive tracking matrix can be created in advance based on the requirement coverage, requirement change rate, requirement satisfaction, requirement realization rate, test coverage, defect discovery rate and defect density to link software requirements with corresponding test cases and ensure that each requirement is covered by appropriate tests. Among them, the requirement coverage can be used to measure the extent to which all identified requirements are fully understood and recorded, and the requirement change rate can be used to measure the frequency and scale of requirement changes during the project life cycle. Requirements changes are a common occurrence in project management, but too high a requirement change rate may lead to project delays, cost overruns and even project failure. Requirements satisfaction can be used to measure whether the project results meet or exceed the indicators of the initial requirements. The requirement realization rate can be used to measure the ratio between the requirements successfully realized during the project implementation phase and the total requirements. This reflects the efficiency and effectiveness of project execution. Test coverage is the ratio of code, functions, requirements, etc. covered during the test process, which can discover more potential problems and ensure the quality and reliability of the host to be tested. The defect discovery rate refers to the ratio of the number of defects found during the test process to the total number of test cases, ensuring the quality and reliability of the host to be tested. Defect density represents the number of defects relative to the size of the software and can be measured by dividing the number of defects by thousands of lines of code or function points.
[0104] Once the tracking matrix is determined, you can also select and use appropriate test management tools to establish and maintain the tracking matrix. Test management tools such as JIRA (tool name), TestRail (tool name), and Azure Test Plans (tool name) can also provide defect tracking and test progress monitoring functions through test management tools.
[0105] In addition, during the entire process of repeated version upgrade and downgrade testing, it is necessary to continuously monitor the test progress, such as regularly checking the completion status of the test, including the number of test cases executed, the test pass rate, the number of defects found, and the defect handling status, etc., and record all findings during the test in detail, including successful and failed test cases, and write a test report, including the test results, problems found and their possible causes.
[0106] As can be seen from the above, this embodiment can ensure that the test results are effectively recorded and managed, thereby improving the quality and efficiency of repeated upgrade and downgrade tests of the host to be tested.
[0107] It should be noted that there is no strict order of execution between the steps in the present invention. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1-Figure 5 This is just a schematic and does not mean that this is the only execution order.
[0108] The present invention also provides a corresponding device for the upgrade and downgrade test method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The upgrade and downgrade test device provided by the present invention is introduced below. The device is used to implement the upgrade and downgrade test method provided by the present invention. In this embodiment, the upgrade and downgrade test device may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the upgrade and downgrade test method disclosed in Example 1. The program module referred to in this embodiment refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the upgrade and downgrade test device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment, and the upgrade and downgrade test device described below and the upgrade and downgrade test method described above can be referred to each other.
[0109] From the perspective of functional modules, see Figure 6 , Figure 6 The structural diagram of the upgrade and downgrade test device provided in this embodiment under a specific implementation mode, the device may include:
[0110] The file reading module 601 is used to read the test configuration information file when receiving the test instruction; the test configuration information file at least includes the storage system configuration information and the version upgrade and downgrade information; the version upgrade and downgrade information includes the version upgrade times and the resource construction information;
[0111] The data processing module 602 is used to fill the storage system configuration information and version upgrade and downgrade information of the test configuration information file into the host common resource structure and the upgrade and downgrade version information structure of the device under test;
[0112] The version acquisition module 603 is used to log in to the device under test based on the host public resource structure and obtain the current host version of the device under test;
[0113] The automatic upgrade and downgrade test module 604 is used to determine whether to trigger the upgrade sub-process or the downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested when the number of version upgrades has not been reached, and execute the corresponding sub-process on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure.
[0114] Exemplarily, in some implementations of the present embodiment, the above-mentioned device may also include a parallel testing module, which is used to obtain the starting position of each line of the test configuration information file when the test configuration information file includes multiple devices to be tested; count the number of lines whose starting position is at a preset position to determine the total number of devices to be tested; and create a corresponding number of test processes based on the total number of devices to be tested to perform repeated upgrade and downgrade tests on each device to be tested at the same time.
[0115] Illustratively, in some other implementations of this embodiment, the data processing module 602 may also be used to:
[0116] Fill the cluster address, cluster password, node address, and node password read from the storage system configuration information into the host public resource structure, and fill the file server login information, installation package download address, version upgrade times, upgrade version to be tested, and downgrade version to be tested read from the version upgrade and downgrade information into the host public resource structure;
[0117] Fill the version file name, checkpoint instruction and upgrade delay value read from the version upgrade and downgrade information into the upgrade version information structure;
[0118] Fill the downgrade version information structure with the version file name, resource setting information, and downgrade delay value read from the version upgrade and downgrade information.
[0119] For example, in some other implementations of this embodiment, the automatic upgrade and downgrade test module 604 may also be used to:
[0120] When the current host version is consistent with the upgrade version to be tested, or the current host version is inconsistent with both the upgrade version to be tested and the downgrade version to be tested, the downgrade sub-process is triggered;
[0121] Determine the downgrade installation package based on the host public resource structure and install it to each node of the device under test;
[0122] When the downgrade installation package is successfully installed on each node of the device under test, and the node status of each node of the device under test is all in the standby state, a master node is selected from each node, and a cluster is created on the master node;
[0123] When the cluster is created, corresponding resources are created for the device under test based on the resource setting information of the upgrade and downgrade version information structure.
[0124] As an exemplary implementation of the above embodiment, the above automatic upgrade and downgrade test module 604 may also be used for:
[0125] The installation package download address read from the host public resource structure and the downgraded version to be tested are spliced, and the downgraded version to be tested is checked based on the splicing result.
[0126] If there is a downgraded version to be tested, split the cluster, determine the total number of devices to be installed with the downgraded version according to the total number of nodes of the devices to be tested, and install the downgrade installation package on each node in turn until the number of installations reaches the total number of devices;
[0127] The installation process of the downgrade installation package for a single node is as follows:
[0128] The downgrade installation package corresponding to the downgraded version to be tested is stored in the preset file package installation location of the target node of the device to be tested, and the downgrade installation package is installed to the target node;
[0129] Execute the Internet Packet Explorer command on the target node. If the status of the target node after the command execution is passed, remotely log in to the target node, and when it is determined that the version of the current node is consistent with the downgraded version to be tested, execute the installation package installation process for the next node;
[0130] If the state of the target node after the command execution is not connected, then after the first preset sleep time ends, the Internet packet explorer command is executed to the target node again, and the command is executed in a loop within the degradation delay until the state of the target node after the command execution is connected.
[0131] For example, in some other implementations of this embodiment, the automatic upgrade and downgrade test module 604 may also be used to:
[0132] When the current host version is consistent with the downgrade version to be tested, the upgrade sub-process is triggered;
[0133] The installation package download address read from the host public resource structure and the upgrade version to be tested are spliced, and the existence of the upgrade version to be tested is queried based on the splicing result;
[0134] When there is an upgraded version to be tested, the total number of devices on which the upgraded version to be tested is installed is determined according to the total number of nodes of the device to be tested;
[0135] Start the installation count timer, copy the upgrade installation package corresponding to the upgraded version to be tested from the file server to the preset installation package storage location of one of the current nodes of the device to be tested, remotely log in to the current node, and install the upgrade installation package online to the target node, complete the installation operation of the upgrade installation package on the current node, and install the upgrade installation package on the next node of the device to be tested, and execute it in a loop until the number of installations reaches the total number of devices;
[0136] Log in to the cluster address of the host public resource structure, execute the node status query command, and count the total number of nodes in the valid state; if the total number of nodes in the valid state is the same as the total number of devices, the installation process of the upgrade installation package of the device to be tested is completed;
[0137] If the total number of nodes in the valid state is less than the total number of devices, the delay time is started, and after the second preset sleep time is reached, the total number of nodes in the valid state is counted again. If the total number of nodes in the valid state is less than the total number of devices, and the current delay time is less than the upgrade delay, the total number of nodes in the valid state is counted again after the second preset sleep time is reached. When the current delay time is less than the upgrade delay, the loop is executed until the total number of nodes in the valid state is the same as the total number of devices. Exemplarily, in some other implementations of this embodiment, the above-mentioned device may also include a data verification module, which can be used to:
[0138] If the parameter type is an upgrade parameter, the current version upgrade times are updated, and the cluster information is checked at the same time. The resource information of the device under test is checked according to the checkpoint instructions in the upgrade version information structure to see if it is normal; check whether the version information of the device under test is the upgrade version to be tested, and check whether the log information contains information such as warnings or error codes;
[0139] If the parameter type is a downgrade parameter, check whether the version information of the device under test is the downgrade version to be tested, and check whether the log information contains information such as warnings or error codes.
[0140] The functions of the functional modules of the upgrade and downgrade test device described in this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0141] It can be seen from the above that this embodiment can free up manpower and effectively improve the efficiency of repeated upgrade and downgrade testing.
[0142] The upgrade and downgrade test device mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 7 The following is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention in one implementation manner. Figure 7 As shown, the electronic device includes a memory 70 for storing a computer program; a processor 71 for implementing the steps of the upgrade and downgrade test method mentioned in any of the above embodiments when executing the computer program.
[0143] Among them, the processor 71 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 71 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 71 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 71 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 71 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 71 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0144] The memory 70 may include one or more computer non-volatile storage media, which may be non-transitory. The memory 70 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the memory 70 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 70 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 70 may also include both an internal storage unit of an electronic device and an external storage device. The memory 70 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the upgrade and downgrade test method, but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 70 is at least used to store the following computer program 701, wherein, after the computer program is loaded and executed by the processor 71, the relevant steps of the upgrade and downgrade test method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 70 may also include an operating system 702 and data 703, and the storage method may be temporary storage or permanent storage. The operating system 702 may include Windows, Unix, Linux, etc. The data 703 may include but is not limited to data corresponding to the upgrade and downgrade test results.
[0145] In some embodiments, the electronic device may further include a display screen 72, an input / output interface 73, a communication interface 74 or a network interface, a power supply 75 and a communication bus 76. Among them, the display screen 72 and the input / output interface 73, such as a keyboard, belong to the user interface, and exemplary user interfaces may also include standard wired interfaces, wireless interfaces, and the like. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, and the like. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 74 may exemplarily include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, and the like, which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 76 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, and the like. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0146] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, for example, it may also include a sensor 77 to implement various functions.
[0147] It is understandable that if the upgrade and downgrade test method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the upgrade and downgrade test method recorded in any of the above embodiments are performed.
[0148] It is understandable that if the upgrade and downgrade test method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product does not need to be stored in a physical storage medium. For example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to execute all or part of the steps of the methods of each embodiment of the present invention. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product storing a computer program, which, when executed by a processor, performs the steps of the upgrade and downgrade test method described in any of the above embodiments.
[0149] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices, electronic devices, and non-volatile storage media, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0150] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0151] The above is a detailed introduction to the upgrade and downgrade test method, device, electronic device and non-volatile storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that based on the embodiments of the present invention, for ordinary technicians in this technical field, all other embodiments obtained without creative work are within the scope of protection of the present invention. Without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A method for upgrading and downgrading test, characterized in that: include: When receiving a test instruction, reading a test configuration information file; the test configuration information file at least includes storage system configuration information and version upgrade and downgrade information; The version upgrade and downgrade information includes version upgrade times and resource construction information; Fill the storage system configuration information and version upgrade and downgrade information of the test configuration information file into the host common resource structure and upgrade and downgrade version information structure of the device under test accordingly; Logging into the device under test based on the host public resource structure, and obtaining the current host version of the device under test; When the version upgrade times are not reached, the upgrade sub-process or the downgrade sub-process is triggered by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and the corresponding sub-process is executed on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure.
2. The upgrade and downgrade test method according to claim 1, characterized in that: The test configuration information file includes a plurality of devices to be tested, and after reading the test configuration information file, the method further includes: Obtaining the starting position of each line of the test configuration information file; Count the number of rows whose starting positions are at the preset positions to determine the total number of devices under test; A corresponding number of test processes are created based on the total number of devices under test, so as to perform repeated upgrade and downgrade tests on each device under test simultaneously.
3. The upgrade and downgrade test method according to claim 1, characterized in that: The step of filling the storage system configuration information and the version upgrade and downgrade information of the test configuration information file into the host common resource structure and the upgrade and downgrade version information structure of the device under test includes: Fill the cluster address, cluster password, node address, and node password read from the storage system configuration information into the host common resource structure, and fill the file server login information, installation package download address, version upgrade times, upgrade version to be tested, and downgrade version to be tested read from the version upgrade and downgrade information into the host common resource structure; Fill the version file name, checkpoint instruction and upgrade delay value read from the version upgrade and downgrade information into the upgrade version information structure; The version file name, resource setting information and downgrade delay value read from the version upgrade and downgrade information are filled into the downgrade version information structure.
4. The upgrade and downgrade test method according to claim 1, characterized in that: The step of determining whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and executing a corresponding sub-process on the device to be tested according to the upgrade / downgrade version information structure and the host common resource structure, includes: When the current host version is consistent with the upgrade version to be tested, or the current host version is inconsistent with both the upgrade version to be tested and the downgrade version to be tested, the downgrade sub-process is triggered; Determine the downgrade installation package based on the host public resource structure, and install it into each node of the device under test; When the downgrade installation package is successfully installed on each node of the device under test, and the node status of each node of the device under test is a candidate status, a master node is selected from each node, and a cluster is created on the master node; When the cluster is created, corresponding resources are created for the device under test based on the resource setting information of the upgrade and downgrade version information structure.
5. The upgrade and downgrade test method according to claim 4, characterized in that: The filling to each node of the device under test includes: splicing the installation package download address read from the host public resource structure with the downgraded version to be tested, and querying whether there is a downgraded version to be tested according to the splicing result; When the downgraded version to be tested exists, the cluster is split, and the total number of devices installed with the downgraded version to be tested is determined according to the total number of nodes of the device to be tested, and the downgrade installation package is installed on each node in turn until the number of installations reaches the total number of devices; The installation process of the downgrade installation package for a single node is as follows: Storing the downgrade installation package corresponding to the downgraded version to be tested in a preset file package installation location of the target node of the device to be tested, and installing the downgrade installation package to the target node; Execute an Internet packet explorer command on the target node, and if the status of the target node after the command execution is pass, remotely log in to the target node, and when it is determined that the version of the current node is consistent with the downgraded version to be tested, execute the installation package installation process for the next node; If the state of the target node after the command execution is not connected, then after the first preset sleep time ends, the Internet packet explorer command is executed to the target node again, and the command is executed in a loop within the degradation delay until the state of the target node after the command execution is connected.
6. The upgrade and downgrade test method according to claim 1, characterized in that: The step of determining whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested, and executing a corresponding sub-process on the device to be tested according to the upgrade / downgrade version information structure and the host common resource structure, includes: When the current host version is consistent with the downgraded version to be tested, the upgrade sub-process is triggered; splicing the installation package download address read from the host public resource structure and the upgrade version to be tested, and querying whether there is an upgrade version to be tested according to the splicing result; When the upgraded version to be tested exists, determining the total number of devices on which the upgraded version to be tested is installed according to the total number of nodes of the device to be tested; Start the installation count timer, copy the upgrade installation package corresponding to the upgraded version to be tested from the file server to the preset installation package storage location of one of the current nodes of the device to be tested, remotely log in to the current node, and install the upgrade installation package online to the target node, complete the installation operation of the upgrade installation package of the current node, and install the upgrade installation package on the next node of the device to be tested, and execute it in a loop until the number of installations reaches the total number of devices; Log in to the cluster address of the host public resource structure, execute the node status query instruction, and count the total number of nodes in the valid state; if the total number of nodes in the valid state is the same as the total number of devices, the installation process of the upgrade installation package of the device to be tested is completed; If the total number of nodes in a valid state is less than the total number of devices, the delay time is started, and after the second preset sleep time is reached, the total number of nodes in a valid state is counted again; if the total number of nodes in a valid state is less than the total number of devices, and the current delay time is less than the upgrade delay, the total number of nodes in a valid state is counted again after the second preset sleep time is reached, and when the current delay time is less than the upgrade delay, the cycle is executed until the total number of nodes in a valid state is the same as the total number of devices.
7. The upgrade and downgrade test method according to any one of claims 1 to 6, characterized in that: After executing the corresponding sub-process on the device under test according to the upgrade and downgrade version information structure and the host common resource structure, the method further includes: If the parameter type is an upgrade parameter, the current version upgrade times are updated, and the cluster information is checked at the same time. The resource information of the device under test is checked to see if it is normal according to the checkpoint instruction in the upgrade version information structure; the version information of the device under test is checked to see if it is the upgrade version to be tested, and the log information contains information such as warnings or error codes; If the parameter type is a downgrade parameter, check whether the version information of the device under test is the downgrade version to be tested, and check whether the log information contains information such as an alarm or an error code.
8. A upgrading and downgrading test device, characterized in that: include: A file reading module, used to read a test configuration information file when receiving a test instruction; the test configuration information file at least includes storage system configuration information and version upgrade and downgrade information; The version upgrade and downgrade information includes the version upgrade times and resource construction information; A data processing module, used to fill the storage system configuration information and version upgrade and downgrade information of the test configuration information file into the host public resource structure and upgrade and downgrade version information structure of the device under test; A version acquisition module, used to log in to the device under test based on the host public resource structure and obtain the current host version of the device under test; The automatic upgrade and downgrade test module is used to determine whether to trigger an upgrade sub-process or a downgrade sub-process by comparing the current host version, the upgrade version to be tested, and the downgrade version to be tested when the number of version upgrades has not been reached, and execute the corresponding sub-process on the device to be tested according to the upgrade and downgrade version information structure and the host public resource structure.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to implement the steps of the upgrade and downgrade test method as claimed in any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the upgrade and downgrade test method according to any one of claims 1 to 7 are implemented.