This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
galaxy-platform-galaxy-trou…/24.02/tsg_olap_e2e_test/README.md

128 lines
3.9 KiB
Markdown
Raw Normal View History

2024-04-20 12:52:13 +00:00
# TSG OLAP End-to-End Test
2024-04-22 14:07:10 +00:00
## 概述
2024-04-23 10:19:41 +00:00
TSG OLAP的数据摄入分为三种类型Logs、Metrics 和 File Chunks。为确保能够正确处理并写入相应存储系统需要支持端到端业务自检。支持部署方式
- 集中式部署
- 多数据中心部署
2024-04-23 10:16:10 +00:00
2024-04-22 14:08:43 +00:00
![End-to-End Workflow](images/e2e-test-flow-figure.png)
2024-04-22 14:07:10 +00:00
2024-04-20 12:52:13 +00:00
## 环境依赖
2024-04-22 10:14:27 +00:00
- Logs和Metric生成工具 `kafka-operation.sh` ,详细参考[帮助文档](https://docs.geedge.net/pages/viewpage.action?pageId=8029767)
2024-04-22 14:25:47 +00:00
- File Chunks生成工具 `file-chunk-generator.jar`
2024-04-20 12:52:13 +00:00
- 安装`Newman`,详细参考[帮助文档](https://learning.postman.com/docs/collections/using-newman-cli/newman-options/)
## 使用方法
2024-04-23 10:11:59 +00:00
### 配置Newman CLI enviroment.json
2024-04-20 12:52:13 +00:00
```json
{
2024-04-23 10:11:59 +00:00
"key": "qgw_ip",
"value": "192.168.44.30",
"type": "default",
"enabled": true
},
{
"key": "qgw_port",
"value": "9999",
"type": "default",
"enabled": true
},
{
"key": "hos_ip",
"value": "192.168.44.30",
"type": "default",
"enabled": true
},
{
"key": "hos_port",
"value": "9098",
"type": "default",
"enabled": true
},
{
"key": "hos_token",
"value": "xxxxxx",
"type": "default",
"enabled": true
}
2024-04-20 12:52:13 +00:00
```
2024-04-22 09:57:56 +00:00
### 配置File Chunks 生成工具
2024-04-23 10:11:59 +00:00
- 修改`config.properties`, 增加Kafka访问地址
2024-04-22 09:57:56 +00:00
```props
2024-04-23 10:11:59 +00:00
kafka.server=192.168.41.29:9092
2024-04-22 09:57:56 +00:00
```
2024-04-20 12:52:13 +00:00
### 写入测试集至Kafka
- Logs
```shell
cd tsg_olap_e2e_test/
2024-04-20 13:11:21 +00:00
kafka-operation.sh producer SESSION-RECORD < ./datasets/logs/session_record.dat
2024-04-20 12:52:13 +00:00
kafka-operation.sh producer VOIP-RECORD < ./datasets/logs/voip_record.dat
kafka-operation.sh producer PROXY-EVENT < ./datasets/logs/proxy_event.dat
```
- Metrics
```shell
cd tsg_olap_e2e_test/
kafka-operation.sh producer NETWORK-TRAFFIC-METRIC < ./datasets/metrics/network_traffic_metric.dat
kafka-operation.sh producer POLICY-RULE-METRIC < ./datasets/metrics/policy_rule_metric.dat
2024-04-20 13:12:59 +00:00
kafka-operation.sh producer OBJECT-STATISTICS-METRIC < ./datasets/metrics/object_statistics_metric.dat
2024-04-20 12:52:13 +00:00
2024-04-20 13:12:59 +00:00
kafka-operation.sh producer STATISTICS-RULE-METRIC < ./datasets/metrics/statistics_rule_metric.dat
2024-04-20 12:52:13 +00:00
```
2024-04-22 10:12:41 +00:00
- Files(与日志路径对应)
2024-04-20 12:52:13 +00:00
2024-04-22 09:57:56 +00:00
```shell
2024-04-23 09:17:03 +00:00
cd file-chunk-generator/
2024-04-22 09:57:56 +00:00
2024-04-23 10:11:59 +00:00
java -jar file-chunk-generator.jar --topic TRAFFIC-FILE-STREAM-RECORD -n 123e4567-e89b-12d3-a456-426614174001 --file_type traffic_pcapng
java -jar file-chunk-generator.jar --topic TRAFFIC-FILE-STREAM-RECORD -n 123e4567-e89b-12d3-a456-426614174002 --file_type html
2024-04-22 09:57:56 +00:00
2024-04-23 10:11:59 +00:00
java -jar file-chunk-generator.jar --topic TRAFFIC-FILE-STREAM-RECORD -n 123e4567-e89b-12d3-a456-426614174003 --file_type html
2024-04-22 09:57:56 +00:00
2024-04-23 10:11:59 +00:00
java -jar file-chunk-generator.jar --topic TRAFFIC-FILE-STREAM-RECORD -n 123e4567-e89b-12d3-a456-426614174004 --file_type eml
2024-04-22 09:57:56 +00:00
2024-04-23 10:11:59 +00:00
java -jar file-chunk-generator.jar --topic TRAFFIC-FILE-STREAM-RECORD -n 123e4567-e89b-12d3-a456-426614174005 --file_type traffic_pcapng
2024-04-22 09:57:56 +00:00
2024-04-23 10:22:43 +00:00
java -jar file-chunk-generator.jar --topic TROUBLESHOOTING-FILE-STREAM-RECORD -n 123e4567-e89b-12d3-a456-426614174006 --file_type troubleshooting_pcapng
2024-04-22 09:57:56 +00:00
```
2024-04-23 09:11:28 +00:00
### 输出故障诊断报告等待3-5分钟
2024-04-20 13:11:21 +00:00
2024-04-20 12:52:13 +00:00
```shell
2024-04-22 11:10:52 +00:00
# -n 执行次数 --folder 测试目录logsmetricsfiles不指定将对所有模块进行自检
2024-04-20 13:11:21 +00:00
# Logs进行故障诊断输出诊断明细
2024-04-23 09:09:48 +00:00
newman run ./collection.json -n 1 -e ./environment.json --delay-request 500 --timeout-script 10000 --timeout-request 300000 --timeout 3600000 --insecure --verbose --ignore-redirects --folder logs
2024-04-20 13:11:21 +00:00
#Logs进行故障诊断通过表情形式输出测试结果
2024-04-23 09:09:48 +00:00
newman run ./collection.json -n 1 --delay-request 500 -e ./environment.json --ignore-redirects --folder logs -r emojitrain
2024-04-20 12:52:13 +00:00
2024-04-20 13:11:21 +00:00
#Logs进行故障诊断输出报告json格式自动存储newman目录
2024-04-23 09:09:48 +00:00
newman run ./collection.json -n 1 --delay-request 500 -e ./environment.json --ignore-redirects --folder logs -r cli,json
2024-04-23 10:19:41 +00:00
#清除测试数据(暂支持对文件的删除)
2024-04-23 09:09:48 +00:00
newman run ./collection.json -n 1 --delay-request 500 -e ./environment.json --ignore-redirects --folder clear_test_data -r emojitrain
2024-04-20 12:52:13 +00:00
```