1 Star 0 Fork 48

Meredith/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0516-test-udev-add-a-testcase-of-too-long-line.patch 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:46 . update to systemd-239-45.el8.src.rpm
From 527d43064a93fae9a4490e5d152b120e91f5eade Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Mon, 18 Feb 2019 10:38:29 +0900
Subject: [PATCH] test-udev: add a testcase of too long line
(cherry picked from commit 1e797cf596df50a6bdd8cbf8e9b2467a3a934171)
Related: #1642728
---
test/udev-test.pl | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 957cda541c..3a50694fa9 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -39,6 +39,11 @@ for (my $i = 1; $i <= 10000; ++$i) {
$rules_10k_tags .= 'KERNEL=="sda", TAG+="test' . $i . "\"\n";
}
+my $rules_10k_tags_continuation = "";
+for (my $i = 1; $i <= 10000; ++$i) {
+ $rules_10k_tags_continuation .= 'KERNEL=="sda", TAG+="test' . $i . "\"\\\n";
+}
+
my @tests = (
{
desc => "no rules",
@@ -1444,6 +1449,16 @@ EOF
exp_name => "found",
rules => $rules_10k_tags . <<EOF
TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test10000", SYMLINK+="found"
+EOF
+ },
+ {
+ desc => "don't crash with lots of tags with continuation",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad" ,
+ rules => $rules_10k_tags_continuation . <<EOF
+TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test10000", SYMLINK+="bad"
+KERNEL=="sda", SYMLINK+="found"
EOF
},
);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yueeranna/systemd.git
git@gitee.com:yueeranna/systemd.git
yueeranna
systemd
systemd
a8

搜索帮助