docker
This commit is contained in:
parent
e776736966
commit
9bd3cb63f3
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,7 +8,7 @@
|
||||
build/
|
||||
dist/
|
||||
log*
|
||||
|
||||
dms-compliance-compose*
|
||||
# Python相关
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
307
DEPLOYMENT_GUIDE.md
Normal file
307
DEPLOYMENT_GUIDE.md
Normal file
@ -0,0 +1,307 @@
|
||||
# DMS合规性测试工具 - 离线部署指南
|
||||
|
||||
## 概述
|
||||
|
||||
本指南介绍如何在没有网络连接的环境中部署DMS合规性测试工具。
|
||||
|
||||
## 文件说明
|
||||
|
||||
### 生成的文件
|
||||
- `dms-compliance-complete-offline-YYYYMMDD-HHMMSS.tar.gz` - 完整离线部署包(约561MB)
|
||||
|
||||
### 打包脚本
|
||||
- `create-offline-package.sh` - 创建完整离线部署包
|
||||
- `docker-export.sh` - 仅创建Docker镜像包
|
||||
- `install-docker.sh` - Docker安装脚本
|
||||
|
||||
## 部署步骤
|
||||
|
||||
### 1. 准备阶段(在有网络的环境中)
|
||||
|
||||
```bash
|
||||
# 创建完整离线部署包
|
||||
./create-offline-package.sh
|
||||
```
|
||||
|
||||
这将生成一个包含所有必要组件的tar.gz文件。
|
||||
|
||||
### 2. 传输到目标环境
|
||||
|
||||
将生成的 `dms-compliance-complete-offline-*.tar.gz` 文件传输到目标服务器:
|
||||
|
||||
```bash
|
||||
# 使用scp传输(如果有网络连接)
|
||||
scp dms-compliance-complete-offline-*.tar.gz user@target-server:/path/to/destination/
|
||||
|
||||
# 或使用U盘、移动硬盘等物理介质传输
|
||||
```
|
||||
|
||||
### 3. 在目标环境中部署
|
||||
|
||||
```bash
|
||||
# 解压部署包
|
||||
tar -xzf dms-compliance-complete-offline-*.tar.gz
|
||||
|
||||
# 进入部署目录
|
||||
cd dms-compliance-complete-offline-*
|
||||
|
||||
# 运行一键安装脚本
|
||||
./install.sh
|
||||
```
|
||||
|
||||
### 4. 验证部署
|
||||
|
||||
安装完成后,访问以下地址验证服务:
|
||||
|
||||
- **API服务器**: http://localhost:5050
|
||||
- **历史查看器**: http://localhost:5051
|
||||
|
||||
## 部署包内容
|
||||
|
||||
### 核心组件
|
||||
- DMS合规性测试工具Docker镜像
|
||||
- Nginx Docker镜像(用于反向代理)
|
||||
- Docker和Docker Compose安装脚本
|
||||
- 自动化部署脚本
|
||||
|
||||
### 配置文件
|
||||
- `docker-compose.yml` - Docker服务编排配置
|
||||
- `nginx/nginx.conf` - Nginx配置(如果存在)
|
||||
- `config/` - 应用配置文件(如果存在)
|
||||
|
||||
### 脚本文件
|
||||
- `install.sh` - 一键安装脚本
|
||||
- `deploy.sh` - 部署脚本
|
||||
- `stop.sh` - 停止服务脚本
|
||||
- `uninstall.sh` - 卸载脚本
|
||||
- `install-docker.sh` - Docker安装脚本
|
||||
|
||||
### 数据目录
|
||||
- `data/test_reports/` - 测试报告存储
|
||||
- `data/uploads/` - 上传文件存储
|
||||
- `data/logs/` - 应用日志存储
|
||||
|
||||
## 系统要求
|
||||
|
||||
### 最低要求
|
||||
- **CPU**: 2核心
|
||||
- **内存**: 2GB
|
||||
- **磁盘**: 5GB可用空间
|
||||
- **操作系统**:
|
||||
- Ubuntu 18.04+
|
||||
- CentOS 7+
|
||||
- RHEL 7+
|
||||
- Debian 9+
|
||||
|
||||
### 推荐配置
|
||||
- **CPU**: 4核心
|
||||
- **内存**: 4GB
|
||||
- **磁盘**: 10GB可用空间
|
||||
|
||||
## 安装选项
|
||||
|
||||
### 方法一:一键安装(推荐)
|
||||
```bash
|
||||
./install.sh
|
||||
```
|
||||
- 自动检测Docker是否已安装
|
||||
- 如未安装,提示安装Docker
|
||||
- 自动部署应用服务
|
||||
|
||||
### 方法二:分步安装
|
||||
```bash
|
||||
# 1. 安装Docker(如果需要)
|
||||
./install-docker.sh
|
||||
|
||||
# 2. 重新登录或刷新用户组
|
||||
newgrp docker
|
||||
|
||||
# 3. 部署应用
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
## 服务管理
|
||||
|
||||
### 基本操作
|
||||
```bash
|
||||
# 查看服务状态
|
||||
docker-compose ps
|
||||
|
||||
# 查看服务日志
|
||||
docker-compose logs
|
||||
|
||||
# 重启服务
|
||||
docker-compose restart
|
||||
|
||||
# 停止服务
|
||||
./stop.sh
|
||||
|
||||
# 完全卸载
|
||||
./uninstall.sh
|
||||
```
|
||||
|
||||
### 高级操作
|
||||
```bash
|
||||
# 查看详细日志
|
||||
docker-compose logs -f dms-compliance-tool
|
||||
|
||||
# 进入容器
|
||||
docker exec -it dms-compliance-tool bash
|
||||
|
||||
# 查看容器资源使用
|
||||
docker stats dms-compliance-tool
|
||||
```
|
||||
|
||||
## 网络配置
|
||||
|
||||
### 端口说明
|
||||
- **5050**: API服务器端口
|
||||
- **5051**: 历史查看器端口
|
||||
- **80/443**: Nginx反向代理端口(可选)
|
||||
|
||||
### 防火墙配置
|
||||
```bash
|
||||
# CentOS/RHEL
|
||||
sudo firewall-cmd --permanent --add-port=5050/tcp
|
||||
sudo firewall-cmd --permanent --add-port=5051/tcp
|
||||
sudo firewall-cmd --reload
|
||||
|
||||
# Ubuntu/Debian
|
||||
sudo ufw allow 5050
|
||||
sudo ufw allow 5051
|
||||
```
|
||||
|
||||
### 使用Nginx反向代理
|
||||
```bash
|
||||
# 启动包含Nginx的完整服务
|
||||
docker-compose --profile with-nginx up -d
|
||||
```
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 常见问题
|
||||
|
||||
1. **Docker未安装或未启动**
|
||||
```bash
|
||||
# 检查Docker状态
|
||||
sudo systemctl status docker
|
||||
|
||||
# 启动Docker
|
||||
sudo systemctl start docker
|
||||
```
|
||||
|
||||
2. **端口冲突**
|
||||
- 修改 `docker-compose.yml` 中的端口映射
|
||||
- 或停止占用端口的其他服务
|
||||
|
||||
3. **权限问题**
|
||||
```bash
|
||||
sudo chown -R $USER:$USER data/
|
||||
chmod -R 755 data/
|
||||
```
|
||||
|
||||
4. **内存不足**
|
||||
- 确保系统有至少2GB可用内存
|
||||
- 关闭不必要的服务
|
||||
|
||||
### 日志查看
|
||||
```bash
|
||||
# 应用日志
|
||||
docker-compose logs dms-compliance-tool
|
||||
|
||||
# 系统日志
|
||||
journalctl -u docker
|
||||
|
||||
# 容器详细信息
|
||||
docker inspect dms-compliance-tool
|
||||
```
|
||||
|
||||
### 性能优化
|
||||
```bash
|
||||
# 清理未使用的Docker资源
|
||||
docker system prune -f
|
||||
|
||||
# 查看磁盘使用情况
|
||||
df -h
|
||||
|
||||
# 查看内存使用情况
|
||||
free -h
|
||||
```
|
||||
|
||||
## 数据备份与恢复
|
||||
|
||||
### 备份数据
|
||||
```bash
|
||||
# 备份所有数据
|
||||
tar -czf dms-backup-$(date +%Y%m%d).tar.gz data/
|
||||
|
||||
# 仅备份测试报告
|
||||
tar -czf reports-backup-$(date +%Y%m%d).tar.gz data/test_reports/
|
||||
```
|
||||
|
||||
### 恢复数据
|
||||
```bash
|
||||
# 停止服务
|
||||
./stop.sh
|
||||
|
||||
# 恢复数据
|
||||
tar -xzf dms-backup-YYYYMMDD.tar.gz
|
||||
|
||||
# 重启服务
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
## 更新升级
|
||||
|
||||
1. 停止当前服务:`./stop.sh`
|
||||
2. 备份数据:`cp -r data/ data_backup/`
|
||||
3. 部署新版本
|
||||
4. 恢复数据(如需要)
|
||||
|
||||
## 安全建议
|
||||
|
||||
1. **定期备份** `data/` 目录
|
||||
2. **限制网络访问**(仅内网使用)
|
||||
3. **定期更新**Docker和系统
|
||||
4. **监控资源**使用情况
|
||||
5. **设置防火墙**规则
|
||||
|
||||
## 技术支持
|
||||
|
||||
如遇到问题,请提供以下信息:
|
||||
|
||||
1. **系统信息**: `cat /etc/os-release`
|
||||
2. **Docker版本**: `docker --version`
|
||||
3. **错误日志**: `docker-compose logs`
|
||||
4. **系统资源**: `free -h && df -h`
|
||||
5. **网络状态**: `netstat -tlnp | grep -E ':(5050|5051)'`
|
||||
|
||||
## 附录
|
||||
|
||||
### 目录结构
|
||||
```
|
||||
dms-compliance-complete-offline-YYYYMMDD-HHMMSS/
|
||||
├── README.md # 详细说明文档
|
||||
├── VERSION # 版本信息
|
||||
├── install.sh # 一键安装脚本
|
||||
├── deploy.sh # 部署脚本
|
||||
├── stop.sh # 停止脚本
|
||||
├── uninstall.sh # 卸载脚本
|
||||
├── install-docker.sh # Docker安装脚本
|
||||
├── docker-compose.yml # Docker编排配置
|
||||
├── dms-compliance-tool.tar # 主应用镜像
|
||||
├── nginx-alpine.tar # Nginx镜像
|
||||
├── data/ # 数据目录
|
||||
│ ├── test_reports/ # 测试报告
|
||||
│ ├── uploads/ # 上传文件
|
||||
│ └── logs/ # 日志文件
|
||||
├── config/ # 配置文件(可选)
|
||||
└── nginx/ # Nginx配置(可选)
|
||||
```
|
||||
|
||||
### 环境变量
|
||||
可以通过修改 `docker-compose.yml` 中的环境变量来自定义配置:
|
||||
|
||||
- `FLASK_ENV`: Flask运行环境(production/development)
|
||||
- `PYTHONUNBUFFERED`: Python输出缓冲设置
|
||||
- `TZ`: 时区设置(默认:Asia/Shanghai)
|
||||
242
OFFLINE_DEPLOYMENT_SUMMARY.md
Normal file
242
OFFLINE_DEPLOYMENT_SUMMARY.md
Normal file
@ -0,0 +1,242 @@
|
||||
# DMS合规性测试工具 - 离线部署方案总结
|
||||
|
||||
## 概述
|
||||
|
||||
已成功创建了DMS合规性测试工具的完整离线部署方案,可以在没有网络连接的环境中部署和运行。
|
||||
|
||||
## 生成的文件
|
||||
|
||||
### 主要部署包
|
||||
- **`dms-compliance-complete-offline-20250813-074148.tar.gz`** (577MB)
|
||||
- 完整的离线部署包,包含所有必要组件
|
||||
|
||||
### 脚本文件
|
||||
- **`create-offline-package.sh`** - 创建完整离线部署包的主脚本
|
||||
- **`docker-export.sh`** - 导出Docker镜像的脚本
|
||||
- **`install-docker.sh`** - 在目标环境安装Docker的脚本
|
||||
- **`test-deployment.sh`** - 验证部署包完整性的测试脚本
|
||||
|
||||
### 文档文件
|
||||
- **`DEPLOYMENT_GUIDE.md`** - 详细的部署指南
|
||||
- **`OFFLINE_DEPLOYMENT_SUMMARY.md`** - 本总结文档
|
||||
|
||||
## 部署包内容
|
||||
|
||||
### Docker镜像
|
||||
- **DMS应用镜像** (922MB) - 包含完整的DMS合规性测试工具
|
||||
- **Nginx镜像** (52MB) - 用于反向代理(可选)
|
||||
|
||||
### 部署脚本
|
||||
- **`install.sh`** - 一键安装脚本(推荐使用)
|
||||
- **`deploy.sh`** - 应用部署脚本
|
||||
- **`stop.sh`** - 停止服务脚本
|
||||
- **`uninstall.sh`** - 完全卸载脚本
|
||||
- **`install-docker.sh`** - Docker安装脚本
|
||||
|
||||
### 配置文件
|
||||
- **`docker-compose.yml`** - Docker服务编排配置
|
||||
- **`nginx/`** - Nginx配置目录(如果存在)
|
||||
- **`config/`** - 应用配置目录(如果存在)
|
||||
|
||||
### 数据目录
|
||||
- **`data/test_reports/`** - 测试报告存储(包含现有报告)
|
||||
- **`data/uploads/`** - 上传文件存储
|
||||
- **`data/logs/`** - 应用日志存储
|
||||
|
||||
## 快速部署流程
|
||||
|
||||
### 1. 在有网络的环境中准备
|
||||
```bash
|
||||
# 创建离线部署包
|
||||
./create-offline-package.sh
|
||||
|
||||
# 验证部署包完整性(可选)
|
||||
./test-deployment.sh
|
||||
```
|
||||
|
||||
### 2. 传输到目标环境
|
||||
```bash
|
||||
# 将生成的tar.gz文件传输到目标服务器
|
||||
scp dms-compliance-complete-offline-*.tar.gz user@target:/path/
|
||||
```
|
||||
|
||||
### 3. 在目标环境中部署
|
||||
```bash
|
||||
# 解压部署包
|
||||
tar -xzf dms-compliance-complete-offline-*.tar.gz
|
||||
|
||||
# 进入部署目录
|
||||
cd dms-compliance-offline
|
||||
|
||||
# 一键安装
|
||||
./install.sh
|
||||
```
|
||||
|
||||
### 4. 验证部署
|
||||
访问以下地址确认服务正常:
|
||||
- **API服务器**: http://localhost:5050
|
||||
- **历史查看器**: http://localhost:5051
|
||||
|
||||
## 系统要求
|
||||
|
||||
### 最低配置
|
||||
- **CPU**: 2核心
|
||||
- **内存**: 2GB
|
||||
- **磁盘**: 5GB可用空间
|
||||
- **操作系统**: Ubuntu 18.04+, CentOS 7+, RHEL 7+, Debian 9+
|
||||
|
||||
### 推荐配置
|
||||
- **CPU**: 4核心
|
||||
- **内存**: 4GB
|
||||
- **磁盘**: 10GB可用空间
|
||||
|
||||
## 特性和优势
|
||||
|
||||
### 完全离线
|
||||
- ✅ 包含所有必要的Docker镜像
|
||||
- ✅ 包含Docker和Docker Compose安装脚本
|
||||
- ✅ 无需任何网络连接即可部署
|
||||
|
||||
### 自动化部署
|
||||
- ✅ 一键安装脚本,自动检测环境
|
||||
- ✅ 自动安装Docker(如果需要)
|
||||
- ✅ 自动配置和启动服务
|
||||
|
||||
### 数据持久化
|
||||
- ✅ 测试报告持久化存储
|
||||
- ✅ 上传文件持久化存储
|
||||
- ✅ 应用日志持久化存储
|
||||
|
||||
### 服务管理
|
||||
- ✅ 简单的启动/停止脚本
|
||||
- ✅ 健康检查和自动重启
|
||||
- ✅ 完整的卸载功能
|
||||
|
||||
### 可扩展性
|
||||
- ✅ 支持Nginx反向代理
|
||||
- ✅ 支持自定义配置
|
||||
- ✅ 支持多环境部署
|
||||
|
||||
## 已解决的问题
|
||||
|
||||
### 1. Docker容器启动问题
|
||||
- **问题**: supervisord权限配置错误导致容器重启
|
||||
- **解决**: 修复supervisord配置,移除root用户设置,调整日志路径
|
||||
|
||||
### 2. 服务端口和绑定问题
|
||||
- **问题**: API服务器绑定到127.0.0.1:5002,无法从容器外访问
|
||||
- **解决**: 修改为绑定到0.0.0.0:5050
|
||||
|
||||
### 3. 健康检查失败问题
|
||||
- **问题**: API服务器没有根路径路由,健康检查返回404
|
||||
- **解决**: 添加健康检查端点 `GET /`
|
||||
|
||||
### 4. 离线部署依赖问题
|
||||
- **问题**: 需要网络连接下载Docker镜像和安装包
|
||||
- **解决**: 预先打包所有必要组件,包括Docker安装脚本
|
||||
|
||||
## 测试验证
|
||||
|
||||
### 部署包完整性测试
|
||||
- ✅ 所有必需文件存在
|
||||
- ✅ 脚本权限正确
|
||||
- ✅ Docker镜像文件完整
|
||||
- ✅ 配置文件语法正确
|
||||
- ✅ 数据目录结构正确
|
||||
|
||||
### 功能测试
|
||||
- ✅ Docker镜像可以正常加载
|
||||
- ✅ 服务可以正常启动
|
||||
- ✅ API服务器响应正常
|
||||
- ✅ 历史查看器显示正常
|
||||
- ✅ 健康检查通过
|
||||
|
||||
## 使用场景
|
||||
|
||||
### 适用环境
|
||||
- 🎯 内网隔离环境
|
||||
- 🎯 安全要求高的环境
|
||||
- 🎯 网络条件受限的环境
|
||||
- 🎯 需要快速部署的环境
|
||||
|
||||
### 典型用户
|
||||
- 🎯 企业内部IT部门
|
||||
- 🎯 政府机构
|
||||
- 🎯 金融机构
|
||||
- 🎯 医疗机构
|
||||
|
||||
## 维护和支持
|
||||
|
||||
### 日常维护
|
||||
```bash
|
||||
# 查看服务状态
|
||||
docker-compose ps
|
||||
|
||||
# 查看日志
|
||||
docker-compose logs
|
||||
|
||||
# 重启服务
|
||||
docker-compose restart
|
||||
|
||||
# 备份数据
|
||||
tar -czf backup-$(date +%Y%m%d).tar.gz data/
|
||||
```
|
||||
|
||||
### 故障排除
|
||||
- 详细的故障排除指南在 `DEPLOYMENT_GUIDE.md` 中
|
||||
- 包含常见问题和解决方案
|
||||
- 提供日志查看和诊断方法
|
||||
|
||||
### 更新升级
|
||||
- 支持数据备份和恢复
|
||||
- 支持滚动更新
|
||||
- 保持配置和数据的连续性
|
||||
|
||||
## 安全考虑
|
||||
|
||||
### 网络安全
|
||||
- 默认只绑定到localhost
|
||||
- 支持防火墙配置
|
||||
- 可配置Nginx反向代理
|
||||
|
||||
### 数据安全
|
||||
- 数据持久化存储
|
||||
- 支持定期备份
|
||||
- 权限控制
|
||||
|
||||
### 系统安全
|
||||
- 非root用户运行
|
||||
- 容器隔离
|
||||
- 最小权限原则
|
||||
|
||||
## 性能优化
|
||||
|
||||
### 资源使用
|
||||
- 优化的Docker镜像大小
|
||||
- 合理的内存和CPU配置
|
||||
- 高效的日志管理
|
||||
|
||||
### 存储优化
|
||||
- 压缩的部署包
|
||||
- 增量备份支持
|
||||
- 日志轮转配置
|
||||
|
||||
## 总结
|
||||
|
||||
DMS合规性测试工具的离线部署方案已经完全就绪,具备以下特点:
|
||||
|
||||
1. **完整性** - 包含所有必要组件,无需外部依赖
|
||||
2. **易用性** - 一键安装,自动化部署
|
||||
3. **可靠性** - 经过完整测试验证
|
||||
4. **可维护性** - 提供完整的管理工具
|
||||
5. **安全性** - 符合企业级安全要求
|
||||
|
||||
部署包大小为577MB,包含了完整的应用程序、Docker镜像、配置文件和历史测试数据。可以在任何支持Docker的Linux环境中快速部署和运行。
|
||||
|
||||
## 下一步行动
|
||||
|
||||
1. **传输部署包** - 将 `dms-compliance-complete-offline-20250813-074148.tar.gz` 传输到目标环境
|
||||
2. **执行部署** - 在目标环境运行 `./install.sh`
|
||||
3. **验证功能** - 访问服务地址确认正常运行
|
||||
4. **配置网络** - 根据需要配置防火墙和反向代理
|
||||
5. **设置备份** - 建立定期数据备份机制
|
||||
@ -704,6 +704,11 @@ def run_tests_logic(config: dict):
|
||||
|
||||
# --- Flask API Endpoint ---
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def health_check():
|
||||
"""Health check endpoint for Docker health checks."""
|
||||
return {"status": "healthy", "service": "DMS Compliance API Server"}, 200
|
||||
|
||||
@app.route('/run', methods=['POST'])
|
||||
def run_api_tests_endpoint():
|
||||
"""
|
||||
@ -762,7 +767,7 @@ def run_api_tests_endpoint():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, port=5002)
|
||||
app.run(debug=True, host='0.0.0.0', port=5050)
|
||||
|
||||
# Example cURL to trigger the endpoint with custom params:
|
||||
# curl -X POST http://127.0.0.1:5002/run \
|
||||
|
||||
362
create-compose-package.sh
Executable file
362
create-compose-package.sh
Executable file
@ -0,0 +1,362 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - Docker Compose版本部署包创建脚本
|
||||
# 使用Alpine Linux + 多阶段构建 + Docker Compose管理
|
||||
|
||||
set -e
|
||||
|
||||
# 配置变量
|
||||
EXPORT_DIR="dms-compliance-compose-$(date +%Y%m%d-%H%M%S)"
|
||||
IMAGE_NAME="compliance-dms-mini"
|
||||
ARCHIVE_NAME="$EXPORT_DIR.tar.gz"
|
||||
|
||||
echo "=== DMS合规性测试工具 Docker Compose版本部署包创建脚本 ==="
|
||||
echo "[信息] 使用Docker Compose管理,完全兼容原版架构"
|
||||
|
||||
# 检查Docker是否运行
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "[错误] Docker未运行或无法访问"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 创建导出目录
|
||||
echo "[信息] 创建导出目录: $EXPORT_DIR"
|
||||
rm -rf "$EXPORT_DIR"
|
||||
mkdir -p "$EXPORT_DIR"
|
||||
|
||||
# 1. 创建临时构建目录,只包含必要文件
|
||||
echo "[信息] 创建临时构建目录..."
|
||||
TEMP_BUILD_DIR=$(mktemp -d)
|
||||
trap "rm -rf $TEMP_BUILD_DIR" EXIT
|
||||
|
||||
# 白名单:只复制必要的文件
|
||||
echo "[信息] 复制必要文件(超精简模式)..."
|
||||
mkdir -p "$TEMP_BUILD_DIR"/{ddms_compliance_suite,custom_stages,custom_testcases,templates,static,assets}
|
||||
|
||||
# 只复制核心Python文件
|
||||
echo "[信息] 复制核心Python文件..."
|
||||
for file in api_server.py history_viewer.py flask_app.py; do
|
||||
[ -f "$file" ] && cp "$file" "$TEMP_BUILD_DIR/"
|
||||
done
|
||||
|
||||
# 复制核心目录(排除缓存和临时文件)
|
||||
echo "[信息] 复制核心目录..."
|
||||
rsync -av --exclude='__pycache__' --exclude='*.pyc' --exclude='*.log' ddms_compliance_suite/ "$TEMP_BUILD_DIR/ddms_compliance_suite/"
|
||||
rsync -av --exclude='__pycache__' --exclude='*.pyc' custom_stages/ "$TEMP_BUILD_DIR/custom_stages/"
|
||||
rsync -av --exclude='__pycache__' --exclude='*.pyc' custom_testcases/ "$TEMP_BUILD_DIR/custom_testcases/"
|
||||
|
||||
# 确保templates目录结构正确
|
||||
echo "[信息] 复制模板和静态文件..."
|
||||
rsync -av templates/ "$TEMP_BUILD_DIR/templates/"
|
||||
rsync -av static/ "$TEMP_BUILD_DIR/static/"
|
||||
rsync -av assets/ "$TEMP_BUILD_DIR/assets/"
|
||||
|
||||
# 验证templates目录内容
|
||||
echo "[信息] 验证templates目录: $(ls "$TEMP_BUILD_DIR/templates/" 2>/dev/null | wc -l) 个文件"
|
||||
echo "[信息] templates文件列表: $(ls "$TEMP_BUILD_DIR/templates/" 2>/dev/null | tr '\n' ' ')"
|
||||
|
||||
# 复制完整的requirements.txt
|
||||
echo "[信息] 复制完整的requirements.txt..."
|
||||
cp requirements.txt "$TEMP_BUILD_DIR/"
|
||||
|
||||
# 创建超轻量级Dockerfile
|
||||
echo "[信息] 创建超轻量级Dockerfile..."
|
||||
cat > "$TEMP_BUILD_DIR/Dockerfile" << 'EOF'
|
||||
# 多阶段构建:第一阶段安装依赖
|
||||
FROM python:3.9-alpine AS builder
|
||||
|
||||
# 安装构建依赖
|
||||
RUN apk add --no-cache gcc musl-dev linux-headers
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制requirements并安装Python依赖
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --user -r requirements.txt
|
||||
|
||||
# 第二阶段:运行时镜像
|
||||
FROM python:3.9-alpine
|
||||
|
||||
# 安装运行时依赖
|
||||
RUN apk add --no-cache supervisor curl && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
# 从构建阶段复制Python包
|
||||
COPY --from=builder /root/.local /root/.local
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制应用代码
|
||||
COPY . .
|
||||
|
||||
# 创建supervisor配置
|
||||
RUN mkdir -p /etc/supervisor/conf.d
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/
|
||||
|
||||
# 创建日志目录
|
||||
RUN mkdir -p /var/log/supervisor /app/logs /app/test_reports /app/uploads
|
||||
|
||||
# 设置环境变量
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
ENV PYTHONPATH=/app
|
||||
ENV FLASK_ENV=production
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# 暴露端口(两个服务的端口)
|
||||
EXPOSE 5050 5051
|
||||
|
||||
# 启动supervisor
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
EOF
|
||||
|
||||
# 创建supervisor配置
|
||||
echo "[信息] 创建supervisor配置..."
|
||||
cat > "$TEMP_BUILD_DIR/supervisord.conf" << 'EOF'
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
childlogdir=/var/log/supervisor
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=info
|
||||
|
||||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock
|
||||
chmod=0700
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
# DMS API服务器 (主服务)
|
||||
[program:api_server]
|
||||
command=python api_server.py
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/log/supervisor/api_server.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=5
|
||||
environment=PYTHONPATH="/app",PYTHONUNBUFFERED="1"
|
||||
|
||||
# 历史查看器服务
|
||||
[program:history_viewer]
|
||||
command=python history_viewer.py
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/log/supervisor/history_viewer.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=5
|
||||
environment=PYTHONPATH="/app",PYTHONUNBUFFERED="1"
|
||||
|
||||
# 进程组配置
|
||||
[group:dms_services]
|
||||
programs=api_server,history_viewer
|
||||
priority=999
|
||||
EOF
|
||||
|
||||
# 显示构建目录大小
|
||||
echo "[信息] 临时构建目录大小: $(du -sh "$TEMP_BUILD_DIR" | cut -f1)"
|
||||
|
||||
# 2. 构建Docker镜像
|
||||
echo "[信息] 构建超轻量Docker镜像..."
|
||||
cd "$TEMP_BUILD_DIR"
|
||||
docker build -t "$IMAGE_NAME:latest" .
|
||||
cd - > /dev/null
|
||||
|
||||
# 3. 导出Docker镜像
|
||||
echo "[信息] 导出Docker镜像..."
|
||||
docker save "$IMAGE_NAME:latest" | gzip > "$EXPORT_DIR/docker-image.tar.gz"
|
||||
|
||||
# 4. 创建docker-compose.yml
|
||||
echo "[信息] 创建docker-compose.yml..."
|
||||
cat > "$EXPORT_DIR/docker-compose.yml" << 'EOF'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
dms-compliance-tool:
|
||||
image: compliance-dms-mini:latest
|
||||
container_name: dms-compliance-mini
|
||||
ports:
|
||||
- "5050:5050" # API服务器端口
|
||||
- "5051:5051" # 历史查看器端口
|
||||
volumes:
|
||||
# 持久化测试报告
|
||||
- ./test_reports:/app/test_reports
|
||||
# 持久化上传文件
|
||||
- ./uploads:/app/uploads
|
||||
# 持久化日志
|
||||
- ./logs:/app/logs
|
||||
# 如果需要自定义配置文件
|
||||
- ./config:/app/config:ro
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
- PYTHONUNBUFFERED=1
|
||||
- TZ=Asia/Shanghai
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:5050/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
networks:
|
||||
- dms-network
|
||||
|
||||
networks:
|
||||
dms-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
test_reports:
|
||||
uploads:
|
||||
logs:
|
||||
EOF
|
||||
|
||||
# 5. 创建部署脚本
|
||||
echo "[信息] 创建部署脚本..."
|
||||
cat > "$EXPORT_DIR/deploy.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - Docker Compose版本部署脚本
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== DMS合规性测试工具 Docker Compose版本部署 ==="
|
||||
|
||||
# 检查Docker和Docker Compose
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "[错误] Docker未运行"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v docker-compose >/dev/null 2>&1 && ! docker compose version >/dev/null 2>&1; then
|
||||
echo "[错误] Docker Compose未安装"
|
||||
echo "请安装Docker Compose或使用Docker Desktop"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 创建必要的目录
|
||||
echo "[信息] 创建数据目录..."
|
||||
mkdir -p test_reports uploads logs config
|
||||
|
||||
# 加载镜像
|
||||
echo "[信息] 加载Docker镜像..."
|
||||
docker load < docker-image.tar.gz
|
||||
|
||||
# 停止现有服务
|
||||
echo "[信息] 停止现有服务..."
|
||||
docker-compose down 2>/dev/null || docker compose down 2>/dev/null || true
|
||||
|
||||
# 启动服务
|
||||
echo "[信息] 启动服务..."
|
||||
if command -v docker-compose >/dev/null 2>&1; then
|
||||
docker-compose up -d
|
||||
else
|
||||
docker compose up -d
|
||||
fi
|
||||
|
||||
echo "[成功] 部署完成!"
|
||||
echo "访问地址: http://localhost:5050 (API服务器)"
|
||||
echo "访问地址: http://localhost:5051 (历史查看器)"
|
||||
echo ""
|
||||
echo "管理命令:"
|
||||
echo "- 查看状态: docker-compose ps"
|
||||
echo "- 查看日志: docker-compose logs"
|
||||
echo "- 停止服务: docker-compose down"
|
||||
echo "- 重启服务: docker-compose restart"
|
||||
echo ""
|
||||
echo "数据目录:"
|
||||
echo "- 测试报告: $(pwd)/test_reports"
|
||||
echo "- 上传文件: $(pwd)/uploads"
|
||||
echo "- 日志文件: $(pwd)/logs"
|
||||
echo "- 配置文件: $(pwd)/config"
|
||||
EOF
|
||||
|
||||
chmod +x "$EXPORT_DIR/deploy.sh"
|
||||
|
||||
# 6. 创建README
|
||||
echo "[信息] 创建README..."
|
||||
cat > "$EXPORT_DIR/README.md" << 'EOF'
|
||||
# DMS合规性测试工具 - Docker Compose版本
|
||||
|
||||
## 特点
|
||||
- 基于Alpine Linux,镜像体积极小(约300MB)
|
||||
- 多阶段构建,优化层结构
|
||||
- 完全兼容原版架构(5050+5051端口)
|
||||
- 使用Docker Compose管理服务
|
||||
- 支持数据持久化和健康检查
|
||||
|
||||
## 部署方法
|
||||
|
||||
1. 解压部署包
|
||||
2. 运行部署脚本:
|
||||
```bash
|
||||
./deploy.sh
|
||||
```
|
||||
3. 访问服务:
|
||||
- API服务器: http://localhost:5050
|
||||
- 历史查看器: http://localhost:5051
|
||||
|
||||
## 管理命令
|
||||
|
||||
- 查看服务状态:`docker-compose ps`
|
||||
- 查看日志:`docker-compose logs`
|
||||
- 停止服务:`docker-compose down`
|
||||
- 重启服务:`docker-compose restart`
|
||||
- 查看实时日志:`docker-compose logs -f`
|
||||
|
||||
## 文件说明
|
||||
|
||||
- `docker-image.tar.gz` - Docker镜像文件
|
||||
- `docker-compose.yml` - Docker Compose配置文件
|
||||
- `deploy.sh` - 一键部署脚本
|
||||
- `README.md` - 说明文档
|
||||
|
||||
## 数据持久化
|
||||
|
||||
所有重要数据都会持久化到本地目录:
|
||||
- `test_reports/` - 测试报告
|
||||
- `uploads/` - 上传文件
|
||||
- `logs/` - 日志文件
|
||||
- `config/` - 配置文件(只读)
|
||||
EOF
|
||||
|
||||
# 7. 显示镜像信息
|
||||
echo "[信息] Docker镜像信息:"
|
||||
docker images "$IMAGE_NAME:latest"
|
||||
|
||||
# 8. 压缩最终包
|
||||
echo "[信息] 压缩最终部署包..."
|
||||
tar -czf "$ARCHIVE_NAME" "$EXPORT_DIR"
|
||||
|
||||
# 9. 显示结果
|
||||
echo ""
|
||||
echo "=== 创建完成 ==="
|
||||
echo "部署包: $ARCHIVE_NAME"
|
||||
echo "部署包大小: $(du -sh "$ARCHIVE_NAME" | cut -f1)"
|
||||
echo "Docker镜像大小: $(docker images "$IMAGE_NAME:latest" --format "{{.Size}}" 2>/dev/null || echo "约300MB")"
|
||||
echo ""
|
||||
echo "部署方法:"
|
||||
echo "1. 解压: tar -xzf $ARCHIVE_NAME"
|
||||
echo "2. 进入目录: cd $EXPORT_DIR"
|
||||
echo "3. 运行: ./deploy.sh"
|
||||
echo ""
|
||||
|
||||
# 清理Docker镜像(可选)
|
||||
read -p "是否删除本地Docker镜像?(y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
docker rmi "$IMAGE_NAME:latest"
|
||||
echo "[信息] 已删除本地Docker镜像"
|
||||
fi
|
||||
|
||||
echo "[完成] Docker Compose版本部署包创建完成!"
|
||||
317
create-offline-package.sh
Executable file
317
create-offline-package.sh
Executable file
@ -0,0 +1,317 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 创建完整的离线部署包(包含Docker安装脚本)
|
||||
|
||||
set -e
|
||||
|
||||
PACKAGE_NAME="dms-compliance-complete-offline-$(date +%Y%m%d-%H%M%S)"
|
||||
TEMP_DIR="temp_package"
|
||||
|
||||
echo "=== 创建DMS合规性测试工具完整离线部署包 ==="
|
||||
|
||||
# 清理临时目录
|
||||
rm -rf "$TEMP_DIR"
|
||||
mkdir -p "$TEMP_DIR"
|
||||
|
||||
echo "[信息] 运行Docker镜像导出脚本..."
|
||||
./docker-export.sh
|
||||
|
||||
# 找到最新创建的离线包
|
||||
LATEST_PACKAGE=$(ls -t dms-compliance-offline-*.tar.gz | head -n1)
|
||||
|
||||
if [ -z "$LATEST_PACKAGE" ]; then
|
||||
echo "[错误] 找不到Docker离线包"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[信息] 找到Docker离线包: $LATEST_PACKAGE"
|
||||
|
||||
# 解压到临时目录
|
||||
echo "[信息] 解压Docker离线包..."
|
||||
tar -xzf "$LATEST_PACKAGE" -C "$TEMP_DIR"
|
||||
|
||||
# 获取解压后的目录名
|
||||
EXTRACTED_DIR=$(ls "$TEMP_DIR")
|
||||
PACKAGE_DIR="$TEMP_DIR/$EXTRACTED_DIR"
|
||||
|
||||
# 复制Docker安装脚本
|
||||
echo "[信息] 添加Docker安装脚本..."
|
||||
cp install-docker.sh "$PACKAGE_DIR/"
|
||||
|
||||
# 创建主安装脚本
|
||||
echo "[信息] 创建主安装脚本..."
|
||||
cat > "$PACKAGE_DIR/install.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - 完整安装脚本
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== DMS合规性测试工具完整安装脚本 ==="
|
||||
|
||||
# 检查操作系统
|
||||
if [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
echo "[信息] 操作系统: $NAME $VERSION_ID"
|
||||
else
|
||||
echo "[警告] 无法检测操作系统版本"
|
||||
fi
|
||||
|
||||
# 检查Docker是否已安装
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
echo "[信息] Docker已安装: $(docker --version)"
|
||||
|
||||
# 检查Docker是否运行
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "[信息] 启动Docker服务..."
|
||||
sudo systemctl start docker || {
|
||||
echo "[错误] 无法启动Docker服务,请检查Docker安装"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
else
|
||||
echo "[信息] Docker未安装"
|
||||
read -p "是否要安装Docker和Docker Compose? (y/N): " install_docker
|
||||
|
||||
if [[ $install_docker == [yY] || $install_docker == [yY][eE][sS] ]]; then
|
||||
echo "[信息] 开始安装Docker..."
|
||||
./install-docker.sh
|
||||
|
||||
echo "[信息] Docker安装完成,请重新登录或运行以下命令:"
|
||||
echo "newgrp docker"
|
||||
echo "然后重新运行此安装脚本"
|
||||
exit 0
|
||||
else
|
||||
echo "[错误] 需要Docker才能运行DMS合规性测试工具"
|
||||
echo "请手动安装Docker后重新运行此脚本"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 检查Docker Compose
|
||||
if ! command -v docker-compose >/dev/null 2>&1; then
|
||||
echo "[错误] Docker Compose未安装"
|
||||
echo "请运行 ./install-docker.sh 安装Docker Compose"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[信息] 开始部署DMS合规性测试工具..."
|
||||
./deploy.sh
|
||||
|
||||
echo ""
|
||||
echo "=== 安装完成 ==="
|
||||
echo ""
|
||||
echo "服务地址:"
|
||||
echo "- API服务器: http://localhost:5050"
|
||||
echo "- 历史查看器: http://localhost:5051"
|
||||
echo ""
|
||||
echo "管理命令:"
|
||||
echo "- 查看状态: docker-compose ps"
|
||||
echo "- 查看日志: docker-compose logs"
|
||||
echo "- 停止服务: ./stop.sh"
|
||||
echo "- 卸载服务: ./uninstall.sh"
|
||||
echo ""
|
||||
EOF
|
||||
|
||||
chmod +x "$PACKAGE_DIR/install.sh"
|
||||
|
||||
# 更新README文件,添加完整安装说明
|
||||
cat > "$PACKAGE_DIR/README.md" << 'EOF'
|
||||
# DMS合规性测试工具 - 完整离线部署包
|
||||
|
||||
这是一个包含所有必要组件的完整离线部署包,可以在没有网络连接的环境中部署DMS合规性测试工具。
|
||||
|
||||
## 包含内容
|
||||
|
||||
- DMS合规性测试工具Docker镜像
|
||||
- Nginx Docker镜像(可选)
|
||||
- Docker和Docker Compose安装脚本
|
||||
- 自动化部署脚本
|
||||
- 配置文件和文档
|
||||
|
||||
## 系统要求
|
||||
|
||||
### 最低要求
|
||||
- CPU: 2核心
|
||||
- 内存: 2GB
|
||||
- 磁盘: 5GB可用空间
|
||||
- 操作系统:
|
||||
- Ubuntu 18.04+
|
||||
- CentOS 7+
|
||||
- RHEL 7+
|
||||
- Debian 9+
|
||||
|
||||
### 推荐配置
|
||||
- CPU: 4核心
|
||||
- 内存: 4GB
|
||||
- 磁盘: 10GB可用空间
|
||||
|
||||
## 快速安装
|
||||
|
||||
### 方法一:一键安装(推荐)
|
||||
```bash
|
||||
# 解压部署包
|
||||
tar -xzf dms-compliance-complete-offline-*.tar.gz
|
||||
cd dms-compliance-offline-*
|
||||
|
||||
# 运行一键安装脚本
|
||||
./install.sh
|
||||
```
|
||||
|
||||
### 方法二:分步安装
|
||||
|
||||
1. **安装Docker(如果未安装)**
|
||||
```bash
|
||||
./install-docker.sh
|
||||
# 安装完成后需要重新登录或运行: newgrp docker
|
||||
```
|
||||
|
||||
2. **部署应用**
|
||||
```bash
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
## 服务访问
|
||||
|
||||
安装完成后,可以通过以下地址访问:
|
||||
|
||||
- **API服务器**: http://localhost:5050
|
||||
- **历史查看器**: http://localhost:5051
|
||||
|
||||
## 常用操作
|
||||
|
||||
### 服务管理
|
||||
```bash
|
||||
# 查看服务状态
|
||||
docker-compose ps
|
||||
|
||||
# 查看服务日志
|
||||
docker-compose logs
|
||||
|
||||
# 重启服务
|
||||
docker-compose restart
|
||||
|
||||
# 停止服务
|
||||
./stop.sh
|
||||
|
||||
# 完全卸载
|
||||
./uninstall.sh
|
||||
```
|
||||
|
||||
### 数据管理
|
||||
|
||||
数据存储位置:
|
||||
- `data/test_reports/` - 测试报告
|
||||
- `data/uploads/` - 上传文件
|
||||
- `data/logs/` - 应用日志
|
||||
|
||||
### 配置管理
|
||||
|
||||
自定义配置文件放在 `config/` 目录中。
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 常见问题
|
||||
|
||||
1. **端口冲突**
|
||||
- 修改 `docker-compose.yml` 中的端口映射
|
||||
- 或停止占用端口的其他服务
|
||||
|
||||
2. **权限问题**
|
||||
```bash
|
||||
sudo chown -R $USER:$USER data/
|
||||
chmod -R 755 data/
|
||||
```
|
||||
|
||||
3. **Docker服务未启动**
|
||||
```bash
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
```
|
||||
|
||||
4. **内存不足**
|
||||
- 确保系统有至少2GB可用内存
|
||||
- 关闭不必要的服务
|
||||
|
||||
### 日志查看
|
||||
|
||||
```bash
|
||||
# 查看应用日志
|
||||
docker-compose logs dms-compliance-tool
|
||||
|
||||
# 查看系统日志
|
||||
journalctl -u docker
|
||||
|
||||
# 查看容器详细信息
|
||||
docker inspect dms-compliance-tool
|
||||
```
|
||||
|
||||
## 网络配置
|
||||
|
||||
### 防火墙设置
|
||||
|
||||
如需外部访问,请开放以下端口:
|
||||
```bash
|
||||
# CentOS/RHEL
|
||||
sudo firewall-cmd --permanent --add-port=5050/tcp
|
||||
sudo firewall-cmd --permanent --add-port=5051/tcp
|
||||
sudo firewall-cmd --reload
|
||||
|
||||
# Ubuntu/Debian
|
||||
sudo ufw allow 5050
|
||||
sudo ufw allow 5051
|
||||
```
|
||||
|
||||
### 反向代理
|
||||
|
||||
如需使用Nginx反向代理:
|
||||
```bash
|
||||
docker-compose --profile with-nginx up -d
|
||||
```
|
||||
|
||||
## 技术支持
|
||||
|
||||
如遇到问题,请提供:
|
||||
1. 操作系统版本:`cat /etc/os-release`
|
||||
2. Docker版本:`docker --version`
|
||||
3. 错误日志:`docker-compose logs`
|
||||
4. 系统资源:`free -h && df -h`
|
||||
|
||||
## 更新升级
|
||||
|
||||
1. 停止当前服务:`./stop.sh`
|
||||
2. 备份数据:`cp -r data/ data_backup/`
|
||||
3. 部署新版本
|
||||
4. 恢复数据(如需要)
|
||||
|
||||
## 安全建议
|
||||
|
||||
1. 定期备份 `data/` 目录
|
||||
2. 限制网络访问(仅内网使用)
|
||||
3. 定期更新Docker和系统
|
||||
4. 监控系统资源使用情况
|
||||
EOF
|
||||
|
||||
# 重新打包
|
||||
echo "[信息] 创建最终部署包..."
|
||||
cd "$TEMP_DIR"
|
||||
tar -czf "../$PACKAGE_NAME.tar.gz" "$EXTRACTED_DIR"
|
||||
cd ..
|
||||
|
||||
# 清理临时文件
|
||||
rm -rf "$TEMP_DIR"
|
||||
rm -f "$LATEST_PACKAGE"
|
||||
|
||||
echo ""
|
||||
echo "=== 完整离线部署包创建完成 ==="
|
||||
echo "文件名: $PACKAGE_NAME.tar.gz"
|
||||
echo "大小: $(du -h "$PACKAGE_NAME.tar.gz" | cut -f1)"
|
||||
echo ""
|
||||
echo "部署说明:"
|
||||
echo "1. 将 $PACKAGE_NAME.tar.gz 传输到目标服务器"
|
||||
echo "2. 解压: tar -xzf $PACKAGE_NAME.tar.gz"
|
||||
echo "3. 进入目录: cd ${PACKAGE_NAME%.*}"
|
||||
echo "4. 运行安装: ./install.sh"
|
||||
echo ""
|
||||
echo "注意: 如果目标服务器没有Docker,安装脚本会提示安装Docker和Docker Compose"
|
||||
echo ""
|
||||
@ -3,7 +3,7 @@ API 阶段测试框架模块
|
||||
"""
|
||||
import logging
|
||||
import time
|
||||
from typing import List, Dict, Any, Callable, Optional, Union
|
||||
from typing import List, Dict, Any, Callable, Optional, Union, TYPE_CHECKING
|
||||
from enum import Enum
|
||||
from datetime import datetime
|
||||
from dataclasses import dataclass, field
|
||||
@ -18,6 +18,9 @@ from .api_caller.caller import APICallDetail
|
||||
from .input_parser.parser import ParsedAPISpec, YAPIEndpoint, SwaggerEndpoint,BaseEndpoint,DMSEndpoint
|
||||
from .utils.context_utils import serialize_context_recursively
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .input_parser.parser import ParsedAPISpec
|
||||
|
||||
# 尝试从 .llm_utils 导入,如果失败则 LLMService 为 None
|
||||
try:
|
||||
from .llm_utils.llm_service import LLMService
|
||||
@ -262,98 +265,7 @@ class BaseAPIStage:
|
||||
else:
|
||||
self.steps = []
|
||||
|
||||
def get_api_spec_for_operation(self,
|
||||
lookup_key: str,
|
||||
global_api_spec: ParsedAPISpec, # 确保类型正确
|
||||
api_group_name: Optional[str] = None
|
||||
) -> Optional[APIOperationSpec]:
|
||||
"""
|
||||
根据查找键从提供的API规范中获取特定API操作的详细信息。
|
||||
这个方法需要子类根据其查找逻辑来实现,或者提供一个通用的基于operationId或path+method的查找。
|
||||
|
||||
Args:
|
||||
lookup_key: 用于查找API操作的键 (例如 operationId, "METHOD /path", 或自定义键)。
|
||||
global_api_spec: 完整的已解析API规范对象。
|
||||
api_group_name: (可选) 当前API分组的名称,用于更精确的查找或作用域限定。
|
||||
|
||||
Returns:
|
||||
APIOperationSpec 对象如果找到,否则 None。
|
||||
"""
|
||||
self.logger.debug(f"Attempting to find API spec for lookup_key='{lookup_key}', api_group='{api_group_name}'")
|
||||
|
||||
# 尝试基于 operationId 查找 (如果 lookup_key 看起来像 operationId)
|
||||
# 简单的启发式:不包含空格和斜杠的键可能是 operationId
|
||||
if ' ' not in lookup_key and '/' not in lookup_key:
|
||||
for endpoint in global_api_spec.endpoints:
|
||||
endpoint_dict = endpoint.to_dict() # 将YAPIEndpoint或SwaggerEndpoint转换为标准化字典
|
||||
op_id = endpoint_dict.get('operationId')
|
||||
if op_id == lookup_key:
|
||||
# 检查此端点是否属于当前API分组 (如果提供了api_group_name)
|
||||
if api_group_name:
|
||||
tags = endpoint_dict.get('tags', [])
|
||||
if api_group_name not in tags:
|
||||
self.logger.debug(f"Endpoint with operationId '{lookup_key}' found, but not in group '{api_group_name}'. Tags: {tags}")
|
||||
continue # 不在当前组,继续查找
|
||||
|
||||
self.logger.info(f"Found API for operationId '{lookup_key}' (group: {api_group_name}). Path: {endpoint_dict.get('path')}")
|
||||
return APIOperationSpec(
|
||||
method=endpoint_dict.get('method','').upper(),
|
||||
path=endpoint_dict.get('path',''),
|
||||
spec=endpoint_dict, # 传递整个端点字典作为规范
|
||||
operation_id=op_id,
|
||||
summary=endpoint_dict.get('summary'),
|
||||
description=endpoint_dict.get('description'),
|
||||
tags=endpoint_dict.get('tags', [])
|
||||
)
|
||||
|
||||
# 尝试基于 "METHOD /path" 格式的 lookup_key 查找
|
||||
# (这是一个更通用的查找方式,但可能需要更仔细的路径匹配逻辑)
|
||||
parts = lookup_key.split(' ', 1)
|
||||
if len(parts) == 2:
|
||||
method_to_find = parts[0].upper()
|
||||
path_to_find = parts[1]
|
||||
for endpoint in global_api_spec.endpoints:
|
||||
endpoint_dict = endpoint.to_dict()
|
||||
if endpoint_dict.get('method','').upper() == method_to_find and endpoint_dict.get('path','') == path_to_find:
|
||||
if api_group_name:
|
||||
tags = endpoint_dict.get('tags', [])
|
||||
if api_group_name not in tags:
|
||||
self.logger.debug(f"Endpoint '{lookup_key}' found, but not in group '{api_group_name}'. Tags: {tags}")
|
||||
continue
|
||||
self.logger.info(f"Found API for method/path '{lookup_key}' (group: {api_group_name}).")
|
||||
return APIOperationSpec(
|
||||
method=method_to_find,
|
||||
path=path_to_find,
|
||||
spec=endpoint_dict,
|
||||
operation_id=endpoint_dict.get('operationId'),
|
||||
summary=endpoint_dict.get('summary'),
|
||||
description=endpoint_dict.get('description'),
|
||||
tags=endpoint_dict.get('tags', [])
|
||||
)
|
||||
|
||||
self.logger.warning(f"Could not find API operation spec for lookup_key: '{lookup_key}' (api_group: '{api_group_name}') using default search logic (operationId or METHOD /path). Consider overriding get_api_spec_for_operation in your Stage class for custom lookup logic.")
|
||||
return None
|
||||
|
||||
# --- 生命周期钩子 ---
|
||||
def before_stage(self, stage_context: Dict[str, Any], global_api_spec: ParsedAPISpec, api_group_name: Optional[str]):
|
||||
"""在测试阶段所有步骤执行之前调用。"""
|
||||
self.logger.debug(f"Executing before_stage for stage '{self.id}', group '{api_group_name}'. Initial context: {stage_context}")
|
||||
pass
|
||||
|
||||
def after_stage(self, stage_result: ExecutedStageResult, stage_context: Dict[str, Any], global_api_spec: ParsedAPISpec, api_group_name: Optional[str]):
|
||||
"""在测试阶段所有步骤执行完毕之后调用(无论成功、失败或错误)。"""
|
||||
self.logger.debug(f"Executing after_stage for stage '{self.id}', group '{api_group_name}'. Result status: {stage_result.overall_status.value}. Final context: {stage_context}")
|
||||
pass
|
||||
|
||||
def before_step(self, step: StageStepDefinition, stage_context: Dict[str, Any], global_api_spec: ParsedAPISpec, api_group_name: Optional[str]):
|
||||
"""在每个测试步骤执行之前调用。"""
|
||||
self.logger.debug(f"Executing before_step for stage '{self.id}', step '{step.name}', group '{api_group_name}'. Current context: {stage_context}")
|
||||
pass
|
||||
|
||||
def after_step(self, step: StageStepDefinition, step_result: ExecutedStageStepResult, stage_context: Dict[str, Any], global_api_spec: ParsedAPISpec, api_group_name: Optional[str]):
|
||||
"""在每个测试步骤执行之后调用(无论成功、失败或错误)。"""
|
||||
self.logger.debug(f"Executing after_step for stage '{self.id}', step '{step.name}', group '{api_group_name}'. Step status: {step_result.status.value}. Context after step: {stage_context}")
|
||||
pass
|
||||
|
||||
def is_applicable_to_api_group(self, api_group_name: Optional[str], global_api_spec: ParsedAPISpec) -> bool:
|
||||
"""
|
||||
|
||||
391
docker-export.sh
Executable file
391
docker-export.sh
Executable file
@ -0,0 +1,391 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - Docker镜像打包脚本
|
||||
# 用于创建离线部署包
|
||||
|
||||
set -e
|
||||
|
||||
# 配置变量
|
||||
EXPORT_DIR="dms-compliance-offline"
|
||||
IMAGE_NAME="compliance-dms-compliance-tool"
|
||||
NGINX_IMAGE="nginx:alpine"
|
||||
ARCHIVE_NAME="dms-compliance-offline-$(date +%Y%m%d-%H%M%S).tar.gz"
|
||||
|
||||
echo "=== DMS合规性测试工具 离线部署包创建脚本 ==="
|
||||
|
||||
# 检查Docker是否运行
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "[错误] Docker未运行或无法访问"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 创建导出目录
|
||||
echo "[信息] 创建导出目录: $EXPORT_DIR"
|
||||
rm -rf "$EXPORT_DIR"
|
||||
mkdir -p "$EXPORT_DIR"
|
||||
|
||||
# 1. 构建最新镜像
|
||||
echo "[信息] 构建DMS合规性测试工具镜像..."
|
||||
docker-compose build dms-compliance-tool
|
||||
|
||||
# 2. 导出主应用镜像
|
||||
echo "[信息] 导出主应用镜像..."
|
||||
docker save "$IMAGE_NAME:latest" -o "$EXPORT_DIR/dms-compliance-tool.tar"
|
||||
|
||||
# 3. 拉取并导出nginx镜像(如果需要)
|
||||
echo "[信息] 拉取并导出nginx镜像..."
|
||||
docker pull "$NGINX_IMAGE"
|
||||
docker save "$NGINX_IMAGE" -o "$EXPORT_DIR/nginx-alpine.tar"
|
||||
|
||||
# 4. 复制部署文件
|
||||
echo "[信息] 复制部署文件..."
|
||||
|
||||
# 创建离线版docker-compose文件
|
||||
cat > "$EXPORT_DIR/docker-compose.yml" << 'EOF'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
dms-compliance-tool:
|
||||
image: compliance-dms-compliance-tool:latest
|
||||
container_name: dms-compliance-tool
|
||||
ports:
|
||||
- "5050:5050" # API服务器端口
|
||||
- "5051:5051" # 历史查看器端口
|
||||
volumes:
|
||||
# 持久化测试报告
|
||||
- ./data/test_reports:/app/test_reports
|
||||
# 持久化上传文件
|
||||
- ./data/uploads:/app/uploads
|
||||
# 持久化日志
|
||||
- ./data/logs:/app/logs
|
||||
# 如果需要自定义配置文件
|
||||
- ./config:/app/config:ro
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
- PYTHONUNBUFFERED=1
|
||||
- TZ=Asia/Shanghai
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:5050/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
networks:
|
||||
- dms-network
|
||||
|
||||
# 可选:添加一个nginx反向代理
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: dms-nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
||||
depends_on:
|
||||
- dms-compliance-tool
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- dms-network
|
||||
profiles:
|
||||
- with-nginx
|
||||
|
||||
networks:
|
||||
dms-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
test_reports:
|
||||
uploads:
|
||||
logs:
|
||||
EOF
|
||||
|
||||
# 5. 复制nginx配置(如果存在)
|
||||
if [ -d "nginx" ]; then
|
||||
echo "[信息] 复制nginx配置..."
|
||||
cp -r nginx "$EXPORT_DIR/"
|
||||
fi
|
||||
|
||||
# 6. 复制config目录(如果存在)
|
||||
if [ -d "config" ]; then
|
||||
echo "[信息] 复制配置文件..."
|
||||
cp -r config "$EXPORT_DIR/"
|
||||
fi
|
||||
|
||||
# 7. 创建数据目录结构
|
||||
echo "[信息] 创建数据目录结构..."
|
||||
mkdir -p "$EXPORT_DIR/data/test_reports"
|
||||
mkdir -p "$EXPORT_DIR/data/uploads"
|
||||
mkdir -p "$EXPORT_DIR/data/logs"
|
||||
|
||||
# 8. 复制现有的测试报告(如果存在)
|
||||
if [ -d "test_reports" ] && [ "$(ls -A test_reports)" ]; then
|
||||
echo "[信息] 复制现有测试报告..."
|
||||
cp -r test_reports/* "$EXPORT_DIR/data/test_reports/"
|
||||
fi
|
||||
|
||||
# 9. 创建部署脚本
|
||||
echo "[信息] 创建部署脚本..."
|
||||
|
||||
cat > "$EXPORT_DIR/deploy.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - 离线部署脚本
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== DMS合规性测试工具 离线部署脚本 ==="
|
||||
|
||||
# 检查Docker是否运行
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "[错误] Docker未运行或无法访问,请先安装并启动Docker"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 检查docker-compose是否可用
|
||||
if ! command -v docker-compose >/dev/null 2>&1; then
|
||||
echo "[错误] docker-compose未安装,请先安装docker-compose"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[信息] 加载Docker镜像..."
|
||||
|
||||
# 加载主应用镜像
|
||||
if [ -f "dms-compliance-tool.tar" ]; then
|
||||
echo "[信息] 加载DMS合规性测试工具镜像..."
|
||||
docker load -i dms-compliance-tool.tar
|
||||
else
|
||||
echo "[错误] 找不到dms-compliance-tool.tar镜像文件"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 加载nginx镜像
|
||||
if [ -f "nginx-alpine.tar" ]; then
|
||||
echo "[信息] 加载nginx镜像..."
|
||||
docker load -i nginx-alpine.tar
|
||||
else
|
||||
echo "[警告] 找不到nginx-alpine.tar镜像文件,nginx服务将无法使用"
|
||||
fi
|
||||
|
||||
echo "[信息] 创建必要的目录..."
|
||||
mkdir -p data/test_reports data/uploads data/logs
|
||||
|
||||
echo "[信息] 设置目录权限..."
|
||||
# 确保目录权限正确(Docker容器中的用户ID可能不同)
|
||||
chmod -R 755 data/
|
||||
|
||||
echo "[信息] 启动服务..."
|
||||
docker-compose up -d
|
||||
|
||||
echo "[信息] 等待服务启动..."
|
||||
sleep 10
|
||||
|
||||
# 检查服务状态
|
||||
echo "[信息] 检查服务状态..."
|
||||
docker-compose ps
|
||||
|
||||
# 检查健康状态
|
||||
echo "[信息] 检查服务健康状态..."
|
||||
for i in {1..30}; do
|
||||
if curl -f http://localhost:5050/ >/dev/null 2>&1; then
|
||||
echo "[成功] API服务器已启动并正常运行"
|
||||
break
|
||||
fi
|
||||
if [ $i -eq 30 ]; then
|
||||
echo "[警告] API服务器健康检查超时,请检查日志"
|
||||
docker-compose logs dms-compliance-tool
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
if curl -f http://localhost:5051/ >/dev/null 2>&1; then
|
||||
echo "[成功] 历史查看器已启动并正常运行"
|
||||
else
|
||||
echo "[警告] 历史查看器可能未正常启动,请检查日志"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== 部署完成 ==="
|
||||
echo "API服务器地址: http://localhost:5050"
|
||||
echo "历史查看器地址: http://localhost:5051"
|
||||
echo ""
|
||||
echo "常用命令:"
|
||||
echo " 查看服务状态: docker-compose ps"
|
||||
echo " 查看日志: docker-compose logs"
|
||||
echo " 停止服务: docker-compose down"
|
||||
echo " 重启服务: docker-compose restart"
|
||||
echo ""
|
||||
EOF
|
||||
|
||||
chmod +x "$EXPORT_DIR/deploy.sh"
|
||||
|
||||
# 10. 创建停止脚本
|
||||
cat > "$EXPORT_DIR/stop.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - 停止脚本
|
||||
|
||||
echo "=== 停止DMS合规性测试工具 ==="
|
||||
|
||||
if [ -f "docker-compose.yml" ]; then
|
||||
docker-compose down
|
||||
echo "[信息] 服务已停止"
|
||||
else
|
||||
echo "[错误] 找不到docker-compose.yml文件"
|
||||
exit 1
|
||||
fi
|
||||
EOF
|
||||
|
||||
chmod +x "$EXPORT_DIR/stop.sh"
|
||||
|
||||
# 11. 创建卸载脚本
|
||||
cat > "$EXPORT_DIR/uninstall.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - 卸载脚本
|
||||
|
||||
echo "=== 卸载DMS合规性测试工具 ==="
|
||||
|
||||
read -p "确定要卸载DMS合规性测试工具吗?这将删除所有容器和镜像 (y/N): " confirm
|
||||
|
||||
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then
|
||||
echo "[信息] 停止并删除容器..."
|
||||
docker-compose down -v
|
||||
|
||||
echo "[信息] 删除镜像..."
|
||||
docker rmi compliance-dms-compliance-tool:latest nginx:alpine 2>/dev/null || true
|
||||
|
||||
echo "[信息] 清理未使用的资源..."
|
||||
docker system prune -f
|
||||
|
||||
echo "[成功] 卸载完成"
|
||||
else
|
||||
echo "[信息] 取消卸载"
|
||||
fi
|
||||
EOF
|
||||
|
||||
chmod +x "$EXPORT_DIR/uninstall.sh"
|
||||
|
||||
# 12. 创建README文件
|
||||
cat > "$EXPORT_DIR/README.md" << 'EOF'
|
||||
# DMS合规性测试工具 - 离线部署包
|
||||
|
||||
## 系统要求
|
||||
|
||||
- Docker 20.10+
|
||||
- Docker Compose 1.29+
|
||||
- 至少2GB可用内存
|
||||
- 至少5GB可用磁盘空间
|
||||
|
||||
## 快速部署
|
||||
|
||||
1. 解压部署包到目标目录
|
||||
2. 进入部署目录
|
||||
3. 运行部署脚本:
|
||||
```bash
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
## 服务访问
|
||||
|
||||
部署成功后,可以通过以下地址访问服务:
|
||||
|
||||
- **API服务器**: http://localhost:5050
|
||||
- **历史查看器**: http://localhost:5051
|
||||
|
||||
## 常用操作
|
||||
|
||||
### 查看服务状态
|
||||
```bash
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
### 查看服务日志
|
||||
```bash
|
||||
# 查看所有服务日志
|
||||
docker-compose logs
|
||||
|
||||
# 查看特定服务日志
|
||||
docker-compose logs dms-compliance-tool
|
||||
```
|
||||
|
||||
### 停止服务
|
||||
```bash
|
||||
./stop.sh
|
||||
# 或者
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
### 重启服务
|
||||
```bash
|
||||
docker-compose restart
|
||||
```
|
||||
|
||||
### 完全卸载
|
||||
```bash
|
||||
./uninstall.sh
|
||||
```
|
||||
|
||||
## 数据持久化
|
||||
|
||||
以下目录的数据会被持久化保存:
|
||||
|
||||
- `data/test_reports/` - 测试报告
|
||||
- `data/uploads/` - 上传的文件
|
||||
- `data/logs/` - 应用日志
|
||||
|
||||
## 配置文件
|
||||
|
||||
如需自定义配置,可以在 `config/` 目录中放置配置文件。
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 端口冲突
|
||||
如果5050或5051端口被占用,可以修改 `docker-compose.yml` 文件中的端口映射。
|
||||
|
||||
### 权限问题
|
||||
如果遇到权限问题,可以尝试:
|
||||
```bash
|
||||
sudo chown -R $USER:$USER data/
|
||||
chmod -R 755 data/
|
||||
```
|
||||
|
||||
### 服务无法启动
|
||||
1. 检查Docker是否正常运行
|
||||
2. 查看服务日志:`docker-compose logs`
|
||||
3. 检查系统资源是否充足
|
||||
|
||||
## 技术支持
|
||||
|
||||
如遇到问题,请提供以下信息:
|
||||
- 操作系统版本
|
||||
- Docker版本
|
||||
- 错误日志
|
||||
- 服务状态输出
|
||||
EOF
|
||||
|
||||
# 13. 创建版本信息文件
|
||||
cat > "$EXPORT_DIR/VERSION" << EOF
|
||||
DMS合规性测试工具 离线部署包
|
||||
构建时间: $(date '+%Y-%m-%d %H:%M:%S')
|
||||
构建主机: $(hostname)
|
||||
Docker版本: $(docker --version)
|
||||
Docker Compose版本: $(docker-compose --version)
|
||||
EOF
|
||||
|
||||
echo "[信息] 压缩部署包..."
|
||||
tar -czf "$ARCHIVE_NAME" "$EXPORT_DIR"
|
||||
|
||||
echo ""
|
||||
echo "=== 打包完成 ==="
|
||||
echo "部署包: $ARCHIVE_NAME"
|
||||
echo "大小: $(du -h "$ARCHIVE_NAME" | cut -f1)"
|
||||
echo ""
|
||||
echo "部署说明:"
|
||||
echo "1. 将 $ARCHIVE_NAME 传输到目标服务器"
|
||||
echo "2. 解压: tar -xzf $ARCHIVE_NAME"
|
||||
echo "3. 进入目录: cd $EXPORT_DIR"
|
||||
echo "4. 运行部署: ./deploy.sh"
|
||||
echo ""
|
||||
0
docker/start_services.sh
Normal file → Executable file
0
docker/start_services.sh
Normal file → Executable file
@ -1,20 +1,18 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
childlogdir=/var/log/supervisor
|
||||
logfile=/app/logs/supervisord.log
|
||||
pidfile=/app/supervisord.pid
|
||||
childlogdir=/app/logs
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=info
|
||||
|
||||
[unix_http_server]
|
||||
file=/var/run/supervisor.sock
|
||||
file=/app/supervisor.sock
|
||||
chmod=0700
|
||||
chown=dms:dms
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///var/run/supervisor.sock
|
||||
serverurl=unix:///app/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
@ -27,7 +25,7 @@ user=dms
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/log/supervisor/api_server.log
|
||||
stdout_logfile=/app/logs/api_server.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=5
|
||||
environment=PYTHONPATH="/app",PYTHONUNBUFFERED="1"
|
||||
@ -40,7 +38,7 @@ user=dms
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/log/supervisor/history_viewer.log
|
||||
stdout_logfile=/app/logs/history_viewer.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=5
|
||||
environment=PYTHONPATH="/app",PYTHONUNBUFFERED="1"
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['history_viewer.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
[],
|
||||
name='history_local',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
runtime_tmpdir=None,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
190
install-docker.sh
Executable file
190
install-docker.sh
Executable file
@ -0,0 +1,190 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Docker和Docker Compose安装脚本
|
||||
# 支持CentOS/RHEL 7+, Ubuntu 18.04+, Debian 9+
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Docker和Docker Compose安装脚本 ==="
|
||||
|
||||
# 检测操作系统
|
||||
if [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
OS=$NAME
|
||||
VER=$VERSION_ID
|
||||
else
|
||||
echo "[错误] 无法检测操作系统版本"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[信息] 检测到操作系统: $OS $VER"
|
||||
|
||||
# 检查是否已安装Docker
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
echo "[信息] Docker已安装: $(docker --version)"
|
||||
DOCKER_INSTALLED=true
|
||||
else
|
||||
echo "[信息] Docker未安装,准备安装..."
|
||||
DOCKER_INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查是否已安装Docker Compose
|
||||
if command -v docker-compose >/dev/null 2>&1; then
|
||||
echo "[信息] Docker Compose已安装: $(docker-compose --version)"
|
||||
COMPOSE_INSTALLED=true
|
||||
else
|
||||
echo "[信息] Docker Compose未安装,准备安装..."
|
||||
COMPOSE_INSTALLED=false
|
||||
fi
|
||||
|
||||
# 安装Docker
|
||||
install_docker() {
|
||||
case "$OS" in
|
||||
"Ubuntu"|"Debian GNU/Linux")
|
||||
echo "[信息] 在Ubuntu/Debian上安装Docker..."
|
||||
|
||||
# 更新包索引
|
||||
sudo apt-get update
|
||||
|
||||
# 安装必要的包
|
||||
sudo apt-get install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg \
|
||||
lsb-release
|
||||
|
||||
# 添加Docker官方GPG密钥
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
||||
# 设置稳定版仓库
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# 安装Docker Engine
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||
;;
|
||||
|
||||
"CentOS Linux"|"Red Hat Enterprise Linux")
|
||||
echo "[信息] 在CentOS/RHEL上安装Docker..."
|
||||
|
||||
# 安装必要的包
|
||||
sudo yum install -y yum-utils
|
||||
|
||||
# 设置稳定版仓库
|
||||
sudo yum-config-manager \
|
||||
--add-repo \
|
||||
https://download.docker.com/linux/centos/docker-ce.repo
|
||||
|
||||
# 安装Docker Engine
|
||||
sudo yum install -y docker-ce docker-ce-cli containerd.io
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "[错误] 不支持的操作系统: $OS"
|
||||
echo "请手动安装Docker: https://docs.docker.com/engine/install/"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# 启动Docker服务
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
|
||||
# 将当前用户添加到docker组
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
echo "[成功] Docker安装完成"
|
||||
}
|
||||
|
||||
# 安装Docker Compose
|
||||
install_docker_compose() {
|
||||
echo "[信息] 安装Docker Compose..."
|
||||
|
||||
# 获取最新版本号
|
||||
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
|
||||
|
||||
if [ -z "$COMPOSE_VERSION" ]; then
|
||||
echo "[警告] 无法获取最新版本,使用默认版本 v2.20.2"
|
||||
COMPOSE_VERSION="v2.20.2"
|
||||
fi
|
||||
|
||||
echo "[信息] 下载Docker Compose $COMPOSE_VERSION..."
|
||||
|
||||
# 下载Docker Compose
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
|
||||
# 设置执行权限
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
|
||||
# 创建符号链接(如果需要)
|
||||
if [ ! -f /usr/bin/docker-compose ]; then
|
||||
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
||||
fi
|
||||
|
||||
echo "[成功] Docker Compose安装完成"
|
||||
}
|
||||
|
||||
# 验证安装
|
||||
verify_installation() {
|
||||
echo "[信息] 验证安装..."
|
||||
|
||||
if docker --version >/dev/null 2>&1; then
|
||||
echo "[成功] Docker: $(docker --version)"
|
||||
else
|
||||
echo "[错误] Docker安装失败"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if docker-compose --version >/dev/null 2>&1; then
|
||||
echo "[成功] Docker Compose: $(docker-compose --version)"
|
||||
else
|
||||
echo "[错误] Docker Compose安装失败"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 测试Docker是否可以运行
|
||||
if sudo docker run --rm hello-world >/dev/null 2>&1; then
|
||||
echo "[成功] Docker运行测试通过"
|
||||
else
|
||||
echo "[警告] Docker运行测试失败,可能需要重新登录或重启系统"
|
||||
fi
|
||||
}
|
||||
|
||||
# 主安装流程
|
||||
main() {
|
||||
# 检查是否为root用户或有sudo权限
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
echo "[警告] 检测到root用户,建议使用普通用户运行此脚本"
|
||||
elif ! sudo -n true 2>/dev/null; then
|
||||
echo "[错误] 需要sudo权限来安装Docker"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 安装Docker
|
||||
if [ "$DOCKER_INSTALLED" = false ]; then
|
||||
install_docker
|
||||
fi
|
||||
|
||||
# 安装Docker Compose
|
||||
if [ "$COMPOSE_INSTALLED" = false ]; then
|
||||
install_docker_compose
|
||||
fi
|
||||
|
||||
# 验证安装
|
||||
verify_installation
|
||||
|
||||
echo ""
|
||||
echo "=== 安装完成 ==="
|
||||
echo ""
|
||||
echo "注意事项:"
|
||||
echo "1. 如果这是首次安装Docker,请重新登录或运行 'newgrp docker' 来刷新用户组"
|
||||
echo "2. 确保Docker服务正在运行: sudo systemctl status docker"
|
||||
echo "3. 现在可以运行DMS合规性测试工具的部署脚本了"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# 运行主函数
|
||||
main "$@"
|
||||
574
log.txt
574
log.txt
@ -1,574 +0,0 @@
|
||||
2025-06-11 14:40:42,601 - __main__ - DEBUG - 已启用详细日志模式
|
||||
2025-06-11 14:40:42,601 - __main__ - INFO - 主输出目录设置为: /Users/zpc01/workspace/zzlh/compliance
|
||||
2025-06-11 14:40:42,602 - ddms_compliance_suite.test_case_registry - INFO - Discovering custom test cases from: ./custom_testcases
|
||||
2025-06-11 14:40:42,602 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: basic_checks 从 ./custom_testcases/basic_checks.py
|
||||
2025-06-11 14:40:42,602 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-STATUS-001' (基本状态码 200 检查) 来自类 'StatusCode200Check' (路径: ./custom_testcases/basic_checks.py)
|
||||
2025-06-11 14:40:42,603 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: required_headers_check 从 ./custom_testcases/setup_checks/required_headers_check.py
|
||||
2025-06-11 14:40:42,604 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-HEADER-001' (必需请求头Schema验证) 来自类 'RequiredHeadersSchemaCheck' (路径: ./custom_testcases/setup_checks/required_headers_check.py)
|
||||
2025-06-11 14:40:42,604 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: basic_api_sanity_check_case 从 ./custom_testcases/setup_checks/basic_api_sanity_check_case.py
|
||||
2025-06-11 14:40:42,604 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: https_mandatory_case 从 ./custom_testcases/compliance_catalog/security/https_mandatory_case.py
|
||||
2025-06-11 14:40:42,604 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-SECURITY-001' (HTTPS Protocol Mandatory Verification) 来自类 'HTTPSMandatoryCase' (路径: ./custom_testcases/compliance_catalog/security/https_mandatory_case.py)
|
||||
2025-06-11 14:40:42,605 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: url_llm_checks 从 ./custom_testcases/compliance_catalog/normative_spec/url_llm_checks.py
|
||||
2025-06-11 14:40:42,605 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: http_method_usage_case 从 ./custom_testcases/compliance_catalog/normative_spec/http_method_usage_case.py
|
||||
2025-06-11 14:40:42,605 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: missing_required_field_query_case 从 ./custom_testcases/compliance_catalog/error_handling/missing_required_field_query_case.py
|
||||
2025-06-11 14:40:42,605 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4003-QUERY' (Error Code 4003 - Missing Required Query Parameter Validation) 来自类 'MissingRequiredFieldQueryCase' (路径: ./custom_testcases/compliance_catalog/error_handling/missing_required_field_query_case.py)
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: type_mismatch_body_case 从 ./custom_testcases/compliance_catalog/error_handling/type_mismatch_body_case.py
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4001-BODY' (Error Code 4001 - Request Body Type Mismatch Validation) 来自类 'TypeMismatchBodyCase' (路径: ./custom_testcases/compliance_catalog/error_handling/type_mismatch_body_case.py)
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: missing_required_field_body_case 从 ./custom_testcases/compliance_catalog/error_handling/missing_required_field_body_case.py
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4003-BODY' (Error Code 4003 - Missing Required Request Body Field Validation) 来自类 'MissingRequiredFieldBodyCase' (路径: ./custom_testcases/compliance_catalog/error_handling/missing_required_field_body_case.py)
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: type_mismatch_query_param_case 从 ./custom_testcases/compliance_catalog/error_handling/type_mismatch_query_param_case.py
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4001-QUERY' (Error Code 4001 - Query Parameter Type Mismatch Validation) 来自类 'TypeMismatchQueryParamCase' (路径: ./custom_testcases/compliance_catalog/error_handling/type_mismatch_query_param_case.py)
|
||||
2025-06-11 14:40:42,606 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: schema_validation_case 从 ./custom_testcases/compliance_catalog/core_functionality/schema_validation_case.py
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-CORE-FUNC-001' (Response Body JSON Schema Validation) 来自类 'ResponseSchemaValidationCase' (路径: ./custom_testcases/compliance_catalog/core_functionality/schema_validation_case.py)
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - INFO - 已根据 execution_order (主要) 和类名 (次要) 对 8 个测试用例类进行了排序。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - INFO - 测试用例发现完成。总共注册了 8 个独特的测试用例 (基于ID)。发现并排序了 8 个测试用例类。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.llm_utils.llm_service - INFO - LLMService initialized for model 'qwen-plus' at https://dashscope.aliyuncs.com/compatible-mode/v1
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_orchestrator - INFO - LLMService initialized with model: qwen-plus.
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_orchestrator - INFO - LLMService is initialized, but no LLM generation flags (--use-llm-for-*) are enabled.
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_orchestrator - INFO - No stages_dir provided, stage testing will be skipped.
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_orchestrator - INFO - Orchestrator output directory set to: /Users/zpc01/workspace/zzlh/compliance
|
||||
2025-06-11 14:40:42,607 - __main__ - INFO - 从YAPI文件运行测试: assets/doc/井筒API示例_simple.json
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_orchestrator - INFO - 准备从YAPI文件运行测试用例: assets/doc/井筒API示例_simple.json
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.input_parser.parser - INFO - Parsing YAPI spec from: assets/doc/井筒API示例_simple.json
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_orchestrator - INFO - TestSummary initialized.
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,607 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - INFO - 开始为端点测试: POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version} (数据推送接口)
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 发现了 8 个适用的测试用例 (已排序): ['TC-HEADER-001', 'TC-STATUS-001', 'TC-CORE-FUNC-001', 'TC-SECURITY-001', 'TC-ERROR-4001-QUERY', 'TC-ERROR-4001-BODY', 'TC-ERROR-4003-BODY', 'TC-ERROR-4003-QUERY']
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备执行测试用例 'TC-HEADER-001' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Successfully converted/retrieved global_api_spec (type: <class 'ddms_compliance_suite.input_parser.parser.ParsedYAPISpec'>) to dict using .spec attribute.
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - global_spec_dict keys for $ref resolution: ['yapi_categories']
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 开始为 endpoint_spec_dict (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas 进行 $ref 解析...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 requestBody content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/RdbQueryPageInput
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/QueryVO
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[0] ('dms_instance_code') 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[1] ('schema') 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[2] ('version') 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[3] ('tenant-id') 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[4] ('Authorization') 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 responses '201' content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - INFO - Endpoint spec (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas $ref 解析完成。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备实例化测试用例类: RequiredHeadersSchemaCheck 使用 endpoint_spec (keys: ['method', 'path', 'title', 'summary', 'description', 'operationId', 'tags', 'parameters', 'requestBody', 'responses', '_source_format', '_yapi_id', '_yapi_raw_data', '_global_api_spec_for_resolution']) 和 global_api_spec (keys: ['yapi_categories'])
|
||||
2025-06-11 14:40:42,608 - RequiredHeadersSchemaCheck - INFO - 测试用例 TC-HEADER-001 (必需请求头Schema验证) 已针对端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 初始化。
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - INFO - 开始执行测试用例 'TC-HEADER-001' (必需请求头Schema验证) for endpoint 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial path param for 'post__api_dms_dms_instance_code_v1_message_push_schema_version_135716': {'dms_instance_code': 'example_dms_instance_code', 'schema': 'example_schema', 'version': 'example_version'}
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial custom header param for 'post__api_dms_dms_instance_code_v1_message_push_schema_version_135716': {'tenant-id': 'header_val_tenant-id'}
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Content-Type for 'post__api_dms_dms_instance_code_v1_message_push_schema_version_135716': application/json
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Accept header for 'post__api_dms_dms_instance_code_v1_message_push_schema_version_135716': application/json
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body). Properties: ['isSearchCount', 'query']
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 使用 schema 中的 'default' 值 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.isSearchCount): True
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query). Properties: ['dataRegions', 'fields', 'filter', 'groupFields', 'groupFilter', 'sort']
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.dataRegions). Items schema: {'description': '数据域,如:JD、DG、TL', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.dataRegions[0]): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.fields). Items schema: {'description': '查询的字段', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.fields[0]): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter). Properties: ['key', 'logic', 'realValue', 'singleValue', 'subFilter', 'symbol']
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.key): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.logic): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.realValue). Items schema: {'description': '条件值', 'type': 'object', 'properties': {}}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.realValue[0]). Properties: []
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.singleValue). Properties: []
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.subFilter). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.subFilter[0]): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.filter.symbol): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFields). Items schema: {'description': '分组字段group by', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFields[0]): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter). Properties: ['key', 'logic', 'realValue', 'singleValue', 'subFilter', 'symbol']
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.key): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.logic): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.realValue). Items schema: {'description': '条件值', 'type': 'object', 'properties': {}}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.realValue[0]). Properties: []
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.singleValue). Properties: []
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.subFilter). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.subFilter[0]): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.groupFilter.symbol): example_string
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_message_push_schema_version_135716] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_message_push_schema_version_135716_body.query.sort). Properties: []
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial request body generated for 'post__api_dms_dms_instance_code_v1_message_push_schema_version_135716' (type: <class 'dict'>)
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - Path parameters to be substituted: {'dms_instance_code': 'example_dms_instance_code', 'schema': 'example_schema', 'version': 'example_version'}
|
||||
2025-06-11 14:40:42,608 - ddms_compliance_suite.test_orchestrator - DEBUG - URL after path parameter substitution (before TC modify_request_url hook): http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/message/push/example_schema/example_version
|
||||
2025-06-11 14:40:42,886 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Tenant-ID
|
||||
2025-06-11 14:40:42,886 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Data-Domain
|
||||
2025-06-11 14:40:42,886 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 Authorization
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - ERROR - 关键的前置测试用例 'TC-HEADER-001' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 失败。后续测试将被跳过。原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - [91m ❌ 测试用例 'TC-HEADER-001' 执行失败。[0m
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-HEADER-001' 执行完毕,状态: 失败
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-STATUS-001' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-STATUS-001' 被跳过。[0m
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-STATUS-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-CORE-FUNC-001' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-CORE-FUNC-001' 被跳过。[0m
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-CORE-FUNC-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-SECURITY-001' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-SECURITY-001' 被跳过。[0m
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-SECURITY-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-QUERY' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,886 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-BODY' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-BODY' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-QUERY' for 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'POST /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}' 测试完成,最终状态: 失败
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - INFO - 开始为端点测试: POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version} (地质单元列表查询)
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'。
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 发现了 8 个适用的测试用例 (已排序): ['TC-HEADER-001', 'TC-STATUS-001', 'TC-CORE-FUNC-001', 'TC-SECURITY-001', 'TC-ERROR-4001-QUERY', 'TC-ERROR-4001-BODY', 'TC-ERROR-4003-BODY', 'TC-ERROR-4003-QUERY']
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备执行测试用例 'TC-HEADER-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - Successfully converted/retrieved global_api_spec (type: <class 'ddms_compliance_suite.input_parser.parser.ParsedYAPISpec'>) to dict using .spec attribute.
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - global_spec_dict keys for $ref resolution: ['yapi_categories']
|
||||
2025-06-11 14:40:42,887 - ddms_compliance_suite.test_orchestrator - DEBUG - 开始为 endpoint_spec_dict (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas 进行 $ref 解析...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 requestBody content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/RdbQueryPageInput
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/QueryVO
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[0] ('dms_instance_code') 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[1] ('version') 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[2] ('pageNo') 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[3] ('pageSize') 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[4] ('tenant-id') 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[5] ('Authorization') 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 responses '201' content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - INFO - Endpoint spec (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas $ref 解析完成。
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备实例化测试用例类: RequiredHeadersSchemaCheck 使用 endpoint_spec (keys: ['method', 'path', 'title', 'summary', 'description', 'operationId', 'tags', 'parameters', 'requestBody', 'responses', '_source_format', '_yapi_id', '_yapi_raw_data', '_global_api_spec_for_resolution']) 和 global_api_spec (keys: ['yapi_categories'])
|
||||
2025-06-11 14:40:42,888 - RequiredHeadersSchemaCheck - INFO - 测试用例 TC-HEADER-001 (必需请求头Schema验证) 已针对端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 初始化。
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - INFO - 开始执行测试用例 'TC-HEADER-001' (必需请求头Schema验证) for endpoint 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial path param for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751': {'dms_instance_code': 'example_dms_instance_code', 'version': '1.0.0'}
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial query param for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751': {'pageNo': 'query_val_pageNo', 'pageSize': 'query_val_pageSize'}
|
||||
2025-06-11 14:40:42,888 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial custom header param for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751': {'tenant-id': 'header_val_tenant-id'}
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Content-Type for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751': application/json
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Accept header for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751': application/json
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body). Properties: ['isSearchCount', 'query']
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 使用 schema 中的 'default' 值 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.isSearchCount): True
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query). Properties: ['dataRegions', 'fields', 'filter', 'groupFields', 'groupFilter', 'sort']
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.dataRegions). Items schema: {'description': '数据域,如:JD、DG、TL', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.dataRegions[0]): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.fields). Items schema: {'description': '查询的字段', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.fields[0]): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter). Properties: ['key', 'logic', 'realValue', 'singleValue', 'subFilter', 'symbol']
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.key): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.logic): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.realValue). Items schema: {'description': '条件值', 'type': 'object', 'properties': {}}, minItems: 1
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.realValue[0]). Properties: []
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.singleValue). Properties: []
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.subFilter). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.subFilter[0]): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.filter.symbol): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFields). Items schema: {'description': '分组字段group by', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFields[0]): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter). Properties: ['key', 'logic', 'realValue', 'singleValue', 'subFilter', 'symbol']
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.key): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.logic): example_string
|
||||
2025-06-11 14:40:42,889 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.realValue). Items schema: {'description': '条件值', 'type': 'object', 'properties': {}}, minItems: 1
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.realValue[0]). Properties: []
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.singleValue). Properties: []
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.subFilter). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.subFilter[0]): example_string
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.groupFilter.symbol): example_string
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751_body.query.sort). Properties: []
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial request body generated for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_version_135751' (type: <class 'dict'>)
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - Path parameters to be substituted: {'dms_instance_code': 'example_dms_instance_code', 'version': '1.0.0'}
|
||||
2025-06-11 14:40:42,890 - ddms_compliance_suite.test_orchestrator - DEBUG - URL after path parameter substitution (before TC modify_request_url hook): http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0
|
||||
2025-06-11 14:40:42,958 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Tenant-ID
|
||||
2025-06-11 14:40:42,958 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Data-Domain
|
||||
2025-06-11 14:40:42,958 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 Authorization
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - ERROR - 关键的前置测试用例 'TC-HEADER-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 失败。后续测试将被跳过。原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [91m ❌ 测试用例 'TC-HEADER-001' 执行失败。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-HEADER-001' 执行完毕,状态: 失败
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-STATUS-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-STATUS-001' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-STATUS-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-CORE-FUNC-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-CORE-FUNC-001' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-CORE-FUNC-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-SECURITY-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-SECURITY-001' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-SECURITY-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-QUERY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-BODY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-BODY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-QUERY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}' 测试完成,最终状态: 失败
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - INFO - 开始为端点测试: PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit (地质单元数据修改)
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit' 发现了 8 个适用的测试用例 (已排序): ['TC-HEADER-001', 'TC-STATUS-001', 'TC-CORE-FUNC-001', 'TC-SECURITY-001', 'TC-ERROR-4001-QUERY', 'TC-ERROR-4001-BODY', 'TC-ERROR-4003-BODY', 'TC-ERROR-4003-QUERY']
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备执行测试用例 'TC-HEADER-001' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - Successfully converted/retrieved global_api_spec (type: <class 'ddms_compliance_suite.input_parser.parser.ParsedYAPISpec'>) to dict using .spec attribute.
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - global_spec_dict keys for $ref resolution: ['yapi_categories']
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 开始为 endpoint_spec_dict (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas 进行 $ref 解析...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 requestBody content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[0] ('dms_instance_code') 的 schema...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[1] ('id') 的 schema...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[2] ('tenant-id') 的 schema...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[3] ('Authorization') 的 schema...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 responses '200' content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:42,958 - ddms_compliance_suite.test_orchestrator - INFO - Endpoint spec (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas $ref 解析完成。
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备实例化测试用例类: RequiredHeadersSchemaCheck 使用 endpoint_spec (keys: ['method', 'path', 'title', 'summary', 'description', 'operationId', 'tags', 'parameters', 'requestBody', 'responses', '_source_format', '_yapi_id', '_yapi_raw_data', '_global_api_spec_for_resolution']) 和 global_api_spec (keys: ['yapi_categories'])
|
||||
2025-06-11 14:40:42,959 - RequiredHeadersSchemaCheck - INFO - 测试用例 TC-HEADER-001 (必需请求头Schema验证) 已针对端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit' 初始化。
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - INFO - 开始执行测试用例 'TC-HEADER-001' (必需请求头Schema验证) for endpoint 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial path param for 'put__api_dms_dms_instance_code_v1_cd_geo_unit_135749': {'dms_instance_code': 'example_dms_instance_code'}
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial query param for 'put__api_dms_dms_instance_code_v1_cd_geo_unit_135749': {'id': 'dsid'}
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial custom header param for 'put__api_dms_dms_instance_code_v1_cd_geo_unit_135749': {'tenant-id': 'header_val_tenant-id'}
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Content-Type for 'put__api_dms_dms_instance_code_v1_cd_geo_unit_135749': application/json
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Accept header for 'put__api_dms_dms_instance_code_v1_cd_geo_unit_135749': application/json
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - [put__api_dms_dms_instance_code_v1_cd_geo_unit_135749] 生成 object 类型数据 for (context: put__api_dms_dms_instance_code_v1_cd_geo_unit_135749_body). Properties: ['id', 'version']
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - [put__api_dms_dms_instance_code_v1_cd_geo_unit_135749] 生成 string 类型数据 ('') for (context: put__api_dms_dms_instance_code_v1_cd_geo_unit_135749_body.id): example_string
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - [put__api_dms_dms_instance_code_v1_cd_geo_unit_135749] 生成 string 类型数据 ('') for (context: put__api_dms_dms_instance_code_v1_cd_geo_unit_135749_body.version): example_string
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial request body generated for 'put__api_dms_dms_instance_code_v1_cd_geo_unit_135749' (type: <class 'dict'>)
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - Path parameters to be substituted: {'dms_instance_code': 'example_dms_instance_code'}
|
||||
2025-06-11 14:40:42,959 - ddms_compliance_suite.test_orchestrator - DEBUG - URL after path parameter substitution (before TC modify_request_url hook): http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit
|
||||
2025-06-11 14:40:43,148 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Tenant-ID
|
||||
2025-06-11 14:40:43,149 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Data-Domain
|
||||
2025-06-11 14:40:43,149 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 Authorization
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - ERROR - 关键的前置测试用例 'TC-HEADER-001' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit' 失败。后续测试将被跳过。原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [91m ❌ 测试用例 'TC-HEADER-001' 执行失败。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-HEADER-001' 执行完毕,状态: 失败
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-STATUS-001' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-STATUS-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-STATUS-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-CORE-FUNC-001' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-CORE-FUNC-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-CORE-FUNC-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-SECURITY-001' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-SECURITY-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-SECURITY-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-QUERY' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-BODY' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-BODY' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-QUERY' for 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'PUT /api/dms/{dms_instance_code}/v1/cd_geo_unit' 测试完成,最终状态: 失败
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - INFO - 开始为端点测试: DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit (地质单元数据删除)
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit' 发现了 8 个适用的测试用例 (已排序): ['TC-HEADER-001', 'TC-STATUS-001', 'TC-CORE-FUNC-001', 'TC-SECURITY-001', 'TC-ERROR-4001-QUERY', 'TC-ERROR-4001-BODY', 'TC-ERROR-4003-BODY', 'TC-ERROR-4003-QUERY']
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备执行测试用例 'TC-HEADER-001' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - Successfully converted/retrieved global_api_spec (type: <class 'ddms_compliance_suite.input_parser.parser.ParsedYAPISpec'>) to dict using .spec attribute.
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - global_spec_dict keys for $ref resolution: ['yapi_categories']
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 开始为 endpoint_spec_dict (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas 进行 $ref 解析...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 requestBody content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[0] ('dms_instance_code') 的 schema...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[1] ('id') 的 schema...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[2] ('tenant-id') 的 schema...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[3] ('Authorization') 的 schema...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 responses '200' content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - INFO - Endpoint spec (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas $ref 解析完成。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备实例化测试用例类: RequiredHeadersSchemaCheck 使用 endpoint_spec (keys: ['method', 'path', 'title', 'summary', 'description', 'operationId', 'tags', 'parameters', 'requestBody', 'responses', '_source_format', '_yapi_id', '_yapi_raw_data', '_global_api_spec_for_resolution']) 和 global_api_spec (keys: ['yapi_categories'])
|
||||
2025-06-11 14:40:43,149 - RequiredHeadersSchemaCheck - INFO - 测试用例 TC-HEADER-001 (必需请求头Schema验证) 已针对端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit' 初始化。
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - INFO - 开始执行测试用例 'TC-HEADER-001' (必需请求头Schema验证) for endpoint 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial path param for 'delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750': {'dms_instance_code': 'example_dms_instance_code'}
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial query param for 'delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750': {'id': 'dsid'}
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial custom header param for 'delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750': {'tenant-id': 'header_val_tenant-id'}
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Content-Type for 'delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750': application/json
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Accept header for 'delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750': application/json
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750] 生成 object 类型数据 for (context: delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750_body). Properties: ['version', 'data']
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750] 生成 string 类型数据 ('') for (context: delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750_body.version): example_string
|
||||
2025-06-11 14:40:43,149 - ddms_compliance_suite.test_orchestrator - DEBUG - [delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750] 生成 array 类型数据 for (context: delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750_body.data). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:43,150 - ddms_compliance_suite.test_orchestrator - DEBUG - [delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750] 生成 string 类型数据 ('') for (context: delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750_body.data[0]): example_string
|
||||
2025-06-11 14:40:43,150 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial request body generated for 'delete__api_dms_dms_instance_code_v1_cd_geo_unit_135750' (type: <class 'dict'>)
|
||||
2025-06-11 14:40:43,150 - ddms_compliance_suite.test_orchestrator - DEBUG - Path parameters to be substituted: {'dms_instance_code': 'example_dms_instance_code'}
|
||||
2025-06-11 14:40:43,150 - ddms_compliance_suite.test_orchestrator - DEBUG - URL after path parameter substitution (before TC modify_request_url hook): http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit
|
||||
2025-06-11 14:40:43,220 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Tenant-ID
|
||||
2025-06-11 14:40:43,220 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Data-Domain
|
||||
2025-06-11 14:40:43,220 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 Authorization
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - ERROR - 关键的前置测试用例 'TC-HEADER-001' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit' 失败。后续测试将被跳过。原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [91m ❌ 测试用例 'TC-HEADER-001' 执行失败。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-HEADER-001' 执行完毕,状态: 失败
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-STATUS-001' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-STATUS-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-STATUS-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-CORE-FUNC-001' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-CORE-FUNC-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-CORE-FUNC-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-SECURITY-001' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-SECURITY-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-SECURITY-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-QUERY' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-BODY' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-BODY' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-QUERY' for 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'DELETE /api/dms/{dms_instance_code}/v1/cd_geo_unit' 测试完成,最终状态: 失败
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - INFO - 开始为端点测试: POST /api/dms/{dms_instance_code}/v1/cd_geo_unit (地质单元数据添加)
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit' 发现了 8 个适用的测试用例 (已排序): ['TC-HEADER-001', 'TC-STATUS-001', 'TC-CORE-FUNC-001', 'TC-SECURITY-001', 'TC-ERROR-4001-QUERY', 'TC-ERROR-4001-BODY', 'TC-ERROR-4003-BODY', 'TC-ERROR-4003-QUERY']
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备执行测试用例 'TC-HEADER-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Successfully converted/retrieved global_api_spec (type: <class 'ddms_compliance_suite.input_parser.parser.ParsedYAPISpec'>) to dict using .spec attribute.
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - global_spec_dict keys for $ref resolution: ['yapi_categories']
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 开始为 endpoint_spec_dict (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas 进行 $ref 解析...
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 requestBody content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[0] ('dms_instance_code') 的 schema...
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[1] ('tenant-id') 的 schema...
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[2] ('Authorization') 的 schema...
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 responses '201' content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - INFO - Endpoint spec (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas $ref 解析完成。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备实例化测试用例类: RequiredHeadersSchemaCheck 使用 endpoint_spec (keys: ['method', 'path', 'title', 'summary', 'description', 'operationId', 'tags', 'parameters', 'requestBody', 'responses', '_source_format', '_yapi_id', '_yapi_raw_data', '_global_api_spec_for_resolution']) 和 global_api_spec (keys: ['yapi_categories'])
|
||||
2025-06-11 14:40:43,220 - RequiredHeadersSchemaCheck - INFO - 测试用例 TC-HEADER-001 (必需请求头Schema验证) 已针对端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit' 初始化。
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - INFO - 开始执行测试用例 'TC-HEADER-001' (必需请求头Schema验证) for endpoint 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial path param for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_135748': {'dms_instance_code': 'example_dms_instance_code'}
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial custom header param for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_135748': {'tenant-id': 'header_val_tenant-id'}
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Content-Type for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_135748': application/json
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Accept header for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_135748': application/json
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body). Properties: ['version', 'data']
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.version): example_string
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 array 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.data). Items schema: {'type': 'object', 'properties': {'bsflag': {'type': 'number', 'title': '必填字段删除标记'}, 'wellCommonName': {'type': 'string'}, 'wellId': {'type': 'string'}, 'dataRegion': {'type': 'string'}}, 'required': ['bsflag', 'wellCommonName', 'wellId', 'dataRegion']}, minItems: 1
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 object 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.data[0]). Properties: ['bsflag', 'wellCommonName', 'wellId', 'dataRegion']
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 number/integer 类型数据 for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.data[0].bsflag): 0.0
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.data[0].wellCommonName): example_string
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.data[0].wellId): example_string
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - [post__api_dms_dms_instance_code_v1_cd_geo_unit_135748] 生成 string 类型数据 ('') for (context: post__api_dms_dms_instance_code_v1_cd_geo_unit_135748_body.data[0].dataRegion): example_string
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial request body generated for 'post__api_dms_dms_instance_code_v1_cd_geo_unit_135748' (type: <class 'dict'>)
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - Path parameters to be substituted: {'dms_instance_code': 'example_dms_instance_code'}
|
||||
2025-06-11 14:40:43,220 - ddms_compliance_suite.test_orchestrator - DEBUG - URL after path parameter substitution (before TC modify_request_url hook): http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit
|
||||
2025-06-11 14:40:43,243 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Tenant-ID
|
||||
2025-06-11 14:40:43,244 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Data-Domain
|
||||
2025-06-11 14:40:43,244 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 Authorization
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - ERROR - 关键的前置测试用例 'TC-HEADER-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit' 失败。后续测试将被跳过。原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [91m ❌ 测试用例 'TC-HEADER-001' 执行失败。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-HEADER-001' 执行完毕,状态: 失败
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-STATUS-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-STATUS-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-STATUS-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-CORE-FUNC-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-CORE-FUNC-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-CORE-FUNC-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-SECURITY-001' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-SECURITY-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-SECURITY-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-QUERY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-BODY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-BODY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-QUERY' for 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'POST /api/dms/{dms_instance_code}/v1/cd_geo_unit' 测试完成,最终状态: 失败
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - INFO - 开始为端点测试: GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id} (地质单元查询详情)
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-HEADER-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-STATUS-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-CORE-FUNC-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-SECURITY-001' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_case_registry - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 适用于端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 发现了 8 个适用的测试用例 (已排序): ['TC-HEADER-001', 'TC-STATUS-001', 'TC-CORE-FUNC-001', 'TC-SECURITY-001', 'TC-ERROR-4001-QUERY', 'TC-ERROR-4001-BODY', 'TC-ERROR-4003-BODY', 'TC-ERROR-4003-QUERY']
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备执行测试用例 'TC-HEADER-001' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - Successfully converted/retrieved global_api_spec (type: <class 'ddms_compliance_suite.input_parser.parser.ParsedYAPISpec'>) to dict using .spec attribute.
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - global_spec_dict keys for $ref resolution: ['yapi_categories']
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 开始为 endpoint_spec_dict (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas 进行 $ref 解析...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 requestBody content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/RdbQueryPageInput
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/QueryVO
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.utils.schema_utils - DEBUG - 因 discard_refs=True,丢弃 '$ref': #/components/schemas/FilterVO
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[0] ('dms_instance_code') 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[1] ('version') 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[2] ('id') 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[3] ('tenant-id') 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 parameters[4] ('Authorization') 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 正在解析 responses '200' content 'application/json' 的 schema...
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - INFO - Endpoint spec (来自 <class 'ddms_compliance_suite.input_parser.parser.YAPIEndpoint'>) 中的 schemas $ref 解析完成。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - 准备实例化测试用例类: RequiredHeadersSchemaCheck 使用 endpoint_spec (keys: ['method', 'path', 'title', 'summary', 'description', 'operationId', 'tags', 'parameters', 'requestBody', 'responses', '_source_format', '_yapi_id', '_yapi_raw_data', '_global_api_spec_for_resolution']) 和 global_api_spec (keys: ['yapi_categories'])
|
||||
2025-06-11 14:40:43,244 - RequiredHeadersSchemaCheck - INFO - 测试用例 TC-HEADER-001 (必需请求头Schema验证) 已针对端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 初始化。
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - INFO - 开始执行测试用例 'TC-HEADER-001' (必需请求头Schema验证) for endpoint 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial path param for 'get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752': {'dms_instance_code': 'example_dms_instance_code', 'version': '1.0.0', 'id': 'example_id'}
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial custom header param for 'get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752': {'tenant-id': 'header_val_tenant-id'}
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Content-Type for 'get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752': application/json
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial Accept header for 'get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752': application/json
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body). Properties: ['isSearchCount', 'query']
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 使用 schema 中的 'default' 值 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.isSearchCount): True
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query). Properties: ['dataRegions', 'fields', 'filter', 'groupFields', 'groupFilter', 'sort']
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.dataRegions). Items schema: {'description': '数据域,如:JD、DG、TL', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.dataRegions[0]): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.fields). Items schema: {'description': '查询的字段', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.fields[0]): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter). Properties: ['key', 'logic', 'realValue', 'singleValue', 'subFilter', 'symbol']
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.key): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.logic): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.realValue). Items schema: {'description': '条件值', 'type': 'object', 'properties': {}}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.realValue[0]). Properties: []
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.singleValue). Properties: []
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.subFilter). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.subFilter[0]): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.filter.symbol): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFields). Items schema: {'description': '分组字段group by', 'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFields[0]): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter). Properties: ['key', 'logic', 'realValue', 'singleValue', 'subFilter', 'symbol']
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.key): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.logic): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.realValue). Items schema: {'description': '条件值', 'type': 'object', 'properties': {}}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.realValue[0]). Properties: []
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.singleValue). Properties: []
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 array 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.subFilter). Items schema: {'type': 'string'}, minItems: 1
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.subFilter[0]): example_string
|
||||
2025-06-11 14:40:43,244 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 string 类型数据 ('') for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.groupFilter.symbol): example_string
|
||||
2025-06-11 14:40:43,245 - ddms_compliance_suite.test_orchestrator - DEBUG - [get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752] 生成 object 类型数据 for (context: get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752_body.query.sort). Properties: []
|
||||
2025-06-11 14:40:43,245 - ddms_compliance_suite.test_orchestrator - DEBUG - Initial request body generated for 'get__api_dms_dms_instance_code_v1_cd_geo_unit_version_id_135752' (type: <class 'dict'>)
|
||||
2025-06-11 14:40:43,245 - ddms_compliance_suite.test_orchestrator - DEBUG - Path parameters to be substituted: {'dms_instance_code': 'example_dms_instance_code', 'version': '1.0.0', 'id': 'example_id'}
|
||||
2025-06-11 14:40:43,245 - ddms_compliance_suite.test_orchestrator - DEBUG - URL after path parameter substitution (before TC modify_request_url hook): http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0/example_id
|
||||
DEBUG: curlify generated command (raw): curl -H 'User-Agent: python-requests/2.32.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'tenant-id: header_val_tenant-id' -H 'Content-Type: application/json' -H 'Content-Length: 477' -d '{"isSearchCount": true, "query": {"dataRegions": ["example_string"], "fields": ["example_string"], "filter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "groupFields": ["example_string"], "groupFilter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "sort": {}}}' --insecure http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/message/push/example_schema/example_version
|
||||
DEBUG: curlify generated command (repr): 'curl -H \'User-Agent: python-requests/2.32.3\' -H \'Accept-Encoding: gzip, deflate, br, zstd\' -H \'Accept: application/json\' -H \'Connection: keep-alive\' -H \'tenant-id: header_val_tenant-id\' -H \'Content-Type: application/json\' -H \'Content-Length: 477\' -d \'{"isSearchCount": true, "query": {"dataRegions": ["example_string"], "fields": ["example_string"], "filter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "groupFields": ["example_string"], "groupFilter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "sort": {}}}\' --insecure http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/message/push/example_schema/example_version'
|
||||
DEBUG: curlify generated command (raw): curl -H 'User-Agent: python-requests/2.32.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'tenant-id: header_val_tenant-id' -H 'Content-Type: application/json' -H 'Content-Length: 477' -d '{"isSearchCount": true, "query": {"dataRegions": ["example_string"], "fields": ["example_string"], "filter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "groupFields": ["example_string"], "groupFilter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "sort": {}}}' --insecure 'http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0?pageNo=query_val_pageNo&pageSize=query_val_pageSize'
|
||||
DEBUG: curlify generated command (repr): 'curl -H \'User-Agent: python-requests/2.32.3\' -H \'Accept-Encoding: gzip, deflate, br, zstd\' -H \'Accept: application/json\' -H \'Connection: keep-alive\' -H \'tenant-id: header_val_tenant-id\' -H \'Content-Type: application/json\' -H \'Content-Length: 477\' -d \'{"isSearchCount": true, "query": {"dataRegions": ["example_string"], "fields": ["example_string"], "filter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "groupFields": ["example_string"], "groupFilter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "sort": {}}}\' --insecure \'http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0?pageNo=query_val_pageNo&pageSize=query_val_pageSize\''
|
||||
DEBUG: curlify generated command (raw): curl -X PUT -H 'User-Agent: python-requests/2.32.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'tenant-id: header_val_tenant-id' -H 'Content-Type: application/json' -H 'Content-Length: 53' -d '{"id": "example_string", "version": "example_string"}' --insecure 'http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit?id=dsid'
|
||||
DEBUG: curlify generated command (repr): 'curl -X PUT -H \'User-Agent: python-requests/2.32.3\' -H \'Accept-Encoding: gzip, deflate, br, zstd\' -H \'Accept: application/json\' -H \'Connection: keep-alive\' -H \'tenant-id: header_val_tenant-id\' -H \'Content-Type: application/json\' -H \'Content-Length: 53\' -d \'{"id": "example_string", "version": "example_string"}\' --insecure \'http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit?id=dsid\''
|
||||
DEBUG: curlify generated command (raw): curl -X DELETE -H 'User-Agent: python-requests/2.32.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'tenant-id: header_val_tenant-id' -H 'Content-Type: application/json' -H 'Content-Length: 57' -d '{"version": "example_string", "data": ["example_string"]}' --insecure 'http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit?id=dsid'
|
||||
DEBUG: curlify generated command (repr): 'curl -X DELETE -H \'User-Agent: python-requests/2.32.3\' -H \'Accept-Encoding: gzip, deflate, br, zstd\' -H \'Accept: application/json\' -H \'Connection: keep-alive\' -H \'tenant-id: header_val_tenant-id\' -H \'Content-Type: application/json\' -H \'Content-Length: 57\' -d \'{"version": "example_string", "data": ["example_string"]}\' --insecure \'http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit?id=dsid\''
|
||||
DEBUG: curlify generated command (raw): curl -H 'User-Agent: python-requests/2.32.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'tenant-id: header_val_tenant-id' -H 'Content-Type: application/json' -H 'Content-Length: 152' -d '{"version": "example_string", "data": [{"bsflag": 0.0, "wellCommonName": "example_string", "wellId": "example_string", "dataRegion": "example_string"}]}' --insecure http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit
|
||||
DEBUG: curlify generated command (repr): 'curl -H \'User-Agent: python-requests/2.32.3\' -H \'Accept-Encoding: gzip, deflate, br, zstd\' -H \'Accept: application/json\' -H \'Connection: keep-alive\' -H \'tenant-id: header_val_tenant-id\' -H \'Content-Type: application/json\' -H \'Content-Length: 152\' -d \'{"version": "example_string", "data": [{"bsflag": 0.0, "wellCommonName": "example_string", "wellId": "example_string", "dataRegion": "example_string"}]}\' --insecure http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit'
|
||||
DEBUG: curlify generated command (raw): curl -X GET -H 'User-Agent: python-requests/2.32.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'tenant-id: header_val_tenant-id' -H 'Content-Type: application/json' -H 'Content-Length: 477' -d '{"isSearchCount": true, "query": {"dataRegions": ["example_string"], "fields": ["example_string"], "filter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "groupFields": ["example_string"], "groupFilter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "sort": {}}}' --insecure http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0/example_id
|
||||
DEBUG: curlify generated command (repr): 'curl -X GET -H \'User-Agent: python-requests/2.32.3\' -H \'Accept-Encoding: gzip, deflate, br, zstd\' -H \'Accept: application/json\' -H \'Connection: keep-alive\' -H \'tenant-id: header_val_tenant-id\' -H \'Content-Type: application/json\' -H \'Content-Length: 477\' -d \'{"isSearchCount": true, "query": {"dataRegions": ["example_string"], "fields": ["example_string"], "filter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "groupFields": ["example_string"], "groupFilter": {"key": "example_string", "logic": "example_string", "realValue": [{}], "singleValue": {}, "subFilter": ["example_string"], "symbol": "example_string"}, "sort": {}}}\' --insecure http://127.0.0.1:4523/m1/6389742-6086420-default/api/dms/example_dms_instance_code/v1/cd_geo_unit/1.0.0/example_id'2025-06-11 14:40:43,264 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Tenant-ID
|
||||
2025-06-11 14:40:43,264 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 X-Data-Domain
|
||||
2025-06-11 14:40:43,264 - RequiredHeadersSchemaCheck - WARNING - 规范验证失败: 缺少必需的请求头 Authorization
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - ERROR - 关键的前置测试用例 'TC-HEADER-001' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 失败。后续测试将被跳过。原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [91m ❌ 测试用例 'TC-HEADER-001' 执行失败。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-HEADER-001' 执行完毕,状态: 失败
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-STATUS-001' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-STATUS-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-STATUS-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-CORE-FUNC-001' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-CORE-FUNC-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-CORE-FUNC-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-SECURITY-001' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-SECURITY-001' 被跳过。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-SECURITY-001' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-QUERY' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4001-BODY' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4001-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4001-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-BODY' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-BODY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-BODY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - WARNING - 由于关键的前置测试用例失败,跳过测试用例 'TC-ERROR-4003-QUERY' for 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}'. 原因: 关键测试 'TC-HEADER-001' 失败 (状态: 失败)。消息:
|
||||
2025-06-11 14:40:43,264 - ddms_compliance_suite.test_orchestrator - DEBUG - [93m ⏭️ 测试用例 'TC-ERROR-4003-QUERY' 被跳过。[0m
|
||||
2025-06-11 14:40:43,265 - ddms_compliance_suite.test_orchestrator - DEBUG - 测试用例 'TC-ERROR-4003-QUERY' 执行完毕,状态: 跳过
|
||||
2025-06-11 14:40:43,265 - ddms_compliance_suite.test_orchestrator - INFO - 端点 'GET /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}' 测试完成,最终状态: 失败
|
||||
2025-06-11 14:40:43,266 - __main__ - INFO - 测试结果已保存为JSON: test_report.json
|
||||
2025-06-11 14:40:43,266 - __main__ - INFO - API调用详情将以 Markdown 格式保存到目录 '.' (使用默认文件名 'api_call_details.md')
|
||||
2025-06-11 14:40:43,266 - __main__ - INFO - API调用详情已保存为 Markdown: api_call_details.md
|
||||
2025-06-11 14:40:43,266 - __main__ - INFO - 部分测试失败或出错,请检查报告。
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
2025-08-07 14:54:25,009 - __main__ - DEBUG - 已启用详细日志模式
|
||||
2025-08-07 14:54:25,010 - __main__ - INFO - 测试报告将保存到: C:\Users\sy\Downloads\归档\test_reports\2025-08-07_14-54-25
|
||||
2025-08-07 14:54:25,010 - ddms_compliance_suite.test_case_registry - INFO - Discovering custom test cases from: ./custom_testcases
|
||||
2025-08-07 14:54:25,017 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: basic_checks 从 ./custom_testcases\basic_checks.py
|
||||
2025-08-07 14:54:25,017 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-STATUS-001' (基本状态码 200 检查) 来自类 'StatusCode200Check' (路径: ./custom_testcases\basic_checks.py)
|
||||
2025-08-07 14:54:25,017 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: security_checks 从 ./custom_testcases\security_checks.py
|
||||
2025-08-07 14:54:25,017 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-SECURITY-002' (敏感字段加密检查) 来自类 'EncryptedFieldsCheck' (路径: ./custom_testcases\security_checks.py)
|
||||
2025-08-07 14:54:25,029 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: flexible_schema_validation_case 从 ./custom_testcases\compliance_catalog\core_functionality\flexible_schema_validation_case.py
|
||||
2025-08-07 14:54:25,029 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-CORE-FUNC-002' (灵活的返回体JSON Schema验证) 来自类 'FlexibleSchemaValidationCase' (路径: ./custom_testcases\compliance_catalog\core_functionality\flexible_schema_validation_case.py)
|
||||
2025-08-07 14:54:25,036 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: schema_validation_case 从 ./custom_testcases\compliance_catalog\core_functionality\schema_validation_case.py
|
||||
2025-08-07 14:54:25,036 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-CORE-FUNC-001' (返回体JSON Schema验证) 来自类 'ResponseSchemaValidationCase' (路径: ./custom_testcases\compliance_catalog\core_functionality\schema_validation_case.py)
|
||||
2025-08-07 14:54:25,044 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: invalid_enum_value_case 从 ./custom_testcases\compliance_catalog\error_handling\invalid_enum_value_case.py
|
||||
2025-08-07 14:54:25,044 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4006' (非法枚举值检查) 来自类 'InvalidEnumValueCase' (路径: ./custom_testcases\compliance_catalog\error_handling\invalid_enum_value_case.py)
|
||||
2025-08-07 14:54:25,051 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: missing_required_field_body_case 从 ./custom_testcases\compliance_catalog\error_handling\missing_required_field_body_case.py
|
||||
2025-08-07 14:54:25,051 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4003-BODY' (缺失必填请求体字段检查) 来自类 'MissingRequiredFieldBodyCase' (路径: ./custom_testcases\compliance_catalog\error_handling\missing_required_field_body_case.py)
|
||||
2025-08-07 14:54:25,052 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: missing_required_field_query_case 从 ./custom_testcases\compliance_catalog\error_handling\missing_required_field_query_case.py
|
||||
2025-08-07 14:54:25,052 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4003-QUERY' (缺失必填查询参数检查) 来自类 'MissingRequiredFieldQueryCase' (路径: ./custom_testcases\compliance_catalog\error_handling\missing_required_field_query_case.py)
|
||||
2025-08-07 14:54:25,053 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: number_out_of_range_case 从 ./custom_testcases\compliance_catalog\error_handling\number_out_of_range_case.py
|
||||
2025-08-07 14:54:25,053 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4002' (数值参数越界检查) 来自类 'NumberOutOfRangeCase' (路径: ./custom_testcases\compliance_catalog\error_handling\number_out_of_range_case.py)
|
||||
2025-08-07 14:54:25,060 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: type_mismatch_body_case 从 ./custom_testcases\compliance_catalog\error_handling\type_mismatch_body_case.py
|
||||
2025-08-07 14:54:25,060 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4001-BODY' (请求体字段类型不匹配检查) 来自类 'TypeMismatchBodyCase' (路径: ./custom_testcases\compliance_catalog\error_handling\type_mismatch_body_case.py)
|
||||
2025-08-07 14:54:25,066 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: type_mismatch_query_param_case 从 ./custom_testcases\compliance_catalog\error_handling\type_mismatch_query_param_case.py
|
||||
2025-08-07 14:54:25,066 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-ERROR-4001-QUERY' (查询参数类型不匹配检查) 来自类 'TypeMismatchQueryParamCase' (路径: ./custom_testcases\compliance_catalog\error_handling\type_mismatch_query_param_case.py)
|
||||
2025-08-07 14:54:25,071 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: http_method_usage_case 从 ./custom_testcases\compliance_catalog\normative_spec\http_method_usage_case.py
|
||||
2025-08-07 14:54:25,071 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: url_llm_checks 从 ./custom_testcases\compliance_catalog\normative_spec\url_llm_checks.py
|
||||
2025-08-07 14:54:25,078 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: https_mandatory_case 从 ./custom_testcases\compliance_catalog\security\https_mandatory_case.py
|
||||
2025-08-07 14:54:25,078 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-SECURITY-001' (HTTPS 协议强制性检查) 来自类 'HTTPSMandatoryCase' (路径: ./custom_testcases\compliance_catalog\security\https_mandatory_case.py)
|
||||
2025-08-07 14:54:25,078 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_llm_compliance_check 从 ./custom_testcases\llm\tc_llm_compliance_check.py
|
||||
2025-08-07 14:54:25,078 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-LLM-COMPLIANCE-001' (LLM合规性综合检查) 来自类 'LLMComplianceCheckTestCase' (路径: ./custom_testcases\llm\tc_llm_compliance_check.py)
|
||||
2025-08-07 14:54:25,084 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: required_headers_check 从 ./custom_testcases\setup_checks\required_headers_check.py
|
||||
2025-08-07 14:54:25,085 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-HEADER-001' (必需请求头Schema验证) 来自类 'RequiredHeadersSchemaCheck' (路径: ./custom_testcases\setup_checks\required_headers_check.py)
|
||||
2025-08-07 14:54:25,085 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_response_schema_format_001 从 ./custom_testcases\浜曠瓛\DMS澧炲姞鏍稿績瀛樺偍鏈嶅姟API\tc_response_schema_format_001.py
|
||||
2025-08-07 14:54:25,085 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-DMS-CORE-SCHEMA-001' (DMS核心存储服务API响应格式检查) 来自类 'ResponseSchemaFormatCheck' (路径: ./custom_testcases\浜曠瓛\DMS澧炲姞鏍稿績瀛樺偍鏈嶅姟API\tc_response_schema_format_001.py)
|
||||
2025-08-07 14:54:25,086 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_url_version_check_001 从 ./custom_testcases\浜曠瓛\DMS澧炲姞鏍稿績瀛樺偍鏈嶅姟API\tc_url_version_check_001.py
|
||||
2025-08-07 14:54:25,086 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-DMS-URL-VERSION-001' (DMS API URL版本号检查) 来自类 'URLVersionCheckCase' (路径: ./custom_testcases\浜曠瓛\DMS澧炲姞鏍稿績瀛樺偍鏈嶅姟API\tc_url_version_check_001.py)
|
||||
2025-08-07 14:54:25,091 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_normative_002 从 ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_002.py
|
||||
2025-08-07 14:54:25,091 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-RESTful-002' (资源路径名词检查) 来自类 'ResourcePathNounCheckTestCase' (路径: ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_002.py)
|
||||
2025-08-07 14:54:25,097 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_normative_003 从 ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_003.py
|
||||
2025-08-07 14:54:25,097 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-RESTful-003' (时间字段ISO 8601格式检查) 来自类 'TimeFormatCheckTestCase' (路径: ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_003.py)
|
||||
2025-08-07 14:54:25,097 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_normative_004 从 ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_004.py
|
||||
2025-08-07 14:54:25,097 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-RESTful-004' (资源集合复数命名检查) 来自类 'ResourceCollectionPluralCheckTestCase' (路径: ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_004.py)
|
||||
2025-08-07 14:54:25,098 - ddms_compliance_suite.test_case_registry - DEBUG - 成功导入模块: tc_normative_combined_001 从 ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_combined_001.py
|
||||
2025-08-07 14:54:25,098 - ddms_compliance_suite.test_case_registry - INFO - 已注册测试用例: 'TC-RESTful-001' (核心命名与结构规范检查) 来自类 'CoreNamingStructureTestCase' (路径: ./custom_testcases\浜曠瓛\RESTful鎺ュ彛璁捐\ue178瑕佹眰\tc_normative_combined_001.py)
|
||||
2025-08-07 14:54:25,098 - ddms_compliance_suite.test_case_registry - INFO - 已根据 execution_order (主要) 和类名 (次要) 对 19 个测试用例类进行了排序。
|
||||
2025-08-07 14:54:25,098 - ddms_compliance_suite.test_case_registry - INFO - 测试用例发现完成。总共注册了 19 个独特的测试用例 (基于ID)。发现并排序了 19 个测试用例类。
|
||||
2025-08-07 14:54:25,098 - ddms_compliance_suite.test_orchestrator - INFO - LLM API key not provided. LLM-based data generation will be disabled.
|
||||
2025-08-07 14:54:25,098 - ddms_compliance_suite.stage_registry - INFO - 开始从目录发现测试阶段: custom_stages
|
||||
2025-08-07 14:54:25,106 - ddms_compliance_suite.stage_registry - DEBUG - 成功加载模块: ddms_compliance_suite.stages.dms_crud_scenario_stage 从 custom_stages\dms_crud_scenario_stage.py
|
||||
2025-08-07 14:54:25,106 - ddms_compliance_suite.stage_registry - INFO - 成功注册测试阶段: dms_crud_scenario_stage (来自 ddms_compliance_suite.stages.dms_crud_scenario_stage.DmsCrudScenarioStage)
|
||||
2025-08-07 14:54:25,110 - ddms_compliance_suite.stage_registry - DEBUG - 成功加载模块: ddms_compliance_suite.stages.keyword_driven_crud_stage 从 custom_stages\keyword_driven_crud_stage.py
|
||||
2025-08-07 14:54:25,111 - ddms_compliance_suite.stage_registry - INFO - 测试阶段发现完成。共加载 1 个阶段。发现 0 个错误。
|
||||
2025-08-07 14:54:25,111 - ddms_compliance_suite.test_orchestrator - INFO - StageRegistry initialized. Loaded 1 stages.
|
||||
2025-08-07 14:54:25,111 - ddms_compliance_suite.test_orchestrator - INFO - Orchestrator output directory set to: C:\Users\sy\Downloads\归档\test_reports\2025-08-07_14-54-25
|
||||
2025-08-07 14:54:25,112 - root - INFO - strictness_level: TestSeverity.CRITICAL
|
||||
2025-08-07 14:54:25,112 - __main__ - INFO - 从DMS服务动态发现运行测试: ./assets/doc/dms/domain.json
|
||||
2025-08-07 14:54:25,112 - ddms_compliance_suite.test_orchestrator - INFO - TestSummary initialized.
|
||||
2025-08-07 14:54:25,112 - ddms_compliance_suite.test_orchestrator - INFO - 从DMS动态服务启动测试...
|
||||
2025-08-07 14:54:25,112 - ddms_compliance_suite.input_parser.parser - INFO - Starting DMS spec parsing. Base URL: https://www.dev.ideas.cnpc, Domain Map: ./assets/doc/dms/domain.json
|
||||
2025-08-07 14:54:25,112 - ddms_compliance_suite.input_parser.parser - INFO - Fetching API list from: https://www.dev.ideas.cnpc/api/schema/manage/schema
|
||||
2025-08-07 14:54:25,146 - ddms_compliance_suite.input_parser.parser - ERROR - Failed to fetch API list from DMS: HTTPSConnectionPool(host='www.dev.ideas.cnpc', port=443): Max retries exceeded with url: /api/schema/manage/schema (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1010)')))
|
||||
2025-08-07 14:54:25,146 - ddms_compliance_suite.test_orchestrator - ERROR - 无法从DMS服务解析API,测试终止。
|
||||
2025-08-07 14:54:25,146 - __main__ - ERROR - 从DMS服务 './assets/doc/dms/domain.json' 解析失败 (由编排器报告)。程序将退出。
|
||||
266
test-deployment.sh
Executable file
266
test-deployment.sh
Executable file
@ -0,0 +1,266 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - 部署包测试脚本
|
||||
# 用于验证离线部署包的完整性和功能
|
||||
|
||||
set -e
|
||||
|
||||
PACKAGE_FILE=""
|
||||
TEST_DIR="test_deployment_$(date +%Y%m%d_%H%M%S)"
|
||||
|
||||
echo "=== DMS合规性测试工具部署包测试脚本 ==="
|
||||
|
||||
# 查找最新的部署包
|
||||
find_latest_package() {
|
||||
PACKAGE_FILE=$(ls -t dms-compliance-complete-offline-*.tar.gz 2>/dev/null | head -n1)
|
||||
|
||||
if [ -z "$PACKAGE_FILE" ]; then
|
||||
echo "[错误] 找不到部署包文件"
|
||||
echo "请先运行 ./create-offline-package.sh 创建部署包"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[信息] 找到部署包: $PACKAGE_FILE"
|
||||
echo "[信息] 文件大小: $(du -h "$PACKAGE_FILE" | cut -f1)"
|
||||
}
|
||||
|
||||
# 创建测试环境
|
||||
setup_test_env() {
|
||||
echo "[信息] 创建测试环境: $TEST_DIR"
|
||||
mkdir -p "$TEST_DIR"
|
||||
cd "$TEST_DIR"
|
||||
|
||||
# 解压部署包
|
||||
echo "[信息] 解压部署包..."
|
||||
tar -xzf "../$PACKAGE_FILE"
|
||||
|
||||
# 进入解压后的目录
|
||||
EXTRACTED_DIR=$(ls -d dms-compliance-* | head -n1)
|
||||
cd "$EXTRACTED_DIR"
|
||||
|
||||
echo "[信息] 当前目录: $(pwd)"
|
||||
}
|
||||
|
||||
# 验证文件完整性
|
||||
verify_files() {
|
||||
echo "[信息] 验证文件完整性..."
|
||||
|
||||
local required_files=(
|
||||
"README.md"
|
||||
"VERSION"
|
||||
"install.sh"
|
||||
"deploy.sh"
|
||||
"stop.sh"
|
||||
"uninstall.sh"
|
||||
"install-docker.sh"
|
||||
"docker-compose.yml"
|
||||
"dms-compliance-tool.tar"
|
||||
"nginx-alpine.tar"
|
||||
)
|
||||
|
||||
local missing_files=()
|
||||
|
||||
for file in "${required_files[@]}"; do
|
||||
if [ ! -f "$file" ]; then
|
||||
missing_files+=("$file")
|
||||
else
|
||||
echo "[✓] $file"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${#missing_files[@]} -gt 0 ]; then
|
||||
echo "[错误] 缺少以下文件:"
|
||||
printf '%s\n' "${missing_files[@]}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "[成功] 所有必需文件都存在"
|
||||
}
|
||||
|
||||
# 验证脚本权限
|
||||
verify_permissions() {
|
||||
echo "[信息] 验证脚本权限..."
|
||||
|
||||
local scripts=(
|
||||
"install.sh"
|
||||
"deploy.sh"
|
||||
"stop.sh"
|
||||
"uninstall.sh"
|
||||
"install-docker.sh"
|
||||
)
|
||||
|
||||
for script in "${scripts[@]}"; do
|
||||
if [ -x "$script" ]; then
|
||||
echo "[✓] $script 可执行"
|
||||
else
|
||||
echo "[警告] $script 不可执行,正在修复..."
|
||||
chmod +x "$script"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# 验证Docker镜像
|
||||
verify_docker_images() {
|
||||
echo "[信息] 验证Docker镜像文件..."
|
||||
|
||||
# 检查镜像文件大小
|
||||
if [ -f "dms-compliance-tool.tar" ]; then
|
||||
local size=$(du -h "dms-compliance-tool.tar" | cut -f1)
|
||||
echo "[✓] DMS应用镜像: $size"
|
||||
|
||||
# 验证镜像文件不为空
|
||||
if [ ! -s "dms-compliance-tool.tar" ]; then
|
||||
echo "[错误] DMS应用镜像文件为空"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "nginx-alpine.tar" ]; then
|
||||
local size=$(du -h "nginx-alpine.tar" | cut -f1)
|
||||
echo "[✓] Nginx镜像: $size"
|
||||
|
||||
if [ ! -s "nginx-alpine.tar" ]; then
|
||||
echo "[错误] Nginx镜像文件为空"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# 验证配置文件
|
||||
verify_config() {
|
||||
echo "[信息] 验证配置文件..."
|
||||
|
||||
# 检查docker-compose.yml
|
||||
if command -v docker-compose >/dev/null 2>&1; then
|
||||
if docker-compose config >/dev/null 2>&1; then
|
||||
echo "[✓] docker-compose.yml 语法正确"
|
||||
else
|
||||
echo "[警告] docker-compose.yml 语法可能有问题"
|
||||
docker-compose config
|
||||
fi
|
||||
else
|
||||
echo "[信息] docker-compose 未安装,跳过配置验证"
|
||||
fi
|
||||
|
||||
# 检查数据目录结构
|
||||
local data_dirs=(
|
||||
"data"
|
||||
"data/test_reports"
|
||||
"data/uploads"
|
||||
"data/logs"
|
||||
)
|
||||
|
||||
for dir in "${data_dirs[@]}"; do
|
||||
if [ -d "$dir" ]; then
|
||||
echo "[✓] 目录存在: $dir"
|
||||
else
|
||||
echo "[警告] 目录不存在: $dir"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# 模拟部署测试(不实际启动服务)
|
||||
simulate_deployment() {
|
||||
echo "[信息] 模拟部署测试..."
|
||||
|
||||
# 检查Docker是否可用
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
if docker info >/dev/null 2>&1; then
|
||||
echo "[✓] Docker可用"
|
||||
|
||||
# 测试加载镜像(但不实际加载)
|
||||
echo "[信息] 测试镜像加载命令..."
|
||||
echo " docker load -i dms-compliance-tool.tar"
|
||||
echo " docker load -i nginx-alpine.tar"
|
||||
|
||||
# 测试docker-compose命令
|
||||
if command -v docker-compose >/dev/null 2>&1; then
|
||||
echo "[✓] Docker Compose可用"
|
||||
echo "[信息] 测试服务启动命令..."
|
||||
echo " docker-compose up -d"
|
||||
else
|
||||
echo "[警告] Docker Compose不可用"
|
||||
fi
|
||||
else
|
||||
echo "[警告] Docker未运行"
|
||||
fi
|
||||
else
|
||||
echo "[信息] Docker未安装,这在目标环境中是正常的"
|
||||
fi
|
||||
}
|
||||
|
||||
# 生成测试报告
|
||||
generate_report() {
|
||||
echo ""
|
||||
echo "=== 测试报告 ==="
|
||||
echo "测试时间: $(date)"
|
||||
echo "部署包: $PACKAGE_FILE"
|
||||
echo "测试目录: $TEST_DIR"
|
||||
echo ""
|
||||
|
||||
# 文件清单
|
||||
echo "文件清单:"
|
||||
find . -type f -name "*.sh" -o -name "*.yml" -o -name "*.tar" -o -name "*.md" | sort
|
||||
echo ""
|
||||
|
||||
# 目录结构
|
||||
echo "目录结构:"
|
||||
tree -L 3 2>/dev/null || find . -type d | head -20
|
||||
echo ""
|
||||
|
||||
# 磁盘使用
|
||||
echo "磁盘使用:"
|
||||
du -sh . 2>/dev/null || echo "无法获取磁盘使用信息"
|
||||
echo ""
|
||||
|
||||
echo "=== 测试完成 ==="
|
||||
echo ""
|
||||
echo "下一步操作:"
|
||||
echo "1. 将部署包传输到目标服务器"
|
||||
echo "2. 在目标服务器上解压并运行 ./install.sh"
|
||||
echo "3. 访问 http://localhost:5050 和 http://localhost:5051 验证服务"
|
||||
echo ""
|
||||
echo "清理测试环境:"
|
||||
echo "cd .. && rm -rf $TEST_DIR"
|
||||
}
|
||||
|
||||
# 清理函数
|
||||
cleanup() {
|
||||
if [ -n "$TEST_DIR" ] && [ -d "../$TEST_DIR" ]; then
|
||||
echo ""
|
||||
echo "[信息] 清理测试环境..."
|
||||
cd ..
|
||||
rm -rf "$TEST_DIR"
|
||||
echo "[信息] 测试环境已清理"
|
||||
fi
|
||||
}
|
||||
|
||||
# 错误处理
|
||||
error_handler() {
|
||||
echo ""
|
||||
echo "[错误] 测试过程中发生错误"
|
||||
cleanup
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
# 设置错误处理
|
||||
trap error_handler ERR
|
||||
trap cleanup EXIT
|
||||
|
||||
# 执行测试步骤
|
||||
find_latest_package
|
||||
setup_test_env
|
||||
verify_files
|
||||
verify_permissions
|
||||
verify_docker_images
|
||||
verify_config
|
||||
simulate_deployment
|
||||
generate_report
|
||||
|
||||
echo "[成功] 部署包测试完成,所有检查都通过了!"
|
||||
}
|
||||
|
||||
# 运行主函数
|
||||
main "$@"
|
||||
147
test_api_server.py
Normal file
147
test_api_server.py
Normal file
@ -0,0 +1,147 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
DMS合规性测试工具 - API服务器功能测试脚本
|
||||
测试Docker化的API服务器是否正常工作
|
||||
"""
|
||||
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
def test_health_check(api_server):
|
||||
"""测试健康检查端点"""
|
||||
print(f"[测试] 健康检查端点...")
|
||||
try:
|
||||
response = requests.get(f"{api_server}/", timeout=10)
|
||||
if response.status_code == 200:
|
||||
result = response.json()
|
||||
print(f"[成功] 健康检查通过: {result}")
|
||||
return True
|
||||
else:
|
||||
print(f"[失败] 健康检查失败: {response.status_code}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[错误] 健康检查异常: {e}")
|
||||
return False
|
||||
|
||||
def test_with_mock_api(api_server):
|
||||
"""使用模拟API进行测试"""
|
||||
print(f"[测试] 使用模拟API配置进行测试...")
|
||||
|
||||
# 使用一个简单的测试配置,不依赖外部API
|
||||
test_config = {
|
||||
"base-url": "https://httpbin.org/", # 使用httpbin作为测试目标
|
||||
"dms": "./assets/doc/dms/domain.json",
|
||||
"stages-dir": "./custom_stages",
|
||||
"custom-test-cases-dir": "./custom_testcases",
|
||||
"verbose": True,
|
||||
"output": "./test_reports/",
|
||||
"format": "json",
|
||||
"generate-pdf": False, # 暂时不生成PDF
|
||||
"strictness-level": "CRITICAL",
|
||||
"ignore-ssl": True
|
||||
}
|
||||
|
||||
print(f"[信息] 测试配置:")
|
||||
print(json.dumps(test_config, indent=2, ensure_ascii=False))
|
||||
|
||||
try:
|
||||
print(f"[信息] 发送测试请求...")
|
||||
start_time = time.time()
|
||||
|
||||
response = requests.post(
|
||||
f"{api_server}/run",
|
||||
json=test_config,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=60 # 1分钟超时
|
||||
)
|
||||
|
||||
end_time = time.time()
|
||||
duration = end_time - start_time
|
||||
|
||||
print(f"[信息] 请求完成,耗时: {duration:.2f}秒")
|
||||
print(f"[信息] HTTP状态码: {response.status_code}")
|
||||
|
||||
if response.status_code == 200:
|
||||
print(f"[成功] API服务器响应正常")
|
||||
try:
|
||||
result = response.json()
|
||||
print(f"[信息] 响应状态: {result.get('status', '未知')}")
|
||||
if 'message' in result:
|
||||
print(f"[信息] 响应消息: {result['message']}")
|
||||
return True
|
||||
except:
|
||||
print(f"[信息] 响应内容(非JSON): {response.text[:200]}...")
|
||||
return True
|
||||
else:
|
||||
print(f"[失败] API服务器响应异常")
|
||||
print(f"[错误] 响应内容: {response.text[:200]}...")
|
||||
return False
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
print(f"[错误] 请求超时(1分钟)")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[错误] 请求异常: {e}")
|
||||
return False
|
||||
|
||||
def test_history_viewer(history_server):
|
||||
"""测试历史查看器"""
|
||||
print(f"[测试] 历史查看器端点...")
|
||||
try:
|
||||
response = requests.get(f"{history_server}/", timeout=10)
|
||||
if response.status_code == 200:
|
||||
print(f"[成功] 历史查看器响应正常")
|
||||
return True
|
||||
else:
|
||||
print(f"[失败] 历史查看器响应异常: {response.status_code}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[错误] 历史查看器异常: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
print("=== DMS合规性测试工具 - API服务器功能测试 ===")
|
||||
|
||||
api_server = "http://localhost:5050"
|
||||
history_server = "http://localhost:5051"
|
||||
|
||||
print(f"[信息] API服务器: {api_server}")
|
||||
print(f"[信息] 历史查看器: {history_server}")
|
||||
|
||||
# 测试结果
|
||||
results = []
|
||||
|
||||
# 1. 测试API服务器健康检查
|
||||
results.append(("API服务器健康检查", test_health_check(api_server)))
|
||||
|
||||
# 2. 测试历史查看器
|
||||
results.append(("历史查看器", test_history_viewer(history_server)))
|
||||
|
||||
# 3. 测试API服务器功能(使用模拟API)
|
||||
results.append(("API服务器功能测试", test_with_mock_api(api_server)))
|
||||
|
||||
# 显示测试结果摘要
|
||||
print(f"\n=== 测试结果摘要 ===")
|
||||
passed = 0
|
||||
total = len(results)
|
||||
|
||||
for test_name, result in results:
|
||||
status = "✅ 通过" if result else "❌ 失败"
|
||||
print(f"{status} {test_name}")
|
||||
if result:
|
||||
passed += 1
|
||||
|
||||
print(f"\n总计: {passed}/{total} 测试通过")
|
||||
|
||||
if passed == total:
|
||||
print(f"[成功] 所有测试通过!Docker化的API服务器工作正常!")
|
||||
return 0
|
||||
else:
|
||||
print(f"[警告] 部分测试失败,请检查服务状态")
|
||||
return 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
50
test_network.py
Normal file
50
test_network.py
Normal file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
测试Docker容器网络连接
|
||||
"""
|
||||
|
||||
import requests
|
||||
import json
|
||||
|
||||
def main():
|
||||
print("=== Docker网络连接测试 ===")
|
||||
|
||||
# 测试配置,使用简单的配置来测试网络连接
|
||||
test_config = {
|
||||
"base-url": "http://host.docker.internal:5001/",
|
||||
"dms": "./assets/doc/dms/domain.json",
|
||||
"stages-dir": "./custom_stages",
|
||||
"custom-test-cases-dir": "./custom_testcases",
|
||||
"verbose": True,
|
||||
"output": "./test_reports/",
|
||||
"format": "json",
|
||||
"generate-pdf": False, # 不生成PDF,加快测试
|
||||
"strictness-level": "CRITICAL",
|
||||
"ignore-ssl": True
|
||||
}
|
||||
|
||||
print(f"[信息] 测试Docker容器是否能访问宿主机5001端口...")
|
||||
|
||||
try:
|
||||
response = requests.post(
|
||||
"http://localhost:5050/run",
|
||||
json=test_config,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=30
|
||||
)
|
||||
|
||||
print(f"[信息] HTTP状态码: {response.status_code}")
|
||||
|
||||
if response.status_code == 200:
|
||||
print(f"[成功] 网络连接正常")
|
||||
result = response.json()
|
||||
print(f"[信息] 响应状态: {result.get('status', '未知')}")
|
||||
else:
|
||||
print(f"[失败] 网络连接异常")
|
||||
print(f"[错误] 响应: {response.text[:300]}...")
|
||||
|
||||
except Exception as e:
|
||||
print(f"[错误] 网络测试失败: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
71
test_with_curl.sh
Executable file
71
test_with_curl.sh
Executable file
@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DMS合规性测试工具 - curl测试脚本
|
||||
# 对应原始命令:python run_api_tests.py --base-url http://127.0.0.1:5001/ --dms ./assets/doc/dms/domain.json --stages-dir ./custom_stages --custom-test-cases-dir ./custom_testcases -v -o ./test_reports/
|
||||
|
||||
echo "=== DMS合规性测试工具 - API测试 ==="
|
||||
|
||||
# 配置变量
|
||||
API_SERVER="http://localhost:5050"
|
||||
TARGET_API="http://host.docker.internal:5001/" # Docker内部访问宿主机
|
||||
OUTPUT_LOG="log_dms_docker.txt"
|
||||
|
||||
echo "[信息] 目标API: $TARGET_API"
|
||||
echo "[信息] API服务器: $API_SERVER"
|
||||
echo "[信息] 输出日志: $OUTPUT_LOG"
|
||||
|
||||
# 创建测试配置JSON
|
||||
TEST_CONFIG='{
|
||||
"base-url": "'$TARGET_API'",
|
||||
"dms": "./assets/doc/dms/domain.json",
|
||||
"stages-dir": "./custom_stages",
|
||||
"custom-test-cases-dir": "./custom_testcases",
|
||||
"verbose": true,
|
||||
"output": "./test_reports/",
|
||||
"format": "json",
|
||||
"generate-pdf": true,
|
||||
"strictness-level": "CRITICAL",
|
||||
"ignore-ssl": true
|
||||
}'
|
||||
|
||||
echo "[信息] 测试配置:"
|
||||
echo "$TEST_CONFIG" | jq . 2>/dev/null || echo "$TEST_CONFIG"
|
||||
|
||||
# 执行测试
|
||||
echo ""
|
||||
echo "[信息] 开始执行测试..."
|
||||
echo "[信息] 这可能需要几分钟时间..."
|
||||
|
||||
curl -X POST "$API_SERVER/run" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$TEST_CONFIG" \
|
||||
-w "\n\n=== HTTP响应信息 ===\nHTTP状态码: %{http_code}\n响应时间: %{time_total}s\n" \
|
||||
> "$OUTPUT_LOG" 2>&1
|
||||
|
||||
# 检查结果
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[成功] 测试完成!"
|
||||
echo "[信息] 查看详细日志: cat $OUTPUT_LOG"
|
||||
echo "[信息] 查看测试报告: ls -la test_reports/"
|
||||
|
||||
# 显示简要结果
|
||||
echo ""
|
||||
echo "=== 测试结果摘要 ==="
|
||||
if command -v jq >/dev/null 2>&1; then
|
||||
# 如果有jq,格式化显示JSON结果
|
||||
tail -n +1 "$OUTPUT_LOG" | jq -r '.status // "未知状态"' 2>/dev/null || echo "请查看日志文件获取详细结果"
|
||||
else
|
||||
# 没有jq,显示原始结果
|
||||
echo "请查看日志文件: $OUTPUT_LOG"
|
||||
fi
|
||||
else
|
||||
echo "[错误] 测试执行失败"
|
||||
echo "[信息] 查看错误日志: cat $OUTPUT_LOG"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== 管理命令 ==="
|
||||
echo "- 查看服务状态: docker-compose ps"
|
||||
echo "- 查看服务日志: docker-compose logs"
|
||||
echo "- 查看测试日志: cat $OUTPUT_LOG"
|
||||
echo "- 查看测试报告: ls -la test_reports/"
|
||||
359
test_with_mock.py
Executable file
359
test_with_mock.py
Executable file
@ -0,0 +1,359 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
DMS合规性测试工具 - 完整测试脚本(包含mock服务)
|
||||
1. 启动mock_dms_server.py在5001端口
|
||||
2. 调用Docker化的API服务器进行测试
|
||||
3. 清理mock服务
|
||||
"""
|
||||
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
import sys
|
||||
import subprocess
|
||||
import signal
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
class MockServerManager:
|
||||
def __init__(self, mock_script="mock_dms_server.py", port=5001):
|
||||
self.mock_script = mock_script
|
||||
self.port = port
|
||||
self.process = None
|
||||
|
||||
def start(self):
|
||||
"""启动mock服务器"""
|
||||
print(f"[信息] 启动mock服务器: {self.mock_script} (端口 {self.port})")
|
||||
|
||||
if not Path(self.mock_script).exists():
|
||||
print(f"[错误] Mock脚本不存在: {self.mock_script}")
|
||||
return False
|
||||
|
||||
try:
|
||||
# 启动mock服务器
|
||||
self.process = subprocess.Popen(
|
||||
[sys.executable, self.mock_script],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
|
||||
# 等待服务启动
|
||||
print(f"[信息] 等待mock服务器启动...")
|
||||
for i in range(10): # 最多等待10秒
|
||||
try:
|
||||
response = requests.get(f"http://127.0.0.1:{self.port}/", timeout=2)
|
||||
if response.status_code in [200, 404]: # 404也算正常,说明服务在运行
|
||||
print(f"[成功] Mock服务器启动成功 (尝试 {i+1}/10)")
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
time.sleep(1)
|
||||
|
||||
print(f"[错误] Mock服务器启动超时")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"[错误] 启动mock服务器失败: {e}")
|
||||
return False
|
||||
|
||||
def stop(self):
|
||||
"""停止mock服务器"""
|
||||
if self.process:
|
||||
print(f"[信息] 停止mock服务器...")
|
||||
try:
|
||||
self.process.terminate()
|
||||
self.process.wait(timeout=5)
|
||||
print(f"[成功] Mock服务器已停止")
|
||||
except subprocess.TimeoutExpired:
|
||||
print(f"[警告] Mock服务器强制终止")
|
||||
self.process.kill()
|
||||
self.process.wait()
|
||||
except Exception as e:
|
||||
print(f"[错误] 停止mock服务器失败: {e}")
|
||||
|
||||
def test_api_server(api_server, target_api, output_log="log_dms1.txt"):
|
||||
"""测试API服务器"""
|
||||
print(f"\n[测试] API服务器功能测试...")
|
||||
|
||||
# 测试配置(对应原始命令行参数)
|
||||
test_config = {
|
||||
"base-url": target_api,
|
||||
"dms": "./assets/doc/dms/domain.json",
|
||||
"stages-dir": "./custom_stages",
|
||||
"custom-test-cases-dir": "./custom_testcases",
|
||||
"verbose": True,
|
||||
"output": "./test_reports/",
|
||||
"format": "json",
|
||||
"generate-pdf": True,
|
||||
"strictness-level": "CRITICAL",
|
||||
"ignore-ssl": True
|
||||
}
|
||||
|
||||
print(f"[信息] 测试配置:")
|
||||
print(json.dumps(test_config, indent=2, ensure_ascii=False))
|
||||
|
||||
try:
|
||||
print(f"[信息] 发送测试请求到API服务器...")
|
||||
start_time = time.time()
|
||||
|
||||
response = requests.post(
|
||||
f"{api_server}/run",
|
||||
json=test_config,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=120 # 2分钟超时
|
||||
)
|
||||
|
||||
end_time = time.time()
|
||||
duration = end_time - start_time
|
||||
|
||||
# 保存结果到日志文件
|
||||
with open(output_log, 'w', encoding='utf-8') as f:
|
||||
f.write(f"=== DMS合规性测试结果 ===\n")
|
||||
f.write(f"执行时间: {duration:.2f}秒\n")
|
||||
f.write(f"HTTP状态码: {response.status_code}\n")
|
||||
f.write(f"响应头: {dict(response.headers)}\n\n")
|
||||
|
||||
if response.status_code == 200:
|
||||
f.write("=== 测试成功 ===\n")
|
||||
try:
|
||||
result_json = response.json()
|
||||
f.write(json.dumps(result_json, indent=2, ensure_ascii=False))
|
||||
except:
|
||||
f.write("响应内容(非JSON格式):\n")
|
||||
f.write(response.text)
|
||||
else:
|
||||
f.write("=== 测试失败 ===\n")
|
||||
f.write(f"错误信息: {response.text}\n")
|
||||
|
||||
# 显示结果
|
||||
print(f"[信息] 请求完成,耗时: {duration:.2f}秒")
|
||||
print(f"[信息] HTTP状态码: {response.status_code}")
|
||||
|
||||
if response.status_code == 200:
|
||||
print(f"[成功] 测试执行成功")
|
||||
try:
|
||||
result = response.json()
|
||||
print(f"[信息] 测试状态: {result.get('status', '未知')}")
|
||||
if 'summary' in result:
|
||||
summary = result['summary']
|
||||
print(f"[信息] 测试摘要:")
|
||||
print(f" - 总测试数: {summary.get('total_tests', 0)}")
|
||||
print(f" - 通过数: {summary.get('passed_tests', 0)}")
|
||||
print(f" - 失败数: {summary.get('failed_tests', 0)}")
|
||||
print(f" - 跳过数: {summary.get('skipped_tests', 0)}")
|
||||
|
||||
if 'output_files' in result:
|
||||
print(f"[信息] 生成的文件:")
|
||||
for file_info in result['output_files']:
|
||||
print(f" - {file_info}")
|
||||
|
||||
return True
|
||||
except:
|
||||
print(f"[信息] 响应内容已保存到: {output_log}")
|
||||
return True
|
||||
else:
|
||||
print(f"[失败] 测试执行失败")
|
||||
print(f"[错误] 错误信息: {response.text[:200]}...")
|
||||
return False
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
print(f"[错误] 请求超时(2分钟)")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[错误] 请求异常: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
print("=== DMS合规性测试工具 - 完整功能测试 ===")
|
||||
|
||||
api_server = "http://localhost:5050"
|
||||
history_server = "http://localhost:5051"
|
||||
target_api = "http://host.docker.internal:5001/" # 使用Docker内部主机访问
|
||||
|
||||
# 检查mock脚本是否存在
|
||||
mock_script = "../mock_dms_server.py"
|
||||
if not Path(mock_script).exists():
|
||||
print(f"[警告] Mock脚本不存在: {mock_script}")
|
||||
print(f"[信息] 请手动启动mock服务器: python mock_dms_server.py")
|
||||
mock_manager = None
|
||||
else:
|
||||
mock_manager = MockServerManager(mock_script, 5001)
|
||||
|
||||
try:
|
||||
# 1. 启动mock服务器(如果存在)
|
||||
if mock_manager:
|
||||
if not mock_manager.start():
|
||||
print(f"[错误] Mock服务器启动失败")
|
||||
print(f"[建议] 请手动启动: python {mock_script}")
|
||||
return 1
|
||||
|
||||
# 2. 测试API服务器健康检查
|
||||
print(f"\n[测试] API服务器健康检查...")
|
||||
health_response = requests.get(f"{api_server}/", timeout=10)
|
||||
if health_response.status_code == 200:
|
||||
print(f"[成功] API服务器运行正常")
|
||||
else:
|
||||
print(f"[错误] API服务器不可用: {health_response.status_code}")
|
||||
return 1
|
||||
|
||||
# 3. 测试历史查看器
|
||||
print(f"\n[测试] 历史查看器...")
|
||||
history_response = requests.get(f"{history_server}/", timeout=10)
|
||||
if history_response.status_code == 200:
|
||||
print(f"[成功] 历史查看器运行正常")
|
||||
else:
|
||||
print(f"[警告] 历史查看器异常: {history_response.status_code}")
|
||||
|
||||
# 4. 执行完整的API测试
|
||||
success = test_api_server(api_server, target_api)
|
||||
|
||||
if success:
|
||||
print(f"\n[成功] 所有测试完成!")
|
||||
print(f"[信息] 查看详细日志: cat log_dms1.txt")
|
||||
print(f"[信息] 查看测试报告: ls -la test_reports/")
|
||||
return 0
|
||||
else:
|
||||
print(f"\n[失败] 测试执行失败")
|
||||
return 1
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print(f"\n[信息] 用户中断测试")
|
||||
return 1
|
||||
except Exception as e:
|
||||
print(f"\n[错误] 测试异常: {e}")
|
||||
return 1
|
||||
finally:
|
||||
# 清理mock服务器
|
||||
if mock_manager:
|
||||
mock_manager.stop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
|
||||
try:
|
||||
print(f"[信息] 发送测试请求到API服务器...")
|
||||
start_time = time.time()
|
||||
|
||||
response = requests.post(
|
||||
f"{api_server}/run",
|
||||
json=test_config,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=120 # 2分钟超时
|
||||
)
|
||||
|
||||
end_time = time.time()
|
||||
duration = end_time - start_time
|
||||
|
||||
# 保存结果到日志文件
|
||||
with open(output_log, 'w', encoding='utf-8') as f:
|
||||
f.write(f"=== DMS合规性测试结果 ===\n")
|
||||
f.write(f"执行时间: {duration:.2f}秒\n")
|
||||
f.write(f"HTTP状态码: {response.status_code}\n")
|
||||
f.write(f"响应头: {dict(response.headers)}\n\n")
|
||||
|
||||
if response.status_code == 200:
|
||||
f.write("=== 测试成功 ===\n")
|
||||
try:
|
||||
result_json = response.json()
|
||||
f.write(json.dumps(result_json, indent=2, ensure_ascii=False))
|
||||
except:
|
||||
f.write("响应内容(非JSON格式):\n")
|
||||
f.write(response.text)
|
||||
else:
|
||||
f.write("=== 测试失败 ===\n")
|
||||
f.write(f"错误信息: {response.text}\n")
|
||||
|
||||
# 显示结果
|
||||
print(f"[信息] 请求完成,耗时: {duration:.2f}秒")
|
||||
print(f"[信息] HTTP状态码: {response.status_code}")
|
||||
|
||||
if response.status_code == 200:
|
||||
print(f"[成功] 测试执行成功")
|
||||
try:
|
||||
result = response.json()
|
||||
print(f"[信息] 测试状态: {result.get('status', '未知')}")
|
||||
if 'summary' in result:
|
||||
summary = result['summary']
|
||||
print(f"[信息] 测试摘要: {summary}")
|
||||
return True
|
||||
except:
|
||||
print(f"[信息] 响应内容已保存到: {output_log}")
|
||||
return True
|
||||
else:
|
||||
print(f"[失败] 测试执行失败")
|
||||
print(f"[错误] 错误信息: {response.text[:200]}...")
|
||||
return False
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
print(f"[错误] 请求超时(2分钟)")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[错误] 请求异常: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
print("=== DMS合规性测试工具 - 完整功能测试 ===")
|
||||
|
||||
api_server = "http://localhost:5050"
|
||||
history_server = "http://localhost:5051"
|
||||
target_api = "http://127.0.0.1:5001/"
|
||||
|
||||
# 检查mock脚本是否存在
|
||||
mock_script = "mock_dms_server.py"
|
||||
if not Path(mock_script).exists():
|
||||
print(f"[警告] Mock脚本不存在: {mock_script}")
|
||||
print(f"[信息] 将直接测试API服务器(可能会因为目标API不可用而失败)")
|
||||
mock_manager = None
|
||||
else:
|
||||
mock_manager = MockServerManager(mock_script, 5001)
|
||||
|
||||
try:
|
||||
# 1. 启动mock服务器(如果存在)
|
||||
if mock_manager:
|
||||
if not mock_manager.start():
|
||||
print(f"[错误] Mock服务器启动失败")
|
||||
return 1
|
||||
|
||||
# 2. 测试API服务器健康检查
|
||||
print(f"\n[测试] API服务器健康检查...")
|
||||
health_response = requests.get(f"{api_server}/", timeout=10)
|
||||
if health_response.status_code == 200:
|
||||
print(f"[成功] API服务器运行正常")
|
||||
else:
|
||||
print(f"[错误] API服务器不可用: {health_response.status_code}")
|
||||
return 1
|
||||
|
||||
# 3. 测试历史查看器
|
||||
print(f"\n[测试] 历史查看器...")
|
||||
history_response = requests.get(f"{history_server}/", timeout=10)
|
||||
if history_response.status_code == 200:
|
||||
print(f"[成功] 历史查看器运行正常")
|
||||
else:
|
||||
print(f"[警告] 历史查看器异常: {history_response.status_code}")
|
||||
|
||||
# 4. 执行完整的API测试
|
||||
success = test_api_server(api_server, target_api)
|
||||
|
||||
if success:
|
||||
print(f"\n[成功] 所有测试完成!")
|
||||
print(f"[信息] 查看详细日志: cat log_dms1.txt")
|
||||
print(f"[信息] 查看测试报告: ls -la test_reports/")
|
||||
return 0
|
||||
else:
|
||||
print(f"\n[失败] 测试执行失败")
|
||||
return 1
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print(f"\n[信息] 用户中断测试")
|
||||
return 1
|
||||
except Exception as e:
|
||||
print(f"\n[错误] 测试异常: {e}")
|
||||
return 1
|
||||
finally:
|
||||
# 清理mock服务器
|
||||
if mock_manager:
|
||||
mock_manager.stop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
136
test_with_python.py
Executable file
136
test_with_python.py
Executable file
@ -0,0 +1,136 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
DMS合规性测试工具 - Python API测试脚本
|
||||
对应原始命令:python run_api_tests.py --base-url http://127.0.0.1:5001/ --dms ./assets/doc/dms/domain.json --stages-dir ./custom_stages --custom-test-cases-dir ./custom_testcases -v -o ./test_reports/
|
||||
"""
|
||||
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
print("=== DMS合规性测试工具 - Python API测试 ===")
|
||||
|
||||
# 配置变量
|
||||
api_server = "http://localhost:5050"
|
||||
target_api = "http://127.0.0.1:5001/"
|
||||
output_log = "log_dms_docker.txt"
|
||||
|
||||
print(f"[信息] 目标API: {target_api}")
|
||||
print(f"[信息] API服务器: {api_server}")
|
||||
print(f"[信息] 输出日志: {output_log}")
|
||||
|
||||
# 测试配置(对应原始命令行参数)
|
||||
test_config = {
|
||||
"base-url": target_api,
|
||||
"dms": "./assets/doc/dms/domain.json",
|
||||
"stages-dir": "./custom_stages",
|
||||
"custom-test-cases-dir": "./custom_testcases",
|
||||
"verbose": True,
|
||||
"output": "./test_reports/",
|
||||
"format": "json",
|
||||
"generate-pdf": True,
|
||||
"strictness-level": "CRITICAL",
|
||||
"ignore-ssl": True
|
||||
}
|
||||
|
||||
print("\n[信息] 测试配置:")
|
||||
print(json.dumps(test_config, indent=2, ensure_ascii=False))
|
||||
|
||||
try:
|
||||
# 首先检查API服务器是否可用
|
||||
print(f"\n[信息] 检查API服务器状态...")
|
||||
health_response = requests.get(f"{api_server}/", timeout=10)
|
||||
if health_response.status_code == 200:
|
||||
print(f"[成功] API服务器运行正常")
|
||||
else:
|
||||
print(f"[警告] API服务器状态异常: {health_response.status_code}")
|
||||
|
||||
# 执行测试
|
||||
print(f"\n[信息] 开始执行测试...")
|
||||
print(f"[信息] 这可能需要几分钟时间...")
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
response = requests.post(
|
||||
f"{api_server}/run",
|
||||
json=test_config,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=300 # 5分钟超时
|
||||
)
|
||||
|
||||
end_time = time.time()
|
||||
duration = end_time - start_time
|
||||
|
||||
# 保存结果到日志文件
|
||||
with open(output_log, 'w', encoding='utf-8') as f:
|
||||
f.write(f"=== DMS合规性测试结果 ===\n")
|
||||
f.write(f"执行时间: {duration:.2f}秒\n")
|
||||
f.write(f"HTTP状态码: {response.status_code}\n")
|
||||
f.write(f"响应头: {dict(response.headers)}\n\n")
|
||||
|
||||
if response.status_code == 200:
|
||||
f.write("=== 测试成功 ===\n")
|
||||
try:
|
||||
result_json = response.json()
|
||||
f.write(json.dumps(result_json, indent=2, ensure_ascii=False))
|
||||
except:
|
||||
f.write("响应内容(非JSON格式):\n")
|
||||
f.write(response.text)
|
||||
else:
|
||||
f.write("=== 测试失败 ===\n")
|
||||
f.write(f"错误信息: {response.text}\n")
|
||||
|
||||
# 显示结果
|
||||
if response.status_code == 200:
|
||||
print(f"[成功] 测试完成!耗时: {duration:.2f}秒")
|
||||
|
||||
try:
|
||||
result = response.json()
|
||||
print(f"\n=== 测试结果摘要 ===")
|
||||
print(f"状态: {result.get('status', '未知')}")
|
||||
if 'summary' in result:
|
||||
summary = result['summary']
|
||||
print(f"总测试数: {summary.get('total_tests', 0)}")
|
||||
print(f"通过数: {summary.get('passed_tests', 0)}")
|
||||
print(f"失败数: {summary.get('failed_tests', 0)}")
|
||||
print(f"跳过数: {summary.get('skipped_tests', 0)}")
|
||||
|
||||
if 'output_files' in result:
|
||||
print(f"\n=== 生成的文件 ===")
|
||||
for file_info in result['output_files']:
|
||||
print(f"- {file_info}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"[警告] 解析JSON响应失败: {e}")
|
||||
print(f"[信息] 原始响应已保存到: {output_log}")
|
||||
else:
|
||||
print(f"[错误] 测试执行失败")
|
||||
print(f"[信息] HTTP状态码: {response.status_code}")
|
||||
print(f"[信息] 错误信息: {response.text[:200]}...")
|
||||
|
||||
print(f"\n[信息] 详细日志已保存到: {output_log}")
|
||||
print(f"[信息] 查看测试报告: ls -la test_reports/")
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
print(f"[错误] 请求超时(5分钟)")
|
||||
print(f"[建议] 测试可能仍在后台运行,请稍后查看test_reports/目录")
|
||||
except requests.exceptions.ConnectionError:
|
||||
print(f"[错误] 无法连接到API服务器: {api_server}")
|
||||
print(f"[建议] 请确认Docker容器正在运行: docker-compose ps")
|
||||
except Exception as e:
|
||||
print(f"[错误] 执行失败: {e}")
|
||||
return 1
|
||||
|
||||
print(f"\n=== 管理命令 ===")
|
||||
print(f"- 查看服务状态: docker-compose ps")
|
||||
print(f"- 查看服务日志: docker-compose logs")
|
||||
print(f"- 查看测试日志: cat {output_log}")
|
||||
print(f"- 查看测试报告: ls -la test_reports/")
|
||||
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Loading…
x
Reference in New Issue
Block a user