From 997b4f6b5b5d17b8ad5e1b43c57bcb1057bb3efb Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 24 May 2016 09:11:39 -0400 Subject: [PATCH] sync xCATreg according to GA build --- xCAT-server/share/xcat/tools/xCATreg | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index 2ad97c79f..88084c575 100755 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -294,6 +294,12 @@ sub mn_install { } send_msg(2, "[$mn->$confkeys{$mn}][mn_install] installing $osimage for node $confkeys{$mn}................"); + + if( $arch =~ /x86_64/ || $arch =~ /ppc64le/ || $arch =~ /ppc64el/){ + &runcmd("rmvm $confkeys{$mn} -f -p "); + &runcmd("chdef $confkeys{$mn} mac= "); + &runcmd("mkvm $confkeys{$mn} -s 40G"); + } &runcmd("makedhcp -n"); &runcmd("makedns -n"); @@ -317,6 +323,11 @@ sub mn_install { send_msg(0, "[$mn->$confkeys{$mn}][mn_install] install $osimage for node $confkeys{$mn} failed"); return 1; } + + if($mn =~ /ubuntu/){ + system("xdsh $confkeys{$mn} \"rm -rf /bin/sh\" >/dev/null 2>&1"); + system("xdsh $confkeys{$mn} \"ln -s /bin/bash /bin/sh\""); + } # if($mn =~ /ubuntu/){ # system("updatenode $confkeys{$mn} -P \"confignics -s\" >/dev/null 2>&1"); # system("xdsh $confkeys{$mn} \"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\" >/dev/null 2>&1"); @@ -672,9 +683,9 @@ sub install_xcat { } #check if MN is installed successful - my $lsdefout = `ssh -t $confkeys{$mn} 'bash -l -i -c "lsdef -v"'`; - chomp($lsdefout); - if($lsdefout !~ /^lsdef - Version/ ){ + my $lsdefout = `xdsh $confkeys{$mn} '/opt/xcat/bin/lsdef -v'`; + chomp($lsdefout); + if($lsdefout !~ /lsdef - Version/ ){ send_msg(0, "[$mn->$confkeys{$mn}][install_xcat] install xcat in $mn failed"); return 1; } @@ -870,13 +881,15 @@ sub do_test { $rc=system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -t $diskfull_installation_flat_testcase\"' >/dev/null 2>&1"); send_msg(2, "[$mn->$confkeys{$mn}][do_test] do diskfull installation test in flat mode in $mn.....[done]"); last if($rc != 0); - + + if($mn =~ /ubuntux/){ #set up dockerhosts send_msg(2, "[$mn->$confkeys{$mn}][do_test] setupdockerhost $mn....."); $rc=system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -t $setup_dockerhost_testcase\"' >/dev/null 2>&1"); send_msg(2, "[$mn->$confkeys{$mn}][do_test] setup dockerhosts $mn.....[done]"); last if($rc != 0); - + } + #commands bundle in flat mode test send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing all commands test in flat mode in $mn....."); $rc=system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -b $batbundle\"' >/dev/null 2>&1");