Files
baijiahao_data_crawl/test_validation_sms.sh

48 lines
1.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 数据验证与短信告警系统 - 快速测试Linux版本
echo "============================================================"
echo "数据验证与短信告警系统 - 快速测试"
echo "============================================================"
echo ""
echo "[步骤1] 检查Python环境..."
if command -v python3 &> /dev/null; then
PYTHON_CMD=python3
elif command -v python &> /dev/null; then
PYTHON_CMD=python
else
echo "[错误] Python未安装或未添加到PATH"
exit 1
fi
$PYTHON_CMD --version
if [ $? -ne 0 ]; then
echo "[错误] Python版本检查失败"
exit 1
fi
echo ""
echo "[步骤2] 测试短信发送功能..."
echo ""
$PYTHON_CMD data_validation_with_sms.py --test-sms
if [ $? -ne 0 ]; then
echo ""
echo "[错误] 短信发送测试失败"
echo "请检查:"
echo " 1. 阿里云SDK是否已安装"
echo " 2. sms_config.json配置是否正确"
echo " 3. AccessKey和Secret是否有效"
exit 1
fi
echo ""
echo "[步骤3] 执行数据验证..."
echo ""
$PYTHON_CMD data_validation_with_sms.py
echo ""
echo "============================================================"
echo "测试完成!"
echo "============================================================"