CN107766071A - 一种在linux下自动刷新IO firmware的方法 - Google Patents

一种在linux下自动刷新IO firmware的方法 Download PDF

Info

Publication number
CN107766071A
CN107766071A CN201710994303.3A CN201710994303A CN107766071A CN 107766071 A CN107766071 A CN 107766071A CN 201710994303 A CN201710994303 A CN 201710994303A CN 107766071 A CN107766071 A CN 107766071A
Authority
CN
China
Prior art keywords
firmware
product
automatically
refreshing
test
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.)
Pending
Application number
CN201710994303.3A
Other languages
English (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710994303.3A priority Critical patent/CN107766071A/zh
Publication of CN107766071A publication Critical patent/CN107766071A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种在linux下自动刷新IO firmware的方法,属于服务器测试领域,该方法通过执行测试刷新程序对IO firmware进行自动刷新,其操作步骤如下:将存储器I/O端的串口和网线连接到服务器端;运行自动测试程序;根据终端提示,扫描存储器产品外部的条码:自动测试程序通过串口读取该产品的firmware版本,对比判断该产品需要刷新的firmware文件;若该产品的firmware版本是最新的,不执行刷新程序,提示test pass后自动结束;若该产品的firmware版本不是最新版本,自动执行刷新程序。本发明操作简单,测试速度快,刷新效率高。

Description

一种在linux下自动刷新IO firmware的方法
技术领域
本发明涉及服务器测试领域,具体涉及一种在linux下自动刷新IO firmware的方法。
背景技术
随着目前服务器、存储器领域的不断发展与科技迅速进步,服务器、存储器的市场需求也越来越大,服务器、存储器的测试是出厂之前必经的程序,特别是存储端的测试极为重要。大批量的服务器、存储器生产也使得测试领域面临着严峻的挑战;高效能的测试对产品的工期有着至关重要的影响,能够按时的达成生产排配准时出货,不但关系到公司的信誉也代表一个公司的生产能力,同时也影响着客户的满意度。因此产品的测试能够高效的完成是至关重要的一个环节,无论是研发段还是生产线的测试。
发明内容
本发明的技术任务是提供一种在linux下自动刷新IO firmware的方法,通过运行自动测试程序实现IO firmware的自动刷新,操作简单,测试速度快,刷新效率高。
本发明解决其技术问题所采用的技术方案是:
一种在linux下自动刷新IO firmware的方法,该方法通过执行测试刷新程序对IOfirmware进行自动刷新,其操作步骤如下:
1)、将存储器I/O端的串口和网线连接到服务器端;
2)、运行自动测试程序;
3)、根据终端提示,扫描存储器产品外部的条码:
4)、自动测试程序通过串口读取该产品的firmware版本,对比判断该产品需要刷新的firmware文件;
5)、若该产品的firmware版本是最新的,不执行刷新程序,提示test pass后自动结束;若该产品的firmware版本不是最新版本,自动执行刷新程序。
进一步的,自动测试程序通过串口读取I/O的IP地址;然后通过网线进行自动刷新工作。
进一步的,所述firmware文件刷新成功后自动重启I/O,使刷新生效,开机后文件再次进行对比,如果刷新成功,提示test pass,刷新结束。
该方法的具体实现程序如下:
##############
# Main logic
##############
# allow easier debugging while forked
$DB::inhibit_exit=0;
$cmd="neptune_test --version";
@results=`$cmd`;
for(@results) {
chomp();
next unless(/^Version: ((.*)-(\d+)([^+-]*)(.*))/);
$fullVer=$1;
$ver=$2;
$relNum=$3;
$relLetter=$4;
$flag=$5;
last;
}
$ctrlfwRev = "20160626";
chomp($hostname=`hostname`);
open_log_file;
printout("both","Wrapper REV :$ctrlfwRev\n\n");
printout("both","PATP-III REV :$fullVer\n\n");
printout("both","HOST :$hostname\n\n");
printout("both","Start Time :" . `date "+%D %R"` . "\n");
printout("both", "log file : $debugLogfile\n\n");
get_options;
build_cmd_para;
$testStartTime=`date`;
{ # putting the following do-block within a block lets "last" work. Howobscure.
do {
check_mount;
get_user_input;
check_sfc;
# $spare=1; #for speacial build...
IOMs_type;
} until (1);
}
# Following two lines to make printout test start and end time string
# at the end not overwrite tee log, please don't remove them.
close(DLOG);
open(DLOG,">>$debugLogfile");
$testEndTime=`date`;
printout("both","Test started : $testStartTime");
printout("both","Test completed: $testEndTime");
close(DLOG);
system("cp $debugLogfile /NEPTUNE/PATP-III_logs");
exit(0);
###################
# End of Main logic
###################
sub get_user_input{
printout("both","Please scan upper IoM SERIAL Numbe : ");
chomp($uiomsn=<STDIN>);
$uiomsn=uc($uiomsn);
if(($uiomsn=~ /^7CE/ && length($uiomsn) == 10) ||
($uiomsn =~ (/^081.../ or /^862.../)&& length($uiomsn) == 17)||
($uiomsn =~ (/^11S/) && length($uiomsn) == 22)||
($uiomsn =~ (/^8S/) && length($uiomsn) == 23)||
($uiomsn =~ (/^GNRCFTJ.../ or /^DHSIFTJ.../) && length($uiomsn) == 18)) {
}else{
printout("both","$uiomsn is not a valid serial number for $type !\n");
exit;
}
}
sub printout {
$dest = shift;
$msg = shift;
if(($dest eq "log") or ($dest eq "both")) {
print DLOG $msg;
}
if($dest ne "log") {
print $msg;
}
}
sub mc_login {
$retry=15;
while($retry--) {
print("Log in...[$CS::COMPORT]\n");
@watch_mc = CS::serial( "", '(\/ #)|(login:)', 2, 1 );
@watch_mc = CS::serial( "manage", "[#:]", 60 );
sleep 1;
#print(@watch_mc);
if((grep {/Login incorrect/} @watch_mc) and $retry) {
print(" WARNING ! Initial login failed !\n");
sleep 5;
# $CS::COMPORT = "/dev/tty" . $comx;
@watch_mc = CS::serial( "manage", "[#:]", 60 );
}
sleep 1;
# $CS::COMPORT = "/dev/tty" . $comx;
@watch_mc = CS::serial( "!manage", "#", 60, 1 );
#print(@watch_mc);
if((grep {/Login incorrect/} @watch_mc) and $retry) {
print(" WARNING ! Initial login failed !\n");
sleep 5;
print(" ... retry " . (5-$retry)) . "\n";
} else {
$retry=0;
}
}
}
sub check_fw {
$fw_choice=`grep $gnrcfw /NEPTUNE/PATP-III_config/90-00003000-02.csv`;
($fw_pn, $bundle, $sc_want, $mem_want, $scl_want, $mc_want, $mcl_want, $ec_want, $cpld_want, $fwfil_name) = (split ',', $fw_choice);
$ctrl_not_ready = 1;
$ctrl="a";
while($ctrl_not_ready){
$retries++;
if ($retries > 5){
exit;
}
while (@SCs_got) {pop @SCs_got}
while (@MEMs_got) {pop @MEMs_got}
while (@SCLs_got) {pop @SCLs_got}
while (@MCs_got) {pop @MCs_got}
while (@SCLs_got) {pop @SCLs_got}
while (@ECs_got) {pop @ECs_got}
while (@CPLDs_got) {pop @CPLDs_got}
@resp1 = CS::serial("manage","[:#]",180);
@resp2 = CS::serial("!manage","#",180);
if (isTit) {
@CMD = CS::serial("show versions detail","#", 180, 0);
}else{
@CMD = CS::serial("show versions","#", 180, 0);
}
foreach(@CMD) {
if ($_ =~ /Storage Controller Code Version/) {
$sc_got = (split ':', $_)[1];
$sc_got =~ s/\s+//g;
push @SCs_got, $sc_got;
}
if ($_ =~ /Memory Controller FPGA Code Version/) {
$mem_got = (split ':', $_)[1];
$mem_got =~ s/\s+//g;
push @MEMs_got, $mem_got;
}
if ($_ =~ /Storage Controller Loader Code Version/) {
$scl_got = (split ':', $_)[1];
$scl_got =~ s/\s+//g;
push @SCLs_got, $scl_got;
}
if ($_ =~ /Management Controller Code Version/) {
$mc_got = (split ':', $_)[1];
$mc_got =~ s/\s+//g;
push @MCs_got, $mc_got;
}
if ($_ =~ /Management Controller Loader Code Version/) {
$mcl_got = (split ':', $_)[1];
$mcl_got =~ s/^\s//;
$mcl_got =~ s/\s$//;
#$mcl_got =~ s/\s+//g;
push @MCLs_got, $mcl_got;
}
if ($_ =~ /Expander Controller Code Version/) {
$ec_got = (split ':', $_)[1];
# $ec_got =~ s/\s$//;
$ec_got =~ s/\s+//g;
push @ECs_got, $ec_got;
}
if ($_ =~ /CPLD Code Version/) {
$cpld_got = (split ':', $_)[1];
$cpld_got =~ s/\s+//g;
push @CPLDs_got, $cpld_got;
}
}$FWs_got_A = @SCs_got[0] . "|" . @MEMs_got[0] . "|" . @SCLs_got[0] . "|"
. @MCs_got[0] . "|" . @MCLs_got[0] . "|" . @ECs_got[0] ."|" . @CPLDs_got[0];
$FWs_got_B = @SCs_got[1] . "|" . @MEMs_got[1] . "|" . @SCLs_got[1] . "|"
. @MCs_got[1] . "|" . @MCLs_got[1] . "|" . @ECs_got[1] ."|" . @CPLDs_got[1];
if ($ctrl eq "a"){
if(@SCs_got[0] eq "" || @MEMs_got[0] eq "" || @SCLs_got[0] eq"" || @MCs_got[0] eq ""
|| @MCLs_got[0] eq "" || @ECs_got[0] eq "" || @CPLDs_got[0] eq"" ){
$ctrl_not_ready = 1;
printout("both","Controller not ready!!!\n");
printout("both","$FWs_got_A\n\n");
sleep 30;
}else{
$ctrl_not_ready = 0;
}
}
}
$FWs_want = $sc_want . "|" . $mem_want . "|" . $scl_want . "|" . $mc_want . "|" . $mcl_want . "|" . $ec_want . "|" . $cpld_want;
printout("both"," FW want: $FWs_want\n");
if ($ctrl eq "a"){
printout("both","Controller A FW got : $FWs_got_A\n");
}
if ($ctrl eq "b"){
printout("both","Controller B FW got : $FWs_got_B\n\n");
}
if ($FWs_want eq $FWs_got_A){
return 1;
}else{
return 0;
}
}
sub ctrlfw_update {
unless (defined $com){
$CS::COMPORT = "/dev/tty" ."USB3";
}else{
#$CS::COMPORT = "/dev/tty" . uc($com);
}
unless($is_mer){mc_login}
CS::serial("set cli-parameters pager off", "#", 100);
@output = CS::serial("show shutdown-status", "#", 60);
foreach(@output){
if (/Storage Controller A up/i){
$sc_a_status = 1;
printout ("both","SC A is up\n");
}
if (/Storage Controller B up/i){
$sc_b_status = 1;
printout ("both","SC B is up\n");
}
}
if ($sc_a_status and $sc_b_status){
print "Both A and B are up, please shutdown the othercontroller!\n";
print "Then rerun the test.";
exit;
}
if($uiomsn !~ /GNRC|DHSI/){$sn6 = substr($udhsn,-6)}
else{$sn6 = substr($uiomsn,-6)}
@macs = ();
@output = CS::serial("show inq", "#", 60);
foreach (@output){
if($_ =~ /MAC Address:/){
$mac = (split /:\s+/, $_)[1];
$mac =~ s/\s+$//;
$mac =~ s/://g;
push @macs, $mac;
}
}
printout("both","macs: @macs\n");
if ($macs[0] =~ /$sn6/){$ctrl = "a"}
elsif ($macs[1] =~ /$sn6/){$ctrl = "b"}
else {
printout("both","Serial Number not match!\n");
printout("both","MAC-A: $macs[0], MAC-B: $macs[1], you scanned $uiomsn!\n\n");
exit;
}
# }
$CS::ctrl = $ctrl;
CS::get_ctrl_SN($ctrl);
$set_ip_address=$CS::set_ip_address;
printout("both", "Setting uniq IP address for controller $ctrl to $set_ip_address.\n");
printout("log", "COMMAND: set network-parameters ip $set_ip_addressnetmask 255.255.0.0 gateway 10.0.0.1 controller $ctrl\n");
$CMD = CS::serial(
"set network-parameters ip $set_ip_address netmask 255.255.0.0gateway 10.0.0.1 controller $ctrl","Success", 180, 1);
sleep 20;
$ip_address = CS::get_ip($ctrl);
printout("log", "The ip_address is $ip_address\n");
CS::serial("set cli-parameters pager off","Success",60,1);
# enable Telnet
my $telnet_S = "";
my $retry = 0;
until( $telnet_S eq "Enabled" ) {
@show_protocals = CS::serial( "showprotocols", "#", 60, 1);
foreach( @show_protocals ) {
if( $_ =~ /Telnet/ ) {
print "$_\n";
$telnet_S = ( split /:\s/,$_) [ 1 ];
}
}
print "\n";
if ($retry >= 5){ last }
if ($telnet_S eq "Disabled"){
print " Enable Telnet for$uiomsn / $CS::COMPORT ... Retry [$retry]\n";
my @set_protocols = CS::serial ("setprotocols telnet enabled", "(\^# )|(Do you want to continue\\ \\(y\\/n\\))",60 , 1);
if (grep {/Do you want tocontinue\ /} @set_protocols){ CS::serial ( "y", "#" ) }
sleep 15;
}
$retry++;
}
if ( $telnet_S ne "Enabled"){
print "\n Unable to Enable Telnet for UUT$slot / $CS::COMPORT\n";
exit 1;
}
本发明的一种在linux下自动刷新IO firmware的方法与现有技术相比,具有以下有益效果:
本方法可以测试所有类型的存储器中的I/O,测试速度快,定位问题准确,测试覆盖率高。我们通过此程式能能快速完成I/O firmware的刷新和测试部分,很大程度上提高生产速度,并且不会有人为配置时可能出现的错误、漏失等错误。
使用该方法可以降低操作复杂度并且减少人工输入命令的时间。该程序使用方便,操作简单,实用性较强,对于我们的一些问题分析及定位、生产提速等有很好的作用,较好的提高了存储端的测试效率与覆盖率,并可适用于任何存储器产品。该方法可以提高测试的测试效率和准确定位问题,并且节省人力和时间,提高工作效率。
附图说明
图1是本发明自动刷新IO firmware方法的流程框图。
具体实施方式
下面结合具体实施例对本发明作进一步说明。
一种在linux下自动刷新IO firmware的方法,该方法通过执行测试刷新程序对IOfirmware进行自动刷新,其操作步骤如下:
1)、将存储器I/O端的串口和网线连接到服务器端;
2)、运行上述的自动测试程序;
3)、根据终端提示,扫描存储器产品外部的条码:
4)、自动测试程序通过串口读取该产品的firmware版本,对比判断该产品需要刷新的firmware文件;
5)、若该产品的firmware版本是最新的,不执行刷新程序,提示test pass后自动结束;若该产品的firmware版本不是最新版本,自动执行刷新程序。
所述firmware文件刷新成功后自动重启I/O,使刷新生效,开机后文件再次进行对比,如果刷新成功,提示test pass,刷新结束。
自动测试程序通过串口读取I/O的IP地址;然后通过网线进行自动刷新工作。
该程式为linux 下perl 语言所编写,可应用于所有存储器产品,无论那种料号只要扫描条码就可以自动测试,减少了不必要的人机交互过程,节省人力、时间、成本等资源,操作简单无需经验也可完成相关操作,同时测试的覆盖率极高,任何的问题产品都会被拦截下来并准确定位问题。在提高硬盘背板测试准速度和准确性的同时又有极高的覆盖率又有完成的测试log保存,为公司节省了人力、时间、成本等资源,也减少了不必要的人机交互过程同时又确保出货质量。
整个过程都是由程式自动抓取信息,对比信息,判断信息,并将问题生成fail log打印在终端的同时也保存在服务器上,让测试有绝对的保障。
通过上面具体实施方式,所述技术领域的技术人员可容易的实现本发明。但是应当理解,本发明并不限于上述的具体实施方式。在公开的实施方式的基础上,所述技术领域的技术人员可任意组合不同的技术特征,从而实现不同的技术方案。

Claims (3)

1.一种在linux下自动刷新IO firmware的方法,其特征在于该方法通过执行测试刷新程序对IO firmware进行自动刷新,其操作步骤如下:
1)、将存储器I/O端的串口和网线连接到服务器端;
2)、运行自动测试程序;
3)、根据终端提示,扫描存储器产品外部的条码:
4)、自动测试程序通过串口读取该产品的firmware版本,对比判断该产品需要刷新的firmware文件;
5)、若该产品的firmware版本是最新的,不执行刷新程序,提示test pass后自动结束;若该产品的firmware版本不是最新版本,自动执行刷新程序。
2.根据权利要求1所述的一种在linux下自动刷新IO firmware的方法,其特征在于自动测试程序通过串口读取I/O的IP地址;然后通过网线进行自动刷新工作。
3.根据权利要求1所述的一种在linux下自动刷新IO firmware的方法,其特征在于所述firmware文件刷新成功后自动重启I/O,使刷新生效,开机后文件再次进行对比,如果刷新成功,提示test pass,刷新结束。
CN201710994303.3A 2017-10-23 2017-10-23 一种在linux下自动刷新IO firmware的方法 Pending CN107766071A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710994303.3A CN107766071A (zh) 2017-10-23 2017-10-23 一种在linux下自动刷新IO firmware的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710994303.3A CN107766071A (zh) 2017-10-23 2017-10-23 一种在linux下自动刷新IO firmware的方法

Publications (1)

Publication Number Publication Date
CN107766071A true CN107766071A (zh) 2018-03-06

Family

ID=61269166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710994303.3A Pending CN107766071A (zh) 2017-10-23 2017-10-23 一种在linux下自动刷新IO firmware的方法

Country Status (1)

Country Link
CN (1) CN107766071A (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109254789A (zh) * 2018-09-30 2019-01-22 美的集团股份有限公司 智能设备电控固件烧写方法、系统、智能设备及服务器
CN111722880A (zh) * 2020-05-11 2020-09-29 深圳市共进电子股份有限公司 一种设备生产方法、装置、终端设备及介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109254789A (zh) * 2018-09-30 2019-01-22 美的集团股份有限公司 智能设备电控固件烧写方法、系统、智能设备及服务器
CN109254789B (zh) * 2018-09-30 2023-06-20 美的集团股份有限公司 智能设备电控固件烧写方法、系统、智能设备及服务器
CN111722880A (zh) * 2020-05-11 2020-09-29 深圳市共进电子股份有限公司 一种设备生产方法、装置、终端设备及介质
CN111722880B (zh) * 2020-05-11 2024-02-09 深圳市共进电子股份有限公司 一种设备生产方法、装置、终端设备及介质

Similar Documents

Publication Publication Date Title
CN110879712B (zh) 一种云数据中心物理主机装机方法及相关装置
US20160034382A1 (en) Automated regression test case selector and black box test coverage tool for product testing
CN104461611A (zh) 一种rack机柜批量刷新节点bios的方法
WO2021129551A1 (zh) 一种测试pcba板的方法、系统、测试设备及微控制单元
CN107766071A (zh) 一种在linux下自动刷新IO firmware的方法
CN107896173A (zh) 自动化测试方法、测试设备、自动化测试系统及存储介质
US8751868B2 (en) Control server and method for switching running of test programs stored in multiple storage mediums of test server
CN105260208A (zh) 一种服务器自动批量刷新raid卡驱动的方法
CN104317618A (zh) 一种固件分区处理方法和装置
CN103592898A (zh) 一种电子产品生产自动化控制系统及方法
CN111462811A (zh) 自动化测试方法、装置、存储介质和电子设备
CN107688537A (zh) 测试方法、装置及前置机
CN112463510A (zh) 一种临时限速服务器测试系统的部署方法及装置
US9612944B2 (en) Method and system for verifying scenario based test selection, execution and reporting
CN104461651A (zh) 一种框架流程控制方法、装置及系统
CN108763098B (zh) 一种内存数据处理测试系统
CN112732556B (zh) 分布式系统的自动化测试方法、装置、设备及存储介质
CN111628910B (zh) 蜂窝通信终端协议栈ttcn软件测试系统
CN100395727C (zh) 媒体接入控制地址烧录方法
CN110888648A (zh) 一种交互界面生成自定义linux镜像的方法
CN106502845A (zh) 一种对服务器做ac开关机的自动化测试方法
CN107179919A (zh) 源码管理系统、应用程序管理方法及装置
CN110071848B (zh) 自动化测试命令行命令的方法、设备及存储介质
CN104468608B (zh) 应用程序接入方法、装置
CN105893192A (zh) 一种记录测试数据的方法及装置

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180306

WD01 Invention patent application deemed withdrawn after publication