当前位置: 首页 > news >正文

网站重新备案 需要关闭网站么长沙速马科技

网站重新备案 需要关闭网站么,长沙速马科技,行业网站产品选择,网络信息有限公司前言 在现代软件开发中#xff0c;测试自动化是确保软件质量和稳定性的核心手段之一。随着开发周期的缩短和功能模块的增多#xff0c;手动测试逐渐无法满足高效性和准确性的需求。因此#xff0c;测试人员需要依赖自动化工具来提升测试效率#xff0c;减少人为干预和错误。…前言 在现代软件开发中测试自动化是确保软件质量和稳定性的核心手段之一。随着开发周期的缩短和功能模块的增多手动测试逐渐无法满足高效性和准确性的需求。因此测试人员需要依赖自动化工具来提升测试效率减少人为干预和错误。 本文将介绍一款基于 Bash 脚本的简单自动化测试工具它旨在帮助测试人员高效地管理和执行多种测试任务。这个脚本不仅能在命令行下交互式地进行模块选择还能根据实际测试结果显示通过或失败的状态方便测试人员快速识别问题。 一、目录结构 test/ ├── config.conf ├── scripts/ │ └── eth.sh └── tools/ └── xxx_test_scripts.sheth.sh: 当前示例脚本一个sh脚本写一个测试功能所有测试脚本都放在scripts目录下 xxx_test_scripts.sh: 这是框架的主脚本包含多个可选的测试模块用户可以根据需要选择并执行某个具体的功能测试 config.conf: 配置文件用于存储全局配置、测试项启用状态以及其他参数 tools/: 存放工具或素材用于扩展框架的功能。二、代码 1、config.conf # 0 代表启用测试项1 代表不启用测试项 example1_activation0 example2_activation0 example3_activation0# 其它功能配置 test888 2、eth.sh #!/bin/bash# 获取当前脚本所在的目录 SCRIPT_DIR$(cd $(dirname ${BASH_SOURCE[0]}) pwd) echo Current script directory: ${SCRIPT_DIR}# 返回到上级目录 PARENT_DIR$(dirname $SCRIPT_DIR) echo Parent directory: ${PARENT_DIR}# 加载上级目录中的配置文件 source ${PARENT_DIR}/config.conf echo ${test}test_eth() {eth_status$1if ! ip link show $eth_status | grep -q state UP; thenexit 1 # 失败时退出返回 1elseexit 0 # 成功时退出返回 0fi }test_eth $1 3、xxx_test_scripts.sh #!/bin/bash# 获取当前脚本所在的目录 SCRIPT_DIR$(cd $(dirname ${BASH_SOURCE[0]}) pwd)# 检查 config.conf 是否存在 if [[ ! -f ${SCRIPT_DIR}/config.conf ]]; thenecho config.conf not found!exit 1 fi# 加载配置文件 source ${SCRIPT_DIR}/config.confEXAMPLE1_RESULT0 EXAMPLE2_RESULT0 EXAMPLE3_RESULT0# 依赖软件安装 install() {if ! command -v figlet /dev/null 21; thenecho Writing the installation method.fi }test_example1() {read -p example1 test results(y: pass - n: fail): example1if [[ ${example1} N ]] || [[ ${example1} n ]]; thenEXAMPLE1_RESULT1echo -e ####################\033[31m example1: fail \033[0m#####################echo ##############################################################elseEXAMPLE1_RESULT0echo -e ####################\033[32m example1: pass \033[0m#####################echo ##############################################################fi }test_example2() {read -p example2 test results(y: pass - n: fail): example2if [[ ${example2} N ]] || [[ ${example2} n ]]; thenEXAMPLE2_RESULT1echo -e ####################\033[31m example2: fail \033[0m#####################echo ##############################################################elseEXAMPLE2_RESULT0echo -e ####################\033[32m example2: pass \033[0m#####################echo ##############################################################fi }test_example3() {sudo chmod 777 ${SCRIPT_DIR}/scripts/eth.shsudo ${SCRIPT_DIR}/scripts/eth.sh eth0if [[ $? -eq 0 ]]; thenEXAMPLE3_RESULT0echo -e ####################\033[32m example3: pass \033[0m#####################echo ##############################################################elseEXAMPLE3_RESULT1echo -e ####################\033[31m example3: fail \033[0m#####################echo ##############################################################fi }test_exit() {exit 11 }module_choice() {echo echo **************** Test Module Selection (Failures Detected) ****************echo 0 (exit test)if [[ ${example1_activation} 0 ]]; thenif [[ ${EXAMPLE1_RESULT} -eq 0 ]]; thenecho -e 1 (example1 test) [\033[32m pass \033[0m]elseecho -e 1 (example1 test) [\033[31m fail \033[0m]fifiif [[ ${example2_activation} 0 ]]; thenif [[ ${EXAMPLE2_RESULT} -eq 0 ]]; thenecho -e 2 (example2 test) [\033[32m pass \033[0m]elseecho -e 2 (example2 test) [\033[31m fail \033[0m]fifiif [[ ${example3_activation} 0 ]]; thenif [[ ${EXAMPLE3_RESULT} -eq 0 ]]; thenecho -e 3 (example3 test) [\033[32m pass \033[0m]elseecho -e 3 (example3 test) [\033[31m fail \033[0m]fifiecho R (Failure item test)echo ***************************************************************************read -p please select a test module to rerun or exit: MODULE_CHOICE }module_test() {MODULE_CHOICE$(echo $MODULE_CHOICE | tr [:upper:] [:lower:])case ${MODULE_CHOICE} in0)test_exit;;1)if [[ ${example1_activation} 0 ]]; thentest_example1fi;;2)if [[ ${example2_activation} 0 ]]; thentest_example2fi;;3)if [[ ${example3_activation} 0 ]]; thentest_example3fi;;r)# Failure item选项重新测试所有失败的项if [[ ${EXAMPLE1_RESULT} -eq 1 ]]; thentest_example1fiif [[ ${EXAMPLE2_RESULT} -eq 1 ]]; thentest_example2fiif [[ ${EXAMPLE3_RESULT} -eq 1 ]]; thentest_example3fi;;# *)# echo Invalid choice. Please try again.# ;;esac }check_all_pass() {local test_results(${EXAMPLE1_RESULT}${EXAMPLE2_RESULT}${EXAMPLE3_RESULT})all_zerotrue# 如果有一个结果等于1标记为falsefor all_result in ${test_results[]}; doif [[ ${all_result} -eq 1 ]]; thenall_zerofalsebreakfidone# 获取全部测试结果 0通过 1不通过if [[ $all_zero true ]]; thenreturn 0 # 返回0表示所有结果为0elsereturn 1 # 返回1表示至少有一个结果不为0fi }test_single() {while true; domodule_choicemodule_testcheck_all_passif [[ $? -eq 0 ]]; thenecho ****************************************************************echo -e \033[32m$(figlet PASS)\033[0mecho ****************************************************************breakfisleep 1done }test_all() {echo echo ******************** Test Execution Started ********************echo ****************************************************************echo if [[ ${example1_activation} 0 ]]; thentest_example1sleep 1fiif [[ ${example2_activation} 0 ]]; thentest_example2sleep 1fiif [[ ${example3_activation} 0 ]]; thentest_example3sleep 1fiecho echo echo ********************* Test Results Summary *********************echo ****************************************************************if [[ ${example1_activation} 0 ]]; thenif [[ ${EXAMPLE1_RESULT} -eq 0 ]]; thenecho -e example1: \033[32m pass \033[0melseecho -e example1: \033[31m fail \033[0mfifiif [[ ${example2_activation} 0 ]]; thenif [[ ${EXAMPLE2_RESULT} -eq 0 ]]; thenecho -e example2: \033[32m pass \033[0melseecho -e example2: \033[31m fail \033[0mfifiif [[ ${example3_activation} 0 ]]; thenif [[ ${EXAMPLE3_RESULT} -eq 0 ]]; thenecho -e example3: \033[32m pass \033[0melseecho -e example3: \033[31m fail \033[0mfifiecho check_all_passif [[ $? -eq 0 ]]; thenecho ****************************************************************echo -e \033[32m$(figlet PASS)\033[0mecho ****************************************************************elseecho ****************************************************************echo -e \033[31m$(figlet FAIL)\033[0mecho ****************************************************************echo echo fi }send_result() {echo Upload test results. }main() {installtest_allcheck_all_passif [[ $? -eq 1 ]]; thentest_singlefisend_result }main 注释文件必须 Unix(LF) 格式 可用通过 notepad 转换
http://www.hkea.cn/news/14509334/

