Files
his/scripts/test-emr-sync.sh

32 lines
918 B
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
# EMR数据同步测试脚本
BASE_URL="http://localhost:18082"
TOKEN=""
echo "=== EMR数据同步测试 ==="
# 1. 获取统计信息
echo ""
echo "1. 获取同步统计..."
curl -s "${BASE_URL}/emr-sync/stats" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" | python3 -m json.tool 2>/dev/null || echo "请先登录获取Token"
# 2. 执行同步
echo ""
echo "2. 执行数据同步..."
curl -s -X POST "${BASE_URL}/emr-sync/sync" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" | python3 -m json.tool 2>/dev/null || echo "同步失败请检查Token"
# 3. 再次获取统计
echo ""
echo "3. 同步后统计..."
curl -s "${BASE_URL}/emr-sync/stats" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" | python3 -m json.tool 2>/dev/null || echo "请先登录获取Token"
echo ""
echo "=== 测试完成 ==="