CN103092754A - Automatic test method of long distance multi-device condition - Google Patents

Automatic test method of long distance multi-device condition Download PDF

Info

Publication number
CN103092754A
CN103092754A CN2013100039204A CN201310003920A CN103092754A CN 103092754 A CN103092754 A CN 103092754A CN 2013100039204 A CN2013100039204 A CN 2013100039204A CN 201310003920 A CN201310003920 A CN 201310003920A CN 103092754 A CN103092754 A CN 103092754A
Authority
CN
China
Prior art keywords
device
script
test
ip address
expect
Prior art date
Application number
CN2013100039204A
Other languages
Chinese (zh)
Inventor
王淼
Original Assignee
上海斐讯数据通信技术有限公司
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 上海斐讯数据通信技术有限公司 filed Critical 上海斐讯数据通信技术有限公司
Priority to CN2013100039204A priority Critical patent/CN103092754A/en
Publication of CN103092754A publication Critical patent/CN103092754A/en

Links

Abstract

The invention discloses an automatic test method of a long distance multi-device condition. The automatic test method of the long distance multi-device condition comprises the following steps of obtaining a personal computer (PC) machine with a Linux operation system; obtaining an internet protocol (IP) address of each test device; arranging a storage block on the PC machine, storing all operation information, including the IP address of each test device and operation orders, in the storage block; running the information in the storage block through a SHELL script, achieving circulation of each IP address, calling a tool command language (TCL)/Expect script secure shell (SSH) to each IP address, and returning a login password, a login overtime time and the operation orders to the Expect script as parameters; and logging in each test device by the Expect script. The automatic test method of the long distance multi-device condition has the advantages of being simple, easy to achieve, and capable of reducing development cost of a test system, facilitating combined tests of test devices in a plurality of different locations, and being good in usability.

Description

一种远程多设备情况的自动化测试方法 An automated method for testing multi-device remote case

技术领域 FIELD

[0001] 本发明涉及一种自动化测试方法,尤其涉及一种远程多设备情况的自动化测试方法。 [0001] The present invention relates to a method for automated testing, and particularly to a multi-device remote case of automated test method.

背景技术 Background technique

[0002] 人们对于软件产品质量和可靠性不断提高的要求,以及人力成本的逐年攀升,都迫切要求公司具有既能节约成本又能保证测试质量的测试方法。 [0002] people for the quality and reliability of software products increasing demands, and labor costs rising year by year, urgently requires the company has not only save costs but also to ensure the quality of the method of testing. 尤其是当测试稳定性和性能时,当测试环境中存在多个设备,更甚者当多个设备都不在实验室,而是在不同的地方,比如在其他机房、室外、或路边电线杆上时,如何能节约人力、时间、简化测试流程又保证测试结果的正确性,是当前技术人员所面临的主要问题。 Especially when the test performance and stability, when there are multiple devices in a test environment, or worse still when a plurality of devices are not in the laboratory, but in different places, as in the other room, outdoors, or roadside poles when on, how can save manpower, time and simplify the testing process and ensure the accuracy of test results, the main problem faced by the current technical staff.

[0003] 当前测试人员手动进行检查的操作,通常需要以下几个步骤:1、远程登陆到每一个测试设备;2、手动输入uptime、cpu、free、ps、ifconfig、ping等操作命令,并把检查结果复制到本地;3、在检查结果中筛选出需要的数据;4、发送报告给相关人员。 [0003] checks the current operation manual testers, usually requires the following steps: 1, each remote access to test equipment; 2, manual input uptime, cpu, free, ps, ifconfig, ping operation command, etc., and the test results to the local copy; 3, selected data to the result of checking; 4, send a report to the relevant art. 上述方法不仅需要大量时间,还不能保证筛查数据的准确性。 The above method not only requires a lot of time, we can not guarantee the accuracy of screening data.

发明内容 SUMMARY

[0004] 针对上述存在的问题,本发明的目的是提供一种远程多设备情况的自动化测试方法,以提高当多个待测试设备不在实验室内时的测试精度,节约人力物力,简化测试流程。 [0004] For the above-described problems, an object of the present invention is to provide a multi-device remote case of automated test method, in order to improve the accuracy when testing a plurality of devices under test are not laboratory, saving manpower and resources, to simplify the testing process .

