2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 11:10:24 +00:00

Merge pull request #1076 from hu-weihua/SN1075

Fix bug1075 update SN_setup_case case
This commit is contained in:
tingtli
2016-05-09 20:34:38 +08:00
2 changed files with 5 additions and 16 deletions

View File

@@ -12,11 +12,11 @@ sleep 300;
my $timecnt=0;
while($timecnt < 200){
my $booted=system("lsdef -l $snnodename|grep status|grep booted");
my $booted=system("lsdef -l $snnodename|grep status|grep booted > /dev/null 2>&1");
last if($booted==0);
if($os =~ /rhel/i && $arch =~ /^ppc64$/i){
my $booting=system("lsdef -l $snnodename|grep status|grep booting");
my $booting=system("lsdef -l $snnodename|grep status|grep booting > /dev/null 2>&1");
system("xdsh $snnodename \"echo 1\"") if($booting==0);
`echo "send signal to $snnodename for the $timecnt times" >> $log`;
}

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env perl
$ENV{TERM} = "xterm-256color";
my $os=$ARGV[0];
my $arch=$ARGV[1];
my $log="/tmp/pre_deploy_sn.log";
@@ -13,20 +15,7 @@ sub runcmd{
}
}
my $setupmysqlscript="#!/usr/bin/expect -f
set timeout -1
spawn mysqlsetup -i
expect \"in the MySQL database:\"
send \"12345\\r\"
expect \"in the MySQL database:\"
send \"12345\\r\"
interact
";
my $cmd = "echo '$setupmysqlscript' > /tmp/setupmysqlscript && chmod +x /tmp/setupmysqlscript";
runcmd("$cmd");
$cmd="bash -lic \"/tmp/setupmysqlscript > /tmp/setupmysqlscript.rst\" ";
$cmd="XCATMYSQLADMIN_PW=12345 XCATMYSQLROOT_PW=12345 /opt/xcat/bin/mysqlsetup -i -V";
runcmd("$cmd");
$cmd="echo \"GRANT ALL on xcatdb.* TO xcatadmin@\'%\' IDENTIFIED BY \'12345\'\;\" | mysql -u root -p12345";