OSDN Git Service

Change file name
author0809216 <0809216@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 4 Oct 2010 05:26:48 +0000 (05:26 +0000)
committer0809216 <0809216@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 4 Oct 2010 05:26:48 +0000 (05:26 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10325 1ed66053-1c2d-0410-8867-f7571e6e31d3

test/script/common/backup_file.sh [moved from test/script/common/save_file.sh with 62% similarity]
test/script/common/restore_file.sh [new file with mode: 0755]
test/script/common/return_file.sh [deleted file]
test/umtest.sh

similarity index 62%
rename from test/script/common/save_file.sh
rename to test/script/common/backup_file.sh
index 41aec54..8050e01 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-#Save configfiles and logfiles.
-LOG "save_file start."
+# Backup config files and log files.
+LOG "backup_file start."
 
 if [ -e /etc/hosts ]
 then
@@ -15,9 +15,9 @@ else
 fi
 if [ $? -ne 0 ]
 then
-       LOG_ERR "/etc/hosts file move failed."
+       LOG_ERR "Cannot move /etc/hosts file."
 else
-       LOG "/etc/hosts file moved ${TMP_DIR}/etc ." 
+       LOG "/etc/hosts file was moved to ${TMP_DIR}/etc/hosts." 
 fi
 
 if [ -n ${L7VSD_CONF_DIR} -a ${L7VSD_CONF_DIR} != "/"  ]
@@ -32,12 +32,11 @@ else
 fi
 if [ $? -ne 0 ]
 then
-       LOG_ERR "l7vs config file move failed."
+       LOG_ERR "Cannot move ${L7VSD_CONF_DIR}/* files."
 else
-       LOG "l7vs config file moved ${TMP_DIR}/l7vs ." 
+       LOG "${L7VSD_CONF_DIR}/* files were moved to ${TMP_DIR}/l7vs directory." 
 fi
 
-
 if [ -n ${L7DIRECTORD_CONF_DIR} -a ${L7DIRECTORD_CONF_DIR} != "/" ]
 then
        if [ ! -d ${TMP_DIR}/l7director ]
@@ -50,12 +49,11 @@ else
 fi
 if [ $? -ne 0 ]
 then
-       LOG_ERR "l7director config file move failed."
+       LOG_ERR "Cannot move ${L7DIRECTORD_CONF_DIR}/* files."
 else
-       LOG "l7director config file moved ${TMP_DIR}/l7direcotr ."
+       LOG "${L7DIRECTORD_CONF_DIR}/* files were moved to ${TMP_DIR}/l7direcotr directory."
 fi
 
-
 if [ -n ${L7VS_LOG_DIR} -a ${L7VS_LOG_DIR} != "/" ]
 then
        if [ ! -d ${TMP_DIR}/log ]
@@ -68,9 +66,9 @@ else
 fi
 if [ $? -ne 0 ]
 then
-       LOG_ERR "UM-L7's log file move failed."
+       LOG_ERR "Cannot move ${L7VS_LOG_DIR}/* files."
 else
-       LOG "UM-L7's log file moved ${TMP_DIR}log ."
+       LOG "${L7VS_LOG_DIR}/* files were moved to ${TMP_DIR}log directory."
 fi
 
-LOG "save_file end."
+LOG "backup_file end."
diff --git a/test/script/common/restore_file.sh b/test/script/common/restore_file.sh
new file mode 100755 (executable)
index 0000000..d0c4abc
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Restore config files and log files.
+LOG "restore_file start."
+
+\mv -f ${TMP_DIR}/etc/hosts /etc/hosts 2> /dev/null
+if [ $? -ne 0 ]
+then
+       LOG_ERR "Cannot move ${TMP_DIR}/etc/hosts file."
+else
+        LOG "/etc/hosts file was restored."
+fi     
+
+mv ${TMP_DIR}/l7vs/* ${L7VSD_CONF_DIR} 2> /dev/null
+if [ $? -ne 0 ]
+then
+       LOG_ERR "Cannot move ${TMP_DIR}/l7vs/* files."
+else
+        LOG "${L7VSD_CONF_DIR}/* files were restored."
+fi
+
+mv ${TMP_DIR}/l7director/* ${L7DIRECTORD_CONF_DIR} 2> /dev/null
+if [ $? -ne 0 ]
+then
+       LOG_ERR "Cannot move ${TMP_DIR}/l7director/* files."
+else
+        LOG "${L7DIRECTORD_CONF_DIR}/* files were restored."
+fi
+
+mv ${TMP_DIR}/log/* ${L7VS_LOG_DIR} 2> /dev/null
+if [ $? -ne 0 ]
+then
+       LOG_ERR "Cannot move ${TMP_DIR}/log/* files."
+else
+        LOG "${L7VS_LOG_DIR}/* files were restored."
+fi
+
+LOG "restore_file end."
diff --git a/test/script/common/return_file.sh b/test/script/common/return_file.sh
deleted file mode 100755 (executable)
index ae2ea6c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-#Return configfiles and logfiles.
-LOG "return_file start."
-
-\mv -f ${TMP_DIR}/etc/hosts /etc/hosts 2> /dev/null
-if [ $? -ne 0 ]
-then
-       LOG_ERR "${TMP_DIR}/etc/hosts file move failed."
-else
-        LOG "/etc/hosts file return ${L7VSD_CONF_DIR} ."
-fi     
-
-mv ${TMP_DIR}/l7vs/* ${L7VSD_CONF_DIR} 2> /dev/null
-if [ $? -ne 0 ]
-then
-       LOG_ERR "l7vs config file move failed."
-else
-        LOG "l7vs config file return ${L7VSD_CONF_DIR} ."
-fi
-
-mv ${TMP_DIR}/l7director/* ${L7DIRECTORD_CONF_DIR} 2> /dev/null
-if [ $? -ne 0 ]
-then
-       LOG_ERR "l7director config file move failed."
-else
-        LOG "l7director config file return ${L7DIRECTORD_CONF_DIR} ."
-fi
-
-mv ${TMP_DIR}/log/* ${L7VS_LOG_DIR} 2> /dev/null
-if [ $? -ne 0 ]
-then
-       LOG_ERR "UM-L7's log file move failed."
-else
-        LOG "UM-L7's log file return ${L7VS_LOG_DIR} ."
-fi
-
-LOG "return_file end."
index 34e4010..c85a38c 100755 (executable)
@@ -12,8 +12,8 @@ CHECK_ENV="${COMMON_SCRIPT_DIR}/check_env.sh"
 LOGGER="${COMMON_SCRIPT_DIR}/logger.sh"
 LIGHTTPD_FUNC="${COMMON_SCRIPT_DIR}/lighttpd_func.sh"
 STOP_MONKEY="${COMMON_SCRIPT_DIR}/stop_um_ps.sh"
-SAVE_FILE="${COMMON_SCRIPT_DIR}/save_file.sh"
-RETURN_FILE="${COMMON_SCRIPT_DIR}/return_file.sh"
+BACKUP_FILE="${COMMON_SCRIPT_DIR}/backup_file.sh"
+RESTORE_FILE="${COMMON_SCRIPT_DIR}/restore_file.sh"
 COLLECT_FILE="${COMMON_SCRIPT_DIR}/collect_file.sh"
 SET_DEFAULT_CONF="${COMMON_SCRIPT_DIR}/set_default_conf.sh"
 START_SNMPD="${COMMON_SCRIPT_DIR}/start_snmpd.sh"
@@ -163,8 +163,8 @@ shift `expr "$OPTIND" - 1`
 . ${CHECK_ENV}
 # Stop UltraMonkey-L7.
 . ${STOP_MONKEY}
-# Save log and config files.
-. ${SAVE_FILE}
+# Backup log and config files.
+. ${BACKUP_FILE}
 # Initialize environment.
 \cp -f ${CONF_DIR}/hosts /etc/hosts
 . ${LIGHTTPD_FUNC}
@@ -202,8 +202,8 @@ LOG "Test scripts end."
 ###################
 # Stop UltraMonkey-L7.
 . ${STOP_MONKEY}
-# Return log and config files.
-. ${RETURN_FILE}
+# Restore log and config files.
+. ${RESTORE_FILE}
 # Delete temp directory
 rm -rf ${TMP_DIR}
 exit 0