[0005] 本发明的目的是通过下述技术方案实现的: [0005] The object of the present invention is achieved by the following technical scheme:

[0006] 一种远程多设备情况的自动化测试方法,其中,包括下列步骤: [0006] A method of remote automated testing multi-device case, comprising the steps of:

[0007] 获取一台为Linux操作系统并支持发送邮件的PC机; [0007] Gets a Linux operating system and supports PC, send messages;

[0008] 获取每台测试设备的IP地址; [0008] Each test device to obtain an IP address;

[0009] 在所述PC机上设一存储块,在所述存储块中存放包括所述每台测试设备的IP地址和操作命令在内的所有运行信息; [0009] a storage block disposed on the PC, including the IP address of each storage device and all test run including the operation command information in said memory block;

[0010] 通过SHELL脚本运行所述存储块中信息,实现循环每个所述IP地址,调用TCL/Expect脚本SSH到每个所述IP地址,并将登陆密码、登陆超时时间及所述操作命令作为参数返回至所述Expect脚本中; [0010] By running the script information storage block SHELL, each cycle to achieve the IP address, calling TCL / Expect script to each of the SSH IP address, login and password, login and the operation command timeout Back to the Expect script as a parameter;

[0011] 所述Expect脚本登陆到所述每台测试设备将所述操作命令输入,并将测试结果保存在本地的日志文件中。 [0011] The login Expect script to each of the test device, the operation command input, and the test results are stored in a local log file.

[0012] 上述远程设备情况的自动化测试方法,其中,所述运行信息还包括接收测试结果的各个电邮地址。 [0012] The method of the above-described automated test case the remote device, wherein the operation information further includes a respective email address of the received test results.

[0013] 上述远程设备情况的自动化测试方法,其中,在最后一个步骤中,同时将测试结果数据通过所述PC机的邮件自动发送给相关人员。 [0013] The method of automated testing apparatus in the remote case in which, in a final step, while the test result data is automatically sent by e-mail to the related art PC's.

[0014] 上述远程设备情况的自动化测试方法,其中,在最后一个步骤中,使用脚本根据关键字将所述日志文件中重点数据抽取出来保存。 [0014] The method of automated testing apparatus in the remote case in which, in the last step, a script based on keywords in the log file stored key data extracted.

[0015] 上述远程设备情况的自动化测试方法,其中,还包括:设置在每天固定时间开始执行所述SHELL脚本。 [0015] The method of the above-described automated test case the remote device, wherein, further comprising: setting the SHELL script begin at a fixed time every day.

[0016] 与已有技术相比,本发明的有益效果在于: [0016] Compared with the prior art, the beneficial effects of the present invention:

[0017] 本发明所提供的方法具有简单易实现的优点,能够降低测试系统的开发成本,方便多个不同地点测试设备之间的联合测试,具有良好的可用性。 The method provided herein [0017] This has the advantage of simple and easy to implement, it is possible to reduce the development cost of the test system, to facilitate the joint between a plurality of different test locations test apparatus, with good usability.

附图说明 BRIEF DESCRIPTION

[0018] 图1是本发明远程多设备情况的自动化测试方法的流程示意框图。 [0018] FIG. 1 is a schematic block diagram of a process automation remote testing method of the present invention the case of multiple devices.

具体实施方式 Detailed ways

[0019] 下面结合原理图和具体操作实施例对本发明作进一步说明。 [0019] The following embodiments of the present invention will be further described in conjunction with the schematic and specific operation.

[0020] 如图1所示,在进行本发明时,需要提前知道所有测试设备的IP地址,并且需要一台Iinux系统的PC机,该PC机需支持SHELL脚本TCL脚本,且支持发送邮件,通过TCL/Expect脚本实现SSH到远程的设备和输出结果的保存,通过SHELL脚本实现对设备命令的输入,结果的筛选和整理。 [0020] 1, carrying out the present invention, it is necessary to know in advance IP addresses of all of the test equipment, and requires a system Iinux PC, the PC needs to support the TCL script SHELL script, and send messages to support, achieved by TCL / Expect scripts to save SSH remote device and output the results achieved through the input device SHELL command script to screen and sort the results.

