summaryrefslogtreecommitdiffstats
path: root/testsuite/pwdx.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:34:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:34:44 +0000
commite3be059d4da38aa36f1aee1d56f8ceb943d92f1c (patch)
tree26edef31e4e503dd1c92a112de174f366dd61802 /testsuite/pwdx.test
parentInitial commit. (diff)
downloadprocps-e3be059d4da38aa36f1aee1d56f8ceb943d92f1c.tar.xz
procps-e3be059d4da38aa36f1aee1d56f8ceb943d92f1c.zip
Adding upstream version 2:4.0.4.upstream/2%4.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite/pwdx.test')
-rw-r--r--testsuite/pwdx.test/pwdx.exp22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/pwdx.test/pwdx.exp b/testsuite/pwdx.test/pwdx.exp
new file mode 100644
index 0000000..2f71cbd
--- /dev/null
+++ b/testsuite/pwdx.test/pwdx.exp
@@ -0,0 +1,22 @@
+
+make_testproc
+
+set pwdx "${topdir}src/pwdx"
+# Run pwdx with no arguments
+set test "pwdx no args"
+spawn $pwdx
+expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\."
+
+# Run pwdx with pid 0 which is invalid
+set test "pwdx pid 0 should be invalid"
+spawn $pwdx 0
+expect_pass "$test" "\(lt-\)\?pwdx\: invalid process id\: 0"
+
+# Run pwdx with existing pid
+set test "pwdx find test process cwd"
+set my_pwd [ pwd ]
+spawn $pwdx $testproc1_pid
+expect_pass "$test" "^$testproc1_pid: $my_pwd"
+
+# Cleanup
+kill_testproc