Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 16:03:47 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337133 - head/usr.bin/procstat/tests
Message-ID:  <201808021603.w72G3lBs082902@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Aug  2 16:03:47 2018
New Revision: 337133
URL: https://svnweb.freebsd.org/changeset/base/337133

Log:
  Add a rudimentary test for procstat kstack.
  
  MFC after:	1 week

Modified:
  head/usr.bin/procstat/tests/procstat_test.sh

Modified: head/usr.bin/procstat/tests/procstat_test.sh
==============================================================================
--- head/usr.bin/procstat/tests/procstat_test.sh	Thu Aug  2 15:16:59 2018	(r337132)
+++ head/usr.bin/procstat/tests/procstat_test.sh	Thu Aug  2 16:03:47 2018	(r337133)
@@ -144,10 +144,25 @@ file_descriptor_body()
 	atf_check -o match:"$line_re" awk 'NR > 1' procstat.out
 }
 
+atf_test_case kernel_stacks
+kernel_stacks_head()
+{
+	atf_set "descr" "Captures kernel stacks for all visible threads"
+}
+kernel_stacks_body()
+{
+	atf_check -o save:procstat.out procstat -a kstack
+	atf_check -o not-empty awk '{if ($3 == "procstat") print}' procstat.out
+
+	atf_check -o save:procstat.out procstat -kka
+	atf_check -o not-empty awk '{if ($3 == "procstat") print}' procstat.out
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case binary_info
 	atf_add_test_case command_line_arguments
 	atf_add_test_case environment
 	atf_add_test_case file_descriptor
+	atf_add_test_case kernel_stacks
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808021603.w72G3lBs082902>