相关文章:

  • 云浮网站设计做家乡网站的素材
  • 模版网站可以做排名嘛云南网站做的好的公司简介
  • 东莞微联建站淘宝网页模板免费下载
  • 做一个网站需要多少费用太原做淘宝网站的
  • 安徽安庆怎么样知乎seo排名帝搜软件
  • 宁夏网页设计网站购物网站优化的建议
  • 怎么制作免费网站教程视频企业咨询管理公司是干嘛的
  • 做外贸现在一般都通过哪些网站如何让网站被百度快速收录
  • 江苏省城乡和住房建设厅网站广州网站建设需要多少钱
  • 网站百度推广方案兰州网站建设兰州
  • ui设计师网站著名办公室装修公司
  • 海淀区企业网络公司厦门网站关键词优化
  • 教你如何用天翼云盘做网站做国际网站需要多少钱
  • 菠菜导航网站可以做厦门搜索引擎优化
  • 开源门户网站cmsphpcms网站后台
  • 满屏网站做多大尺寸服装建设网站论文的目录
  • 电商网站建设 数商云盈佳国际天天做赢家网站
  • 网站建设需要用到那些语言陕西网站维护
  • 长沙建网站设计网站索引页面
  • 网页设计软件官网模板网站网站 可以做无形资产吗
  • 网站建设完成后交付方式百度企业号
  • 想在微信公众号上做网站链接甘肃网站推广
  • 网站建设流程百度经验下载的html文件打开乱码
  • 网站换域名了怎么做301重定向湖南人文科技学院在哪个城市
  • 成都网站建设 erp怎么做英文的网站
  • 朱腾鹏个人网站程序员自己做网站赚钱
  • 哪些公司做外贸网站企业网站管理系统手机版教程
  • 建筑公司需求发布网站阿里云建站和公司建站有什么优势
  • 西安市高陵区建设局网站对网络营销的认识
  • 万维网中文网站到期济南建行网点