A database test environment building method, device, equipment and medium

CN115454817BActive Publication Date: 2026-08-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210974178.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2026-08-21
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

而手动安装oracle数据库,容易出现权限,切换用户等问题,影响测试的进度

Benefits of technology

[0071]本发明的测试环境搭建平台可以同时部署多个数据库压力测试的环境,并且可以随时查看软件的安装进度,减少了部署的时间;通过使用自动化测试按照预定的配置自动化安装数据库和压力测试软件,减少人工操作,避免因为人工配置而产生错误,同时减少了工作量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115454817B_ABST
    Figure CN115454817B_ABST
Patent Text Reader

Abstract

The application discloses a database test environment building method, device, equipment and medium, and belongs to the technical field of data testing.The method comprises the following steps: starting a device monitoring program; monitoring sequence elements in a formulated queue, and installing a database and test software according to the monitoring result of the sequence elements; starting a log monitoring program; obtaining logs of the installation of the database and the test software; and confirming whether the database test environment is successfully built according to the logs of the installation of the database and the test software.The test environment building platform can simultaneously deploy the environment for multiple database stress tests, thereby reducing the deployment time; the database and the stress test software are automatically installed according to the predetermined configuration by using the automatic test, thereby reducing manual operation, avoiding errors caused by manual configuration, and reducing the workload.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data testing technology, and in particular to a method, apparatus, equipment, and medium for building a database testing environment. Background Technology

[0002] Database stress testing refers to using third-party tools to stress-test a specific database on a specified operating system. Popular databases include Oracle, SQL Server, DB2, MySQL, MariaDB, PostgreSQL, and Redis. The necessity of database stress testing lies in the fact that higher database stress test scores on a server improve the quality of specific company services, boost server sales, and ultimately bring greater profits to the company.

[0003] HammerDB, an open-source database stress testing tool, supports both Linux and Windows systems. It can be operated via command line and graphical interface, and is free. Oracle database is one of the most popular relational databases today. It is easy to use, powerful, and suitable for various testing environments, making it one of the most popular databases for client / server or browser / server architectures.

[0004] This script uses shell scripting to modify or add files using the `sed` and `awk` commands. It can automatically roll back if the installation fails. By calling the software installation script, it can automate the installation of Oracle and HammerDB software, and finally automatically configure HammerDB parameters to obtain the database stress test results under the corresponding parameters.

[0005] Currently, database stress testing typically involves the following steps: Step 1: Manually install the database onto the operating system. Step 2: Manually install HammerDB onto the operating system. Step 3: Open HammerDB, configure parameters, and perform stress testing. However, manually installing Oracle databases can easily lead to issues with permissions and user switching, affecting the test progress. Furthermore, if installation fails, manual uninstallation and rollback are required, further impacting the stress test schedule. Manual deployment also prevents the simultaneous deployment of multiple test environments, is time-consuming and error-prone, significantly increasing the workload of test preparation.

[0006] Currently, the mainstream approach to setting up database testing environments involves manually installing the database and testing software. If other testing environments need to be set up simultaneously, one database or testing software must be installed before another; parallel installation is not possible. Furthermore, errors are prone to occur during the installation process. Summary of the Invention

[0007] To overcome the aforementioned technical deficiencies, the present invention aims to provide a method, apparatus, device, and medium for building a database testing environment. The method is applied to a multi-test environment building platform and includes: activating a device monitoring program; monitoring sequence elements in a designated queue; installing the database and testing software based on the monitoring results of the sequence elements; activating a log monitoring program; acquiring logs of the installation of the database and the testing software; and confirming whether the database testing environment has been successfully built based on the installation logs. The testing environment building platform of the present invention can simultaneously deploy multiple database stress testing environments, reducing deployment time; by using automated testing to automatically install the database and stress testing software according to a predetermined configuration, manual operation is reduced, errors caused by manual configuration are avoided, and workload is reduced.

