{"id":23658775,"url":"https://github.com/opencloudos/longanchkout","last_synced_at":"2025-11-28T06:30:15.752Z","repository":{"id":78471363,"uuid":"445016935","full_name":"OpenCloudOS/LonganChkout","owner":"OpenCloudOS","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-14T07:37:00.000Z","size":4679,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T00:51:48.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenCloudOS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-06T02:37:19.000Z","updated_at":"2022-05-25T12:26:50.000Z","dependencies_parsed_at":"2023-04-18T10:32:29.906Z","dependency_job_id":null,"html_url":"https://github.com/OpenCloudOS/LonganChkout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCloudOS%2FLonganChkout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCloudOS%2FLonganChkout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCloudOS%2FLonganChkout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCloudOS%2FLonganChkout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenCloudOS","download_url":"https://codeload.github.com/OpenCloudOS/LonganChkout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239644158,"owners_count":19673577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-29T00:51:28.268Z","updated_at":"2025-11-28T06:30:15.699Z","avatar_url":"https://github.com/OpenCloudOS.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Longan\nLongan项目用于内核离线自动化压力测试。\n\n# 原理\n本项目基于avocado框架（[https://github.com/avocado-framework/avocado](https://github.com/avocado-framework/avocado)），配套使用avocado测试套件（[https://github.com/avocado-framework-tests/avocado-misc-tests](https://github.com/avocado-framework-tests/avocado-misc-tests)），对内核调度、内存、IO等子系统进行压测。\n\n**快速开始**\n\n```bash\n$ cd tlinux_autotest_offline\n$ chmod +x runall.sh\n$ ./runall.sh -t 60\n```\n\n测试分为avocado测试套件以及独立测试，后者可以脱离avocado框架独立运行。目前，前者无法控制测试总时长，后者可以通过加`-t`参数来控制。使用runall脚本串行跑所有测试时，同样通过`-t`参数控制独立测试的时长。\n\nsummary输出测试结果PASS、FAIL、SKIP。\n\n如果希望有更详细的log或测试报告，可以使用avocado框架。avocado框架运行测试支持输出多样式测试报告，比如html、json、tap、xml等。\n\n# 环境配置\n## avocado框架安装\n跑测试用例需要用到avocado框架。本项目使用的avocado框架为93.0。\npython版本：3.6\n```bash\nchmod +x tlinux_autotest_offline/test_env/avocado/93/avocado_install.sh\n./tlinux_autotest_offline/test_env/avocado/93/avocado_install.sh\n```\n\n## docker服务\n测试需要运行docker服务。\n### 安装docker\n安装docker软件包\n```bash\n# TencentOS Server 2 安装docker-ce\nyum install tlinux-release-docker-ce  \u0026\u0026 yum install docker-ce\n# TencentOS Server 3 安装docker-ce\nyum install tencentos-release-docker-ce  \u0026\u0026 yum install docker-ce\n```\n运行docker服务\n```bash\nsystemctl start docker\n```\n使用下面的命令确认docker服务已经启动没有报错\n```bash\ndocker -v\n# 或者\ndocker ps\n```\n## 数据盘vdb、vdc\n机器需要有数据盘vdb、vdc，io读写磁盘测试可能会破坏该盘上的数据。\n系统盘vda建议50G以上，数据盘建议各40G以上。\n\n## 文件系统ext4、xfs\n内核版本需要支持挂载ext4、xfs文件系统。\n\n# 测试说明\n\n## 测试模式\n### 所有测试\n这种模式下，请使用`runall.sh`，接受参数t，将指定`stress_test`中所有测试的运行时长，如果不指定，将使用每个测试各自的默认测试时长。此参数不影响`general_test`中的测试。\n### 单个测试\n使用时请先注意时长，在脚本中固定写死，一般为`test_time`。\n\n## 测试用例说明\n测试用例都在文件夹testcases中。按是否基于avocado运行框架分为两部分：\n- general_test: avocado框架测试套件。需要基于avocado框架运行。\n- stress_test: 独立测试。可以不基于avocado框架运行。\n\n### general_test\n- bench：常见benchmark测试。\n    - filebench\n    - hackbench\n    - tbench\n    - unixbench\n- fs：文件系统测试。\n    - xfstest\n- io：磁盘io测试。\n    - fiotest\n- misc：混合测试。\n    - ltp\n- perf：性能统计测试。\n    - perf_basic\n    - perf_invalid_flag_test\n    - perf_pcp\n    - perf_uprobe\n- sched：调度测试。\n    - cgroup_offline_inheritance_test\n    - cgroup_offline_press\n    - hackbench\n    - offline_cgroup_test\n    - proc_offline_illegal_value_test\n    - root_task_group_test\n    - schbench\n    - set_root_task_group\n    - task_offline_inheritance_test\n    \n### stress_test\n- io_integration_test：io压测。docker里反复挂载、卸载文件系统，默认持续时间12小时。\n    - test_docker_ext4：ext4文件系统。\n    - test_docker_xfs：xfs文件系统。\n- net：网络压测。\n    - docker_performance_test：docker里跑netperf的不同模式，设定baseline，如果没有达到会在日志中输出哪项没有达到预期。\n    - kvm_vhost_hotplug_test：kvm子机里进行热插拔测试。\n    - kvm_vhost_hotunplug_test：kvm子机里进行热插拔测试。\n    - kvm_vhost_netperf_test：kvm子机间跑netperf的不同模式，设定baseline，如果没有达到会在日志中输出哪项没有达到预期。\n    - ping_test：kvm子机是否能ping通。\n    - sriov_fld_start_test：ipv4打流测试，从Transmitter往Receiver发送流量，需要Receiver有两张网卡。\n    - sriov_ipv6_fld_start_test：ipv6打流测试，从Transmitter往Receiver发送流量，需要Receiver有两张网卡、ipv6地址。\n- sched_stress_test：调度、内存相关压测。\n    - oom_test：内存压测。限制cgroup内存使用，不断申请内存。\n    - stress_test：调度压测。测试bt调度算法及cfs调度算法，如果不支持bt调度，测试也不会失败。\n\n**io压测特别说明**\n需要下载镜像文件 `tlinux-64bit-v2.4.20200929.tar` 放在路径 `testcases/stress_test/io_integration_test/io_integration_test.sh.data/` 下。\n\n下载链接为：https://share.weiyun.com/vQloHzrt 密码：3r7wuc\n\n**net网络压测特别说明**\n\n可以使用net文件夹下提供的sshpass-1.06-2.tl2.x86_64.rpm，离线安装sshpass\n```bash\nrpm -Uvh --force --nodeps sshpass-1.06-2.tl2.x86_64.rpm\n```\n或者在配置好yum源后在线安装\n```bash\nyum install -y sshpass\n```\n使用时需要修改测试用例，给出通信双方机器。\n\n## 测试用例运行说明\n每个测试用例的起名类似以下规则：\n```bash\ndirname\n    test.sh.data/\n        xxx\n    test.sh\n```\n或者\n```bash\ndirname\n    test.py.data/\n        xxx\n    test.py\n```\n其中`test.sh`与`test.py`为主要的测试启动脚本。请在运行前确保脚本是可执行的，否则\n```bash\nchmod +x test.sh\nchmod +x test.py\n```\n\n- general_test\n```bash\navocado run path/xxx.sh\n```\n\n- stress_test\n```bash\n./path/xxx.sh -param1 xx -param2 xx\n```\n\n## 测试机器说明\n以stress_test为例，可以运行测试的机器参数为：\n- io_integration_test：\n    - test_docker_ext4：CPU-2 Memory-230M; CPU-4 Memory-480M; CPU-4 Memory-860M; CPU-4 Memory-2.8G; CPU-4 Memory-4.7G\n    - test_docker_xfs：CPU-2 Memory-230M; CPU-4 Memory-480M; CPU-4 Memory-860M; CPU-4 Memory-2.8G; CPU-4 Memory-4.7G\n- net：\n    - docker_performance_test：CPU-4 Memory-8G\n    - kvm_vhost_hotplug_test：CPU-4 Memory-1.5G\n    - kvm_vhost_hotunplug_test：CPU-4 Memory-1.5G\n    - kvm_vhost_netperf_test：CPU-4 Memory-1.5G\n    - ping_test：CPU-4 Memory-1.5G\n    - sriov_fld_start_test：CPU-2 Memory-8G\n    - sriov_ipv6_fld_start_test：CPU-2 Memory-8G\n- sched_stress_test：\n    - oom_test：CPU-2 Memory-512M\n    - stress_test：CPU-2 Memory-512M\n\n## 测试输出样例\n每个测试下可能会有一个以result.txt或者result.log结尾的文件。此文件不参与测试，仅作为测试输出样例。\n注意：测试时长请以脚本里写的为主。测试输出样例只是**样例**。\n\n## 测试说明\n要重复使用测试工具进行测试，请重启机器再进行测试，并确保/dev/vdb和/dev/vdc盘未挂载，且为正常可挂载状态。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencloudos%2Flonganchkout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencloudos%2Flonganchkout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencloudos%2Flonganchkout/lists"}