diff options
author | ngie <ngie@FreeBSD.org> | 2017-05-27 23:20:28 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-05-27 23:20:28 +0000 |
commit | 142751ebb358c617c58b4b451a7ebd9b09cbd0f3 (patch) | |
tree | 0f79053712da13127dfcaed299e6c374c8096dfe | |
parent | fafbbee6b4f6a1ddeb843324a4d328604317a2fb (diff) | |
download | FreeBSD-src-142751ebb358c617c58b4b451a7ebd9b09cbd0f3.zip FreeBSD-src-142751ebb358c617c58b4b451a7ebd9b09cbd0f3.tar.gz |
MFC r319008:
kvm_geterr_test: Compile out the portions that require kvm_open2(3) on
systems that lack the libcall, based on __FreeBSD_version.
kvm_open2(3) wasn't made available until r291406, which is in ^/stable/11,
but not ^/stable/10. This makes some of kvm_geterr_test available for testing
on ^/stable/10.
-rw-r--r-- | lib/libkvm/tests/kvm_geterr_test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libkvm/tests/kvm_geterr_test.c b/lib/libkvm/tests/kvm_geterr_test.c index dc589ac..cd3e20b 100644 --- a/lib/libkvm/tests/kvm_geterr_test.c +++ b/lib/libkvm/tests/kvm_geterr_test.c @@ -65,6 +65,8 @@ ATF_TC_HEAD(kvm_geterr_positive_test_error, tc) atf_tc_set_md_var(tc, "require.user", "root"); } +/* 1100090 was where kvm_open2(3) was introduced. */ +#if __FreeBSD_version >= 1100091 ATF_TC_BODY(kvm_geterr_positive_test_error, tc) { kvm_t *kd; @@ -125,13 +127,16 @@ ATF_TC_BODY(kvm_geterr_positive_test_no_error, tc) ATF_REQUIRE_MSG(kvm_close(kd) == 0, "kvm_close failed: %s", strerror(errno)); } +#endif ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, kvm_geterr_negative_test_NULL); +#if __FreeBSD_version >= 1100091 ATF_TP_ADD_TC(tp, kvm_geterr_positive_test_error); ATF_TP_ADD_TC(tp, kvm_geterr_positive_test_no_error); +#endif return (atf_no_error()); } |