[0008] The specific technical solutions provided by the embodiments of the present invention are as follows:

[0009] Firstly, a method for setting up a database testing environment is provided, the method being applied to a multi-testing environment setup platform, the method comprising:

[0010] Enable device monitoring program;

[0011] Listen to the sequence elements in the specified queue, and install the database and test software based on the listening results of the sequence elements;

[0012] Start the log listener;

[0013] Obtain logs of the installation of the database and the test software;

[0014] Confirm whether the database test environment has been successfully set up based on the installation logs of the database and the test software.

[0015] Furthermore, before activating the device monitoring program, the following steps are included:

[0016] Install the operating system and / or install remote connection and / or install the RPM binary package.

[0017] Furthermore, the step of monitoring the sequence elements in the designated queue and installing the database and test software based on the monitoring results of the sequence elements includes:

[0018] Determine whether any sequence elements have entered the designated queue;

[0019] If yes, then determine the number of elements in the sequence; if no, then end the process.

[0020] The determination of the number of elements in the sequence includes:

[0021] Determine whether the number of elements in the sequence is less than or equal to a first threshold;

[0022] If yes, the installation operation type is determined based on the hash value of the sequence element; if no, the remaining sequence elements exceeding the first threshold enter the queuing state.

[0023] Further, the step of determining the installation operation type based on the hash value of the sequence element includes:

[0024] The installation operation type is determined based on the hash value of the sequence element;

[0025] If the installation operation type is database, then the database installation script is imported according to the database object value, and the database is installed; if the installation operation type is test software, then the test software installation script is imported according to the test software object value, and the test software is installed.

[0026] Further, the step of importing the database installation script based on the object values ​​of the database and installing the database includes:

[0027] Configure RPM software manager;

[0028] Create the users and / or user groups for the database;

[0029] Configure the user's user environment;

[0030] Disable the system firewall and system security subsystem;

[0031] Modify system kernel parameters and limit system resources;

[0032] Modify the remote desktop display configuration file, download the database installation package, and install the database.

[0033] Furthermore, the step of importing the database installation script based on the object values ​​of the database and installing the database further includes:

[0034] If an error occurs during the installation of the database, delete the user and user group, and restore the installation files for the database.

[0035] Furthermore, confirming whether the database test environment has been successfully set up based on the logs of the database and the test software installation includes:

[0036] Determine whether to install the database and the test software simultaneously based on the installation logs of the database and the test software.

[0037] If yes, the database test environment has been successfully set up; otherwise, the sequence elements in the specified queue are monitored again, and the database and test software are installed based on the monitoring results of the sequence elements.

[0038] Secondly, a database testing environment setup device is provided, the device comprising:

[0039] The first startup module is used to start the device monitoring program;

[0040] The processing module is used to monitor the sequence elements in the specified queue and install the database and test software based on the monitoring results of the sequence elements.

[0041] The second module is used to enable the log listening program;

[0042] The acquisition module is used to acquire logs of the database and the test software installation;

[0043] The setup module is used to confirm whether the database test environment has been successfully set up based on the logs of the database and the test software installation.

[0044] Thirdly, a computer device is provided, the device comprising:

[0045] A memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps of the database test environment setup method as described in any of the first aspects.

[0046] Fourthly, a computer storage medium is provided, the medium comprising:

[0047] It stores a computer program, which, when executed by the memory, implements the steps of the database test environment setup method described in any of the first aspects.

[0048] Compared with existing technologies, the technical solution provided by this invention is applied to a multi-test environment building platform. The method includes: starting a device monitoring program; monitoring sequence elements in a designated queue; installing the database and test software based on the monitoring results of the sequence elements; starting a log monitoring program; obtaining logs of the installation of the database and the test software; and confirming whether the database test environment has been successfully built based on the logs of the database and the test software installation. The test environment building platform of this invention can deploy multiple database stress test environments simultaneously and allows for real-time monitoring of software installation progress, reducing deployment time. By using automated testing to automatically install the database and stress test software according to a predetermined configuration, manual operation is reduced, errors caused by manual configuration are avoided, and workload is reduced.

