CN111444104B - OpenStack function test method - Google Patents

OpenStack function test method Download PDF

Info

Publication number
CN111444104B
CN111444104B CN202010247882.7A CN202010247882A CN111444104B CN 111444104 B CN111444104 B CN 111444104B CN 202010247882 A CN202010247882 A CN 202010247882A CN 111444104 B CN111444104 B CN 111444104B
Authority
CN
China
Prior art keywords
test
openstack
job
information
executing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010247882.7A
Other languages
Chinese (zh)
Other versions
CN111444104A (en
Inventor
宋洪圆
蔡卫卫
谢涛涛
宋伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Huimao Electronic Port Co Ltd
Original Assignee
Shandong Huimao Electronic Port Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Huimao Electronic Port Co Ltd filed Critical Shandong Huimao Electronic Port Co Ltd
Priority to CN202010247882.7A priority Critical patent/CN111444104B/en
Publication of CN111444104A publication Critical patent/CN111444104A/en
Application granted granted Critical
Publication of CN111444104B publication Critical patent/CN111444104B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention provides an OpenStack functional test method, which relates to the field of OpenStack functional test, and can automatically run a functional test pod after a hell deploys a containerized OpenStack cluster by only configuring environment variables (test network information, mirror image warehouse address and name, openStack authentication information and the like) specific to the environment in a basic configuration file, and start a jobe for initializing test Keystone information, a jobe for running the functional test and a jobe for exporting a test report. And establishing OpenStack basic resources required by the functional test, executing the functional test, and finally exporting a test report. The automatic function test system has the advantages that the automatic function test after cluster deployment is completed is realized, the production deployment and test efficiency is improved, and the delivery flow is optimized.

Description

OpenStack function test method
Technical Field
The invention relates to a function test technology, in particular to an OpenStack function test method.
Background
With the rise of containerization technology and the continuous optimization of a container arrangement engine, meanwhile, the containerization mode has the advantages of high deployment and recovery speed, convenience in operation and maintenance, high availability of service, elastic expansion, rapid capacity expansion, visualization of a container warehouse, rolling upgrade and the like, so that more and more manufacturers and users use the containerization mode to deploy OpenStack related components.
In a containerized OpenStack cluster deployed in a Kubernets environment, an OpenStack cluster is deployed by using Helm, helm is a package manager for the Kubernets, and functions of software deployment, deletion, upgrading, rollback and packaging, application dependency management, application version management, application warehouse release and application and the like on the Kubernets can be realized through Helm. Helm makes the release configurable, thereby simplifying the application deployment and maintenance in the Kubernetes cluster.
After the OpenStack cluster deployment is completed, the OpenStack cluster is generally subjected to functional testing by using Tempest. The Tempest is an open source item for providing an integrated function test for the OpenStack of the cloud computing platform, and comprises an API test case and a scene of OpenStack basic components (nova, keystone, pane, neutron, shader and the like). The OpenStack test platform is established based on unittest2 and noses, is flexible and easy to expand and maintain, and enables the related test efficiency of OpenStack to be greatly improved.
The OpenStack-Helm project comprises a basic function of a Tempest test and is used for performing functional test on an OpenStack cluster deployed in a Kubernets environment, the OpenStack-Helm is a sub-project of the OpenStack, a group of Helm charts which are used for deploying OpenStack related services on the Kubernets cluster simply and flexibly is provided, but the Tempest function in the OpenStack-Helm is incomplete, and a test basic resource cannot be automatically created after the OpenStack cluster is deployed, a functional test is performed, and a test report is generated.
After the OpenStack cluster deployed in the production environment is completed, functions of components of the cluster need to be tested, and a Tempest component is used for commonly used function testing. In a containerized OpenStack cluster deployed in a kubernets environment, components of the OpenStack are deployed and managed in a palm mode, after the OpenStack cluster is deployed and completed through the palm, a user generally needs to manually create preset resources required by tests such as networks, subnets, routes, mirror images, virtual machine specifications and the like in the environment, then install a OpenStack functional test component Tempest, or use Rally to run a Tempest test, and finally export a test report. The process is complicated, certain OpenStack test priori knowledge is required for operation and maintenance personnel to accumulate, and the cost of deployment and delivery is increased.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method for automatically testing functions of OpenStack clusters deployed in Kubernetes, which can automatically run a function test pod after the OpenStack clusters are deployed and completed by allocating environment specific environment variables (test network information, mirror image warehouse address and name, openStack authentication information and the like) in a basic configuration file, and start a job for initializing test Keystone information, a job for running the function test and a job for exporting a test report. And the OpenStack basic resource required by the functional test is created, the functional test is executed, and finally, a test report is exported. The automatic function test system has the advantages that the automatic function test operation after the cluster deployment is completed is realized, the production deployment and test efficiency is improved, and the delivery flow is optimized.
The technical scheme of the invention is as follows:
a method for OpenStack functional testing comprises the following steps:
(1) Executing the job of basic information of the initialized function test keystone by defining a job template;
(2) Clearing up the last functional test environment resource by executing a tempest clear-init-saved-state command;
(3) Yaml, a script is introduced to initialize variables required in the pre-fabricated environment, which mainly include: environment OpenStack authentication information, external network information, shared network information, mirror image information, virtual machine specification information, and the like;
(4) Importing an export command into an OpenStack environment variable by introducing a value.yaml middle script II;
(5) And calling the OpenStack Client to check and create a preset environment required by functional test by introducing a value.yaml middle script II, wherein the preset environment mainly comprises the following steps: checking and creating network, route, mirror image, virtual machine specification, etc.;
(6) Cleaning up the function testing environment resource by executing the tempest clear command again;
(7) By defining the job template, the job derived by the function report is initialized.
Further, in the step (1), a jobtemplate for initializing the keystone information is defined by a palm-toolkit, games, jobks _ ks _ user, and a job for executing the function test job is executed after executing the job for initializing the keystone information by dependencies definition in values.
Further, in the step (2), before the functional test, the environmental information remained in the previous test is cleared;
further, in the step (3), by extracting variables required for the functional test from values.yaml, a user only needs to explicitly define the variables without concerning a specific process of test execution and optimizing the test process, on the other hand, unknown resource variables (including id, network ip and the like) are set as occupation of special identifiers, after the resources are created, corresponding variables are obtained, and a sed command is used for replacing corresponding identifiers in the configuration file;
still further, in the step (4), the variable defined above is introduced into the test environment by executing the script two in values.
Further, in the job of executing the function test in the step (5), an openstack client command is executed by executing a script two in values.yaml, resources such as an external network and a subnet, a fix network and a subnet, a route, a mirror image, a virtual machine specification and the like are checked and created, then corresponding id information is obtained, a sed command is used for replacing a special placeholder of a corresponding variable in the original configuration file, and a pvc persistent storage test report is used after the function test is finished.
Further, in the step (6), after the function test is completed, the temporary resource created by the test is cleared.
Further, in the step (7), the report export is completed through a job for exporting the custom function test report. Importing a pvc persistent storage test report into a job of exporting a functional test report in the job of the functional test, and adding a nut.sh/hook of a post-install and post-upgrade to realize that the job of exporting the functional test report is executed after the functional test job is finished.
The invention has the advantages that
A user only needs to configure environment specific variables before testing, after the containerized OpenStack cluster is deployed, preset resources required by cluster function test creation, function test execution and test report jobexport can be executed, a series of work of OpenStack cluster function test can be automatically completed, the deployment test process is simplified, and the test efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of an OpenStack functional testing basic framework;
fig. 2 is a basic flow diagram of a jobe running OpenStack functional test.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, it is obvious that the described embodiments are some, but not all embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
As shown in the figure, the first and second,
figure 1 shows the OpenStack functional testing basic framework.
1. Initializing OpenStack functional test Keystone information job;
2. OpenStack functional test basic framework core: running a function test job;
3. exporting a joba functional test report of OpenStack;
fig. 2 shows a basic flow of running the OpenStack functional test joba.
1. Executing a tempest clear-init-saved-state to clean up historical test residual environment resources;
2. defining a basic variable required by introducing an initialization test resource in a script I;
3. a command for loading authentication information required by the OpenStack command is introduced into the second definition script;
4. defining a command of introducing inspection and creating basic environment resources required by the test of a script II;
5. and executing the tempest run to execute the OpenStack functional test case.
The method mainly comprises three main processes, namely initializing function test Keystone information, operating OpenStack function test and exporting an OpenStack function test report. The method comprises the following specific steps:
1. and self-defining a job help template file for initializing Keystone information.
Generating a jobtemplate file of job initializing Keystone information (including authentication information of a creation test user, a project and the like) by referring to openstack-palm-infra, palm-toolkit, requirements, job _ ks _ user; the job contains primarily a containers that initiates the script that creates the test related KeyStone information by executing the/tmp/ks-user.
2. Custom jobs' helm template file for running OpenStack functional test
First, initcontacts (containers that define conditions that need to be pre-made or pre-satisfied first in the contacts' execution) are initialized by referencing openstack-film-infra, film-toolkit, snippets, kubberenets _ entrypoint _ init _ contacts in the initcontacts. Meanwhile, configuring a job of a dependency, static, run _ tests, job, -tempest-ks-user configuration running function test container in values, yaml, and needing to step one job of Keystone information of initialization function test, so that after the job of Keystone information of initialization function test is completed, running the job of OpenStack function test; the job running the functional test mainly contains a containers, and starts the functional test script by executing the/tmp/run-tests. Whether the pvc in the values is enabled or not is introduced into spec, template, spec, contacts, volumes, and name, test-report, persistence, volume, and name, so that the test report is imported into the pvc (a persistent storage volume because resources are released after each jobs is executed and need to be stored in the persistent storage volume) after the test execution is completed.
3. Custom test report exported job's helm template file
Firstly, by defining a hook (intervention can be carried out at some point in a release life cycle) of post-install and post-upgrade in metadata.options, after executing the job of the function test in the step two, operating the job derived from the test report; the job derived from the test report mainly comprises a contiiners, and after waiting for several seconds, executing a cp command to copy the test report generated in the initialization function test to a specified address in the contiiners in pvc for the user to refer.
The second phase in the above steps is the core part of the OpenStack automation function test. This process is implemented by defining run-tests.sh in config-bin.yaml, which mainly includes the following five stages:
1) Clearing up the last functional test environment resource by executing a tempest clear-init-saved-state command;
2) Yaml, a script is introduced to initialize variables required in the pre-fabricated environment, which mainly include: environment OpenStack authentication information, external network information, shared network information, mirror image information, virtual machine specification information, and the like.
3) And importing the OpenStack environment variable by introducing a script II in values.
4) And calling OpenStack Client to check and create a preset environment required by the functional test by introducing a second script in values. External networks and subnets, shared networks and subnets, routing from the external networks to the shared networks, testing mirror images, virtual machine specifications, etc., to achieve function testing preset resource allocation. For resource id information needing to be configured in some function test config files, because the resource id information is not created during introduction, the id cannot be obtained, a variable which is not generated by a special identifier can be defined in values.yaml in advance, after the preset resources created by the script II are created, the OpenStack Client is called to obtain information such as relevant resource id, network name and address, a sed command is used, a query result replaces the special identifier in the configuration file, and the function test config file configuration is completed.
5) And (3) executing a test run command by introducing a value.yaml middle script III, starting an OpenStack functional test, and finally executing a test clear command to clear temporary resources created in the test.
The above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (5)

