CN115622752B - Session management method, device, electronic equipment and storage medium - Google Patents

Session management method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115622752B
CN115622752B CN202211192843.7A CN202211192843A CN115622752B CN 115622752 B CN115622752 B CN 115622752B CN 202211192843 A CN202211192843 A CN 202211192843A CN 115622752 B CN115622752 B CN 115622752B
Authority
CN
China
Prior art keywords
session connection
login
virtual machine
type
storage system
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
CN202211192843.7A
Other languages
Chinese (zh)
Other versions
CN115622752A (en
Inventor
许春
齐武波
周春法
于建彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211192843.7A priority Critical patent/CN115622752B/en
Publication of CN115622752A publication Critical patent/CN115622752A/en
Application granted granted Critical
Publication of CN115622752B publication Critical patent/CN115622752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention provides a session management method, a session management device, electronic equipment and a storage medium, wherein the method comprises the following steps: when a test instruction is received, judging whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction; if the session connection is consistent, determining that the session connection logged in front and back is the same session connection, so as to determine whether to execute the test instruction on the current session connection by the storage system or execute the test instruction on the current session connection by the NAS virtual machine according to the second flag bit; if the session connection is inconsistent, determining that the session connection logged in before and after is different session connection so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type. The two zone bits can avoid frequently creating new session connection and rapidly determine the execution main body of the test instruction, thereby improving the test efficiency and the test accuracy.

Description

Session management method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of automated testing technology, and in particular, to a session management method, a session management apparatus, an electronic device, and a computer readable storage medium.
Background
NAS (Network Attached Storage ) is a function of a storage system, which is deployed on a storage test device, and NAS virtual machine is an independent system of the storage test device, and provides file sharing service to the outside.
In the NAS functional test process, it is necessary to enter a NAS virtual machine to check whether some resource settings are consistent with the settings under the storage system. Because the storage test equipment can only log in one session connection at a time and can not log in more than two session connections at the same time, a tester needs to switch and log in between the session connection of the storage system and the session connection of the NAS virtual machine.
However, even if instructions are continuously sent to the NAS virtual machine execution, or to the storage system execution, the same session connection is constantly interrupted, resulting in the need for frequent creation of new session connections by the tester, thereby greatly reducing test efficiency and test accuracy.
Disclosure of Invention
In view of the above, embodiments of the present invention have been made to provide a session management method that overcomes or at least partially solves the above-mentioned problems.
The embodiment of the invention also provides a session management device, electronic equipment and a storage medium, so as to ensure the implementation of the method.
In order to solve the above problems, an embodiment of the present invention discloses a session management method applied to a storage test device, where the storage test device is deployed with a storage system and a network attached storage NAS virtual machine, and the storage test device is configured with a first flag bit and a second flag bit, and the method includes:
When a test instruction is received, judging whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction;
If the first login type is consistent with the second login type, determining that the session connection of the previous login and the session connection of the current login are the same session connection, so as to determine whether to execute the test instruction on the current session connection by the storage system or execute the test instruction on the current session connection by the NAS virtual machine according to the second flag bit;
If the first login type is inconsistent with the second login type, determining that the session connection of the previous login is different from the session connection of the current login so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
Optionally, the determining, according to the second flag bit, whether to execute the test instruction on the current session connection by the storage system or to execute the test instruction on the current session connection by the NAS virtual machine includes:
judging whether the current session connection is the session connection of the NAS virtual machine according to the second flag bit;
if the current session connection is not the session connection of the NAS virtual machine, determining that the test instruction is executed on the current session connection by the storage system;
And if the current session connection is the session connection of the NAS virtual machine, determining that the NAS virtual machine executes the test instruction on the current session connection.
Optionally, the creating a new session connection and determining, according to the second login type, whether to execute the test instruction on the new session connection by the storage system or to execute the test instruction on the new session connection by the NAS virtual machine includes:
Assigning the second login type to the first flag bit;
Creating a session connection for the storage system;
judging whether the second login type is the NAS virtual machine or not;
if the second login type is not the NAS virtual machine, determining that the test instruction is executed by the storage system on a session connection of the storage system;
if the second login type is the NAS virtual machine, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system, and determining that the test instruction is executed on the session connection of the NAS virtual machine by the NAS virtual machine.
Optionally, the storage test device is further configured with a plurality of login information; the creating a session connection for the storage system includes:
Traversing the login information and searching target login information matched with the second login type; the target login information comprises a port number;
Judging whether the connection protocol of the second login type is a secure shell protocol ssh or a remote terminal protocol telnet according to the port number;
when the connection protocol is ssh protocol, establishing session connection of the storage system by adopting the ssh protocol;
and when the connection protocol is a telnet protocol, establishing session connection of the storage system by adopting the telnet protocol.
Optionally, if the second login type is the NAS virtual machine, creating a session connection of the NAS virtual machine on the basis of the session connection of the storage system, including:
If the second login type is the NAS virtual machine, determining that secondary login is needed;
extracting a secondary login type from the target login information;
judging whether the secondary login type is an ssh protocol type or an instruction type;
when the secondary login type is an ssh protocol type, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the ssh protocol type;
and when the secondary login type is an instruction type, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the instruction type.
Optionally, when the secondary login type is an ssh protocol type, creating a session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the ssh protocol type, including:
when the secondary login type is ssh protocol type, receiving static IP of the built-in virtual machine sent by a program in an interactive mode on the basis of session connection of the storage system;
When the static IP of the built-in virtual machine is correct, returning first response information to the program; the first response information is used for representing success of logging in the NAS virtual machine.
Optionally, when the secondary login type is an instruction type, creating a session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the instruction type, including:
when the secondary login type is the instruction type, on the basis of session connection of the storage system, sequentially receiving login instructions sent by a program in an interactive mode;
when the login instruction is correct, returning second response information to the program; and the second response information is used for representing that the NAS virtual machine is successfully logged in.
Optionally, the method further comprises:
acquiring a first test result obtained by repeatedly executing the storage system and a second test result obtained by repeatedly executing the NAS virtual machine;
and respectively carrying out regular analysis on the first test result and the second test result so as to enable the first test result and the second test result to have the same format.
The embodiment of the invention also discloses a session management device which is applied to storage test equipment, wherein the storage test equipment is provided with a storage system and an NAS virtual machine, the storage test equipment is provided with a first flag bit and a second flag bit, and the device comprises:
The login type judging module is used for judging whether the first login type stored in the first zone bit is consistent with the second login type carried by the test instruction or not when the test instruction is received;
The first execution module is used for determining that the session connection of the previous login and the session connection of the current login are the same session connection if the first login type is consistent with the second login type, so as to determine whether the test instruction is executed on the current session connection by the storage system or the test instruction is executed on the current session connection by the NAS virtual machine according to the second flag bit;
And the second execution module is used for determining that the session connection of the previous login is different from the session connection of the current login so as to create a new session connection if the first login type is inconsistent with the second login type, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
Optionally, the first execution module includes:
the first judging submodule is used for judging whether the current session connection is the session connection of the NAS virtual machine according to the second flag bit;
the first storage system execution sub-module is used for determining that the test instruction is executed on the current session connection by the storage system if the current session connection is not the session connection of the NAS virtual machine;
and the first NAS virtual machine execution submodule is used for determining that the NAS virtual machine executes the test instruction on the current session connection if the current session connection is the session connection of the NAS virtual machine.
Optionally, the second execution module includes:
the assignment sub-module is used for assigning the second login type to the first flag bit;
a creation sub-module for creating a session connection for the storage system;
the second judging submodule is used for judging whether the second login type is the NAS virtual machine or not;
A second storage system execution sub-module configured to determine that the test instruction is executed by the storage system on a session connection of the storage system if the second login type is not the NAS virtual machine;
And the second NAS virtual machine execution submodule is used for creating the session connection of the NAS virtual machine on the basis of the session connection of the storage system if the second login type is the NAS virtual machine, and determining that the NAS virtual machine executes the test instruction on the session connection of the NAS virtual machine.
Optionally, the storage test device is further configured with a plurality of login information; the creation submodule includes:
the target login information searching unit is used for traversing the login information and searching target login information matched with the second login type; the target login information comprises a port number;
A connection protocol judging unit of the second login type, configured to judge whether the connection protocol of the second login type is a secure shell protocol ssh or a remote terminal protocol telnet according to the port number;
A session connection creation unit of the first storage system, configured to create a session connection of the storage system using an ssh protocol when the connection protocol is the ssh protocol;
and the session connection creation unit of the second storage system is used for creating session connection of the storage system by adopting the telnet protocol when the connection protocol is the telnet protocol.
Optionally, the second NAS virtual machine execution submodule includes:
the second login determining unit is used for determining that the second login is needed if the second login type is the NAS virtual machine;
a secondary login type extracting unit, configured to extract a secondary login type from the target login information;
The interactive mode judging unit of the secondary login type is used for judging whether the secondary login type is an ssh protocol type or an instruction type;
A session connection creation unit of a first NAS virtual machine, configured to create, when the secondary login type is an ssh protocol type, session connection of the NAS virtual machine on the basis of session connection of the storage system according to the ssh protocol type;
and the session connection creation unit of the second NAS virtual machine is used for creating the session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the instruction type when the secondary login type is the instruction type.
Optionally, the session connection creation unit of the first NAS virtual machine includes:
the static IP receiving subunit of the built-in virtual machine is used for receiving the static IP of the built-in virtual machine sent by a program in an interactive mode on the basis of session connection of the storage system when the secondary login type is ssh protocol type;
The first response information sending subunit is used for returning first response information to the program when the static IP of the built-in virtual machine is correct; the first response information is used for representing success of logging in the NAS virtual machine.
Optionally, the session connection creation unit of the second NAS virtual machine includes:
The login instruction receiving subunit is used for sequentially receiving login instructions sent by a program in an interactive mode on the basis of session connection of the storage system when the secondary login type is the instruction type;
The second response information sending subunit is used for returning second response information to the program when the login instruction is correct; and the second response information is used for representing that the NAS virtual machine is successfully logged in.
Optionally, the apparatus further comprises:
the test result acquisition module is used for acquiring a first test result obtained by repeatedly executing the storage system and acquiring a second test result obtained by repeatedly executing the NAS virtual machine;
and the regular analysis module is used for performing regular analysis on the first test result and the second test result respectively so as to enable the first test result and the second test result to have the same format.
The embodiment of the invention also discloses electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
The processor is configured to implement the session management method according to the embodiment of the present invention when executing the program stored in the memory.
Embodiments of the present invention also disclose one or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the session management method according to the embodiments of the present invention.
Compared with the prior art, the embodiment of the invention has the following advantages:
In the embodiment of the invention, when a test instruction is received, whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction is judged; if the session connection is consistent with the session connection which is logged in at the present time, determining that the session connection which is logged in at the present time is the same session connection, so as to determine whether to execute the test instruction on the present session connection by the storage system or execute the test instruction on the present session connection by the NAS virtual machine according to the second flag bit; if the session connection is inconsistent with the session connection, determining that the session connection logged in before is different from the session connection logged in at present so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type. According to the embodiment of the invention, the first zone bit and the second zone bit are configured, the first zone bit is used for storing the first login type of the previous login, the second zone bit is used for marking whether the current login is the NAS virtual machine, when a test instruction carrying the second login type of the current login is received, whether the session connection of the previous login is identical to the session connection of the current login or not is judged by comparing the first login type with the second login type, so that whether new session connection is established or not is judged, and therefore, the frequent establishment of new session connection is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a step flowchart of a session management method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another session management method according to an embodiment of the present invention;
FIG. 3 is a flow chart of session management provided by an embodiment of the present invention;
fig. 4 is a block diagram of a session management apparatus according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the NAS functional test process, it is necessary to enter a NAS virtual machine to check whether some resource settings are consistent with the settings under the storage system. Specifically, a tester logs in the storage system first, a test instruction a is sent on session connection of the storage system, the session connection of the storage system returns a test result a, then, under the condition that the storage system is logged in, the NAS virtual machine is logged in again, another test instruction b is sent on session connection of the NAS virtual machine, the session connection of the NAS virtual machine returns another test result b, and the tester compares and analyzes the test result a with the test result b.
However, if the test instruction needs to be continuously sent to the storage system for execution, or the test instruction needs to be continuously sent to the NAS virtual machine for execution, since the storage test device cannot keep track of whether the last logged-in session connection is the same session connection as the current logged-in session connection, the last logged-in session connection is interrupted, and a new session connection is created as the current logged-in session connection. For testers, new session connections are frequently created, which is cumbersome and time consuming, thereby greatly reducing test efficiency and test accuracy.
In view of the above problems, an embodiment of the present invention provides a session management method, where a first flag bit and a second flag bit are configured, where the first flag bit is used to save a first login type of a previous login, and the second flag bit is used to mark whether a current login is a NAS virtual machine, when a test instruction carrying a second login type of a current login is received, whether a session connection of the previous login is identical to a session connection of the current login is determined by comparing whether the first login type is identical to the second login type, so as to determine whether to create a new session connection, thereby avoiding frequent creation of a new session connection, and in addition, according to the second flag bit, an execution subject of the test instruction can be rapidly determined, thereby greatly improving test efficiency and test accuracy.
Referring to fig. 1, a step flowchart of a session management method provided by an embodiment of the present invention is shown and applied to a storage test device, where the storage test device is deployed with a storage system and a NAS virtual machine, and the storage test device is configured with a first flag bit and a second flag bit, and the method specifically may include the following steps:
And step 101, when a test instruction is received, judging whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction.
The embodiment of the invention can be applied to the storage test equipment, wherein the storage test equipment is a physical equipment. The NAS (Network Attached Storage ) is simply referred to as a device connected to a network and having a data storage function, and is also called "network storage", which is a function of providing a file sharing service to the outside of a storage system, and the storage system is deployed in a storage test device. The NAS virtual machine is a separate system that the NAS also plays on the storage test apparatus, and this system is called NAS virtual machine.
The storage test device is configured with a first flag bit Samehost, and the first flag bit Samehost is used to save a first login type of a previous login. When the NAS functionality test is not started, the first login type may be set to NULL, i.e., the first flag bit Samehost =null.
The tester can perform NAS functional testing by issuing a test instruction to the storage system or the NAS virtual machine, where the test instruction carries the second login type of the current login.
When the test instruction is received, the storage test device can judge whether the first login type of the previous login is consistent with the second login type of the current login.
Step 102, if the first login type is consistent with the second login type, determining that the session connection of the previous login is the same session connection as the session connection of the current login, so as to determine whether to execute the test instruction on the current session connection by the storage system or execute the test instruction on the current session connection by the NAS virtual machine according to the second flag bit.
If the first login type of the previous login is consistent with the second login type of the current login, the storage test device may determine that the session connection of the previous login is the same session connection as the session connection of the current login, so that the current session connection may not need to be switched.
The storage test device is configured with a second flag bit Ismflg, where the second flag bit Ismflg is used to flag whether the current login is a NAS virtual machine, so after determining that the current session connection does not need to be switched, it can be determined, according to the second flag bit, whether to execute the test instruction on the current session connection by the storage system or by the NAS virtual machine.
Step 103, if the first login type is inconsistent with the second login type, determining that the session connection of the previous login is different from the session connection of the current login, so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
If the first login type of the previous login is inconsistent with the second login type of the current login, the storage test device may determine that the session connection of the previous login and the session connection of the current login are not the same session connection, i.e., are different session connections, at which time the current session connection may be switched to create a new session connection, and then determine, according to the second login type, whether to execute the test instruction on the new session connection by the storage system at this time or by the NAS virtual machine.
In the embodiment of the invention, when a test instruction is received, whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction is judged; if the session connection is consistent with the session connection which is logged in at the present time, determining that the session connection which is logged in at the present time is the same session connection, so as to determine whether to execute the test instruction on the present session connection by the storage system or execute the test instruction on the present session connection by the NAS virtual machine according to the second flag bit; if the session connection is inconsistent with the session connection, determining that the session connection logged in before is different from the session connection logged in at present so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type. According to the embodiment of the invention, the first zone bit and the second zone bit are configured, the first zone bit is used for storing the first login type of the previous login, the second zone bit is used for marking whether the current login is the NAS virtual machine, when a test instruction carrying the second login type of the current login is received, whether the session connection of the previous login is identical to the session connection of the current login or not is judged by comparing the first login type with the second login type, so that whether new session connection is established or not is judged, and therefore, the frequent establishment of new session connection is avoided.
Referring to fig. 2, a flowchart illustrating steps of another session management method provided by an embodiment of the present invention is applied to a storage test device, where the storage test device is deployed with a storage system and a NAS virtual machine, and the storage test device is configured with a first flag bit and a second flag bit, and the method specifically may include the following steps:
Step 201, when a test instruction is received, judging whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction.
In the embodiment of the present invention, the storage test device is configured with a first flag bit Samehost, and the first flag bit Samehost is used to save the first login type of the previous login. When the NAS functionality test is not started, the first login type may be set to NULL, i.e., the first flag bit Samehost =null.
When a test instruction is received, the storage test device may extract a first login type of a previous login from the first flag bit Samehost, and extract a second login type of the current login from the test instruction, and then compare the first login type and the second login type to determine whether the first login type is consistent with the second login type.
It should be noted that, since access of the NAS virtual machine needs to be logged in twice when the storage system is already logged in, the tester logs in the storage system 1 st time, and switches between the storage system and the NAS virtual machine nth time, where N is a positive integer greater than 2.
Step 202, if the first login type is consistent with the second login type, determining that the session connection of the previous login is the same session connection as the session connection of the current login, so as to determine whether to execute the test instruction on the current session connection by the storage system or execute the test instruction on the current session connection by the NAS virtual machine according to the second flag bit.
If the first login type of the previous login is consistent with the second login type of the current login, the storage test device may determine that the session connection of the previous login is the same session connection as the session connection of the current login, so that the current session connection may not need to be switched.
The storage test device is configured with a second flag bit Ismflg, where the second flag bit Ismflg is used to flag whether the current login is a NAS virtual machine, so after determining that the current session connection does not need to be switched, it can be determined, according to the second flag bit, whether to execute the test instruction on the current session connection by the storage system or by the NAS virtual machine.
In an alternative embodiment of the present invention, step 202 may comprise the sub-steps of:
s11, judging whether the current session connection is the session connection of the NAS virtual machine according to the second flag bit;
step S12, if the current session connection is not the session connection of the NAS virtual machine, determining that the test instruction is executed on the current session connection by the storage system;
And step S13, if the current session connection is the session connection of the NAS virtual machine, determining that the NAS virtual machine executes the test instruction on the current session connection.
In the embodiment of the present invention, the storage test device is configured with a second flag bit Ismflg, where the second flag bit Ismflg is used to flag whether the current login is a NAS virtual machine. Illustratively, the second flag bit Ismflg =1, representing that the current login is a NAS virtual machine; a second flag bit Ismflg =0, representing that the current login is not a NAS virtual machine. At the time when NAS functionality test is not started, ismflg =0, i.e., the initial value of the second flag bit defaults to 0.
If the first login type is consistent with the second login type, then it may be determined that the last logged-in session connection is the same session connection as the current logged-in session connection, at which time the current session connection need not be handed over.
The current session connection may be a session connection of the storage system or a session connection of the NAS virtual machine, that is, the current login may be the storage system or the NAS virtual machine, so it is required to determine whether the current session connection is a session connection of the NAS virtual machine according to the second flag bit.
When the second flag bit Ismflg =1, judging that the current session connection is the session connection of the NAS virtual machine; when the second flag bit Ismflg =0, it is determined that the current session connection is not a session connection of the NAS virtual machine.
If the current session connection is not a session connection of the NAS virtual machine, then it may be determined that the current session connection is a session connection of the storage system, and further it is determined that the test instructions are executed by the storage system, i.e., the test instructions are issued to the connection session of the storage system.
If the current session connection is a session connection of the NAS virtual machine, then it may be determined that the test instructions were executed by the NAS virtual machine, i.e., the test instructions were issued to the connection session of the NAS virtual machine.
Step 203, if the first login type is inconsistent with the second login type, determining that the session connection of the previous login is different from the session connection of the current login, so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
If the first login type of the previous login is inconsistent with the second login type of the current login, the storage test device may determine that the session connection of the previous login and the session connection of the current login are not the same session connection, i.e., are different session connections, at which time the current session connection may be switched to create a new session connection, and then determine, according to the second login type, whether to execute the test instruction on the new session connection by the storage system at this time or by the NAS virtual machine.
In an alternative embodiment of the invention, step 203 may comprise the sub-steps of:
S21, assigning the second login type to the first flag bit;
A substep S22 of creating a session connection of the storage system;
step S23, judging whether the second login type is the NAS virtual machine;
Step S24, if the second login type is not the NAS virtual machine, determining that the test instruction is executed by the storage system on the session connection of the storage system;
And S25, if the second login type is the NAS virtual machine, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system, and determining that the NAS virtual machine executes the test instruction on the session connection of the NAS virtual machine.
In the embodiment of the invention, if the first login type is inconsistent with the second login type, the session connection of the previous login and the session connection of the current login can be determined to be different session connection, and the second login type can be assigned to the first flag bit.
It should be noted that the first login type and the second login type are defined for the login order, that is, the first login type refers to the login type of the previous login, and the second login type refers to the login type of the current login. After the second login type is assigned to the first flag bit, if a next test instruction is received, the second login type in the first flag bit becomes the first login type of the previous login, so that the login type carried by the test instruction is the second login type of the current login.
Because the NAS virtual machine needs to perform the second login when the NAS virtual machine has logged into the storage system, the second login type is whether the storage system or the NAS virtual machine is the storage system or not, and then further determines whether the second login type is the NAS virtual machine.
If the second login type is not a NAS virtual machine, then it may be determined that the test instructions were executed by the storage system on the session connection of the storage system at the time.
If the second login type is a NAS virtual machine, since access of the NAS virtual machine requires a second login in the case where the storage system has been logged in, the session connection of the NAS virtual machine may be created again on the basis of the session connection of the storage system, and it may be determined that the test instruction is executed by the NAS virtual machine on the session connection of the NAS virtual machine at this time.
In an optional embodiment of the present invention, the storage test device is further configured with a plurality of login information; the substep S22 may include the substeps of:
Sub-step S221, traversing the plurality of login information, and searching for target login information matched with the second login type; the target login information comprises a port number;
sub-step S222, judging whether the connection protocol of the second login type is ssh protocol or telnet protocol according to the port number;
Sub-step S223, when the connection protocol is ssh protocol, adopting the ssh protocol to create session connection of the storage system;
substep S224, when the connection protocol is a telnet protocol, creating a session connection of the storage system using the telnet protocol.
In a specific implementation, before NAS functionality testing, the site structure may be pre-configured, that is, all login information to be used for the storage system and the NAS virtual machine is configured into site information host, where the site information host is equivalent to a set of storage test environment configuration items. After the configuration of the site information host is completed, the site information host may be loaded and stored in a memory storing the test device in a list form.
The site information host includes a plurality of login information, each login information includes a plurality of field information, and the field information includes type, ip (Internet Protocol Address ), port (port number), user (user name), password, mask (mask), gateway (portal of all services), mask (mask), kvmtype (login type of virtual machine), kvmuser (user name of virtual machine), kvmpassword (password of virtual machine).
Since the NAS virtual machine needs to perform the secondary login when the storage system has been logged in, type, user, password of the login information belongs to the primary login information, and kvmtype, kvmuser, kvmpassword of the login information belongs to the secondary login information.
After assigning the second login type to the first flag bit, the plurality of login information may be traversed according to the second login type. Specifically, the type in each login information may be matched with the second login type, thereby searching for the target login information matched with the second login type.
After the target login information is found, a port number port can be extracted from the target login information, and whether the connection protocol of the second login type is the ssh protocol or the telnet protocol is distinguished according to the port, so that session connection of the login storage system is created by adopting different connection protocols.
Ssh (secure shell) is a security protocol established on the basis of an application layer and a transport layer, and is a protocol special for providing security for a telnet session and other network services, so that the problem of information leakage in a remote management process can be effectively prevented by using the ssh protocol.
Telnet is a member of the TCP/IP protocol family, a standard protocol and main mode of Internet telnet services, which provides the user with the ability to complete remote host work on a local computer.
When the connection protocol is ssh protocol, the ssh protocol may be employed to create a session connection for the storage system; when the connection protocol is a telnet protocol, the telnet protocol may be employed to create session connections for the storage system.
In an alternative embodiment of the present invention, the substep S25 may comprise the substeps of:
Step S251, if the second login type is the NAS virtual machine, determining that the second login is needed;
Sub-step S252, extracting a secondary login type from the target login information;
Sub-step S253, judging whether said secondary login type is ssh protocol type or instruction type;
Sub-step S254, when the secondary login type is an ssh protocol type, creating session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the ssh protocol type;
And sub-step S255, when the secondary login type is an instruction type, creating session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the instruction type.
In the embodiment of the present invention, since the NAS virtual machine needs to perform the second login when the NAS virtual machine has logged in to the storage system, after the connection session of the storage system is created, whether the second login type is the NAS virtual machine, that is, whether the type in the target login information is nas_kvm (NAS virtual machine) may be further determined.
If the second login type is NAS virtual machine, i.e. the type in the target login information is nas_kvm, then it may be determined that a secondary login is needed, and in the secondary login process, the secondary login type kvmtype may be extracted from the target login information.
It should be noted that, for the first login type and the second login type, both are defined for the login order, that is, the first login type refers to the login type of the previous login, and the second login type refers to the login type of the current login. The second login type (type in the target login information) is a type of one-time login of the current login, and the second login type (kvmtype in the target login information) is a type of two-time login of the current login.
Therefore, even if the connection protocol of the second login type is the ssh protocol, the secondary login type kvmtype is not necessarily the ssh protocol type, and it is necessary to further determine whether the secondary login type kvmtype is the ssh protocol type or the instruction type.
When the secondary login type kvmtype is an ssh protocol type, establishing session connection of the NAS virtual machine on the basis of session connection of the storage system according to the ssh protocol type; when the secondary login type is an instruction type, a session connection of the NAS virtual machine can be created on the basis of the session connection of the storage system according to the instruction type.
It should be noted that, the second login is an interactive login, in other words, the session connection of the NAS virtual machine is a session connection of an interactive mode, the interactive mode is equivalent to that a tester inputs a parameter to the session connection of the NAS virtual machine, waits for the session connection of the NAS virtual machine to return a result, the tester can input the next parameter, waits for the session connection of the NAS virtual machine to return another result, and so on.
Therefore, in the prior art, when the NAS virtual machine is continuously logged in, a tester needs to wait for the response of the NAS virtual machine each time, and the response time of the NAS virtual machine is long, so that the testing process is tedious and time-consuming seriously. In the embodiment of the invention, when the NAS virtual machine is continuously logged in, the first login type is consistent with the second login type, so that the session connection logged in before and the session connection logged in at present are judged to be the same session connection, the current session connection is not required to be switched, and the test instruction is directly executed on the current session connection, so that a tester does not need to wait for the response of the NAS virtual machine every time, and the complex and time-consuming serious waiting process is omitted.
In an alternative embodiment of the present invention, sub-step S254 may comprise the sub-steps of:
Sub-step S2541, when the secondary login type is ssh protocol type, receiving static IP of the built-in virtual machine sent by the program in an interactive mode on the basis of session connection of the storage system;
Sub-step S2542, when the static IP of the built-in virtual machine is correct, returning first response information to the program; the first response information is used for representing success of logging in the NAS virtual machine.
In the embodiment of the invention, a test person can preset a program, and the program is used for sending parameters to the storage test equipment in the secondary login process.
In a specific implementation, when the secondary login type is an ssh protocol type, the program may splice ssh root@built-in IP, for example ssh root@192.168.122, in an interactive mode on the basis of session connection of the storage system, and send ssh root@192.168.122 as a static IP of the built-in virtual machine to the storage test device.
The program waits for a response, and when the character string displayed by the interaction page in a parking mode contains a password, the program can send a login password to the storage test equipment.
And the program waits for response, and when the character string displayed by the interaction page in a parking mode contains first response information, the success of logging in the NAS virtual machine is determined. Illustratively, when the character string displayed by the interaction page parking contains # - #, the login of the NAS virtual machine is successful.
After successful login to the NAS virtual machine, the second flag bit Ismflg may be assigned to "1" at this time, that is, ismflg =1 is set to indicate that the current login is the NAS virtual machine.
In an alternative embodiment of the present invention, the sub-step S255 may comprise the sub-steps of:
sub-step S2551, when the secondary login type is the instruction type, receiving login instructions sent by a program in an interactive mode on the basis of session connection of the storage system;
Sub-step S2552, when the login instruction is correct, returning second response information to the program; and the second response information is used for representing that the NAS virtual machine is successfully logged in.
In a specific implementation, when the secondary login type is an instruction type, the program may send a login instruction, for example chkvm vm _debug, in an interactive mode based on session connection of the storage system, and send chkvm vm _debug as the login instruction to the storage test device.
The program waits for a response, and when the character string displayed by the interaction page in a parking mode contains a password, the program can send a login password to the storage test equipment.
And the program waits for response, and when the character string displayed by the interaction page in a parking mode contains second response information, the success of logging in the NAS virtual machine is determined. Illustratively, when the character string displayed by the interactive page docked contains a Command, it represents successful login to the NAS virtual machine.
After successful login to the NAS virtual machine, the second flag bit Ismflg may be assigned to "1" at this time, that is, ismflg =1 is set to indicate that the current login is the NAS virtual machine.
In an alternative embodiment of the present invention, the method may further include:
Acquiring a first test result obtained by repeatedly executing the storage system and a second test result obtained by repeatedly executing the NAS virtual machine; and respectively carrying out regular analysis on the first test result and the second test result so as to enable the first test result and the second test result to have the same format.
Because the NAS virtual machine is not compatible with all linux instructions and only is compatible with part of platform instructions, a tester for command return values in the prior art needs to process on a server and then compare and analyze with a storage system, and for the tester, the work for converting contents is tedious and time-consuming.
Therefore, the embodiment of the invention can acquire the first test result obtained by repeatedly executing the storage system and acquire the second test result obtained by repeatedly executing the NAS virtual machine, and then respectively perform regular analysis on the first test result and the second test result, so that the first test result and the second test result have the same format, and the unified format is convenient for the comparison analysis of the test results.
In the embodiment of the invention, the first test result obtained by executing the storage system can be intercepted by using awk, cut and other tools, so that the required data can be intercepted accurately.
In the embodiment of the invention, the second test result obtained by executing the NAS virtual machine can be formatted. Specifically, since the interactive mode string will be returned with the control symbol, the type of symbol is to be processed, after splitting the intercepted second test result based on \r\n, a list is generated, then the first bit is determined as errcode as the execution result, the cyclic list formats \r of each element, and the cyclic list is spliced again into a string by using the string as a separator, and meanwhile, the instruction prefix directory of the last line is discarded as a returned string outstring.
Then, whether errcode matches in the test result include: command not found, or error, or fail, and the like, determining whether the current test instruction is successfully executed, returning false if the current test instruction is contained, and returning True if the current test instruction is not contained.
Therefore, according to the embodiment of the invention, the two flag bits (Samehost and Ismflg) are configured to control the login storage system or the login NAS virtual machine to finish connection access, login type information is carried while the test instruction is issued, the login mode is automatically matched through analysis of the login type, quick switching login is realized, the return value of the issued test instruction is subjected to regular analysis, the comparison of test results is facilitated, the NAS test of frequent switching access is solved, and the test efficiency and the test accuracy are greatly improved.
In the embodiment of the invention, when a test instruction is received, whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction is judged; if the session connection is consistent with the session connection which is logged in at the present time, determining that the session connection which is logged in at the present time is the same session connection, so as to determine whether to execute the test instruction on the present session connection by the storage system or execute the test instruction on the present session connection by the NAS virtual machine according to the second flag bit; if the session connection is inconsistent with the session connection, determining that the session connection logged in before is different from the session connection logged in at present so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type. According to the embodiment of the invention, the first zone bit and the second zone bit are configured, the first zone bit is used for storing the first login type of the previous login, the second zone bit is used for marking whether the current login is the NAS virtual machine, when a test instruction carrying the second login type of the current login is received, whether the session connection of the previous login is identical to the session connection of the current login or not is judged by comparing the first login type with the second login type, so that whether new session connection is established or not is judged, and therefore, the frequent establishment of new session connection is avoided.
In order that those skilled in the art may better understand the embodiments of the present invention, the following examples are provided to illustrate the embodiments of the present invention:
Referring to fig. 3, a session management flow chart provided by an embodiment of the present invention is shown, where the session management flow may specifically be as follows:
Before NAS function test, a site structure body is pre-constructed, wherein the site structure body comprises a plurality of login information, each login information comprises a plurality of field information, and the field information comprises type, ip, port, user, password, mask, gateway and mask, kvmtype, kvmuser, kvmpassword;
Two flag bits are preset: a first flag bit Samehost and a second flag bit Ismflg; the method comprises the steps of storing a first login type of a previous login, wherein Samehost is used for storing the first login type of the previous login, and Ismflg is used for marking whether the current login is a NAS virtual machine or not; prior to performing NAS functionality testing, samehost =null, ismflg =0, where Ismflg =1 represents that the current login is a NAS virtual machine, ismflg =0 represents that the current login is not a NAS virtual machine;
entering a NAS function test process:
1. receiving a test instruction; the test instruction carries a second login type;
2. Judging whether the first login type stored in Samehost is consistent with the second login type carried by the test instruction;
3. if the first login type is consistent with the second login type, determining that the session connection of the previous login and the session connection of the current login are the same session connection, and flowing to the step 9;
4. If the first login type is inconsistent with the second login type, determining that the session connection of the previous login and the session connection of the current login are different session connections, and flowing to the step 5;
5. Assigning the second login type to Samehost and resetting Ismflg =0, and flowing to step 6;
6. according to a connection protocol (ssh protocol/telnet protocol) of the second login type, creating a session connection of the storage system, and flowing to the step 7;
7. Judging whether the type is nas_kvm, namely judging whether the second login type is NAS virtual machine: when the type=nas_kvm, determining that the second login type is the NAS virtual machine, and at this time, performing secondary login is needed, and the flow goes to step 8; when the type is not equal to nas_kvm, determining that the second login type is not the NAS virtual machine, and at the moment, no secondary login is needed, and the flow goes to the step 9;
8. According to the secondary login type (ssh protocol type/instruction type), establishing session connection of the NAS virtual machine, setting Ismflg =1, and flowing to the step 11;
9. According to Ismflg, it is determined whether the current session connection is a session connection of the NAS virtual machine: when Ismflg =0, determining that the current session connection is not the session connection of the NAS virtual machine, and flowing to step 10; when Ismflg =1, determining that the current session connection is a session connection of the NAS virtual machine, and flowing to step 11;
10. Executing an instruction by a storage system, obtaining a first test result obtained by the execution of the storage system, and flowing to the step 12;
11. the NAS virtual machine executes the instruction based on the interaction mode to obtain a second test result obtained by the NAS virtual machine, formats the second test result, and flows to the step 12;
12. analyzing the test results (the first test result and the second test result) to perform a comparative analysis process, and returning to the step 1.
Referring to fig. 4, a block diagram of a session management apparatus provided by an embodiment of the present invention is shown and applied to a storage test device, where the storage test device is deployed with a storage system and a NAS virtual machine, and the storage test device is configured with a first flag bit and a second flag bit, and may specifically include the following modules:
the login type judging module 401 is configured to judge, when a test instruction is received, whether a first login type stored in the first flag bit is consistent with a second login type carried by the test instruction;
A first execution module 402, configured to determine that, if the first login type is consistent with the second login type, a session connection of a previous login and a session connection of a current login are the same session connection, so as to determine, according to the second flag bit, whether to execute the test instruction on the current session connection by the storage system or the test instruction on the current session connection by the NAS virtual machine;
A second execution module 403, configured to determine that a session connection of a previous login and a session connection of a current login are different session connections if the first login type is inconsistent with the second login type, so as to create a new session connection, and determine whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
In an alternative embodiment of the present invention, the first execution module 402 may include:
the first judging submodule is used for judging whether the current session connection is the session connection of the NAS virtual machine according to the second flag bit;
the first storage system execution sub-module is used for determining that the test instruction is executed on the current session connection by the storage system if the current session connection is not the session connection of the NAS virtual machine;
and the first NAS virtual machine execution submodule is used for determining that the NAS virtual machine executes the test instruction on the current session connection if the current session connection is the session connection of the NAS virtual machine.
In an alternative embodiment of the present invention, the second execution module 403 may include:
the assignment sub-module is used for assigning the second login type to the first flag bit;
a creation sub-module for creating a session connection for the storage system;
the second judging submodule is used for judging whether the second login type is the NAS virtual machine or not;
A second storage system execution sub-module configured to determine that the test instruction is executed by the storage system on a session connection of the storage system if the second login type is not the NAS virtual machine;
And the second NAS virtual machine execution submodule is used for creating the session connection of the NAS virtual machine on the basis of the session connection of the storage system if the second login type is the NAS virtual machine, and determining that the NAS virtual machine executes the test instruction on the session connection of the NAS virtual machine.
In an optional embodiment of the present invention, the storage test device is further configured with a plurality of login information; the creating sub-module may include:
the target login information searching unit is used for traversing the login information and searching target login information matched with the second login type; the target login information comprises a port number;
A connection protocol judging unit of a second login type, configured to judge whether a connection protocol of the second login type is ssh protocol or telnet protocol according to the port number;
A session connection creation unit of the first storage system, configured to create a session connection of the storage system using an ssh protocol when the connection protocol is the ssh protocol;
and the session connection creation unit of the second storage system is used for creating session connection of the storage system by adopting the telnet protocol when the connection protocol is the telnet protocol.
In an optional embodiment of the present invention, the second NAS virtual machine execution submodule may include:
the second login determining unit is used for determining that the second login is needed if the second login type is the NAS virtual machine;
a secondary login type extracting unit, configured to extract a secondary login type from the target login information;
The interactive mode judging unit of the secondary login type is used for judging whether the secondary login type is an ssh protocol type or an instruction type;
A session connection creation unit of a first NAS virtual machine, configured to create, when the secondary login type is an ssh protocol type, session connection of the NAS virtual machine on the basis of session connection of the storage system according to the ssh protocol type;
and the session connection creation unit of the second NAS virtual machine is used for creating the session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the instruction type when the secondary login type is the instruction type.
In an optional embodiment of the present invention, the session connection creation unit of the first NAS virtual machine may include:
the static IP receiving subunit of the built-in virtual machine is used for receiving the static IP of the built-in virtual machine sent by a program in an interactive mode on the basis of session connection of the storage system when the secondary login type is ssh protocol type;
The first response information sending subunit is used for returning first response information to the program when the static IP of the built-in virtual machine is correct; the first response information is used for representing success of logging in the NAS virtual machine.
In an optional embodiment of the present invention, the session connection creation unit of the second NAS virtual machine may include:
The login instruction receiving subunit is used for sequentially receiving login instructions sent by a program in an interactive mode on the basis of session connection of the storage system when the secondary login type is the instruction type;
The second response information sending subunit is used for returning second response information to the program when the login instruction is correct; and the second response information is used for representing that the NAS virtual machine is successfully logged in.
In an alternative embodiment of the present invention, the apparatus may further include:
the test result acquisition module is used for acquiring a first test result obtained by repeatedly executing the storage system and acquiring a second test result obtained by repeatedly executing the NAS virtual machine;
and the regular analysis module is used for performing regular analysis on the first test result and the second test result respectively so as to enable the first test result and the second test result to have the same format.
In the embodiment of the invention, when a test instruction is received, whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction is judged; if the session connection is consistent with the session connection which is logged in at the present time, determining that the session connection which is logged in at the present time is the same session connection, so as to determine whether to execute the test instruction on the present session connection by the storage system or execute the test instruction on the present session connection by the NAS virtual machine according to the second flag bit; if the session connection is inconsistent with the session connection, determining that the session connection logged in before is different from the session connection logged in at present so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type. According to the embodiment of the invention, the first zone bit and the second zone bit are configured, the first zone bit is used for storing the first login type of the previous login, the second zone bit is used for marking whether the current login is the NAS virtual machine, when a test instruction carrying the second login type of the current login is received, whether the session connection of the previous login is identical to the session connection of the current login or not is judged by comparing the first login type with the second login type, so that whether new session connection is established or not is judged, and therefore, the frequent establishment of new session connection is avoided.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides electronic equipment, which comprises: the processor, the memory, store the computer program on the memory and can run on the processor, this computer program realizes each process of the above-mentioned conversation management method embodiment when being carried out by the processor, and can reach the same technical result, in order to avoid repetition, will not be repeated here.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the session management method embodiment described above, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or terminal device that comprises the element.
The session management method, apparatus, electronic device and computer readable storage medium provided by the present invention have been described in detail, and specific examples are applied to illustrate the principles and embodiments of the present invention, and the description of the above examples is only used to help understand the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (11)

1. A session management method, applied to a storage test device, where the storage test device is deployed with a storage system and a network attached storage NAS virtual machine, and the storage test device is configured with a first flag bit and a second flag bit, the method comprising:
When a test instruction is received, judging whether the first login type stored in the first flag bit is consistent with the second login type carried by the test instruction;
If the first login type is consistent with the second login type, determining that the session connection of the previous login and the session connection of the current login are the same session connection, so as to determine whether to execute the test instruction on the current session connection by the storage system or execute the test instruction on the current session connection by the NAS virtual machine according to the second flag bit;
If the first login type is inconsistent with the second login type, determining that the session connection of the previous login is different from the session connection of the current login so as to create a new session connection, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
2. The method of claim 1, wherein determining, based on the second flag, whether to execute the test instruction by the storage system on a current session connection or by the NAS virtual machine on a current session connection comprises:
judging whether the current session connection is the session connection of the NAS virtual machine according to the second flag bit;
if the current session connection is not the session connection of the NAS virtual machine, determining that the test instruction is executed on the current session connection by the storage system;
And if the current session connection is the session connection of the NAS virtual machine, determining that the NAS virtual machine executes the test instruction on the current session connection.
3. The method of claim 1, wherein the creating a new session connection and determining, based on the second login type, whether to execute the test instructions by the storage system on the new session connection or by the NAS virtual machine on the new session connection comprises:
Assigning the second login type to the first flag bit;
Creating a session connection for the storage system;
judging whether the second login type is the NAS virtual machine or not;
if the second login type is not the NAS virtual machine, determining that the test instruction is executed by the storage system on a session connection of the storage system;
if the second login type is the NAS virtual machine, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system, and determining that the test instruction is executed on the session connection of the NAS virtual machine by the NAS virtual machine.
4. The method of claim 3, wherein the storage test device is further configured with a plurality of login information; the creating a session connection for the storage system includes:
Traversing the login information and searching target login information matched with the second login type; the target login information comprises a port number;
Judging whether the connection protocol of the second login type is a secure shell protocol ssh or a remote terminal protocol telnet according to the port number;
when the connection protocol is ssh protocol, establishing session connection of the storage system by adopting the ssh protocol;
and when the connection protocol is a telnet protocol, establishing session connection of the storage system by adopting the telnet protocol.
5. The method of claim 4, wherein if the second login type is the NAS virtual machine, creating a session connection for the NAS virtual machine based on a session connection for the storage system comprises:
If the second login type is the NAS virtual machine, determining that secondary login is needed;
extracting a secondary login type from the target login information;
judging whether the secondary login type is an ssh protocol type or an instruction type;
when the secondary login type is an ssh protocol type, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the ssh protocol type;
and when the secondary login type is an instruction type, establishing session connection of the NAS virtual machine on the basis of the session connection of the storage system according to the instruction type.
6. The method of claim 5, wherein when the secondary login type is a ssh protocol type, creating a session connection of the NAS virtual machine based on the session connection of the storage system according to the ssh protocol type comprises:
when the secondary login type is ssh protocol type, receiving static IP of the built-in virtual machine sent by a program in an interactive mode on the basis of session connection of the storage system;
When the static IP of the built-in virtual machine is correct, returning first response information to the program; the first response information is used for representing success of logging in the NAS virtual machine.
7. The method of claim 5, wherein when the secondary login type is an instruction type, creating a session connection of the NAS virtual machine based on the session connection of the storage system according to the instruction type comprises:
when the secondary login type is the instruction type, on the basis of session connection of the storage system, sequentially receiving login instructions sent by a program in an interactive mode;
when the login instruction is correct, returning second response information to the program; and the second response information is used for representing that the NAS virtual machine is successfully logged in.
8. The method according to claim 2, wherein the method further comprises:
acquiring a first test result obtained by repeatedly executing the storage system and a second test result obtained by repeatedly executing the NAS virtual machine;
and respectively carrying out regular analysis on the first test result and the second test result so as to enable the first test result and the second test result to have the same format.
9. A session management apparatus, characterized by being applied to a storage test device, the storage test device being deployed with a storage system and a NAS virtual machine, the storage test device being configured with a first flag bit and a second flag bit, the apparatus comprising:
The login type judging module is used for judging whether the first login type stored in the first zone bit is consistent with the second login type carried by the test instruction or not when the test instruction is received;
The first execution module is used for determining that the session connection of the previous login and the session connection of the current login are the same session connection if the first login type is consistent with the second login type, so as to determine whether the test instruction is executed on the current session connection by the storage system or the test instruction is executed on the current session connection by the NAS virtual machine according to the second flag bit;
And the second execution module is used for determining that the session connection of the previous login is different from the session connection of the current login so as to create a new session connection if the first login type is inconsistent with the second login type, and determining whether to execute the test instruction on the new session connection by the storage system or execute the test instruction on the new session connection by the NAS virtual machine according to the second login type.
10. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the session management method according to any of claims 1 to 8.
11. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the session management method according to any of claims 1 to 8.
CN202211192843.7A 2022-09-28 2022-09-28 Session management method, device, electronic equipment and storage medium Active CN115622752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211192843.7A CN115622752B (en) 2022-09-28 2022-09-28 Session management method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211192843.7A CN115622752B (en) 2022-09-28 2022-09-28 Session management method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115622752A CN115622752A (en) 2023-01-17
CN115622752B true CN115622752B (en) 2024-05-14

Family

ID=84860880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211192843.7A Active CN115622752B (en) 2022-09-28 2022-09-28 Session management method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115622752B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391691A (en) * 2018-10-18 2019-02-26 郑州云海信息技术有限公司 The restoration methods and relevant apparatus that NAS is serviced under a kind of single node failure
CN110855518A (en) * 2019-10-31 2020-02-28 苏州浪潮智能科技有限公司 Method and system for automatically adapting test host
CN111427721A (en) * 2020-03-05 2020-07-17 杭州宏杉科技股份有限公司 Exception recovery method and device
CN112655274A (en) * 2018-06-21 2021-04-13 夏普株式会社 UE and communication method thereof
CN112732566A (en) * 2020-12-31 2021-04-30 中国工商银行股份有限公司 Application program user session timeout testing method, background, foreground and system
US11057491B1 (en) * 2020-07-17 2021-07-06 Snowflake Inc. Remote execution using a global identity
US11196728B1 (en) * 2021-03-29 2021-12-07 Fmr Llc Caching login sessions to access a software testing environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112655274A (en) * 2018-06-21 2021-04-13 夏普株式会社 UE and communication method thereof
CN109391691A (en) * 2018-10-18 2019-02-26 郑州云海信息技术有限公司 The restoration methods and relevant apparatus that NAS is serviced under a kind of single node failure
CN110855518A (en) * 2019-10-31 2020-02-28 苏州浪潮智能科技有限公司 Method and system for automatically adapting test host
CN111427721A (en) * 2020-03-05 2020-07-17 杭州宏杉科技股份有限公司 Exception recovery method and device
US11057491B1 (en) * 2020-07-17 2021-07-06 Snowflake Inc. Remote execution using a global identity
CN112732566A (en) * 2020-12-31 2021-04-30 中国工商银行股份有限公司 Application program user session timeout testing method, background, foreground and system
US11196728B1 (en) * 2021-03-29 2021-12-07 Fmr Llc Caching login sessions to access a software testing environment

Also Published As

Publication number Publication date
CN115622752A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
CN109802953B (en) Industrial control asset identification method and device
EP2988454B1 (en) Network device detecting method and apparatus, and cloud detection system
CN109284140B (en) Configuration method and related equipment
CN105787364B (en) Automatic testing method, device and system for tasks
CN110995764B (en) Mobile cellular network application layer data flow fuzzy test method, electronic equipment and storage medium
CN108234246B (en) Method and system for multi-directionally testing network performance of server
CN106776346B (en) Test method and device of CCMTS (China center testing System) equipment
CN112463511B (en) Automatic test system and test method for serial port equipment of Internet of things
CN113038499B (en) Terminal Wi-Fi compatibility testing method, device, system, equipment and medium
CN115622752B (en) Session management method, device, electronic equipment and storage medium
KR100930962B1 (en) Remote security testing device and method of RPC-based software
JP4293169B2 (en) Network equipment control system
CN115022201B (en) Data processing function test method, device, equipment and storage medium
WO2016201997A1 (en) Automatic testing method, device and system
US11729254B2 (en) Patternless prompt detection of command completion
CN116166536A (en) Test method, test device, electronic equipment and storage medium
CN104424096A (en) Automatic testing system and method for Android platform based device
CN114499984A (en) Identity authentication method, device, equipment and medium based on AI and RPA
CN113347062A (en) SIP performance test method, device, equipment and storage medium
CN111953565B (en) Method, system, device and medium for detecting bandwidth in virtualized environment
CN111400057A (en) Method, device and medium for remotely controlling test process
CN112769599B (en) Automatic resource access method, system and readable storage medium
CN115242688B (en) Network fault detection method, device and medium
CN112953806B (en) Method, device and system for determining service type and installation path and storage medium

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