[0049] The technical solution provided in this invention uses an automated installation script and the sed and awk commands to automate multiple steps of modifying and creating files during the software installation process, reducing errors from manual modifications and shortening test preparation time. Furthermore, if software installation fails, it can automatically click "back" to modify parameters, achieving automated rollback and reducing testing workload.

[0050] The technical solution provided by the embodiments of the present invention reduces errors in the process of manually configuring and installing databases and testing software, that is, reduces the amount of preparation work for database stress testing. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a first flowchart of the database testing environment setup method provided in Embodiment 1 of the present invention;

[0053] Figure 2 This is a second flowchart of the database testing environment setup method provided in Embodiment 2 of the present invention;

[0054] Figure 3 This is a flowchart illustrating the method for setting up a database testing environment according to Embodiment 2 of the present invention.

[0055] Figure 4 This is a structural diagram of the database testing environment building device provided in Embodiment 3 of the present invention;

[0056] Figure 5This is an exemplary system provided in Embodiment 5 of the present invention, which can be used to implement the various embodiments described in this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0058] It should be noted that, unless the context explicitly requires it, the words "comprising," "including," and similar terms in the entire specification and claims should be interpreted as encompassing rather than being exclusive or exhaustive; that is, meaning "including but not limited to."

[0059] Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0060] Example 1

[0061] This invention provides a method for setting up a database testing environment, such as... Figure 1 As shown, the method is applied to a multi-test environment building platform, and the method includes:

[0062] Enable device monitoring program;

[0063] Listen to the sequence elements in the specified queue, and install the database and test software based on the listening results of the sequence elements;

[0064] Start the log listener;

[0065] Obtain logs of the installation of the database and the test software;

[0066] Confirm whether the database test environment has been successfully set up based on the installation logs of the database and the test software.

[0067] Specifically, this invention provides a test environment setup platform that allows users to select their desired database and test software. After selecting the database and test software, clicking "Deploy" deploys the test environment with a single click. It also supports deploying multiple database test environments simultaneously, such as stress test environments for Oracle and Splite databases. Furthermore, it allows users to view log information during the software installation and deployment process to track the deployment progress.

[0068] The test environment setup platform includes the database to be tested and the test software. By selecting the corresponding database and test software and clicking "Build," the test environment can be automatically built, and the log information of the test environment setup can be viewed in real time. The platform allows users to add any databases and test software that need to be tested. For users, simply selecting the database and test software to be tested enables one-click deployment of the test environment, with real-time monitoring of the deployment process. This simultaneous deployment of multiple test environments is not possible manually.

[0069] For example, if you choose Oracle relational database and HammerDB database stress testing software, the platform will automatically generate scripts to automate the installation of these databases, significantly reducing the testing workload. Using scripts to install Oracle and HammerDB also minimizes human error during the installation process, greatly shortening installation time. The platform's automated installation scripts use sed and awk commands to automate multiple steps of modifying and creating files during the environment setup and installation process, reducing errors from manual modifications and shortening test preparation time. Furthermore, if the installation fails, it can automatically click "back" to modify parameters and perform an automated rollback, further reducing the testing workload.

[0070] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows:

[0071] The test environment setup platform of this invention can deploy multiple database stress test environments simultaneously and allows for real-time monitoring of software installation progress, reducing deployment time. By using automated testing to automatically install databases and stress test software according to predetermined configurations, manual operations are reduced, errors caused by manual configuration are avoided, and workload is also reduced.

[0072] Example 2

[0073] This invention provides a method for setting up a database testing environment, such as... Figure 2 As shown, the method includes:

[0074] Step S01: Install the operating system and / or install remote connection and / or install the RPM binary package.

