diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2017-10-14 18:38:36 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2017-10-14 18:38:36 +0000 |
| commit | 2a243b9539a45b392a515569cab2091844cf2bdf (patch) | |
| tree | fa6c815477eaedfb7bc8c1882a778285119b5223 /usr.bin/procstat/tests | |
| parent | 8c8e10b763684442d614bc0eb978fd90789cd2a6 (diff) | |
Notes
Diffstat (limited to 'usr.bin/procstat/tests')
| -rwxr-xr-x | usr.bin/procstat/tests/procstat_test.sh | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/usr.bin/procstat/tests/procstat_test.sh b/usr.bin/procstat/tests/procstat_test.sh index a939f4f26cd73..06fa1f9955222 100755 --- a/usr.bin/procstat/tests/procstat_test.sh +++ b/usr.bin/procstat/tests/procstat_test.sh @@ -63,8 +63,11 @@ binary_info_body() header_re=$(printf "$line_format" "PID" "COMM" "OSREL" "PATH") line_re=$(printf "$line_format" $PROG_PID $PROG_COMM "[[:digit:]]+" "$PROG_PATH") - atf_check -o save:procstat.out procstat -b $PROG_PID + atf_check -o save:procstat.out procstat binary $PROG_PID + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" tail -n 1 procstat.out + atf_check -o save:procstat.out procstat -b $PROG_PID atf_check -o match:"$header_re" head -n 1 procstat.out atf_check -o match:"$line_re" tail -n 1 procstat.out } @@ -84,6 +87,10 @@ command_line_arguments_body() header_re=$(printf "$line_format" "PID" "COMM" "ARGS") line_re=$(printf "$line_format" $PROG_PID "$PROG_COMM" "$PROG_PATH $arguments") + atf_check -o save:procstat.out procstat arguments $PROG_PID + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" tail -n 1 procstat.out + atf_check -o save:procstat.out procstat -c $PROG_PID atf_check -o match:"$header_re" head -n 1 procstat.out atf_check -o match:"$line_re" tail -n 1 procstat.out @@ -105,8 +112,11 @@ environment_body() header_re=$(printf "$line_format" "PID" "COMM" "ENVIRONMENT") line_re=$(printf "$line_format" $PROG_PID $PROG_COMM ".*$var.*") - atf_check -o save:procstat.out procstat -e $PROG_PID + atf_check -o save:procstat.out procstat environment $PROG_PID + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" tail -n 1 procstat.out + atf_check -o save:procstat.out procstat -e $PROG_PID atf_check -o match:"$header_re" head -n 1 procstat.out atf_check -o match:"$line_re" tail -n 1 procstat.out } @@ -125,8 +135,11 @@ file_descriptor_body() # XXX: write a more sensible feature test line_re=$(printf "$line_format" $PROG_PID $PROG_COMM ".+" ".+" ".+" ".+" ".+" ".+" ".+" ".+") - atf_check -o save:procstat.out procstat -f $PROG_PID + atf_check -o save:procstat.out procstat files $PROG_PID + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" awk 'NR > 1' procstat.out + atf_check -o save:procstat.out procstat -f $PROG_PID atf_check -o match:"$header_re" head -n 1 procstat.out atf_check -o match:"$line_re" awk 'NR > 1' procstat.out } |