1. A method for OpenStack functional test is characterized in that,
the method comprises the following steps:
(1) Executing the job of basic information of the initialized function test keystone by defining a job template;
(2) Clearing up the last functional test environment resource by executing a tempest clear-init-saved-state command;
(3) Yaml, script-initializing variables needed in the pre-fabricated environment by introducing values, including: environment OpenStack authentication information, external network information, shared network information, mirror image information, virtual machine specification information;
(4) Importing an export command into an OpenStack environment variable by introducing a value.yaml middle script II;
(5) And calling OpenStack Client to check and create a preset environment required by functional test by introducing a second script in values.yaml, wherein the preset environment comprises the following steps: checking and creating network, route, mirror image and virtual machine specifications; a third script in values.yaml is introduced to execute a template run command, and an OpenStack functional test is started;
(6) Cleaning up the function testing environment resource by executing the tempest clear command again;
(7) Executing the job exported by the initialized function report by defining a job template;
in the step (1), a jobtemplate of initialization keystone information is defined by using a palm-toolkit, requirements, jobs _ ks _ user, and a job of running functional test is executed after executing the jobs of the initialization keystone information through dependencies definition in values, yaml;
in the step (3), the variables required by the function test are extracted from values.yaml, and the user only needs to explicitly define the variables; on the other hand, setting unknown resource variables as special identifier occupation, acquiring corresponding variables after the resources are created, and replacing corresponding identifiers in the configuration file by using sed commands;
in the step (7), the report export is completed through the job exported by the user-defined function test report; importing a pvc persistent storage test report into a job of a function test to export the function test report, and adding a nut-insert and nut-upgrade's hell.sh/hook to implement the job of exporting the test report after the function test job is finished.
2. The method of claim 1,
in the step (2), the environmental information remained in the previous test is cleared before the functional test.
3. The method of claim 1,
in the step (4), defined variables are imported into the test environment by executing the script two in values.
4. The method of claim 1,
executing an openstack client command by executing a script II in values.yaml in the job for executing the function test in the step (5), checking and creating external networks and subnets, fix networks and subnets, routes, mirror images and virtual machine specifications, then acquiring corresponding id information, replacing corresponding special placeholders in the original configuration file by a sed command, and persistently storing a test report by using pvc after the function test is finished.
5. The method of claim 1,
and (6) removing the temporary resources created by the test after the function test is finished.
CN202010247882.7A 2020-04-01 2020-04-01 OpenStack function test method Active CN111444104B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010247882.7A CN111444104B (en) 2020-04-01 2020-04-01 OpenStack function test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010247882.7A CN111444104B (en) 2020-04-01 2020-04-01 OpenStack function test method