[0075] Specifically, to deploy the database test environment, log in to the server, enter the username and password, upload the Oracle installation package to the server via FTP (File Transfer Protocol); upload the operating system ISO (image file) to the server via FTP, install the CentOS operating system, install VNC Server for remote connection, install various RPM binary packages, and set the maximum value of the number of sequence elements entering the specified queue, i.e., the first threshold.

[0076] Step S02: Start the device monitoring program.

[0077] Specifically, a listening program is started on the server to listen for any sequence elements entering the designated queue at regular intervals.

[0078] Step S03: Monitor the sequence elements in the designated queue, and install the database and test software based on the monitoring results of the sequence elements.

[0079] Step S03 also includes:

[0080] Step S031: Determine whether any sequence elements have entered the designated queue;

[0081] If yes, then determine the number of elements in the sequence; if no, then end the process.

[0082] The determination of the number of elements in the sequence includes:

[0083] Determine whether the number of elements in the sequence is less than or equal to a first threshold;

[0084] If yes, the installation operation type is determined based on the hash value of the sequence element; if no, the remaining sequence elements exceeding the first threshold enter the queuing state.

[0085] Specifically, if a sequence element enters the designated queue, the number of elements is checked and determined. If the number of elements is less than or equal to a first threshold, the operation type of the installation is determined based on the hash value key of the sequence element. If the operation type is database and the object value of the database is oracle, the automated installation script for the oracle database is imported. If the number of sequence elements is greater than the first threshold, the remaining sequence elements exceeding the first threshold enter a queuing state, or the first threshold can be modified to allow the remaining sequence elements to enter the designated queue.

[0086] Here, the first threshold is a specified value of 10; the sequence element is an unordered, variable sequence whose elements are stored in the form of "key-value pairs".

[0087] Step S032: Determine the installation operation type based on the hash value of the sequence element;

[0088] If the installation operation type is database, then the database installation script is imported according to the database object value, and the database is installed; if the installation operation type is test software, then the test software installation script is imported according to the test software object value, and the test software is installed.

[0089] Specifically, the installation operation type is determined by the hash value key of the sequence element, i.e., whether it is the installation of a database or test software; if the operation type is database and the object value of the database is oracle, then an automated installation script for the oracle database is imported; if the operation type is test software and the object value of the test software is HammerDB, then an automated installation script for the HammerDB test software is imported.

[0090] Here, the system checks if the current platform has the Oracle database installation package and automated installation script. If the system has the corresponding Oracle database installation package and script, it installs directly. If the system does not have the corresponding Oracle database installation package and script, the user can manually import the Oracle database installation package and script. The same applies to installing the HammerDB testing software.

[0091] Step S033: Configure RPM software manager;

[0092] Create the users and / or user groups for the database;

[0093] Configure the user's user environment;

[0094] Disable the system firewall and system security subsystem;

[0095] Modify system kernel parameters and limit system resources;

[0096] Modify the remote desktop display configuration file, download the database installation package, and install the database.

[0097] Specifically, execute the statements in the script to configure the local yum repository; create the user and / or user group for the database, i.e., create the oracle user and the dba (Database Administrator) user group: groupadd -g 500dba useradd -g dba -u 500oracle;

[0098] Configure the user's environment by using the sed and awk commands (sed is generally used for replacing text content; awk is generally used for statistical analysis of text content and outputting it in the required format) to modify the contents of the / bash_profile (environment variables) file as follows:

[0099] export ORACLE_SID = orcl

[0100] export ORACLE_BASE= / home / oracle / oracle

[0101] export ORACLE_HOME=$ORACLE_BASE / product / 11.2.0 / dbhome_1

[0102] export PATH=$PATH:$ORACLE_HOME / bin:$ORACLE_HOME / OPatch

[0103] exportNLS_LANG="simplified Chinese"_china.zhs16gbk

[0104] umask 022;