[0021 ] 在本发明的优选实施例中,实现过程还包括: [0021] In a preferred embodiment of the present invention, further implementation process comprising:

[0022] 在PC机上设一存储块,在存储块中存放包括每台测试设备的IP地址和操作命令在内的所有运行信息,即将全部测试设备的IP地址、需要在测试设备上输入的所有命令、测试结果要告知的所有人的Email地址以固定格式保存至一个文本文件。 [0022] provided on a PC, a memory block, stores all operation information and the operation command including the IP address of each testing apparatus including the memory block, i.e. the IP address of all of the test equipment, the test equipment needs to enter all Email address command, the test results to inform the owners saved to a text file in a fixed format.

[0023] 通过SHELL脚本运行存储块中信息,实现循环每个IP地址,调用TCL/Expect脚本SSH到每个IP地址,并将登陆密码、登陆超时时间及在设备上需输入的命令作为参数带入到Expect脚本中。 [0023] SHELL script information by a memory block, each cycle to achieve IP address, calling TCL / Expect script SSH to each IP address, login and password, and a login timeout for an input device on the command as a parameter bands Expect into the script.

[0024] Expect脚本登陆到每个设备,输入命令,并将结果保存在本地的expect, log文件中。 [0024] Expect script to log in to each device, enter the command, and the results stored in the local expect, log file.

[0025] 使用SHELL脚本,根据关键字将expect, log文件中重点数据抽取出来保存,如当输入top命令时,会将至少十行的输出结果都保存下来,但实际需要的只是第一行的总数据,这就需要根据第一行的关键字,使用awk命令只将含有该关键字的行或者字段保存下来。 [0025] use SHELL script, based on keywords would expect, log file data extracted focus on preservation, such as when the top command input, the output will be at least ten lines are preserved, but the actual need is the first line total data, which requires a first row based on the keywords, the awk command only containing the keyword saved row or column. 期间可通过PING检查设备的连通性,并通过脚本将PING后不通的结果保存到最终文本中。 During may be saved after the final result to the PING nowhere by script text connectivity PING inspection apparatus, and.

[0026] 最后将筛选出来的最终数据文本通过PC机端的邮件发送给相关人员。 [0026] Finally, the final screened text data transmitted by e-mail to a related art PC-side.

[0027] 执行SHELL脚本前在linux PC机上使用crontab命令,设置在固定的时间开始执行脚本,如可设置为每周一至周五的早上五点开始执行脚本,这样当测试人员上班后,打开邮件即可看到所有设备的状态及筛查出来的异常数据。 [0027] Before executing SHELL script using the crontab command on linux PC machine, set at a fixed time to start executing the script, such as can be set every Monday to Friday at five o'clock start executing the script, so that when the testers work, open the mail you can see the status of all devices and screen out the anomaly data.

[0028] 本发明所提供的方法具有简单易实现的优点,能够降低测试系统的开发成本,方便多个不同地点测试设备之间的联合测试,具有良好的可用性。 [0028] The present invention provides a method has the advantage of simple and easy to implement, it is possible to reduce development cost test system, to facilitate the joint between a plurality of different test locations test apparatus, with good usability.

[0029] 以上对本发明的具体实施例进行了详细描述,但本发明并不限制于以上描述的具体实施例,其只是作为范例。 [0029] been described in detail above particular embodiments of the present invention, but the present invention is not limited to the specific embodiments described above, only as examples thereof. 对于本领域技术人员而言,任何等同修改和替代也都在本发明的范畴之中。 To those skilled in the art, any equivalent modifications and alternatives are also within the scope of the invention. 因此,在不脱离本发明的精神和范围下所作出的均等变换和修改,都应涵盖在本发明的范围内。 Accordingly, equalization changes and modifications without departing from the spirit and scope of the present invention made, shall fall within the scope of the present invention.

Claims (5)