Publications (2)

Publication Number Publication Date
CN111444104A CN111444104A (en) 2020-07-24
CN111444104B true CN111444104B (en) 2023-04-07

Family

ID=71650980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010247882.7A Active CN111444104B (en) 2020-04-01 2020-04-01 OpenStack function test method

Country Status (1)

Country Link
CN (1) CN111444104B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419952B (en) * 2021-06-22 2023-06-27 中国联合网络通信集团有限公司 Cloud service management scene testing device and method
CN113434251B (en) * 2021-06-25 2023-05-02 竹间智能科技(上海)有限公司 Cross-platform deployment method, device and equipment for service modules
CN113791941A (en) * 2021-09-15 2021-12-14 华云数据控股集团有限公司 Method for automatically testing stability of OpenStack cluster and application
CN116303067B (en) * 2023-03-24 2024-03-22 安超云软件有限公司 Testing method, device, equipment and medium based on cloud testing platform

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7272822B1 (en) * 2002-09-17 2007-09-18 Cisco Technology, Inc. Automatically generating software tests based on metadata
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
JP2016115182A (en) * 2014-12-16 2016-06-23 日本電信電話株式会社 Virtual equipment test device, virtual equipment test method and virtual equipment test program
WO2017012219A1 (en) * 2015-07-17 2017-01-26 中兴通讯股份有限公司 Software test method, apparatus and system
CN107368425A (en) * 2017-08-25 2017-11-21 郑州云海信息技术有限公司 A kind of openstack method of testings
CN107515823A (en) * 2017-08-16 2017-12-26 郑州云海信息技术有限公司 A kind of method for generating configuration file
CN109582588A (en) * 2018-12-25 2019-04-05 迈普通信技术股份有限公司 Method for generating test case, device and electronic equipment
CN109656686A (en) * 2018-12-17 2019-04-19 武汉烽火信息集成技术有限公司 The upper deployment container cloud method of OpenStack, storage medium, electronic equipment and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227344B (en) * 2015-08-21 2019-03-22 烽火通信科技股份有限公司 Software defined network simulation system and method based on OpenStack
WO2017144432A1 (en) * 2016-02-26 2017-08-31 Nokia Solutions And Networks Oy Cloud verification and test automation
CN106506636A (en) * 2016-11-04 2017-03-15 武汉噢易云计算股份有限公司 A kind of cloud platform cluster method and system based on OpenStack
CN107315950B (en) * 2017-05-03 2020-10-09 北京大学 Automatic division method for minimizing authority of cloud computing platform administrator and access control method
US10534695B2 (en) * 2018-03-30 2020-01-14 Atlassian Pty Ltd Systems and methods for initializing test environments
CN109947536A (en) * 2019-03-25 2019-06-28 山东浪潮云信息技术有限公司 A kind of PostgreSQL Automation arranging method based on Kubernetes

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7272822B1 (en) * 2002-09-17 2007-09-18 Cisco Technology, Inc. Automatically generating software tests based on metadata
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
JP2016115182A (en) * 2014-12-16 2016-06-23 日本電信電話株式会社 Virtual equipment test device, virtual equipment test method and virtual equipment test program
WO2017012219A1 (en) * 2015-07-17 2017-01-26 中兴通讯股份有限公司 Software test method, apparatus and system
CN107515823A (en) * 2017-08-16 2017-12-26 郑州云海信息技术有限公司 A kind of method for generating configuration file
CN107368425A (en) * 2017-08-25 2017-11-21 郑州云海信息技术有限公司 A kind of openstack method of testings
CN109656686A (en) * 2018-12-17 2019-04-19 武汉烽火信息集成技术有限公司 The upper deployment container cloud method of OpenStack, storage medium, electronic equipment and system
CN109582588A (en) * 2018-12-25 2019-04-05 迈普通信技术股份有限公司 Method for generating test case, device and electronic equipment

