plp-test/README.md
2025-04-22 16:53:06 +08:00

60 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

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

# Open-CAS 断电 PLP SSD 数据完整性测试
本项目提供了一套用于测试Open-CAS在断电情况下的PLP SSD数据完整性的测试框架。测试涵盖了多种数据写入场景并通过模拟断电来验证数据的持久性和一致性。
## 环境要求
- Go 1.20+
- NVMe SSD (支持PLP - Power Loss Protection)
- HDD 硬盘
- 已安装配置的Open-CAS
## 目录结构
```
.
├── cmd/
│ ├── client/ # 客户端命令行工具
│ └── server/ # 服务器命令行工具
├── internal/
│ ├── config/ # 配置处理
│ ├── model/ # 数据模型
│ ├── testcase/ # 测试用例实现
│ └── utils/ # 工具函数
├── pkg/ # 可被外部导入的包
│ └── opencastools/ # Open-CAS操作工具
├── scripts/ # 测试脚本
├── go.mod # Go模块文件
└── README.md # 本文档
```
## 使用方法
1. 配置测试环境
在运行测试前请确保您的Open-CAS已正确配置并将需要测试的NVMe和HDD设备路径在配置文件中指定。
2. 启动服务器
```bash
go run cmd/server/main.go -config config.yaml
```
3. 运行客户端测试
```bash
go run cmd/client/main.go -server localhost:8080 -test all
```
## 测试场景
本测试框架包含以下测试场景:
1. 顺序写入测试
2. 随机写入测试
3. 混合读写测试
4. 高并发写入测试
5. 断电恢复测试
6. 长期稳定性测试
详细测试指标和结果分析请参阅测试报告。