From owner-svn-src-stable@freebsd.org Sat May 27 23:04:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC66D85C3F; Sat, 27 May 2017 23:04:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1095715B7; Sat, 27 May 2017 23:04:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4RN4f6D057258; Sat, 27 May 2017 23:04:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4RN4eCw057256; Sat, 27 May 2017 23:04:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705272304.v4RN4eCw057256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 27 May 2017 23:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319006 - in stable/11: etc/mtree lib/libkvm lib/libkvm/tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 May 2017 23:04:42 -0000 Author: ngie Date: Sat May 27 23:04:40 2017 New Revision: 319006 URL: https://svnweb.freebsd.org/changeset/base/319006 Log: MFC r316099: lib/libkvm: start adding basic tests for kvm(3) - kvm_close: add a testcase to verify support for errno = EINVAL / -1 (see D10065) when kd == NULL is provided to the libcall. - kvm_geterr: -- Add a negative testcase for kd == NULL returning "" (see D10022). -- Add two positive testcases: --- test the error case using kvm_write on a O_RDONLY descriptor. --- test the "no error" case using kvm_read(3) and kvm_nlist(3) as helper routines and by injecting a bogus error message via _kvm_err (an internal API) _kvm_err was used as there isn't a formalized way to clear the error output, and because kvm_nlist always returns ENOENT with the NULL terminator today. - kvm_open, kvm_open2: -- Add some basic negative tests for kvm_open(3) and kvm_open2(3). Testing positive cases with a specific `corefile`/`execfile`/`resolver` requires more work and would require user intervention today in order to reliably test this out. Added: stable/11/lib/libkvm/tests/ - copied from r316099, head/lib/libkvm/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/lib/libkvm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Sat May 27 22:59:23 2017 (r319005) +++ stable/11/etc/mtree/BSD.tests.dist Sat May 27 23:04:40 2017 (r319006) @@ -316,6 +316,8 @@ .. libdevdctl .. + libkvm + .. libmp .. libnv Modified: stable/11/lib/libkvm/Makefile ============================================================================== --- stable/11/lib/libkvm/Makefile Sat May 27 22:59:23 2017 (r319005) +++ stable/11/lib/libkvm/Makefile Sat May 27 23:04:40 2017 (r319006) @@ -36,4 +36,10 @@ MLINKS+=kvm_nlist.3 kvm_nlist2.3 MLINKS+=kvm_open.3 kvm_close.3 kvm_open.3 kvm_open2.3 kvm_open.3 kvm_openfiles.3 MLINKS+=kvm_read.3 kvm_read2.3 kvm_read.3 kvm_write.3 +.include + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include