[0105] To disable the system firewall, execute the following command:

[0106] systemctl stop firewalld

[0107] systemctl disable firewalld;

[0108] To disable the SELinux system security subsystem, execute the following command:

[0109] sed-i's / SELINUX=enforcing / SELINUX=disabled / g' / etc / selinux / config;

[0110] Modify system kernel parameters and limit system resources;

[0111] Specifically, the script executes the `sed` command to modify the ` / etc / sysctl.conf` file, changes the system kernel parameters, and executes the command:

[0112] fs.aio-max-nr = 1048576

[0113] fs.file-max = 6815744

[0114] kernel.shmall = 13107200

[0115] kernel.shmmax = 53687091200

[0116] kernel.shmmni=4096

[0117] kernel.sem=25032000100128

[0118] net.ipv4.ip_local_port_range=900065500

[0119] net.core.rmem_default=262144

[0120] net.core.rmem_max = 4194304

[0121] net.core.wmem_default=262144

[0122] net.core.wmem_max = 1048586

[0123] Here, sysctl is a tool used to view and adjust system parameters during system operation. Some sysctl parameters simply report the current system status, such as the current boot time, the operating system version, kernel name, etc.; while others can be modified to adjust system behavior, such as the size of network cache memory, the maximum number of concurrent users, etc. sysctl.conf is the configuration file for sysctl. These adjustable parameters must be set before the system executes other programs at boot, or they can be adjusted arbitrarily after boot. Like most configuration files, sysctl.conf can be configured to optimize system performance.

[0124] To limit system resources, use the awk command to add the following content to the / etc / security / limits.conf file:

[0125] Oracle Soft NProc 2047

[0126] Oracle hard nproc 16384

[0127] Oracle soft nofile 1024

[0128] Oracle hard nofile 65536

[0129] Oracle Soft Memlock Unlimited

[0130] oracle hard memlock unlimited;

[0131] Modify the remote desktop display configuration file, download the database installation package, install the database, execute the command to modify the vncserver configuration file, switch to the oracle user, execute runinstall to enter the installer, the image interface for installing Oracle will pop up, locate the position of the interface, automatically enter text or click nextback, if an error appears on the last page, automatically click back, modify the parameters, and realize the installation rollback.

[0132] The software opens automatically and is centered. Based on the screen resolution, after multiple adjustments, the x and y positions in the code below will be determined, indicating whether the operation involves an input box or a button. First, the email input box is located. Then, mouse movement, click, and text input are invoked to complete the email input.

[0133] rawinput.absoluteMotion(x,y,mouseDelay=None,check=True)

[0134] rawinput.click(x,y,button=1,check=True)

[0135] rawinput.typeText(test@111.com)

[0136] Repeat the process until you reach the Next button, click it, and proceed to the next page.

[0137] The vncserver is a service used to share resources on a Linux server with other distributed users.

[0138] Simultaneously, the script executes the `tar -zxv` command to decompress the HammerDB test software installation package, modifies permissions, and executes the installation package; the script sets the parameters of the HammerDB test software and performs stress tests on the database.

[0139] The local yum repository is an RPM software manager. It stores all RPM packages on the server and records the dependencies between packages in a file. When an administrator uses the yum repository to install an RPM package, the repository first downloads the package's dependency file from the server. By analyzing this file, it downloads all relevant RPM packages from the server at once and installs them. SELinux's main function is to minimize the resources accessible to service processes in the system (the principle of least privilege), preventing roles with excessive privileges from causing catastrophic consequences for the system. The core objective of the DBA (Database Administrator) is to ensure the stability, security, integrity, and high performance of the database management system.

[0140] Step S034: When an error occurs during the installation of the database, delete the user and user group, and restore the installation files of the database.

[0141] Specifically, if an error occurs during the installation of the database, the branch of the installation script is executed, the user and user group are automatically deleted, the sed (stream editor) command is used to restore the installation files of the database, and the back button is automatically clicked to modify parameters and roll back.

