From: Thomas Weißschuh Date: Sat, 24 Dec 2022 16:53:32 +0000 (+0000) Subject: lib: procfs: add parsing cmd containing newline X-Git-Tag: v2.39-rc1~356^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e83ced9250082be03f848e7ee4ea270e878380c6;p=thirdparty%2Futil-linux.git lib: procfs: add parsing cmd containing newline --- diff --git a/tests/expected/lib/procfs-one-process b/tests/expected/lib/procfs-one-process index a8ecf79514..62c89c7209 100644 --- a/tests/expected/lib/procfs-one-process +++ b/tests/expected/lib/procfs-one-process @@ -2,3 +2,9 @@ UID: [redacted] CMDLINE: './test' COMM: 'test' +2 + UID: [redacted] + CMDLINE: './foo +bar' + COMM: 'foo +bar' diff --git a/tests/expected/lib/procfs-stat-nth b/tests/expected/lib/procfs-stat-nth index c6c333ab06..e9d2bab139 100644 --- a/tests/expected/lib/procfs-stat-nth +++ b/tests/expected/lib/procfs-stat-nth @@ -1,2 +1,4 @@ 1: 1th 373850 1: 4th 373752 +2: 1th 1583 +2: 4th 1165 diff --git a/tests/ts/lib/procfs b/tests/ts/lib/procfs index 0d0c812c3b..4f272e80e6 100755 --- a/tests/ts/lib/procfs +++ b/tests/ts/lib/procfs @@ -33,6 +33,7 @@ test_cmd() { ts_init_subtest "one-process" test_cmd --one 1 +test_cmd --one 2 ts_finalize_subtest @@ -44,6 +45,9 @@ test_cmd --stat-nth 1 2 test_cmd --stat-nth 1 3 test_cmd --stat-nth 1 4 +test_cmd --stat-nth 2 1 +test_cmd --stat-nth 2 4 + ts_finalize_subtest ts_finalize diff --git a/tests/ts/lib/procfs-data/proc/2/cmdline b/tests/ts/lib/procfs-data/proc/2/cmdline new file mode 100644 index 0000000000..5ca4218fd0 Binary files /dev/null and b/tests/ts/lib/procfs-data/proc/2/cmdline differ diff --git a/tests/ts/lib/procfs-data/proc/2/comm b/tests/ts/lib/procfs-data/proc/2/comm new file mode 100644 index 0000000000..3bd1f0e297 --- /dev/null +++ b/tests/ts/lib/procfs-data/proc/2/comm @@ -0,0 +1,2 @@ +foo +bar diff --git a/tests/ts/lib/procfs-data/proc/2/stat b/tests/ts/lib/procfs-data/proc/2/stat new file mode 100644 index 0000000000..250e5791f9 --- /dev/null +++ b/tests/ts/lib/procfs-data/proc/2/stat @@ -0,0 +1,2 @@ +1583 (foo +bar) S 1165 1583 1165 34818 1583 4194304 82 0 0 0 0 0 0 0 20 0 1 0 17487 2543616 215 18446744073709551615 93858497511424 93858497511841 140729173273328 0 0 0 0 0 0 1 0 0 17 0 0 0 0 0 0 93858497523152 93858497523752 93858527924224 140729173281886 140729173281896 140729173281896 140729173282798 0