summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorCraig Small <csmall@dropbear.xyz>2022-04-09 14:50:53 +1000
committerCraig Small <csmall@dropbear.xyz>2022-04-09 14:50:53 +1000
commit7597aaf7f9f92899f3a0ad05461d42eeace0c581 (patch)
tree834b635bc3412b05036c94e7b0667dc4a7a1f121 /testsuite
parentb159c198c9160a8eb13254e2b631d0035b9b542c (diff)
downloadprocps-ng-7597aaf7f9f92899f3a0ad05461d42eeace0c581.tar.gz
testsuite: Add AIX field checks for ps
AIX fields (generally %char) have had some love now but are parsed slightly differently to other fields, so they have some tests. References: commit 4fbf8d22a99445bc7b37c6d36ed9e045821439e3 https://www.freelists.org/post/procps/some-procpsn4400-fixes,7 Signed-off-by: Craig Small <csmall@dropbear.xyz>
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ps.test/ps_output.exp16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/ps.test/ps_output.exp b/testsuite/ps.test/ps_output.exp
index 99fa8d4..7df7b0e 100644
--- a/testsuite/ps.test/ps_output.exp
+++ b/testsuite/ps.test/ps_output.exp
@@ -35,3 +35,19 @@ foreach { flag match } $flag_match {
spawn $ps -o $flag
expect_pass "$test" $match
}
+
+set test "ps with correct AIX field"
+spawn $ps -o "%p"
+expect_pass "$test" "\\s*PID\\s+\(\\s*\\d+\\s+\)+$"
+
+set test "ps with improper AIX field"
+spawn $ps -o "%p %G{"
+expect_pass "$test" "error: improper AIX field descriptor"
+
+set test "ps with missing AIX field"
+spawn $ps -o "%p %%a"
+expect_pass "$test" "error: missing AIX field descriptor"
+
+set test "ps with unknown AIX field"
+spawn $ps -o "%p %Z"
+expect_pass "$test" "error: unknown AIX field descriptor"