X7ROOT File Manager
Current Path:
/usr/local/VMOptimizationTools_2.50.0
usr
/
local
/
VMOptimizationTools_2.50.0
/
📁
..
📄
LinuxUpdate.XML
(645 B)
📄
SangforVMSTool
(3.11 KB)
📄
SangforVMSTool.service
(194 B)
📄
action_common.sh
(13.34 KB)
📄
busybox_cmd_ln.sh
(2.24 KB)
📄
collect_test_data.sh
(1.16 KB)
📄
common_config.sh
(278 B)
📄
data_test_tool.sh
(12.59 KB)
📄
debian_vmconfig.sh
(10.74 KB)
📄
guest_system_config.sh
(1.82 KB)
📄
hostname_config
(1 B)
📄
log.sh
(1.36 KB)
📄
mod_test.sh
(3.69 KB)
📄
mod_test1.sh
(914 B)
📄
net_common.sh
(915 B)
📄
network_config
(1 B)
📄
pwd_info_config
(1 B)
📄
redhat_vmconfig.sh
(11.14 KB)
📄
sangfor_guest_datareport
(21.66 KB)
📄
sangfor_heartalive.sh
(2.37 KB)
📄
sangfor_module_update
(28.11 KB)
📄
sangfor_set_network.sh
(504 B)
📄
sangfor_sfping
(3.85 KB)
📄
sangfor_sshkey_gen
(1.29 KB)
📄
sangfor_update_ipc_callback
(5.29 KB)
📄
sangfor_vm_proxyd
(3.45 KB)
📄
sangfor_vm_proxyd_r
(4.4 KB)
📄
sangfor_vm_proxyd_w
(1.32 KB)
📄
sangfor_vmconfig
(2.4 KB)
📄
sangfor_vmconfig_common
(27.99 KB)
📄
sangfor_vmconfig_ipc_callback
(4.75 KB)
📄
sangfor_watchdog
(3.95 KB)
📄
sfping
(13.63 KB)
📄
sfping.pl
(6.15 KB)
📄
startall
(1.78 KB)
📄
stopall
(1.11 KB)
📄
suse_vmconfig.sh
(6.19 KB)
📁
tools_x64
📁
tools_x86
📄
uni_test.sh
(2.59 KB)
📄
update_common_func
(4.35 KB)
📄
update_common_header
(4.86 KB)
📄
update_config
(2.89 KB)
📄
update_install
(28.84 KB)
📄
update_network.flag
(1 B)
📄
virtio_nic_attr_set.sh
(2.42 KB)
📄
virtio_nic_compat.sh.old1578331486
(5.28 KB)
📄
vm_ip_recover.sh
(16.66 KB)
📄
vm_ipc.sh
(9.06 KB)
📄
vmconfig_common_func
(10.76 KB)
📄
vmconfig_common_header
(3.37 KB)
📄
vmconfig_config
(805 B)
📄
vmtools-install.sh
(31.16 KB)
📄
watch_test.sh
(313 B)
📄
watchdog.sh
(1.39 KB)
📁
x64
📁
x86
Editing: uni_test.sh
#!/bin/bash shopt -s expand_aliases shopt expand_aliases shell_dir=`dirname "${BASH_SOURCE[0]}"` TMP_DIR="" TEST_DATA_DIR="/tmp/test_data" #the dir of unit test alias cat='test_cat(){ if [ "$1" = "/proc/stat" -o "$1" = "/proc/diskstats" ]; then if [ -L "${TMP_DIR}/$1" ]; then ln -sf "${TMP_DIR}/$1"2 "${TMP_DIR}/$1"; else ln -sf "${TMP_DIR}/$1"1 "${TMP_DIR}/$1"; fi; fi; cat ${TMP_DIR}/$1; }; test_cat' alias df='test_df(){ cat ./df.txt; }; test_df' alias uname='test_uname(){ cat "./uname$1.txt"; }; test_uname' alias ls='test_ls(){ ls ./$@; }; test_ls' alias lspci='cat ./lspci.txt' alias ip='test_ip(){ sed -n "/${3}/{/inet/p}" ./ipaddr.txt; }; test_ip' vm_ipc_to_local_host() { echo $@ >> "${shell_dir}"/tmp.txt } test_start() { echo "start test $1" vm_ipc_init 666 666 if [ $? -ne 0 ]; then log "vm_ipc_init() failed! modid='${modid}' instid='${instid}'" return 1 fi send_os_version_to_host if [ $? -ne 0 ]; then log "send os version to host failed!" return 1 fi send_os_info_to_host if [ $? -ne 0 ]; then log "send info to host failed!" return 1 fi echo "" > "${shell_dir}"/tmp.txt send_os_version_to_host if [ $? -ne 0 ]; then log "send os version to host failed!" return 1 fi send_os_info_to_host if [ $? -ne 0 ]; then log "send info to host failed!" return 1 fi return 0 } init_test_env() { if [ -d ${TEST_DATA_DIR} ]; then rm -rf ${TEST_DATA_DIR} fi mkdir -p ${TEST_DATA_DIR} cd "${shell_dir}/collect_data" for FILE in `ls *.tar.gz` do #Get the file name of the catalog of tar,then create the corresponding directory os_dir=`basename ${FILE} .tar.gz` mkdir -p "${TEST_DATA_DIR}/${os_dir}" #Decompress the catalog of tar into corresponding directory,pay attention to the path of this file tar -zmxf "${shell_dir}/collect_data/${FILE}" -C "${TEST_DATA_DIR}/${os_dir}" TMP_DIR="${TEST_DATA_DIR}/${os_dir}" cd "${TMP_DIR}" test_start "${TMP_DIR}" || echo "exec ${TMP_DIR} failed!" #check the test result right of wrong result_file="${shell_dir}/collect_data/${os_dir}.txt" test -e "${result_file}" if [ $? -eq 0 ]; then diff -r "${shell_dir}/tmp.txt" "${result_file}" if [ $? -eq 0 ]; then rm -rf "${shell_dir}/tmp.txt" echo "${result_file} test success!" else mv "${shell_dir}/tmp.txt" "${shell_dir}/${os_dir}_diff.txt" echo "${result_file} test failed!" fi else # if the file is not exist , then rename the file, check the result right of wrong end pigeonhole mv "${shell_dir}/tmp.txt" "${shell_dir}/${os_dir}.txt" echo "you should check the file data right or wrong!" fi done } main() { init_test_env }
Upload File
Create Folder