[0142] The sed command processes data in a text file based on script commands.

[0143] Step S04: Start the log listening program.

[0144] Step S05: Obtain the installation logs for the database and the test software.

[0145] Specifically, the log collection system starts a log listening program to obtain logs of the installation of the database and the test software from the system, monitors the progress of the installation of the database and the test software at any time, and outputs the logs to the system.

[0146] Step S06: Confirm whether the database test environment has been successfully set up based on the logs of the database and the test software installation.

[0147] Step S06 also includes:

[0148] Step S061: Determine whether to install the database and the test software simultaneously based on the installation logs of the database and the test software.

[0149] If yes, the database test environment has been successfully set up; otherwise, the sequence elements in the specified queue are monitored again, and the database and test software are installed based on the monitoring results of the sequence elements.

[0150] Specifically, if the database and the test software are not installed simultaneously according to the installation logs, the system will re-listen to the sequence elements in the designated queue, read the hash value key and the corresponding object value value of the next sequence element, and perform a loop installation of the database and the test software based on the listening results of the sequence elements.

[0151] like Figure 3 The following is a flowchart illustrating the process of setting up a database testing environment:

[0152] Specifically, the device monitoring program is started; the sequence elements in the designated queue are monitored, and the database and test software are installed based on the monitoring results of the sequence elements; the log monitoring program is started; the logs of the installation of the database and the test software are obtained; and the database test environment is successfully set up based on the logs of the installation of the database and the test software.

[0153] This invention provides a platform for deploying database testing environments. It allows users to select the database and testing software to be installed and automates the installation process, including automatic rollback in case of errors. This significantly reduces the preparation workload for database stress testing. Manual deployment of multiple testing environments simultaneously is not possible.

[0154] The method for building a database testing environment provided in this embodiment of the invention can be improved and optimized in several ways without departing from the technical solution of this invention, and these improvements and optimizations should also be considered within the scope of protection of this invention.

[0155] This invention provides a method for setting up a database testing environment. The method includes: starting a device monitoring program; monitoring sequence elements in a designated queue; installing the database and testing software based on the monitoring results of the sequence elements; starting a log monitoring program; obtaining logs of the installation of the database and the testing software; and confirming whether the database testing environment has been successfully set up based on the installation logs. The testing environment setup platform of this invention can deploy multiple database stress testing environments simultaneously, reducing deployment time. By using automated testing to automatically install the database and stress testing software according to a predetermined configuration, manual operation is reduced, errors caused by manual configuration are avoided, and workload is reduced.

[0156] Example 3

[0157] This invention provides a database testing environment setup device, such as... Figure 4 As shown, the device includes a preprocessing module, a first activation module, a processing module, a second activation module, an acquisition module, and a construction module.

[0158] In this embodiment, the preprocessing module is used to install the operating system and / or install remote connection and / or install the RPM binary package; the first enabling module is used to enable the device monitoring program;

[0159] The processing module is used to monitor the sequence elements in the specified queue and install the database and test software based on the monitoring results of the sequence elements.

[0160] The second module is used to enable the log listening program;

[0161] The acquisition module is used to acquire logs of the database and the test software installation;

[0162] The setup module is used to confirm whether the database test environment has been successfully set up based on the logs of the database and the test software installation.

[0163] Furthermore, the processing module is used to determine whether any sequence elements have entered the designated queue;

[0164] If yes, then determine the number of elements in the sequence; if no, then end the process.

[0165] The determination of the number of elements in the sequence includes:

[0166] Determine whether the number of elements in the sequence is less than or equal to a first threshold;

[0167] If yes, the installation operation type is determined based on the hash value of the sequence element; if no, the remaining sequence elements exceeding the first threshold enter the queuing state.

[0168] Furthermore, the processing module is also used to determine the installation operation type based on the hash value of the sequence element;

