2014-03-19 00:15:48 -04:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
# IBM(c) 2010 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
#
|
|
|
|
#############################################################################################################################################
|
|
|
|
#
|
|
|
|
# This script will be used to run xCAT daily regression
|
|
|
|
#
|
|
|
|
# Usage:xCATreg - Run xCAT daily regression
|
|
|
|
# xCATreg [-?|-h]
|
|
|
|
# xCATreg [-b branch][-m MN][-f configure file][-a][-V]
|
|
|
|
#
|
|
|
|
# -?/-h: help information for the xCATreg usage.
|
|
|
|
# -b: when -b is specified, the regression will be done against the specified branch. You can use 2.7, 2.8,master.The default value is master.
|
|
|
|
# -m: when -m is specified, the regression will be done the specified mn. The default value is all the mn in configuration file.
|
|
|
|
# -f :specify the configuration file,default value is /xCATreg/regresson.conf
|
|
|
|
# -a: when -a is specified, run the regression even there is no code updates
|
|
|
|
# -V: log and message in verbose mode
|
|
|
|
#
|
|
|
|
# Example usage:
|
|
|
|
# ./xCATreg Run regressoins on master branch and on all platforms in configuration file
|
|
|
|
# ./xCATreg -b 2.8 -m slesmn -f /root/regressoin.conf -a Run regression on 2.8 branch on slesmn even when there is no code updates.
|
|
|
|
#
|
|
|
|
#############################################################################################################################################
|
|
|
|
|
2014-03-24 01:39:31 -07:00
|
|
|
#######################################
|
|
|
|
# step 1. Parse arguments
|
|
|
|
#######################################
|
|
|
|
my %reghash = arg_phase();
|
|
|
|
unless (%reghash) {
|
|
|
|
send_msg("PARSE ARGUMENTS returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 2. Read configuration files
|
|
|
|
#######################################
|
|
|
|
my %confhash = read_conf();
|
|
|
|
unless (%confhash) {
|
|
|
|
send_msg("READ CONF returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 3. Install MNs
|
|
|
|
#######################################
|
|
|
|
$res = mn_install();
|
|
|
|
if ($res) {
|
|
|
|
send_msg("INSTALL MNS returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 4. Copy code to MNs
|
|
|
|
#######################################
|
|
|
|
$res = copy_code();
|
|
|
|
if ($res) {
|
|
|
|
send_msg("COPY CODE returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 5. Build xcat code in MNs
|
|
|
|
#######################################
|
|
|
|
$res = build_xcat();
|
|
|
|
if ($res) {
|
|
|
|
send_msg("BUILD XCAT returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 6. Configure xCAT MN
|
|
|
|
#######################################
|
|
|
|
$res = config_mn();
|
|
|
|
if ($res) {
|
|
|
|
send_msg("CONFIGURE MN returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 7. Genrate local configuration file
|
|
|
|
# Do test
|
|
|
|
# Write log
|
|
|
|
#######################################
|
|
|
|
$res = do_test();
|
|
|
|
if ($res) {
|
|
|
|
send_msg("DO TEST returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
# step 8. Copy code and configuration
|
|
|
|
#######################################
|
|
|
|
$res = pro_result();
|
|
|
|
if ($res) {
|
|
|
|
send_msg("PROCESS RESULT returns error, exit");
|
|
|
|
exit;
|
|
|
|
}
|
2014-03-19 00:15:48 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|