Also Published As

Publication number Publication date
CN111444104A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
CN111444104B (en) OpenStack function test method
CN110389900B (en) Distributed database cluster testing method and device and storage medium
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
CN108763090B (en) Test environment deployment method, device, computer equipment and storage medium
CN112424750A (en) Multi-cluster supply and management method on cloud platform
CN112424751A (en) Cluster resource allocation and management method on cloud platform
CN109298868B (en) Intelligent dynamic deployment and uninstallation method for mapping image data processing software
US20080051921A1 (en) Method for modifying configuration of business system
CN112527349A (en) Dynamic deployment strategy optimization and continuous deployment service guarantee system
CN113127150B (en) Rapid deployment method and device of cloud primary system, electronic equipment and storage medium
CN111198695A (en) Automatic deployment method of micro-service administration management platform and electronic equipment
CN112269640B (en) Method for realizing life cycle management of container cloud component
CN112631614B (en) Application deployment method, device, computer equipment and storage medium
CN109240716B (en) Big data platform version management and rapid iterative deployment method and system
CN112035121B (en) Edge application deployment method and system
CN115292026B (en) Management method, device and equipment of container cluster and computer readable storage medium
CN111813420A (en) Method for carrying out automated performance test on OpenStack cluster
CN113779477A (en) Assembly line publishing method and system based on PaaS cloud platform
CN111459530B (en) Patching method, device and storage medium
CN113900670B (en) Cluster server application deployment system
CN112379934A (en) Deployment method and device of cloud computing platform and storage medium
CN114253564A (en) Container cluster mirror image template generation method and device
CN115113975A (en) Cluster management method and device, electronic equipment and storage medium
CN115051846A (en) Deployment method of K8S cluster based on super fusion platform and electronic equipment
CN114461249A (en) Micro-service deployment method, device, code server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant