From f83c3984507affb04dcbc6f6913fcf3a316ca65c Mon Sep 17 00:00:00 2001 From: baiyuan Date: Sun, 24 Nov 2013 20:53:58 -0500 Subject: [PATCH] enhance os value in testcase,adding os:rhels,os:sles support in cases0 --- xCAT-test/xcattest | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 5804f2c93..511fcfb43 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -21,7 +21,7 @@ my $cmd_list = undef; my $needshow = 0; my $restore = 0; my $ret = 0; - +my $string1 = undef; if ( !GetOptions("h|?" => \$needhelp, "f=s" => \$configfile, @@ -488,7 +488,16 @@ sub loadcase } }elsif($line =~ /^os\s*:\s*(\w[\w\,]+)/){ next if $skip; - $cases[$i]->{os}=$1; + $string1=$1; + if($string1 =~ /^rhels\s*/ && -f "/etc/redhat-release"){ + $cases[$i]->{os}="Linux"; + }elsif($string1 =~ /^sles\s*/ && -f "/etc/SuSE-release"){ + $cases[$i]->{os}="Linux"; + }else{ + $cases[$i]->{os}=$string1; + + } + if($cases[$i]->{os} !~ /$config{var}{OS}/){ push(@notrightcase, $cases[$i]->{name}); pop(@rightcase);