[0169] If the installation operation type is database, then the database installation script is imported according to the database object value, and the database is installed; if the installation operation type is test software, then the test software installation script is imported according to the test software object value, and the test software is installed.

[0170] Furthermore, the processing module is used to configure the RPM software manager;

[0171] Create the users and / or user groups for the database;

[0172] Configure the user's user environment;

[0173] Disable the system firewall and system security subsystem;

[0174] Modify system kernel parameters and limit system resources;

[0175] Modify the remote desktop display configuration file, download the database installation package, and install the database.

[0176] Furthermore, the processing module is also used to delete the user and user group and restore the installation files of the database when an error occurs during the installation of the database.

[0177] Furthermore, the setup module is used to determine whether to install the database and the test software simultaneously based on the installation logs of the database and the test software;

[0178] If yes, the database test environment has been successfully set up; otherwise, the sequence elements in the specified queue are monitored again, and the database and test software are installed based on the monitoring results of the sequence elements.

[0179] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows:

[0180] The technical solution provided in this invention uses an automated installation script and the sed and awk commands to automate multiple steps of modifying and creating files during the software installation process, reducing errors from manual modifications and shortening test preparation time. Furthermore, if software installation fails, it can automatically click "back" to modify parameters, achieving automated rollback and reducing testing workload.

[0181] Example 4

[0182] This invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can perform the following method for building a database testing environment:

[0183] Enable device monitoring program;

[0184] Listen to the sequence elements in the specified queue, and install the database and test software based on the listening results of the sequence elements;

[0185] Start the log listener;

[0186] Obtain logs of the installation of the database and the test software;

[0187] Confirm whether the database test environment has been successfully set up based on the installation logs of the database and the test software.

[0188] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows:

[0189] The technical solution provided by the embodiments of the present invention reduces errors in the process of manually configuring and installing databases and testing software, that is, reduces the amount of preparation work for database stress testing.

[0190] Example 5

[0191] This invention provides a computer storage medium, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:

[0192] Enable device monitoring program;

[0193] Listen to the sequence elements in the specified queue, and install the database and test software based on the listening results of the sequence elements;

[0194] Start the log listener;

[0195] Obtain logs of the installation of the database and the test software;

[0196] Confirm whether the database test environment has been successfully set up based on the installation logs of the database and the test software.

[0197] Furthermore, before activating the device monitoring program, the following steps are included:

[0198] Install the operating system and / or install remote connection and / or install the RPM binary package.

[0199] Furthermore, the step of monitoring the sequence elements in the designated queue and installing the database and test software based on the monitoring results of the sequence elements includes:

[0200] Determine whether any sequence elements have entered the designated queue;

[0201] If yes, then determine the number of elements in the sequence; if no, then end the process.

[0202] The determination of the number of elements in the sequence includes:

[0203] Determine whether the number of elements in the sequence is less than or equal to a first threshold;

[0204] If yes, the installation operation type is determined based on the hash value of the sequence element; if no, the remaining sequence elements exceeding the first threshold enter the queuing state.

[0205] Further, the step of determining the installation operation type based on the hash value of the sequence element includes:

[0206] The installation operation type is determined based on the hash value of the sequence element;

[0207] If the installation operation type is database, then the database installation script is imported according to the database object value, and the database is installed; if the installation operation type is test software, then the test software installation script is imported according to the test software object value, and the test software is installed.

[0208] Further, the step of importing the database installation script based on the object values ​​of the database and installing the database includes:

[0209] Configure RPM software manager;

[0210] Create the users and / or user groups for the database;

[0211] Configure the user's user environment;

[0212] Disable the system firewall and system security subsystem;

[0213] Modify system kernel parameters and limit system resources;

[0214] Modify the remote desktop display configuration file, download the database installation package, and install the database.

[0215] Furthermore, the step of importing the database installation script based on the object values ​​of the database and installing the database further includes:

