2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #1194 from junxiawang/05277NN

Modify xCATreg for rmvm bug 1068#, for docker support and ubuntu's bash issue
This commit is contained in:
tingtli 2016-06-08 15:35:23 +08:00
commit 1e4e8e9581

View File

@ -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");
@ -326,6 +332,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");
@ -679,9 +690,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;
}
@ -877,13 +888,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);
#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);
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");