1.一种远程多设备情况的自动化测试方法,其特征在于,包括下列步骤: 获取一台为Linux操作系统并支持发送邮件的PC机; 获取每台测试设备的IP地址; 在所述PC机上设一存储块,在所述存储块中存放包括所述每台测试设备的IP地址和操作命令在内的所有运行信息; 通过SHELL脚本运行所述存储块中信息,实现循环每个所述IP地址,调用TCL/Expect脚本SSH到每个所述IP地址,并将登陆密码、登陆超时时间及所述操作命令作为参数返回至所述Expect脚本中; 所述Expect脚本登陆到所述每台测试设备将所述操作命令输入,并将测试结果保存在本地的日志文件中。 1. An automated method of testing a multi-device remote situation, characterized by comprising the steps of: obtaining a support for the Linux operating system and the PC to send messages; Get IP address of each testing device; PC on the machine provided a storage block, the storage block is stored in all running information including the IP address and the operation command for each said test device including; by SHELL running the script information storage block, each of said cycles to achieve IP address, call TCL / Expect SSH script to each of the IP address and login password, login timeout and the return operation command as an argument to the Expect script; the script landed Expect each to the test the operation command input device, and the test results are stored in a local log file.
2.按权利要求1所述远程多设备情况的自动化测试方法,其特征在于,所述运行信息还包括接收测试结果的各个电邮地址。 2. The automated test method according to claim 1 in the case of the remote multi-device, wherein the operation information further includes a respective email address of the received test results.
3.按权利要求2所述远程多设备情况的自动化测试方法,其特征在于,在最后一个步骤中,同时将测试结果数据通过所述PC机的邮件自动发送给相关人员。 3. The method of automatic testing according to claim 2 of the remote multi-device case, which is characterized in that in a final step, while the sending test result data by the PC, an automatic message to the relevant art.
4.按权利要求1所述远程多设备情况的自动化测试方法,其特征在于,在最后一个步骤中,使用脚本根据关键字将所述日志文件中重点数据抽取出来保存。 4. The method of automatic testing according to claim 1 in the case of the remote multi-device, characterized in that in a final step, the extracted keywords according to a script saved focused data in the log file.
5.按权利要求1至4中任意一项所述远程设备情况的自动化测试方法,其特征在于,还包括:设置在每天固定时间开始执行所述SHELL脚本。 5. The method according to claim any one of the automated test equipment in the remote 1 to 4, characterized by further comprising: setting the SHELL script begin at a fixed time every day.
CN2013100039204A 2013-01-07 2013-01-07 Automatic test method of long distance multi-device condition CN103092754A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013100039204A CN103092754A (en) 2013-01-07 2013-01-07 Automatic test method of long distance multi-device condition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013100039204A CN103092754A (en) 2013-01-07 2013-01-07 Automatic test method of long distance multi-device condition

Publications (1)

Publication Number Publication Date
CN103092754A true CN103092754A (en) 2013-05-08

Family

ID=48205355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013100039204A CN103092754A (en) 2013-01-07 2013-01-07 Automatic test method of long distance multi-device condition

Country Status (1)