[0216] If an error occurs during the installation of the database, delete the user and user group, and restore the installation files for the database.

[0217] Furthermore, confirming whether the database test environment has been successfully set up based on the logs of the database and the test software installation includes:

[0218] Determine whether to install the database and the test software simultaneously based on the installation logs of the database and the test software.

[0219] If yes, the database test environment has been successfully set up; otherwise, the sequence elements in the specified queue are monitored again, and the database and test software are installed based on the monitoring results of the sequence elements.

[0220] Figure 5 This is an exemplary system provided in Embodiment 5 of the present invention that can be used to implement the various embodiments described in this application;

[0221] like Figure 5As shown, in some embodiments, the system can serve as any of the aforementioned devices for setting up a database testing environment in each of the various embodiments. In some embodiments, the system may include one or more computer-readable media (e.g., system memory or NVM / storage device) having a result, and one or more processors (e.g., one or more processors) coupled to the one or more computer-readable media and configured to execute the result to implement the module thereby performing the actions described in this application.

[0222] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program using related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0223] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0224] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for setting up a database testing environment, characterized in that, The method is applied to a multi-test environment building platform, and the method includes: Enable device monitoring program; Listen to the sequence elements in the specified queue, and install the database and test software based on the listening results of the sequence elements; Start the log listener; Obtain logs of the installation of the database and the test software; Confirm whether the database test environment has been successfully set up based on the installation logs of the database and the test software. The step of monitoring the sequence elements in the designated queue and installing the database and test software based on the monitoring results includes: Determine whether any sequence elements have entered the designated queue; If yes, then determine the number of elements in the sequence; if no, then end the process. The determination of the number of elements in the sequence includes: Determine whether the number of elements in the sequence is less than or equal to a first threshold; If yes, the installation operation type is determined based on the hash value of the sequence element; if no, the remaining sequence elements exceeding the first threshold enter the queuing state. The step of determining the installation operation type based on the hash value of the sequence element includes: The installation operation type is determined based on the hash value of the sequence element; If the installation operation type is database, then the database installation script is imported according to the database object value, and the database is installed; if the installation operation type is test software, then the test software installation script is imported according to the test software object value, and the test software is installed. The step of importing the database installation script based on the object values ​​of the database and installing the database includes: Configure the package manager; Create the users and / or user groups for the database; Configure the user's user environment; Disable the system firewall and system security subsystem; Modify system kernel parameters and limit system resources; When an error occurs during the installation of the database, the branch of the installation script is executed, automatically deleting the user and user group, restoring the installation files of the database using text processing commands, and automatically implementing the ability to click the back button and modify parameters to achieve installation rollback. The text processing command processes data in the text file according to the script command.

2. The database testing environment setup method according to claim 1, characterized in that, Before activating the device monitoring program, the following steps are included: Install the operating system and / or install remote connectivity and / or install the package manager binary package.

3. The database testing environment setup method according to claim 1, characterized in that, The step of confirming whether the database test environment has been successfully set up based on the database and the test software installation logs includes: Determine whether to install the database and the test software simultaneously based on the installation logs of the database and the test software. If yes, the database test environment has been successfully set up; otherwise, the sequence elements in the specified queue are monitored again, and the database and test software are installed based on the monitoring results of the sequence elements.

4. A database testing environment setup apparatus for implementing the method as described in claim 1, characterized in that, The device includes: The first startup module is used to start the device monitoring program; The processing module is used to monitor the sequence elements in the specified queue and install the database and test software based on the monitoring results of the sequence elements. The second module is used to enable the log listening program; The acquisition module is used to acquire logs of the database and the test software installation; The setup module is used to confirm whether the database test environment has been successfully set up based on the logs of the database and the test software installation.

5. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 3.

6. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the memory, it implements the steps of the method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Application service processing method and device, terminal and storage medium

    CN110908859A

  • Universal software test environment automatic synchronization method

    CN111813683A