]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: procfs: add parsing cmd containing newline
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 24 Dec 2022 16:53:32 +0000 (16:53 +0000)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 24 Dec 2022 17:31:48 +0000 (17:31 +0000)
tests/expected/lib/procfs-one-process
tests/expected/lib/procfs-stat-nth
tests/ts/lib/procfs
tests/ts/lib/procfs-data/proc/2/cmdline [new file with mode: 0644]
tests/ts/lib/procfs-data/proc/2/comm [new file with mode: 0644]
tests/ts/lib/procfs-data/proc/2/stat [new file with mode: 0644]

index a8ecf795149c0453f3db62d7fd0c1269054ce32e..62c89c72091372555f8cb2aab0268b6761706466 100644 (file)
@@ -2,3 +2,9 @@
    UID: [redacted]
    CMDLINE: './test'
    COMM: 'test'
+2
+   UID: [redacted]
+   CMDLINE: './foo
+bar'
+   COMM: 'foo
+bar'
index c6c333ab067622f963f9f350fc6f4d2b4b86deae..e9d2bab13965d4920d008ed663aaad03c29beaf0 100644 (file)
@@ -1,2 +1,4 @@
 1: 1th 373850
 1: 4th 373752
+2: 1th 1583
+2: 4th 1165
index 0d0c812c3bd0b7202d1aeea73aff8ff16675f421..4f272e80e6f03313c6de35a48eab22bee2d7ab63 100755 (executable)
@@ -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 (file)
index 0000000..5ca4218
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 (file)
index 0000000..3bd1f0e
--- /dev/null
@@ -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 (file)
index 0000000..250e579
--- /dev/null
@@ -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