Files
REPO_TEST/readme.md
2025-07-23 20:41:13 +08:00

115 lines
3.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 仓库测试工具套件
## 项目概述
本项目是一个综合性的仓库测试工具套件,用于测试和验证软件仓库的各种特性和功能。它提供了一系列工具来检查仓库数据的一致性、软件包签名、哈希值、依赖关系等。
## 架构设计
项目已重构为模块化架构,将功能划分为不同的模块,便于维护和扩展。
### 目录结构
```
repo_test/
├── script/
│ └── 测试项 #测试脚本
├── common/ # 通用工具模块
│ ├── __init__.py
│ ├── config.py # 配置管理
│ ├── file_utils.py # 文件处理工具
│ ├── http_utils.py # HTTP请求工具
│ └── logger.py # 日志管理
├── config/ # 配置文件目录
│ └── repo_configs.json # 仓库配置
├── repodata/ # 仓库数据检查模块
│ ├── __init__.py
│ ├── checker.py # 仓库检查器
│ └── parser.py # 仓库数据解析
├── main.py # 主执行文件
├── requirements.txt # 依赖列表
└── README.md # 项目说明
```
## 测试项
- 仓库repodata数据校验
- 软件包签名
- 软件包哈希值
- 黑名单二次校验
- 单个软件包安装、卸载
- 源码包下所有二进制包升降级
- 软件包依赖检查
- 软件包兼容性对比
- v10spx 产品升级
- v10spx 仓库软件包对比
## 功能模块
### 1. 仓库数据检查 (repodata)
检查仓库元数据的一致性确保repodata中的软件包列表与实际可下载的软件包一致。
**用法**:
```bash
python main.py --config config/repo_configs.json
```
### 2. 配置管理 (common.config)
用于加载和管理各种配置文件支持JSON、YAML、和yum仓库原生格式。
### 3. HTTP工具 (common.http_utils)
处理HTTP请求和下载功能的工具类。
### 4. 文件工具 (common.file_utils)
处理文件操作和压缩文件的工具类。
### 5. 日志管理 (common.logger)
提供统一的日志记录功能。
## 安装依赖
```bash
pip install -r requirements.txt
```
## 命令行参数
主程序支持以下命令行参数:
- `--config`: 配置文件路径
- `--output-dir`: 输出目录(默认: ./results
- `--max-workers`: 最大并行检查线程数(默认: 5
- `--product`: 仅检查指定产品
- `--arch`: 仅检查指定架构
- `--verbose`: 显示详细日志
## 配置文件格式
配置文件支持JSON和YAML格式示例如下
```json
{
"repo_configs": [
{
"product": "V10-SP3",
"base_url": "https://update.cs2c.com.cn/private_test/repo/V10/V10SP3/os/adv/lic/",
"architectures": ["x86_64", "aarch64", "loongarch64"],
"repo_types": ["updates"]
}
]
}
```
## 输出文件
- `repo_rpmlist_check_results.log`: 完整测试结果
- `repo_rpmlist_check_fail.log`: 仅包含失败的测试结果
- `error_*.log`: 各个仓库的详细错误信息