2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Merge pull request #2539 from neo954/postgresql-testcase

Add PostgreSQL support in test case pre_deploy_sn
This commit is contained in:
Weihua Hu 2017-03-20 17:10:17 +08:00 committed by GitHub
commit fc4c75d33e
2 changed files with 18 additions and 5 deletions

View File

@ -1,7 +1,7 @@
start:SN_setup_case
os:Linux
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
check:rc==0
cmd:chtab key=nameservers site.value="<xcatmaster>"

View File

@ -16,11 +16,24 @@ sub runcmd {
}
}
$cmd = "XCATMYSQLADMIN_PW=12345 XCATMYSQLROOT_PW=12345 /opt/xcat/bin/mysqlsetup -i -V";
runcmd("$cmd");
if ($ENV{XCAT_DATABASE} eq "PostgreSQL") {
$cmd = "XCATPGPW=12345 /opt/xcat/bin/pgsqlsetup -i -V";
runcmd("$cmd");
$cmd = "echo \"GRANT ALL on xcatdb.* TO xcatadmin@\'%\' IDENTIFIED BY \'12345\'\;\" | mysql -u root -p12345";
runcmd("$cmd");
open(my $fh, '>>', '/var/lib/pgsql/data/pg_hba.conf') or die("failed open file /var/lib/pgsql/data/pg_bha.conf");
print $fh "host all all 0.0.0.0/0 md5\n";
print $fh "host all all ::0/0 md5\n";
close $fh;
$cmd = "service postgresql restart"
runcmd("$cmd");
} else {
$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";
runcmd("$cmd");
}
my $xcatballpath = "/install/post/otherpkgs/$os/$arch/xcat";
$cmd = "mkdir -p $xcatballpath/xcat-core && cp -r /xcat-core/* $xcatballpath/xcat-core && cp -r /xcat-dep $xcatballpath";