An automatic testing method for performance of a bastion host, an electronic device and a storage medium
By automating the testing process and configuring performance parameter thresholds and stability indicators, we can accurately evaluate the performance of the bastion host, solve the problem of test inaccuracy caused by manual operation in existing technologies, and improve the reliability of test results and system stability.
Patent Information
- Application Number
- CN202411822109.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Existing bastion host performance testing relies on manual operations, resulting in inaccurate test results that are easily affected by human factors, making it difficult to ensure the objectivity and reliability of test end conditions.
Adopt an automated testing process, create a new automated test task, configure performance parameter thresholds, automatically execute test tasks, continuously load operation and maintenance sessions and judge the actual performance parameters, stop loading when the threshold is reached, continue running for a preset time to judge stability, and output a test report.
It improves the accuracy and reliability of test results, reduces the impact of human errors, ensures the objectivity of test end conditions and system stability, and optimizes resource allocation and risk management.
Smart Images

Figure CN119766692B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of operation and maintenance management, and specifically, to an automatic testing method for bastion host performance, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] As a key component of network security, bastion hosts play a vital role in operations management and security auditing. They are primarily used to centrally manage and monitor access to IT infrastructure, ensuring operational security and compliance. With technological advancements and increasing network security demands, the application scope of bastion hosts continues to expand, and enterprises are placing increasing demands on their performance. They prioritize not only the device's functional and technical specifications, but also its ability to handle concurrent sessions.
[0003] In existing technologies, evaluating bastion host performance primarily relies on manual testing. However, this manual testing method is not only complex but also prone to human error, affecting the accuracy of test results. Furthermore, operations and maintenance personnel must determine the end conditions for testing based on their personal experience. This subjective judgment reduces the accuracy and reliability of test output metrics. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an automatic testing method, electronic device, computer-readable storage medium, and computer program product for the performance of a bastion host. By automating the testing process, the tediousness of manual operations can be reduced, the impact of human errors on test results can be reduced, and the impact of human factors on the judgment of test end conditions can be eliminated, thereby improving the accuracy and reliability of test results.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for automatically testing the performance of a bastion host, including: creating a new automated test task, including configuring a performance parameter threshold; automatically executing the test task, including: continuously loading an operation and maintenance session, and determining whether the actual performance parameters of the bastion host reach the performance parameter threshold; if the performance parameter threshold is reached, stopping loading the operation and maintenance session; continuously running for a preset time, determining whether the preset stability index is met, and outputting a test report.
[0007] In one embodiment, the performance parameter thresholds include: connection tolerance rate, which is used to indicate the allowed proportion of failed connections; resource occupancy rate, which is used to indicate the maximum resource usage ratio of the bastion host; and instruction audit time, which is used to indicate the maximum time from instruction request to audit storage.
[0008] In an embodiment, the newly-built automated test task further comprises: configuring the relevant information of the bastion host and the asset, the relevant information of the bastion host and the asset comprising the IP address, account and password and protocol type of the bastion host and the asset; configuring the stability preset index, the stability preset index comprising that the bastion host reaches the performance parameter threshold value, continuously runs for a preset time, and the number of concurrent sessions does not decrease.
[0009] In an embodiment, before the continuously loading the operation and maintenance session, the automatically executing the test task further comprises: automatically inputting the relevant information of the bastion host and the asset into the bastion host according to the newly-built automated test task, and configuring the access permission of the asset.
[0010] In an embodiment, the continuously loading the operation and maintenance session, and judging whether the actual performance parameter of the bastion host reaches the performance parameter threshold value comprises: increasing the operation and maintenance session one by one, and judging whether the actual performance parameter of the bastion host reaches the performance parameter threshold value once for each increase of the operation and maintenance session.
[0011] In an embodiment, the actual performance parameter comprises an actual fault tolerance rate, an actual occupancy rate and an actual audit time, and the stopping of loading the operation and maintenance session if the performance parameter threshold value is reached comprises: stopping the increase of the operation and maintenance session if any one of the actual performance parameters reaches the performance parameter threshold value.
[0012] In an embodiment, the continuously running for a preset time and judging whether the stability preset index is met comprises: continuously running for a preset time, periodically checking the number of concurrent sessions within the preset time, stopping running if the number of concurrent sessions decreases, and stopping running after the preset time if the number of concurrent sessions does not decrease.
[0013] In an embodiment, the outputting the test report comprises: outputting the resource state and the system state of the bastion host at the beginning of the test; outputting the resource state and the system state of the bastion host at the end of the test; and outputting the resource state and the system state of the bastion host when the bastion host reaches the performance parameter threshold value in the test process.
[0014] In an embodiment, after the outputting the test report, the method further comprises: automatically cleaning the test environment, and restoring the bastion host and the asset to the initial state.
[0015] According to a second aspect of the present application, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the automated test method of the performance of the bastion host as described in the above embodiments.
[0016] According to the third aspect of the present application, a computer-readable storage medium is provided, which stores a computer program. The computer program can be executed by a processor to complete the automatic testing method of the bastion host performance described in the above embodiment.
[0017] According to the fourth aspect of the present application, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the automatic testing method for the bastion host performance described in the above embodiment.
[0018] According to the fifth aspect of the present application, an automatic testing device for the performance of a bastion host is also provided to realize the above-mentioned automatic testing method for the performance of the bastion host, including: a task establishment module, used to create a new automated testing task, including configuring performance parameter thresholds; a task execution module, used to automatically execute the test task, including: continuously loading the operation and maintenance session, and judging whether the actual performance parameters of the bastion host reach the performance parameter threshold; a threshold judgment module, used to judge if the performance parameter threshold is reached, then stop loading the operation and maintenance session; a stability testing module, used to continuously run for a preset time, judge whether the preset stability index is met, and output a test report.
[0019] The above-mentioned embodiments provide an automatic testing method, electronic device, computer-readable storage medium, and computer program product for the performance of a bastion host. By automating the testing process, the method reduces the tediousness of manual operations, reduces the impact of human errors on test results, and eliminates the impact of human factors on the judgment of test end conditions, thereby improving the accuracy and reliability of test results. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 Schematic diagram of an application scenario of the automatic testing system for bastion host performance provided in an embodiment of the present application;
[0022] Figure 2 A flowchart of a method for automatically testing the performance of a bastion host provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of a process for determining a preset stability indicator according to an embodiment of the present application;
[0024] Figure 4 A schematic diagram of a process for cleaning a test environment provided in an embodiment of the present application;
[0025] Figure 5 A detailed flowchart of a method for automatically testing the performance of a bastion host provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of the structure of the automatic testing device for the performance of the bastion host provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0028] Figure 1 Schematic diagram of an application scenario of an automatic testing system for bastion host performance provided in an embodiment of the present application, such as Figure 1 As shown, this application scenario includes an automatic bastion host performance testing system 110, a bastion host 120, and assets 130. The automatic bastion host performance testing system 110 communicates with the bastion host 120 and assets 130 to implement performance testing and collect necessary data. It also executes the automated process of bastion host performance testing, including configuring test parameters, launching test tasks, monitoring test execution, and collecting performance data. The bastion host 120 is a key component of network security, responsible for managing and monitoring access to internal network assets. It simulates real-world access scenarios by receiving test requests from the automatic bastion host performance testing system 110 and interacting with assets 130. Assets 130 are internal network resources managed by the bastion host 120, such as servers and databases. During testing, assets 130 simulate the actual business environment and respond to access requests from the bastion host 120.
[0029] The bastion host performance automated testing system 110, bastion host 120, and assets 130 together form a closed-loop testing environment for simulating and evaluating the bastion host's performance when processing user requests. The bastion host performance automated testing system 110 can interact with multiple assets 130 simultaneously to test performance under different configurations and load conditions. Figure 1 Two assets 130 are taken as an example, but there is actually no limit on the number of assets.
[0030] Figure 2 A flowchart of a method for automatically testing the performance of a bastion host provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the process includes the following steps S210 to S240:
[0031] Step S210: Create a new automated test task, including configuring performance parameter thresholds.
[0032] Specifically, the user defines a new test task and configures the performance parameter thresholds in detail, such as setting the CPU usage to no more than 80%, the memory usage to no more than 60%, etc. These thresholds are preset performance upper limits, which are used to evaluate the performance of the bastion host during the test. In the existing technology, the setting of performance parameters and the creation of test tasks are usually done manually, which is not only time-consuming but also prone to errors, resulting in inaccurate test configuration and affecting the reliability of the test results. This step creates new test tasks and configures performance parameter thresholds in an automated manner, which improves the error-prone and time-consuming problems of manual configuration in the existing technology, ensures the accuracy and consistency of test parameters, and improves the repeatability and reliability of the test.
[0033] Step S220: Automatically execute the test task, including: continuously loading the operation and maintenance session, and determining whether the actual performance parameters of the bastion host reach the performance parameter threshold.
[0034] Specifically, the system (i.e., the automatic testing system 110 for the performance of the bastion host mentioned above, hereinafter referred to as the system) automatically starts testing according to the configuration, gradually increases the simulated operation and maintenance sessions, and monitors the actual performance parameters of the bastion host, such as real-time monitoring of CPU and memory usage. Among them, the operation and maintenance session refers to a series of remote management and operation activities conducted through the bastion host, covering the entire process from logging in, executing commands to monitoring and auditing. In the prior art, test execution and performance monitoring often rely on manual operations, which leads to a slow testing process, and it is difficult to respond to performance changes in real time, and it is impossible to adjust the test strategy in time. This step realizes the automatic execution of test tasks and real-time performance monitoring, improves the problems of manual monitoring and insufficient response in the prior art, reduces human intervention, and improves the efficiency of testing and the accuracy of results.
[0035] Step S230: If the performance parameter threshold is reached, stop loading the operation and maintenance session.
[0036] Specifically, when the actual performance parameters monitored approach or reach the performance parameter threshold, the system will automatically stop adding new operation and maintenance sessions to prevent the system from overloading or performance degradation to unacceptable levels. In the prior art, whether to stop the test usually requires manual judgment, which will lead to response delays. The system may continue to bear unnecessary loads after reaching the performance limit, increasing the risk of system crashes. In this step, the system automatically stops adding new sessions, which improves the delays and system overloads that may be caused by relying on manual judgment in the prior art. The automated response mechanism ensures that the system can stop testing in time when the performance limit is reached, protecting the stability of the system.
[0037] Step S240: Continue running for a preset time, determine whether the preset stability index is met, and output a test report.
[0038] Specifically, once the performance parameter threshold is reached, the system will maintain the current load for a preset time, such as 30 minutes, to verify the stability of the bastion host, and output a report containing the test results after the test is completed. In the existing technology, stability testing often relies on manual monitoring and recording, which can easily lead to inaccurate and delayed test results, lack of real-time and objectivity. This step improves the efficiency and accuracy of the test by automatically running for a preset time and monitoring performance in real time, while reducing human errors. The automated test report of this step provides objective performance data to help decision makers accurately assess system stability, identify risks in a timely manner, optimize resource allocation, and guide future system upgrades, thereby enhancing the performance and reliability of network security facilities.
[0039] In one embodiment, the performance parameter thresholds in step S210 include: connection tolerance rate, which is used to indicate the allowed proportion of failed connections; resource occupancy rate, which is used to indicate the maximum resource usage ratio of the bastion host; and instruction audit time, which is used to indicate the maximum time from instruction request to audit storage.
[0040] Specifically, creating a new automated test task involves creating a comprehensive test task that automatically executes and evaluates the performance of the bastion host under different load conditions. This task includes detailed configuration of performance parameter thresholds to ensure comprehensiveness and accuracy. These performance parameter thresholds include key indicators such as connection fault tolerance, resource utilization, and command audit time. These thresholds serve as key constraints in the test, determining whether the test meets the expected performance standards and whether adjustments to the test strategy or system configuration optimization are needed.
[0041] Among them, the parameter of connection fault tolerance defines the maximum proportion of failed connections allowed in high-concurrency tests, thereby evaluating the stability and resilience of the system in the face of network fluctuations or anomalies. In the prior art, when performing performance testing, the judgment and decision-making process of fault tolerance often rely on manual operation, which is not only time-consuming but also easily leads to inaccurate results. In the embodiments of the present application, the automated process judges the fault tolerance, reduces the time delay of manual decision-making, improves the efficiency of the test and the accuracy of the results. For example, if the business scenario has extremely high requirements for the reliability of the connection and no failed connections are allowed, then the connection fault tolerance can be configured to 0, that is, a zero-tolerance policy is implemented. This is usually suitable for mission-critical systems that have extremely high requirements for continuity and stability.
[0042] The resource utilization parameter specifies the maximum percentage of CPU and memory resources that the bastion host uses when processing concurrent requests. Considering the differences between the bastion host and other security devices, and the differences between simulated concurrent performance testing and real-world user usage, a certain percentage of resource utilization is reserved during testing to simulate real-world operation and maintenance session interactions and system performance bottlenecks.
[0043] The instruction audit time parameter measures the maximum time it takes for an instruction to be requested, responded to, and audited into the database after the operation and maintenance session is established. It reflects the integrity of the operation and maintenance session channel and the system's responsiveness. As a key performance indicator, instruction audit time is often overlooked in existing technologies because it is difficult for humans to capture and calculate, despite its critical importance in assessing the success and reliability of concurrent sessions. The embodiments of the present application can automatically and accurately measure instruction audit time, capturing this subtle but critical performance indicator, thereby more accurately assessing the success and reliability of concurrent sessions.
[0044] Together, these thresholds form the basis for evaluating whether the bastion host's performance meets expected standards and provide clear stopping conditions for automated testing. Through these meticulous configurations, automated testing can accurately simulate various scenarios encountered in actual operations and comprehensively evaluate the bastion host's performance.
[0045] In one embodiment, in addition to the above-mentioned key performance parameter thresholds, the newly created automated testing task in step S210 specifically also includes: configuring relevant information of the bastion host and assets, and the relevant information of the bastion host and assets includes the IP address, account and password, and protocol type of the bastion host and assets.
[0046] Configure preset stability indicators. These indicators include the following: after the bastion host reaches the performance parameter threshold, it continues to run for a preset time (for example, 30 minutes) without a decrease in concurrent sessions.
[0047] Specifically, after configuring key performance parameter thresholds, you must also configure the bastion host's information and its asset-related configuration in detail. Setting the bastion host's information includes entering the device's management IP address and port for remote access, as well as providing the administrator account and password for login verification. This basic information is a prerequisite for subsequent performance testing and monitoring operations. You must also specify the communication protocol type, such as SSH, Telnet, or RDP, to ensure test compatibility and effectiveness.
[0048] For assets managed by the bastion host, it's necessary to list each asset's IP address, port number, and access protocol in detail, and configure appropriate access credentials and permissions for each asset to simulate real-world operations. This configuration ensures that test tasks can correctly interact with the assets, comprehensively evaluating the bastion host's performance under realistic workloads while ensuring the accuracy and effectiveness of the test.
[0049] With these detailed configurations, automated testing tasks can accurately simulate operations performed by operators on the bastion host and its managed assets, comprehensively evaluating the bastion host's performance under realistic workloads while ensuring the security and effectiveness of the tests. This configuration information is the foundation for successful automated testing and is crucial for evaluating the performance and stability of the bastion host.
[0050] Specifically, stability preset indicators refer to a series of performance standards set during performance testing to assess system stability under sustained high load conditions. These indicators typically include whether the system can maintain a stable operating state for a certain period of time after reaching a certain performance parameter threshold (such as CPU utilization, memory usage, etc.) without experiencing performance degradation or system crashes.
[0051] The preset stability indicators include two main aspects: on the one hand, the preset continuous operation time. After the bastion host reaches a specific performance parameter threshold (such as CPU usage, memory usage, etc.), it needs to be able to continue to run stably for a preset period of time. The preset continuous operation time is the stable operation time. Among them, the stable operation time refers to the time that the session stability remains online after the maximum concurrency is reached, which is used to evaluate the performance of the system under high load. During this period, the system needs to maintain stable performance without performance degradation or system crashes. On the other hand, the number of concurrent sessions has not decreased. During this period of continuous operation, the number of concurrent sessions that the bastion host can support must not decrease, which indicates that the system can continue to process the same number of concurrent requests without causing some sessions to fail or disconnect due to resource competition or insufficient processing power.
[0052] By configuring preset stability metrics, we provide a quantitative method for evaluating the bastion host's performance under high load. These metrics help identify potential system performance bottlenecks, optimize resource allocation, and ensure that the system remains efficient and stable despite a large number of concurrent requests. By automating the testing and monitoring of these metrics, enterprises can better understand the performance characteristics of their network security infrastructure, enabling more informed technical decisions and system upgrade plans.
[0053] In one embodiment, before continuously loading the operation and maintenance session, step S220 further includes: automatically inputting relevant information of the bastion host and the asset to the bastion host according to the newly created automated testing task, and configuring access rights to the asset.
[0054] Specifically, during the automated execution of test tasks, the system will automatically input pre-configured bastion host and asset-related information into the bastion host based on the requirements of the newly created automated test task. This includes but is not limited to the bastion host's IP address, management port, administrator account and password, as well as the network location, access credentials, and communication protocol of all relevant assets. In addition, the system will automatically configure asset access permissions to ensure that during the test, operation and maintenance users can correctly operate and access assets according to preset security policies and permission requirements. This automated step not only improves the efficiency of testing, but also reduces human error and ensures the accuracy and security of the test. In this way, test tasks can seamlessly interact with the bastion host and the assets it manages, simulating real-world operation and maintenance scenarios and comprehensively evaluating the performance and stability of the bastion host.
[0055] In one embodiment, step S220 continuously loads the operation and maintenance session and determines whether the actual performance parameters of the bastion host reach the performance parameter threshold, specifically including: adding the operation and maintenance session one by one, and each time an operation and maintenance session is added, determining whether the actual performance parameters of the bastion host reach the performance parameter threshold.
[0056] Specifically, during automated performance testing, the system simulates actual maintenance operations and gradually increases the number of maintenance sessions. Each time a maintenance session is added, the system monitors the bastion host's actual performance parameters, such as CPU usage, memory usage, network traffic, and response time, in real time to determine whether they meet preset thresholds. This incremental approach allows the system to meticulously monitor the bastion host's performance under varying loads, promptly identifying performance bottlenecks and potential stability issues.
[0057] Furthermore, this testing method of gradually adding sessions helps simulate real-world business scenarios, where user sessions and system load often increase gradually. By performing performance assessments immediately after each session addition, the system ensures that timely action is taken when performance parameters approach or exceed thresholds, such as stopping the addition of new sessions or adjusting system configurations to avoid system overload and ensure service quality. This method also provides testers with detailed performance data, helping them understand the behavior of the bastion host under different load levels, thereby optimizing system configuration, improving system performance, and ensuring that business needs are met in actual operations. Through this meticulous control and real-time monitoring of automated test tasks, enterprises can more accurately evaluate and improve the performance and stability of the bastion host.
[0058] In one embodiment, the actual performance parameters include actual fault tolerance, actual occupancy, and actual audit time. If the performance parameter threshold is reached, loading of the operation and maintenance session is stopped, including: if any one of the actual performance parameters reaches the performance parameter threshold, adding the operation and maintenance session is stopped.
[0059] Specifically, the system continuously monitors the actual performance parameters of the bastion host, including but not limited to key metrics such as CPU usage, memory usage, disk I / O, network bandwidth utilization, and response time. These parameters are tracked in real time and compared against pre-set performance parameter thresholds. If any of the monitored actual performance parameters reaches or exceeds the set threshold, the system automatically responds and stops adding further operation and maintenance sessions.
[0060] This automatic stop mechanism is designed to prevent performance degradation or system instability on the bastion host due to overload, ensuring a safe and effective testing process. This allows testing to accurately determine the bastion host's performance limits without compromising system stability. Once a performance threshold is reached, the system will maintain the current session level, continue monitoring for a period of time to collect stability data, or initiate other pre-defined test scenarios, such as load reduction testing, to assess the system's responsiveness and resilience under varying load conditions.
[0061] Furthermore, when actual performance parameters reach thresholds, the system automatically records detailed performance data and system status at that moment, providing key information for subsequent performance analysis and reporting. This helps testers and system administrators gain a deeper understanding of system behavior under high load conditions, enabling them to optimize system configurations and improve performance and reliability.
[0062] In one embodiment, Figure 3 A schematic diagram of a flow chart for determining a preset stability indicator provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, step S240 continues to run for a preset time, determines whether the preset stability index is met, and outputs a test report, which specifically includes the following steps S241-S243:
[0063] Step S241: Continue running for a preset time, and regularly check the number of concurrent sessions within the preset time.
[0064] Step S242: If the number of concurrent sessions decreases, it is determined that there is a performance anomaly and the operation is stopped.
[0065] Step S243: If the number of concurrent sessions does not decrease, it is determined that the preset stability index is met and the operation is stopped after the preset time is reached.
[0066] Specifically, the preset duration of continuous operation is a key part of the stability test, which aims to verify the stability of the bastion host's performance under prolonged high load conditions. During this period, the system regularly checks the number of concurrent sessions on the bastion host to monitor whether the system can stably handle the predetermined number of sessions without performance degradation.
[0067] If the number of concurrent sessions decreases within a preset time, the system will determine that there is a performance anomaly. This may mean that system resources are exhausted, processing power is reduced, or other potential performance issues. Once this situation is detected, the test will be stopped for further analysis and problem resolution. For example, in a performance test, once any decrease in the number of concurrent sessions is detected, even if it is only one session, the test will stop immediately. Such a design is highly sensitive and can capture any signs of abnormal system performance at the first time. In addition, this approach also allows testers to intervene quickly, analyze the cause of the problem, and adjust the test strategy or optimize the system configuration when necessary to ensure the stability and efficiency of subsequent tests or actual operations.
[0068] If the number of concurrent sessions remains stable and does not decrease throughout the preset time, the system will determine that the bastion host meets the preset stability indicators. This indicates that the bastion host can maintain stable performance under high load conditions and has not experienced performance degradation. Regardless of the test results, the system will stop running after the preset time and output a detailed test report. The report will include performance data during the continuous operation, changes in the number of concurrent sessions, and the final stability test conclusions, providing testers with comprehensive test analysis and decision support. In this way, automated performance testing methods can not only comprehensively evaluate the stability of the bastion host, but also promptly identify performance issues, providing accurate data support for system optimization and maintenance.
[0069] In one embodiment, the test report is output, including: outputting the resource status and system status of the bastion host at the beginning of the test; outputting the resource status and system status of the bastion host at the end of the test; and outputting the resource status and system status of the bastion host when the performance parameter threshold is reached during the test.
[0070] Specifically, in the automated performance testing method of the present invention, outputting a test report is a key step. It records the entire testing process in detail and provides an in-depth analysis of the bastion host's performance. The content of the test report includes but is not limited to the following aspects:
[0071] At the start of the test, the report first details the bastion host's resource and system status. This includes key resource metrics such as CPU usage, memory usage, disk space, and network connectivity, as well as system-level information such as system logs and service health. This data provides a baseline for comparison with status changes during the test.
[0072] At the end of the test, the report records the bastion host's resource status and system status again to assess the impact of performance changes during the test and determine whether the system has returned to its initial state. This helps identify the long-term impact of the test on system stability and performance.
[0073] During testing, whenever the bastion host's actual performance parameters reach the preset threshold, a report details the resource and system status at that moment. This includes the specific time when the threshold was reached, the relevant performance parameter values, and system resource usage, providing precise data support for analyzing performance bottlenecks and system limits.
[0074] These detailed test reports provide testers and system administrators with a comprehensive understanding of the bastion host's performance under varying load conditions, enabling them to promptly identify performance bottlenecks and potential stability issues, and optimize system configuration and maintenance strategies accordingly. Test reports provide valuable data and insights for performance analysis, troubleshooting, and system optimization, serving as a crucial basis for evaluating test results and guiding system improvements.
[0075] In one embodiment, Figure 4 A flow chart of cleaning the test environment provided in the embodiment of the present application is as follows: Figure 4 As shown, after outputting the test report in step S240, the following steps are further included:
[0076] Step S250: Automatically clean up the test environment and restore the bastion host and assets to their initial state.
[0077] Specifically, after outputting a detailed test report, the system automatically cleans up the test environment, ensuring that the bastion host and related assets are restored to their initial pre-test state. This process involves undoing configuration changes made during the test, releasing all used resources, clearing temporary data and log files, and verifying the system status to ensure that no negative impacts caused by the test remain. Automatic cleanup steps help maintain a clean and secure test environment, reducing errors and omissions that may be caused by manual post-test cleanup. This automated process improves test efficiency and accuracy, ensures the integrity of the test environment, and provides a reliable foundation for subsequent testing or normal operations and maintenance activities.
[0078] Figure 5 This is a detailed flow chart of an automatic testing method for bastion host performance provided by an embodiment of the present application, such as Figure 5 As shown, the automatic testing method for the bastion host performance includes the following steps S100 to S700:
[0079] Step S100: Create a new automated test task, including configuring performance parameter thresholds.
[0080] Specifically, in this step, create a new automated test task and configure key performance parameter thresholds, including connection fault tolerance, resource utilization, and time settings. Among them, the time settings cover stable operation time and instruction audit time. Among them, stable operation time refers to the preset continuous operation time, which refers to the time the system remains online to ensure connection stability after reaching the maximum concurrent sessions. The instruction audit time refers to the time from the establishment of the operation and maintenance session to the instruction request and response to the audit storage. In addition, detailed information about the bastion host and assets needs to be configured, including IP address, user name and password, protocol, etc.
[0081] Step S200: Execute the test task.
[0082] Specifically, after configuration is complete, automated testing tasks can be initiated manually or automatically according to a pre-defined schedule. Manual initiation provides flexibility, allowing testers to immediately execute tests after confirming all preparations are complete, and to select the optimal test timing based on network conditions and system load. Automatic triggering runs tests during periods of low system load, minimizing impact on services, ensuring continuity and regularity of testing, and facilitating long-term performance monitoring.
[0083] Step S300: Record resource status and system status, and output to a test report.
[0084] Specifically, when the automated testing task begins, the system automatically captures the initial resources and system status of the bastion host, including CPU and memory usage, and outputs this data to the test report in real time, providing benchmark information for subsequent performance analysis.
[0085] Step S400: Automatically input the bastion host and asset configuration.
[0086] Specifically, the system will automatically enter pre-configured asset information into the bastion host and set necessary access permissions for the operation and maintenance users to simulate a real operation and maintenance environment.
[0087] Step S500: Execute single sign-on and monitor performance parameters.
[0088] Specifically, when the single sign-on test begins, the system automatically logs in to the bastion host as the operations and maintenance user, adding sessions one by one and monitoring the fault tolerance rate, resource usage, and command audit time after each addition. If any parameter reaches the preset threshold, i.e., the maximum performance index, step S510 is executed to stop adding single sign-ons. Once the maximum performance index is reached, step S300 is executed to output the resource status and system status of the bastion host when the performance parameter threshold was reached during the test to the test report to assess performance limits.
[0089] Step S600: Continue stability operation and monitoring.
[0090] Specifically, after reaching the performance parameter threshold, the system enters a continuous operation state, and continuously executes step S610 to check whether the number of concurrent sessions is decreasing. If the number of sessions decreases, it indicates that there may be a performance anomaly. The test will end the test early and execute step S300 to output to the test report. If the number of sessions remains stable, step S620 is executed to determine whether the stable operation time has been reached. After waiting for the preset continuous operation time (i.e., the stable operation time), step S300 is executed. That is, after the stability test is completed, the system will record the resource status and system status, and output the results to the test report to evaluate the stability of the bastion host under long-term operation.
[0091] Step S700: Clean up the test environment.
[0092] Specifically, the system will clean up the bastion host and assets, restore them to their initial state before testing, ensure the cleanliness of the test environment, and officially end the automated testing task.
[0093] Taking a real-world application scenario as an example, the process of automatically testing the bastion host's performance is as follows:
[0094] The test parameters were set to 1% fault tolerance, 90% maximum resource utilization threshold, 30 minutes of stable operation time, and 200 milliseconds of command audit time. The bastion host IP address involved in the test was 192.168.1.25, and the managed asset IP address range was 192.168.1.2xx.
[0095] Start the automated testing task and execute it according to the preset parameters and conditions.
[0096] The system automatically logs in to the bastion host and automatically configures related assets, including entering the account and password, and adding necessary authorization relationships for the operation and maintenance user.
[0097] Synchronously monitor and record the resource usage of the bastion host, such as CPU usage of 10%, memory usage of 30%, and disk usage of 10%, and output this data to the test report.
[0098] Automatically log in as an operation and maintenance user, perform single sign-on testing, add sessions one by one, and after each addition, determine whether the fault tolerance rate, resource usage, and instruction audit time meet the preset conditions.
[0099] When the number of sessions increases to 100, if more than two connections fail, the number of new single sign-ons will be stopped; if the resource usage reaches 90%, or the instruction audit time of the 100th connection exceeds 200 milliseconds, the number of new sessions will also be stopped.
[0100] After reaching the maximum performance index, the resource status and system status of the equipment are recorded and these key data are output to the test report.
[0101] Enter the 30-minute stabilization phase, during which you should regularly check whether the number of concurrent sessions has decreased. If so, consider a performance anomaly and proceed directly to the next step. If not, continue monitoring until the stabilization phase ends.
[0102] After the stability test is completed, the resource status and system status of the device are recorded again and the results are output to the test report.
[0103] Finally, clean up the test environment, restore the bastion host and assets to their initial state, ensure the test environment is clean, and then end the test task.
[0104] Based on the network security protection method provided in any of the above embodiments and based on the same inventive concept, an embodiment of the present application provides an automatic testing device 1000 for bastion machine performance to implement the above-mentioned automatic testing method for bastion machine performance. Figure 6 A schematic diagram of the structure of the automatic testing device for the bastion host performance provided in the embodiment of the present application is shown as follows: Figure 6 As shown, the automatic testing device 1000 for the bastion host performance of the embodiment of the present application includes at least: a task establishment module 1001, a task execution module 1002, a threshold judgment module 1003, and a stability testing module 1004, wherein:
[0105] The task establishment module 1001 is used to create a new automated test task, including configuring performance parameter thresholds.
[0106] The task execution module 1002 is used to automatically execute the test task, including: continuously loading the operation and maintenance session, and determining whether the actual performance parameters of the bastion host reach the performance parameter threshold.
[0107] The threshold determination module 1003 is used to determine if the performance parameter threshold is reached and then stop loading the operation and maintenance session.
[0108] The stability test module 1004 is used to continuously run for a preset time, determine whether the preset stability index is met, and output a test report.
[0109] The specific execution process of each of the above modules can be found in the corresponding steps of the method section and will not be repeated here.
[0110] An embodiment of the present application also provides an electronic device, which may include a processor and a memory for storing processor-executable instructions, and the processor is configured to implement the steps of the automatic testing method for the bastion host performance of any of the above embodiments.
[0111] The embodiment of the application further provides a computer readable storage medium, the storage medium stores a computer program, and the computer program can be executed by a processor to complete the steps of the automatic testing method for the performance of the bastion host according to any of the foregoing embodiments.
[0112] The embodiment of the application further provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the steps of the automatic testing method for the performance of the bastion host according to any of the foregoing embodiments.
[0113] In summary, the technical solution provided by the embodiment of the application has the following advantages:
[0114] The application provides a novel method for determining the maximum number of sessions supported by the bastion host by gradually increasing the number of sessions until the maximum performance indicator is reached, which is more accurate and efficient than traditional techniques. It can monitor the number of concurrent sessions in real time, intelligently judge performance anomalies, and stop testing in time to avoid resource waste and system risks, thereby improving the accuracy of testing and the stability of the system.
[0115] In addition, the automatic testing mechanism of the application not only optimizes resource allocation but also strengthens risk management by stopping increasing sessions when the performance parameter reaches the threshold, avoiding excessive consumption of system resources and reducing the risk of system collapse or performance degradation due to system overload. Through accurate assessment of the performance of the bastion host, enterprises can make more scientific decisions based on detailed performance data, enhancing the performance and security of network security facilities.
[0116] In the embodiments provided in the application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative.
[0117] It should be noted that if the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the embodiments of the method of the application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0118] The above are merely examples of the present application and are not intended to limit the scope of protection of the present application. Those skilled in the art will appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A method for automatically testing the performance of a bastion host, characterized in that: include: Create new automated test tasks, including configuring performance parameter thresholds; Automatically executing the test task, including: continuously loading the operation and maintenance session, and determining whether the actual performance parameters of the bastion host reach the performance parameter threshold; If the performance parameter threshold is reached, the loading of the operation and maintenance session is stopped; Continue running for the preset time, determine whether the preset stability indicators are met, and output a test report.
2. The method according to claim 1, characterized in that The performance parameter thresholds include: Connection fault tolerance rate, which indicates the allowed proportion of failed connections; Resource occupancy rate, which indicates the maximum resource usage ratio of the bastion host; Instruction audit time is used to indicate the maximum time from instruction request to audit storage.
3. The method according to claim 1, characterized in that The newly created automated test task also includes: Configure the relevant information of the bastion host and assets, including the IP address, account number and password, and protocol type of the bastion host and assets; Configure stability preset indicators, which include that after the bastion host reaches a performance parameter threshold, it continues to run for a preset time without a decrease in concurrent sessions.
4. The method according to claim 3, characterized in that Before the continuous loading of the operation and maintenance session, the automatic execution of the test task further includes: According to the newly created automated test task, the relevant information of the bastion host and the asset is automatically input to the bastion host, and the access rights of the asset are configured.
5. The method according to claim 1, wherein The continuously loading operation and maintenance session and determining whether the actual performance parameter of the bastion host reaches the performance parameter threshold include: Operation and maintenance sessions are added one by one. Each time an operation and maintenance session is added, it is determined whether the actual performance parameter of the bastion host reaches the performance parameter threshold.
6. The method according to claim 1, characterized in that The actual performance parameters include actual fault tolerance, actual occupancy, and actual audit time. If the performance parameter threshold is reached, the operation and maintenance session is stopped from loading, including: If any one of the actual performance parameters reaches the performance parameter threshold, adding the operation and maintenance session is stopped.
7. The method according to claim 1, characterized in that The continuous operation for the preset time is used to determine whether the preset stability index is met, including: Running continuously for a preset time and periodically checking the number of concurrent sessions during said preset time; If the number of concurrent sessions decreases, it is determined that there is a performance anomaly and the operation is stopped; If the number of concurrent sessions does not decrease, it is determined that the preset stability index is met and the operation is stopped after the preset time is reached.
8. The method according to claim 1, characterized in that The output test report includes: Output the resource status and system status of the bastion host at the start of the test; Output the resource status and system status of the bastion host at the end of the test; Outputs the resource status and system status of the bastion host when it reaches the performance parameter threshold during the test.
9. The method according to claim 1, characterized in that After outputting the test report, the method further includes: Automatically clean up the test environment and restore the bastion host and assets to their initial state.
10. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the automatic testing method for the bastion host performance according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that The storage medium stores a computer program, which can be executed by a processor to complete the automatic testing method for the bastion server performance described in any one of claims 1-9.
12. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements the automatic testing method for the bastion host performance described in any one of claims 1-9.
Citation Information
Patent Citations
Performance test method, device, system and equipment and storage medium
CN109977027A
Performance test index data display method, device and equipment and storage medium
CN112527642A