]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r316099:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 27 May 2017 23:26:10 +0000 (23:26 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 27 May 2017 23:26:10 +0000 (23:26 +0000)
commit970274aac9280da11fd166d84b8d4a325187bc55
tree37ec72eb997d3beeea6c03f88461f8e45a717f56
parent6ff60f2584dc6bb7154f2c66c8647949447bbec7
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.

MFC note:
  lib/libkvm/kvm_open2_test is not compiled/tested because ^/stable/10
  lacks the kvm_open2(3) libcall.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319012 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
etc/mtree/BSD.tests.dist
lib/libkvm/Makefile
lib/libkvm/tests/Makefile [new file with mode: 0644]
lib/libkvm/tests/kvm_close_test.c [new file with mode: 0644]
lib/libkvm/tests/kvm_geterr_test.c [new file with mode: 0644]
lib/libkvm/tests/kvm_open2_test.c [new file with mode: 0644]
lib/libkvm/tests/kvm_open_test.c [new file with mode: 0644]
lib/libkvm/tests/kvm_test_common.c [new file with mode: 0644]
lib/libkvm/tests/kvm_test_common.h [new file with mode: 0644]