xref: /aosp_15_r20/external/toybox/tests/ps.test (revision cf5a6c84e2b8763fc1a7db14496fd4742913b199)
1*cf5a6c84SAndroid Build Coastguard Worker#!/bin/bash
2*cf5a6c84SAndroid Build Coastguard Worker
3*cf5a6c84SAndroid Build Coastguard Worker[ -f testing.sh ] && . testing.sh
4*cf5a6c84SAndroid Build Coastguard Worker
5*cf5a6c84SAndroid Build Coastguard Worker#testing "name" "command" "result" "infile" "stdin"
6*cf5a6c84SAndroid Build Coastguard Worker
7*cf5a6c84SAndroid Build Coastguard Workerln -s "$(which sleep)" xiphoid
8*cf5a6c84SAndroid Build Coastguard Worker(./xiphoid 5 & echo $! > pid.txt)
9*cf5a6c84SAndroid Build Coastguard WorkerID=$(cat pid.txt)
10*cf5a6c84SAndroid Build Coastguard WorkerNOSPACE=1 testing "" "ps -o pid $ID" "PID\n$ID\n" "" ""
11*cf5a6c84SAndroid Build Coastguard Workerkill "$ID"
12