Country Link
CN (1) CN103092754A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412815A (en) * 2013-08-12 2013-11-27 浪潮电子信息产业股份有限公司 RMC software automated testing method mainly based on expect tool
CN104572379A (en) * 2015-01-29 2015-04-29 浪潮电子信息产业股份有限公司 RACK cabinet RMC login testing method
CN105007230A (en) * 2015-08-11 2015-10-28 上海斐讯数据通信技术有限公司 System and method for testing multiple wireless routers
CN105117311A (en) * 2015-08-07 2015-12-02 北京思特奇信息技术股份有限公司 System deployment environment inspection method and system
CN105138464A (en) * 2015-09-30 2015-12-09 沈文策 Program code processing method and device
CN105302682A (en) * 2015-11-26 2016-02-03 浪潮电子信息产业股份有限公司 Server test method, device and system
CN105512019A (en) * 2014-09-24 2016-04-20 腾讯科技(深圳)有限公司 Method and device for obtaining operating state of mobile terminal
CN105516359A (en) * 2016-01-19 2016-04-20 浪潮电子信息产业股份有限公司 Method for managing and operating SAS Switch JBOD (Just a Bunch Of Disks) by using telnet protocol
CN106445791A (en) * 2016-10-25 2017-02-22 广东浪潮大数据研究有限公司 Method for grabbing SAS Switch register data on SAS Switch whole cabinet

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080229149A1 (en) * 2007-03-14 2008-09-18 Clifford Penton Remote testing of computer devices
CN102455936A (en) * 2010-11-25 2012-05-16 中标软件有限公司 Trunk quick allocation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080229149A1 (en) * 2007-03-14 2008-09-18 Clifford Penton Remote testing of computer devices
CN102455936A (en) * 2010-11-25 2012-05-16 中标软件有限公司 Trunk quick allocation method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SARATH LAKSHMAN: "《Linux Shell脚本攻略》", 30 November 2011 *
张映: "linux expect自动登录ssh,ftp", 《BLOG.51YIP.COM/LINUX/1462.HTML》 *
田逸: "《互联网运营智慧》", 31 January 2011 *
脚本学堂: "监视远程磁盘的健康情况的shell脚本", 《HTTP://WWW.JBXUE.COM/ARTICLE/3974.HTML》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412815A (en) * 2013-08-12 2013-11-27 浪潮电子信息产业股份有限公司 RMC software automated testing method mainly based on expect tool
CN103412815B (en) * 2013-08-12 2017-02-08 郑州云海信息技术有限公司 RMC method of automated testing software-based expect a major tool
CN105512019A (en) * 2014-09-24 2016-04-20 腾讯科技(深圳)有限公司 Method and device for obtaining operating state of mobile terminal
CN104572379A (en) * 2015-01-29 2015-04-29 浪潮电子信息产业股份有限公司 RACK cabinet RMC login testing method
CN105117311A (en) * 2015-08-07 2015-12-02 北京思特奇信息技术股份有限公司 System deployment environment inspection method and system
CN105007230A (en) * 2015-08-11 2015-10-28 上海斐讯数据通信技术有限公司 System and method for testing multiple wireless routers
CN105138464A (en) * 2015-09-30 2015-12-09 沈文策 Program code processing method and device
CN105138464B (en) * 2015-09-30 2018-06-29 沈文策 Species program code processing method and apparatus
CN105302682A (en) * 2015-11-26 2016-02-03 浪潮电子信息产业股份有限公司 Server test method, device and system
CN105516359A (en) * 2016-01-19 2016-04-20 浪潮电子信息产业股份有限公司 Method for managing and operating SAS Switch JBOD (Just a Bunch Of Disks) by using telnet protocol
CN106445791A (en) * 2016-10-25 2017-02-22 广东浪潮大数据研究有限公司 Method for grabbing SAS Switch register data on SAS Switch whole cabinet

Similar Documents

Publication Publication Date Title
US20140033177A1 (en) Multi-platform test automation enhancement
US9491072B2 (en) Cloud services load testing and analysis
CN102075381A (en) Automatic test platform server and system applied to cloud storage
CN102323499A (en) Method for automatically testing relay protection equipment
US9374278B2 (en) Graphic user interface based network management system to define and execute troubleshooting procedure
CN103186457A (en) Method and device for automatically generating test case
CN102419727A (en) Automatic test method and device
US8352777B2 (en) Replaying captured network traffic
CN103377127B (en) Web product development test systems, test method and apparatus
CN103744784B (en) Mobile application testing methods and automation systems
US9886375B2 (en) Automated execution of functional test scripts on a remote system within a unit testing framework
US20130263090A1 (en) System and method for automated testing
CN102841846B (en) Hadoop Testing Method, apparatus, and systems based
US9575871B2 (en) System and method for dynamically debugging data in a multi-tenant database environment
CN104765678B (en) A method of testing an application on a mobile terminal apparatus and
CN104572444B (en) Kind of game performance cloud test platform and test methods
CN102135938B (en) Software product testing method and system
CN104794050A (en) Application program test method, device and system
CN101034366A (en) Computer testing system and method
Jayathilake Towards structured log analysis
CN103970661A (en) Method for batched server memory fault detection through IPMI tool
CN1302641C (en) Method and apparatus for processing wide band device fault positioning requesting
US8428900B2 (en) Universal quality assurance automation framework
US8539404B2 (en) Functional simulation redundancy reduction by state comparison and pruning
US9639452B2 (en) Automated update testing and deployment

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
RJ01