Index: stable/11/lib/libcam/tests/libcam_test.c =================================================================== --- stable/11/lib/libcam/tests/libcam_test.c (revision 346919) +++ stable/11/lib/libcam/tests/libcam_test.c (revision 346920) @@ -1,322 +1,321 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* Tests functions in lib/libcam/camlib.c */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include static const char * get_cam_test_device(const atf_tc_t *tc) { const char *cam_test_device; cam_test_device = atf_tc_get_config_var(tc, "cam_test_device"); return (cam_test_device); } static void cam_clear_error(void) { strcpy(cam_errbuf, ""); } static bool cam_has_error(void) { return (strlen(cam_errbuf) != 0); } ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_NULL_path); ATF_TC_BODY(cam_get_device_negative_test_NULL_path, tc) { char parsed_dev_name[DEV_IDLEN + 1]; int parsed_unit; ATF_REQUIRE_MSG(cam_get_device(NULL, parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == -1, "cam_get_device succeeded unexpectedly"); } ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_bad_path); ATF_TC_BODY(cam_get_device_negative_test_bad_path, tc) { char parsed_dev_name[DEV_IDLEN + 1]; int parsed_unit; ATF_REQUIRE_MSG(cam_get_device("1ada", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == -1, "cam_get_device succeeded unexpectedly"); } ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_nul_path); ATF_TC_BODY(cam_get_device_negative_test_nul_path, tc) { char parsed_dev_name[DEV_IDLEN + 1]; int parsed_unit; ATF_REQUIRE_MSG(cam_get_device("", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == -1, "cam_get_device succeeded unexpectedly"); } ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_root); ATF_TC_BODY(cam_get_device_negative_test_root, tc) { char parsed_dev_name[DEV_IDLEN + 1]; int parsed_unit; ATF_REQUIRE_MSG(cam_get_device("/", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == -1, "cam_get_device succeeded unexpectedly"); } ATF_TC_WITHOUT_HEAD(cam_get_device_positive_test); ATF_TC_BODY(cam_get_device_positive_test, tc) { char expected_dev_name[] = "foo"; char parsed_dev_name[DEV_IDLEN + 1]; int expected_unit, parsed_unit; expected_unit = 1; ATF_REQUIRE_MSG(cam_get_device("/dev/foo1", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == 0, "cam_get_device failed"); ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); ATF_REQUIRE(parsed_unit == expected_unit); strcpy(parsed_dev_name, ""); parsed_unit = -1; ATF_REQUIRE_MSG(cam_get_device("foo1", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == 0, "cam_get_device failed"); ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); ATF_REQUIRE(parsed_unit == expected_unit); } /* * sa(4) uniquely creates nsa and esa device nodes for non-rewind operations * and eject-on-close operations. cam_get_device must special case these nodes * to always return the base device. */ ATF_TC_WITHOUT_HEAD(cam_get_device_sa_test); ATF_TC_BODY(cam_get_device_sa_test, tc) { char parsed_dev_name[DEV_IDLEN + 1]; int parsed_unit; ATF_REQUIRE_MSG(cam_get_device("nsa99", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == 0, "cam_get_device failed"); ATF_REQUIRE_STREQ(parsed_dev_name, "sa"); ATF_REQUIRE(parsed_unit == 99); strcpy(parsed_dev_name, ""); parsed_unit = -1; ATF_REQUIRE_MSG(cam_get_device("esa99", parsed_dev_name, nitems(parsed_dev_name), &parsed_unit) == 0, "cam_get_device failed"); ATF_REQUIRE_STREQ(parsed_dev_name, "sa"); ATF_REQUIRE(parsed_unit == 99); } ATF_TC(cam_open_device_negative_test_O_RDONLY); ATF_TC_HEAD(cam_open_device_negative_test_O_RDONLY, tc) { atf_tc_set_md_var(tc, "descr", "test that cam_open_device(`cam_device`, O_RDONLY) fails to open " "the underlying pass(4) device (bug 217649)"); atf_tc_set_md_var(tc, "require.config", "cam_test_device"); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(cam_open_device_negative_test_O_RDONLY, tc) { const char *cam_test_device; cam_test_device = get_cam_test_device(tc); cam_clear_error(); ATF_CHECK(cam_open_device(cam_test_device, O_RDONLY) == NULL); ATF_REQUIRE(cam_has_error()); } ATF_TC(cam_open_device_negative_test_nonexistent); ATF_TC_HEAD(cam_open_device_negative_test_nonexistent, tc) { atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(cam_open_device_negative_test_nonexistent, tc) { cam_clear_error(); ATF_REQUIRE(cam_open_device("/nonexistent", O_RDWR) == NULL); ATF_REQUIRE(cam_has_error()); } ATF_TC(cam_open_device_negative_test_unprivileged); ATF_TC_HEAD(cam_open_device_negative_test_unprivileged, tc) { atf_tc_set_md_var(tc, "require.config", "cam_test_device"); atf_tc_set_md_var(tc, "require.user", "unprivileged"); } ATF_TC_BODY(cam_open_device_negative_test_unprivileged, tc) { const char *cam_test_device; cam_test_device = get_cam_test_device(tc); cam_clear_error(); ATF_CHECK(cam_open_device(cam_test_device, O_RDONLY) == NULL); ATF_REQUIRE(cam_has_error()); cam_clear_error(); ATF_CHECK(cam_open_device(cam_test_device, O_RDWR) == NULL); ATF_REQUIRE(cam_has_error()); } ATF_TC(cam_open_device_positive_test); ATF_TC_HEAD(cam_open_device_positive_test, tc) { atf_tc_set_md_var(tc, "require.config", "cam_test_device"); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(cam_open_device_positive_test, tc) { struct cam_device *cam_dev; const char *cam_test_device; cam_test_device = get_cam_test_device(tc); cam_clear_error(); cam_dev = cam_open_device(cam_test_device, O_RDWR); ATF_CHECK_MSG(cam_dev != NULL, "cam_open_device failed: %s", cam_errbuf); ATF_REQUIRE(!cam_has_error()); cam_close_device(cam_dev); } ATF_TC(cam_close_device_negative_test_NULL); ATF_TC_HEAD(cam_close_device_negative_test_NULL, tc) { atf_tc_set_md_var(tc, "descr", "test that cam_close_device(NULL) succeeds without error"); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(cam_close_device_negative_test_NULL, tc) { cam_clear_error(); cam_close_device(NULL); ATF_REQUIRE(!cam_has_error()); } ATF_TC(cam_getccb_positive_test); ATF_TC_HEAD(cam_getccb_positive_test, tc) { atf_tc_set_md_var(tc, "require.config", "cam_test_device"); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(cam_getccb_positive_test, tc) { union ccb *cam_ccb; struct cam_device *cam_dev; const char *cam_test_device; cam_test_device = get_cam_test_device(tc); cam_clear_error(); cam_dev = cam_open_device(cam_test_device, O_RDWR); ATF_CHECK_MSG(cam_dev != NULL, "cam_open_device failed: %s", cam_errbuf); ATF_REQUIRE(!cam_has_error()); cam_ccb = cam_getccb(cam_dev); ATF_CHECK_MSG(cam_ccb != NULL, "get_camccb failed: %s", cam_errbuf); ATF_REQUIRE(!cam_has_error()); cam_freeccb(cam_ccb); cam_close_device(cam_dev); } ATF_TC(cam_freeccb_negative_test_NULL); ATF_TC_HEAD(cam_freeccb_negative_test_NULL, tc) { atf_tc_set_md_var(tc, "descr", "test that cam_freeccb(NULL) succeeds without error"); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(cam_freeccb_negative_test_NULL, tc) { cam_clear_error(); cam_freeccb(NULL); ATF_REQUIRE(!cam_has_error()); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, cam_get_device_negative_test_NULL_path); ATF_TP_ADD_TC(tp, cam_get_device_negative_test_bad_path); ATF_TP_ADD_TC(tp, cam_get_device_negative_test_nul_path); ATF_TP_ADD_TC(tp, cam_get_device_negative_test_root); ATF_TP_ADD_TC(tp, cam_get_device_positive_test); ATF_TP_ADD_TC(tp, cam_get_device_sa_test); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_O_RDONLY); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_nonexistent); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_unprivileged); ATF_TP_ADD_TC(tp, cam_open_device_positive_test); ATF_TP_ADD_TC(tp, cam_close_device_negative_test_NULL); ATF_TP_ADD_TC(tp, cam_getccb_positive_test); ATF_TP_ADD_TC(tp, cam_freeccb_negative_test_NULL); return (atf_no_error()); } Index: stable/11/lib/libkvm/tests/kvm_close_test.c =================================================================== --- stable/11/lib/libkvm/tests/kvm_close_test.c (revision 346919) +++ stable/11/lib/libkvm/tests/kvm_close_test.c (revision 346920) @@ -1,57 +1,56 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include ATF_TC(kvm_close_negative_test_NULL); ATF_TC_HEAD(kvm_close_negative_test_NULL, tc) { atf_tc_set_md_var(tc, "descr", "test that kvm_close(NULL) succeeds without error"); } ATF_TC_BODY(kvm_close_negative_test_NULL, tc) { ATF_REQUIRE_ERRNO(EINVAL, kvm_close(NULL) == -1); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, kvm_close_negative_test_NULL); return (atf_no_error()); } Index: stable/11/lib/libkvm/tests/kvm_geterr_test.c =================================================================== --- stable/11/lib/libkvm/tests/kvm_geterr_test.c (revision 346919) +++ stable/11/lib/libkvm/tests/kvm_geterr_test.c (revision 346920) @@ -1,142 +1,141 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include "kvm_private.h" #include "kvm_test_common.h" ATF_TC(kvm_geterr_negative_test_NULL); ATF_TC_HEAD(kvm_geterr_negative_test_NULL, tc) { atf_tc_set_md_var(tc, "descr", "test that kvm_geterr(NULL) returns NULL"); } ATF_TC_BODY(kvm_geterr_negative_test_NULL, tc) { ATF_REQUIRE(!errbuf_has_error(kvm_geterr(NULL))); } /* 1100090 was where kvm_open2(3) was introduced. */ #if __FreeBSD_version >= 1100091 ATF_TC(kvm_geterr_positive_test_error); ATF_TC_HEAD(kvm_geterr_positive_test_error, tc) { atf_tc_set_md_var(tc, "descr", "test that kvm_geterr(kd) when kd doesn't contain an error returns \"\""); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(kvm_geterr_positive_test_error, tc) { kvm_t *kd; char *error_msg; errbuf_clear(); kd = kvm_open2(NULL, NULL, O_RDONLY, errbuf, NULL); ATF_CHECK(!errbuf_has_error(errbuf)); ATF_REQUIRE_MSG(kd != NULL, "kvm_open2 failed: %s", errbuf); ATF_REQUIRE_MSG(kvm_write(kd, 0, NULL, 0) == -1, "kvm_write succeeded unexpectedly on an O_RDONLY file descriptor"); error_msg = kvm_geterr(kd); ATF_CHECK(errbuf_has_error(error_msg)); ATF_REQUIRE_MSG(kvm_close(kd) == 0, "kvm_close failed: %s", strerror(errno)); } ATF_TC(kvm_geterr_positive_test_no_error); ATF_TC_HEAD(kvm_geterr_positive_test_no_error, tc) { atf_tc_set_md_var(tc, "descr", "test that kvm_geterr(kd) when kd contains an error returns an error message"); atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(kvm_geterr_positive_test_no_error, tc) { #define ALL_IS_WELL "that ends well" kvm_t *kd; char *error_msg; struct nlist nl[] = { #define SYMNAME "_mp_maxcpus" #define X_MAXCPUS 0 { SYMNAME, 0, 0, 0, 0 }, { NULL, 0, 0, 0, 0 }, }; ssize_t rc; int mp_maxcpus, retcode; errbuf_clear(); kd = kvm_open2(NULL, NULL, O_RDONLY, errbuf, NULL); ATF_CHECK(!errbuf_has_error(errbuf)); ATF_REQUIRE_MSG(kd != NULL, "kvm_open2 failed: %s", errbuf); retcode = kvm_nlist(kd, nl); ATF_REQUIRE_MSG(retcode != -1, "kvm_nlist failed (returned %d): %s", retcode, kvm_geterr(kd)); if (nl[X_MAXCPUS].n_type == 0) atf_tc_skip("symbol (\"%s\") couldn't be found", SYMNAME); _kvm_err(kd, NULL, "%s", ALL_IS_WELL); /* XXX: internal API */ rc = kvm_read(kd, nl[X_MAXCPUS].n_value, &mp_maxcpus, sizeof(mp_maxcpus)); ATF_REQUIRE_MSG(rc != -1, "kvm_read failed: %s", kvm_geterr(kd)); error_msg = kvm_geterr(kd); ATF_REQUIRE_MSG(strcmp(error_msg, ALL_IS_WELL) == 0, "error message changed: %s", error_msg); 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()); } Index: stable/11/lib/libkvm/tests/kvm_open2_test.c =================================================================== --- stable/11/lib/libkvm/tests/kvm_open2_test.c (revision 346919) +++ stable/11/lib/libkvm/tests/kvm_open2_test.c (revision 346920) @@ -1,117 +1,116 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include "kvm_test_common.h" ATF_TC_WITHOUT_HEAD(kvm_open2_negative_test_nonexistent_corefile); ATF_TC_BODY(kvm_open2_negative_test_nonexistent_corefile, tc) { errbuf_clear(); ATF_CHECK(kvm_open2(NULL, "/nonexistent", O_RDONLY, NULL, NULL) == NULL); ATF_CHECK(!errbuf_has_error(errbuf)); errbuf_clear(); ATF_CHECK(kvm_open2(NULL, "/nonexistent", O_RDONLY, errbuf, NULL) == NULL); ATF_CHECK(errbuf_has_error(errbuf)); } ATF_TC_WITHOUT_HEAD(kvm_open2_negative_test_nonexistent_execfile); ATF_TC_BODY(kvm_open2_negative_test_nonexistent_execfile, tc) { errbuf_clear(); ATF_CHECK(kvm_open2("/nonexistent", _PATH_DEVZERO, O_RDONLY, NULL, NULL) == NULL); ATF_CHECK(strlen(errbuf) == 0); errbuf_clear(); ATF_CHECK(kvm_open2("/nonexistent", _PATH_DEVZERO, O_RDONLY, errbuf, NULL) == NULL); ATF_CHECK(errbuf_has_error(errbuf)); } ATF_TC(kvm_open2_negative_test_invalid_corefile); ATF_TC_HEAD(kvm_open2_negative_test_invalid_corefile, tc) { atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(kvm_open2_negative_test_invalid_corefile, tc) { kvm_t *kd; errbuf_clear(); atf_utils_create_file("some-file", "this is a text file"); kd = kvm_open2(NULL, "some-file", O_RDONLY, errbuf, NULL); ATF_CHECK(errbuf_has_error(errbuf)); ATF_REQUIRE_MSG(kd == NULL, "kvm_open2 succeeded"); } ATF_TC(kvm_open2_negative_test_invalid_execfile); ATF_TC_HEAD(kvm_open2_negative_test_invalid_execfile, tc) { atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(kvm_open2_negative_test_invalid_execfile, tc) { kvm_t *kd; errbuf_clear(); atf_utils_create_file("some-file", "this is a text file"); kd = kvm_open2("some-file", "/bin/sh", O_RDONLY, errbuf, NULL); ATF_CHECK(errbuf_has_error(errbuf)); ATF_REQUIRE_MSG(kd == NULL, "kvm_open2 succeeded unexpectedly"); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, kvm_open2_negative_test_invalid_corefile); ATF_TP_ADD_TC(tp, kvm_open2_negative_test_invalid_execfile); ATF_TP_ADD_TC(tp, kvm_open2_negative_test_nonexistent_corefile); ATF_TP_ADD_TC(tp, kvm_open2_negative_test_nonexistent_execfile); return (atf_no_error()); } Index: stable/11/lib/libkvm/tests/kvm_open_test.c =================================================================== --- stable/11/lib/libkvm/tests/kvm_open_test.c (revision 346919) +++ stable/11/lib/libkvm/tests/kvm_open_test.c (revision 346920) @@ -1,105 +1,104 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include "kvm_test_common.h" ATF_TC_WITHOUT_HEAD(kvm_open_negative_test_nonexistent_corefile); ATF_TC_BODY(kvm_open_negative_test_nonexistent_corefile, tc) { ATF_CHECK(kvm_open(NULL, "/nonexistent", NULL, O_RDONLY, NULL) == NULL); ATF_CHECK(kvm_open(NULL, "/nonexistent", NULL, O_RDONLY, getprogname()) == NULL); } ATF_TC_WITHOUT_HEAD(kvm_open_negative_test_nonexistent_execfile); ATF_TC_BODY(kvm_open_negative_test_nonexistent_execfile, tc) { ATF_CHECK(kvm_open("/nonexistent", _PATH_DEVZERO, NULL, O_RDONLY, NULL) == NULL); ATF_CHECK(kvm_open("/nonexistent", _PATH_DEVZERO, NULL, O_RDONLY, getprogname()) == NULL); } ATF_TC(kvm_open_negative_test_invalid_corefile); ATF_TC_HEAD(kvm_open_negative_test_invalid_corefile, tc) { atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(kvm_open_negative_test_invalid_corefile, tc) { kvm_t *kd; atf_utils_create_file("some-file", "this is a text file"); kd = kvm_open(NULL, "some-file", NULL, O_RDONLY, getprogname()); ATF_REQUIRE_MSG(kd == NULL, "kvm_open didn't return NULL on failure"); } ATF_TC(kvm_open_negative_test_invalid_execfile); ATF_TC_HEAD(kvm_open_negative_test_invalid_execfile, tc) { atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(kvm_open_negative_test_invalid_execfile, tc) { kvm_t *kd; atf_utils_create_file("some-file", "this is a text file"); kd = kvm_open("some-file", "/bin/sh", NULL, O_RDONLY, getprogname()); ATF_REQUIRE_MSG(kd == NULL, "kvm_open succeeded unexpectedly"); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, kvm_open_negative_test_invalid_corefile); ATF_TP_ADD_TC(tp, kvm_open_negative_test_invalid_execfile); ATF_TP_ADD_TC(tp, kvm_open_negative_test_nonexistent_corefile); ATF_TP_ADD_TC(tp, kvm_open_negative_test_nonexistent_execfile); return (atf_no_error()); } Index: stable/11/lib/libkvm/tests/kvm_test_common.c =================================================================== --- stable/11/lib/libkvm/tests/kvm_test_common.c (revision 346919) +++ stable/11/lib/libkvm/tests/kvm_test_common.c (revision 346920) @@ -1,49 +1,48 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include "kvm_test_common.h" char errbuf[_POSIX2_LINE_MAX]; void errbuf_clear(void) { strcpy(errbuf, ""); } bool errbuf_has_error(const char *_errbuf) { return (strcmp(_errbuf, "")); } Index: stable/11/lib/libkvm/tests/kvm_test_common.h =================================================================== --- stable/11/lib/libkvm/tests/kvm_test_common.h (revision 346919) +++ stable/11/lib/libkvm/tests/kvm_test_common.h (revision 346920) @@ -1,40 +1,39 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __KVM_TEST_COMMON_H__ #include #include #include extern char errbuf[_POSIX2_LINE_MAX]; void errbuf_clear(void); bool errbuf_has_error(const char *); #endif Index: stable/11/lib/libsbuf/tests/sbuf_core_test.c =================================================================== --- stable/11/lib/libsbuf/tests/sbuf_core_test.c (revision 346919) +++ stable/11/lib/libsbuf/tests/sbuf_core_test.c (revision 346920) @@ -1,212 +1,211 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include "sbuf_test_common.h" static char test_string[] = "this is a test string"; #define TEST_STRING_CHOP_COUNT 5 _Static_assert(nitems(test_string) > TEST_STRING_CHOP_COUNT, "test_string is too short"); ATF_TC_WITHOUT_HEAD(sbuf_clear_test); ATF_TC_BODY(sbuf_clear_test, tc) { struct sbuf *sb; ssize_t buf_len; pid_t child_proc; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); /* * Cheat so we can get the contents of the buffer before calling * sbuf_finish(3) below, making additional sbuf changes impossible. */ child_proc = atf_utils_fork(); if (child_proc == 0) { sbuf_putbuf(sb); exit(0); } atf_utils_wait(child_proc, 0, test_string, ""); sbuf_clear(sb); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); buf_len = sbuf_len(sb); ATF_REQUIRE_MSG(buf_len == 0, "sbuf_len (%zd) != 0", buf_len); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), "", "sbuf (\"%s\") was not empty", sbuf_data(sb)); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_done_and_sbuf_finish_test); ATF_TC_BODY(sbuf_done_and_sbuf_finish_test, tc) { struct sbuf *sb; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_CHECK(sbuf_done(sb) == 0); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_CHECK(sbuf_done(sb) != 0); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_len_test); ATF_TC_BODY(sbuf_len_test, tc) { struct sbuf *sb; ssize_t buf_len, test_string_len; int i; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); test_string_len = strlen(test_string); for (i = 0; i < 20; i++) { buf_len = sbuf_len(sb); ATF_REQUIRE_MSG(buf_len == (ssize_t)(i * test_string_len), "sbuf_len (%zd) != %zu", buf_len, i * test_string_len); ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); } #ifdef HAVE_SBUF_SET_FLAGS sbuf_set_flags(sb, SBUF_INCLUDENUL); ATF_REQUIRE_MSG((ssize_t)(i * test_string_len + 1) == sbuf_len(sb), "sbuf_len(..) didn't report the NUL char"); #endif ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_setpos_test); ATF_TC_BODY(sbuf_setpos_test, tc) { struct sbuf *sb; size_t test_string_chopped_len, test_string_len; ssize_t buf_len; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); /* * An obvious sanity check -- if sbuf_len(..) lies, these invariants * are impossible to test. */ ATF_REQUIRE(sbuf_len(sb) == 0); ATF_CHECK(sbuf_setpos(sb, -1) == -1); ATF_CHECK(sbuf_setpos(sb, 0) == 0); ATF_CHECK(sbuf_setpos(sb, 1) == -1); ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); buf_len = sbuf_len(sb); test_string_len = strlen(test_string); test_string_chopped_len = test_string_len - TEST_STRING_CHOP_COUNT; ATF_REQUIRE_MSG(buf_len == (ssize_t)test_string_len, "sbuf length (%zd) != test_string length (%zu)", buf_len, test_string_len); /* Out of bounds (under length) */ ATF_CHECK(sbuf_setpos(sb, -1) == -1); /* * Out of bounds (over length) * * Note: SBUF_INCLUDENUL not set, so take '\0' into account. */ ATF_CHECK(sbuf_setpos(sb, test_string_len + 2) == -1); /* Within bounds */ ATF_CHECK(sbuf_setpos(sb, test_string_chopped_len) == 0); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); buf_len = sbuf_len(sb); ATF_REQUIRE_MSG(buf_len == (ssize_t)test_string_chopped_len, "sbuf_setpos didn't truncate string as expected"); ATF_REQUIRE_MSG(strncmp(sbuf_data(sb), test_string, buf_len) == 0, "sbuf (\"%s\") != test string (\"%s\") for [0,%zd]", sbuf_data(sb), test_string, buf_len); sbuf_delete(sb); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, sbuf_clear_test); ATF_TP_ADD_TC(tp, sbuf_done_and_sbuf_finish_test); ATF_TP_ADD_TC(tp, sbuf_len_test); #if 0 /* TODO */ #ifdef HAVE_SBUF_CLEAR_FLAGS ATF_TP_ADD_TC(tp, sbuf_clear_flags_test); #endif #ifdef HAVE_SBUF_GET_FLAGS ATF_TP_ADD_TC(tp, sbuf_get_flags_test); #endif ATF_TP_ADD_TC(tp, sbuf_new_positive_test); ATF_TP_ADD_TC(tp, sbuf_new_negative_test); #ifdef HAVE_SBUF_SET_FLAGS ATF_TP_ADD_TC(tp, sbuf_set_flags_test); #endif #endif ATF_TP_ADD_TC(tp, sbuf_setpos_test); return (atf_no_error()); } Index: stable/11/lib/libsbuf/tests/sbuf_stdio_test.c =================================================================== --- stable/11/lib/libsbuf/tests/sbuf_stdio_test.c (revision 346919) +++ stable/11/lib/libsbuf/tests/sbuf_stdio_test.c (revision 346920) @@ -1,161 +1,160 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include "sbuf_test_common.h" static char test_string[] = "this is a test string"; #define MESSAGE_FORMAT "message: %s\n" #define MESSAGE_SEPARATOR ';' static int sbuf_vprintf_helper(struct sbuf *sb, const char * restrict format, ...) { va_list ap; int rc; va_start(ap, format); rc = sbuf_vprintf(sb, format, ap); va_end(ap); return (rc); } ATF_TC_WITHOUT_HEAD(sbuf_printf_test); ATF_TC_BODY(sbuf_printf_test, tc) { struct sbuf *sb; char *test_string_tmp; asprintf(&test_string_tmp, "%s%c" MESSAGE_FORMAT, test_string, MESSAGE_SEPARATOR, test_string); ATF_REQUIRE_MSG(test_string_tmp != NULL, "asprintf failed"); sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); ATF_REQUIRE_MSG(sbuf_putc(sb, MESSAGE_SEPARATOR) == 0, "sbuf_putc failed"); ATF_REQUIRE_MSG(sbuf_printf(sb, MESSAGE_FORMAT, test_string) == 0, "sbuf_printf failed"); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), test_string_tmp, "sbuf (\"%s\") != test string (\"%s\")", sbuf_data(sb), test_string_tmp); sbuf_delete(sb); free(test_string_tmp); } ATF_TC_WITHOUT_HEAD(sbuf_putbuf_test); ATF_TC_BODY(sbuf_putbuf_test, tc) { struct sbuf *sb; pid_t child_proc; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); child_proc = atf_utils_fork(); if (child_proc == 0) { sbuf_putbuf(sb); exit(0); } atf_utils_wait(child_proc, 0, test_string, ""); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_vprintf_test); ATF_TC_BODY(sbuf_vprintf_test, tc) { struct sbuf *sb; char *test_string_tmp; int rc; asprintf(&test_string_tmp, "%s%c" MESSAGE_FORMAT, test_string, MESSAGE_SEPARATOR, test_string); ATF_REQUIRE_MSG(test_string_tmp != NULL, "asprintf failed"); sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); ATF_REQUIRE_MSG(sbuf_putc(sb, MESSAGE_SEPARATOR) == 0, "sbuf_putc failed"); rc = sbuf_vprintf_helper(sb, MESSAGE_FORMAT, test_string); ATF_REQUIRE_MSG(rc == 0, "sbuf_vprintf failed"); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), test_string_tmp, "sbuf (\"%s\") != test string (\"%s\")", sbuf_data(sb), test_string_tmp); sbuf_delete(sb); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, sbuf_printf_test); ATF_TP_ADD_TC(tp, sbuf_putbuf_test); ATF_TP_ADD_TC(tp, sbuf_vprintf_test); return (atf_no_error()); } Index: stable/11/lib/libsbuf/tests/sbuf_string_test.c =================================================================== --- stable/11/lib/libsbuf/tests/sbuf_string_test.c (revision 346919) +++ stable/11/lib/libsbuf/tests/sbuf_string_test.c (revision 346920) @@ -1,289 +1,288 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include "sbuf_test_common.h" static char test_string[] = "this is a test string"; static char test_whitespace_string[] = " \f\n\r\t\v "; static int test_buffer[] = { 0, 1, 2, 3, 4, 5, }; static void check_buffers_equal(const void *sb_buf, const void *test_buf, size_t len) { if (memcmp(sb_buf, test_buf, len) != 0) { printf("sbuf:\n"); hexdump(sb_buf, len, NULL, 0), printf("test_buf:\n"); hexdump(test_buf, len, NULL, 0); atf_tc_fail("contents of sbuf didn't match test_buf contents"); } } ATF_TC_WITHOUT_HEAD(sbuf_bcat_test); ATF_TC_BODY(sbuf_bcat_test, tc) { struct sbuf *sb; int *test_buffer_tmp; ssize_t test_sbuf_len; test_buffer_tmp = malloc(sizeof(test_buffer) * 2); ATF_REQUIRE_MSG(test_buffer_tmp != NULL, "malloc failed"); memcpy(test_buffer_tmp, test_buffer, sizeof(test_buffer)); memcpy(&test_buffer_tmp[nitems(test_buffer)], test_buffer, sizeof(test_buffer)); sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_CHECK_MSG(sbuf_bcat(sb, test_buffer, sizeof(test_buffer)) == 0, "sbuf_bcat failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)sizeof(test_buffer), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, sizeof(test_buffer)); ATF_CHECK_MSG(sbuf_bcat(sb, test_buffer, sizeof(test_buffer)) == 0, "sbuf_bcat failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)(2 * sizeof(test_buffer)), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, 2 * sizeof(test_buffer)); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); check_buffers_equal(sbuf_data(sb), test_buffer_tmp, (size_t)test_sbuf_len); sbuf_delete(sb); free(test_buffer_tmp); } ATF_TC_WITHOUT_HEAD(sbuf_bcpy_test); ATF_TC_BODY(sbuf_bcpy_test, tc) { struct sbuf *sb; ssize_t test_sbuf_len; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_CHECK_MSG(sbuf_bcpy(sb, test_buffer, sizeof(test_buffer)) == 0, "sbuf_bcpy failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)sizeof(test_buffer), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, sizeof(test_buffer)); ATF_CHECK_MSG(sbuf_bcpy(sb, test_buffer, sizeof(test_buffer)) == 0, "sbuf_bcpy failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)sizeof(test_buffer), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, sizeof(test_buffer)); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); check_buffers_equal(sbuf_data(sb), test_buffer, (size_t)test_sbuf_len); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_cat_test); ATF_TC_BODY(sbuf_cat_test, tc) { struct sbuf *sb; char *test_string_tmp; ssize_t test_sbuf_len; asprintf(&test_string_tmp, "%s%s", test_string, test_string); ATF_REQUIRE_MSG(test_string_tmp != NULL, "asprintf failed"); sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_CHECK_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)strlen(test_string), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, sizeof(test_string)); ATF_CHECK_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)strlen(test_string_tmp), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, strlen(test_string_tmp)); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), test_string_tmp, "sbuf (\"%s\") != test string (\"%s\")", sbuf_data(sb), test_string_tmp); sbuf_delete(sb); free(test_string_tmp); } ATF_TC_WITHOUT_HEAD(sbuf_cpy_test); ATF_TC_BODY(sbuf_cpy_test, tc) { struct sbuf *sb; ssize_t test_sbuf_len; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_CHECK_MSG(sbuf_cpy(sb, test_string) == 0, "sbuf_cpy failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)strlen(test_string), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, strlen(test_string)); ATF_CHECK_MSG(sbuf_cpy(sb, test_string) == 0, "sbuf_cpy failed"); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(test_sbuf_len == (ssize_t)strlen(test_string), "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, strlen(test_string)); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), test_string, "sbuf (\"%s\") != test string (\"%s\")", sbuf_data(sb), test_string); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_putc_test); ATF_TC_BODY(sbuf_putc_test, tc) { struct sbuf *sb; ssize_t test_sbuf_len; size_t i; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); for (i = 0; i <= strlen(test_string); i++) { /* Include the NUL */ ATF_REQUIRE_MSG(sbuf_putc(sb, test_string[i]) == 0, "sbuf_putc failed"); /* The best we can do until sbuf_finish(3) is called. */ test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG((ssize_t)(i + 1) == test_sbuf_len, "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, i + 1); } ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), test_string, "sbuf (\"%s\") != test string (\"%s\")", sbuf_data(sb), test_string); sbuf_delete(sb); } ATF_TC_WITHOUT_HEAD(sbuf_trim_test); ATF_TC_BODY(sbuf_trim_test, tc) { struct sbuf *sb; ssize_t exp_sbuf_len, test_sbuf_len; sb = sbuf_new_auto(); ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", strerror(errno)); ATF_CHECK_MSG(sbuf_cpy(sb, test_string) == 0, "sbuf_cpy failed"); ATF_CHECK_MSG(sbuf_cat(sb, test_whitespace_string) == 0, "sbuf_cat failed"); /* The best we can do until sbuf_finish(3) is called. */ exp_sbuf_len = (ssize_t)(strlen(test_string) + strlen(test_whitespace_string)); test_sbuf_len = sbuf_len(sb); ATF_REQUIRE_MSG(exp_sbuf_len == test_sbuf_len, "sbuf_len(..) => %zd (actual) != %zu (expected)", test_sbuf_len, exp_sbuf_len); ATF_REQUIRE_MSG(sbuf_trim(sb) == 0, "sbuf_trim failed"); ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), test_string, "sbuf (\"%s\") != test string (\"%s\") (trimmed)", sbuf_data(sb), test_string); sbuf_delete(sb); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, sbuf_bcat_test); ATF_TP_ADD_TC(tp, sbuf_bcpy_test); ATF_TP_ADD_TC(tp, sbuf_cat_test); ATF_TP_ADD_TC(tp, sbuf_cpy_test); ATF_TP_ADD_TC(tp, sbuf_putc_test); ATF_TP_ADD_TC(tp, sbuf_trim_test); return (atf_no_error()); } Index: stable/11/lib/libsbuf/tests/sbuf_test_common.h =================================================================== --- stable/11/lib/libsbuf/tests/sbuf_test_common.h (revision 346919) +++ stable/11/lib/libsbuf/tests/sbuf_test_common.h (revision 346920) @@ -1,40 +1,39 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __LIBSBUF_TEST_COMMON_H__ #define __LIBSBUF_TEST_COMMON_H__ #include #if __FreeBSD_version > 1100064 #define HAVE_SBUF_GET_FLAGS #define HAVE_SBUF_CLEAR_FLAGS #define HAVE_SBUF_SET_FLAGS #endif #endif Index: stable/11/share/examples/tests/tests/tap/cp_test.sh =================================================================== --- stable/11/share/examples/tests/tests/tap/cp_test.sh (revision 346919) +++ stable/11/share/examples/tests/tests/tap/cp_test.sh (revision 346920) @@ -1,99 +1,98 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $FreeBSD$ # # # INTRODUCTION # # This TAP test program mimics the structure and contents of its # ATF-based counterpart. It attempts to represent various test cases # in different separate functions and just calls them all from main. # test_num=1 TEST_COUNT=4 result() { local result=$1; shift local result_string result_string="$result $test_num" if [ $# -gt 0 ]; then result_string="$result_string - $@" fi echo "$result_string" : $(( test_num += 1 )) } # Auxiliary function to compare two files for equality. verify_copy() { if cmp -s "${1}" "${2}"; then result "ok" else result "not ok" "${1} and ${2} differ, but they should be equal" diff -u "${1}" "${2}" fi } simple_test() { cp "$(dirname "${0}")/file1" . if cp file1 file2; then result "ok" verify_copy file1 file2 else result "not ok" "cp failed" result "not ok" "# SKIP" fi } force_test() { echo 'File 3' >file3 chmod 400 file3 if cp -f file1 file3; then result "ok" verify_copy file1 file3 else result "not ok" "cp -f failed" result "not ok" "# SKIP" fi } # If you have read the cp_test.sh counterpart in the atf/ directory, you # may think that the sequencing of tests below and the exposed behavior # to the user is very similar. But you'd be wrong. # # There are two major differences with this and the ATF version. First off, # the TAP test doesn't isolate simple_test from force_test, whereas the ATF # version does. Secondly, the test script accepts arbitrary command line # inputs. echo "1..$TEST_COUNT" simple_test force_test exit 0 Index: stable/11/share/man/man4/cfiscsi.4 =================================================================== --- stable/11/share/man/man4/cfiscsi.4 (revision 346919) +++ stable/11/share/man/man4/cfiscsi.4 (revision 346920) @@ -1,112 +1,111 @@ .\" Copyright (c) 2013 Edward Tomasz Napierala .\" Copyright (c) 2015-2017 Alexander Motin -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .Dd May 28, 2017 .Dt CFISCSI 4 .Os .Sh NAME .Nm cfiscsi .Nd CAM Target Layer iSCSI target frontend .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device cfiscsi" .Cd "device ctl" .Cd "device iscsi" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent cfiscsi_load="YES" .Ed .Sh DESCRIPTION The .Nm subsystem provides the kernel component of an iSCSI target. The target is the iSCSI server, providing LUNs backed by local files and volumes to remote initiators. The userspace component is provided by .Xr ctld 8 . .Nm is implemented as a .Xr ctl 4 frontend and uses infrastructure provided by .Xr iscsi 4 . .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 variables and .Xr loader 8 tunables: .Bl -tag -width indent .It Va kern.cam.ctl.iscsi.debug Verbosity level for log messages from the kernel part of iSCSI target. Set to 0 to disable logging or 1 to warn about potential problems. Larger values enable debugging output. Defaults to 1. .It Va kern.cam.ctl.iscsi.maxtags The number of outstanding commands to advertise to each iSCSI initiator. Current implementation is not very accurate, so do not set this below 2. Defaults to 256. .It Va kern.cam.ctl.iscsi.ping_timeout The number of seconds to wait for the iSCSI initiator to respond to a NOP-In PDU. In the event that there is no response within that time the session gets forcibly terminated. Set to 0 to disable sending NOP-In PDUs. Defaults to 5. .El .Sh SEE ALSO .Xr ctl 4 , .Xr iscsi 4 , .Xr ctl.conf 5 , .Xr ctld 8 .Sh HISTORY The .Nm subsystem first appeared in .Fx 10.0 as part of the .Xr ctl 4 driver. It was split off of .Xr ctl 4 in .Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm subsystem was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Index: stable/11/share/man/man5/cd9660.5 =================================================================== --- stable/11/share/man/man5/cd9660.5 (revision 346919) +++ stable/11/share/man/man5/cd9660.5 (revision 346920) @@ -1,82 +1,81 @@ .\" -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission .\" .\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd March 22, 2017 .Dt CD9660 5 .Os .Sh NAME .Nm cd9660 .Nd "ISO-9660 file system" .Sh SYNOPSIS To link into the kernel: .Bd -ragged -offset indent .Cd "options CD9660" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent cd9660_load="YES" .Sh DESCRIPTION The .Nm driver will permit the .Fx kernel to access the .Tn cd9660 file system. .Sh EXAMPLES To mount a .Nm volume located on .Pa /dev/cd0 : .Pp .Dl "mount -t cd9660 /dev/cd0 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , .Xr fstab 5 , .Xr mount 8 , .Xr mount_cd9660 8 .Sh HISTORY The .Nm driver first appeared in .Fx 4.4 Lite .Sh AUTHORS .An -nosplit The .Nm kernel implementation was originally written by .An Pace Willisson Aq Mt pace@blitz.com and .An Atsushi Murai Aq Mt amurai@spec.co.jp . .Pp This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Index: stable/11/share/zoneinfo/tests/backward_test.sh =================================================================== --- stable/11/share/zoneinfo/tests/backward_test.sh (revision 346919) +++ stable/11/share/zoneinfo/tests/backward_test.sh (revision 346920) @@ -1,44 +1,43 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ atf_test_case links links_head() { atf_set "descr" "Verify Links directives in contrib/tzdata/backward" } links_body() { verify_Links $(atf_get_srcdir)/backward } atf_init_test_cases() { . "$(dirname "$0")/zoneinfo_common.sh" atf_add_test_case links } Index: stable/11/share/zoneinfo/tests/zoneinfo_common.sh =================================================================== --- stable/11/share/zoneinfo/tests/zoneinfo_common.sh (revision 346919) +++ stable/11/share/zoneinfo/tests/zoneinfo_common.sh (revision 346920) @@ -1,54 +1,53 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ ZONEINFO_DIR=/usr/share/zoneinfo verify_Links() { local zoneinfo_file zoneinfo_file=$1 awk '$1 == "Link" && NF == 3 { print $2, $3; }' < $zoneinfo_file | \ while read src dest; do verify_Link $src $dest done } verify_Link() { local src dest old_path=$ZONEINFO_DIR/$src new_path=$ZONEINFO_DIR/$dest atf_check test -f $new_path atf_check test -f $old_path atf_check cmp $old_path $new_path } Index: stable/11/usr.bin/calendar/calendars/calendar.freebsd =================================================================== --- stable/11/usr.bin/calendar/calendars/calendar.freebsd (revision 346919) +++ stable/11/usr.bin/calendar/calendars/calendar.freebsd (revision 346920) @@ -1,455 +1,455 @@ /* * FreeBSD * * $FreeBSD$ */ #ifndef _calendar_freebsd_ #define _calendar_freebsd_ 01/01 Dimitry Andric born in Utrecht, the Netherlands, 1969 01/01 Lev Serebryakov born in Leningrad, USSR, 1979 01/01 Alexander Langer born in Duesseldorf, Nordrhein-Westfalen, Germany, 1981 01/02 Ion-Mihai "IOnut" Tetcu born in Bucharest, Romania, 1980 01/02 Patrick Li born in Beijing, People's Republic of China, 1985 01/03 Tetsurou Okazaki born in Mobara, Chiba, Japan, 1972 01/04 Hiroyuki Hanai born in Kagawa pre., Japan, 1969 01/06 Philippe Audeoud born in Bretigny-Sur-Orge, France, 1980 01/08 Michael L. Hostbaek born in Copenhagen, Denmark, 1977 01/10 Jean-Yves Lefort born in Charleroi, Belgium, 1980 01/12 Yen-Ming Lee born in Taipei, Taiwan, Republic of China, 1977 01/12 Ying-Chieh Liao born in Taipei, Taiwan, Republic of China, 1979 01/12 Kristof Provost born in Aalst, Belgium, 1983 01/13 Ruslan Bukin born in Dudinka, Russian Federation, 1985 01/14 Yi-Jheng Lin born in Taichung, Taiwan, Republic of China, 1985 01/15 Anne Dickison born in Madison, Indiana, United States, 1976 01/16 Ariff Abdullah born in Kuala Lumpur, Malaysia, 1978 01/16 Dmitry Sivachenko born in Moscow, USSR, 1978 01/16 Vanilla I. Shu born in Taipei, Taiwan, Republic of China, 1978 01/17 Raphael Kubo da Costa born in Sao Paulo, Sao Paulo, Brazil, 1989 01/18 Dejan Lesjak born in Ljubljana, Slovenia, Yugoslavia, 1977 01/19 Marshall Kirk McKusick born in Wilmington, Delaware, United States, 1954 01/19 Ruslan Ermilov born in Simferopol, USSR, 1974 01/19 Marcelo S. Araujo born in Joinville, Santa Catarina, Brazil, 1981 01/20 Poul-Henning Kamp born in Korsoer, Denmark, 1966 01/21 Mahdi Mokhtari born in Tehran, Iran, 1995 01/22 Johann Visagie born in Cape Town, South Africa, 1970 01/23 Hideyuki KURASHINA born in Niigata, Japan, 1982 01/24 Fabien Thomas born in Avignon, France, 1971 01/24 Matteo Riondato born in Padova, Italy, 1986 01/25 Nick Hibma born in Groningen, the Netherlands, 1972 01/25 Bernd Walter born in Moers, Nordrhein-Westfalen, Germany, 1974 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 -01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 +01/27 Enji Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 02/01 Paul Saab born in Champaign-Urbana, Illinois, United States, 1978 02/01 Martin Wilke born in Ludwigsfelde, Brandenburg, Germany, 1980 02/01 Christian Brueffer born in Gronau, Nordrhein-Westfalen, Germany, 1982 02/01 Steven Kreuzer born in Oceanside, New York, United States, 1982 02/01 Juli Mallett born in Washington, Pennsylvania, United States, 1985 02/02 Diomidis D. Spinellis born in Athens, Greece, 1967 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 02/02 Yoshihiro Takahashi born in Yokohama, Kanagawa, Japan, 1976 02/03 Jason Helfman born in Royal Oak, Michigan, United States, 1972 02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/06 Julien Charbon born in Saint Etienne, Loire, France, 1978 02/07 Bjoern Heidotting born in Uelsen, Germany, 1980 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 02/10 Simon Barner born in Rosenheim, Bayern, Germany, 1980 02/10 Jason E. Hale born in Pittsburgh, Pennsylvania, United States, 1982 02/13 Jesper Skriver born in Aarhus, Denmark, 1975 02/13 Steve Wills born in Lynchburg, Virginia, United States, 1975 02/13 Andrey Slusar born in Odessa, USSR, 1979 02/13 David W. Chapman Jr. born in Bethel, Connecticut, United States, 1981 02/14 Manolis Kiagias born in Chania, Greece, 1970 02/14 Erwin Lansing born in 's-Hertogenbosch, the Netherlands, 1975 02/14 Martin Blapp born in Olten, Switzerland, 1976 02/15 Hiren Panchasara born in Ahmedabad, Gujarat, India, 1984 02/16 Justin Hibbits born in Toledo, Ohio, United States, 1983 02/16 Tobias Christian Berner born in Bern, Switzerland, 1985 02/18 Christoph Moench-Tegeder born in Hannover, Niedersachsen, Germany, 1980 02/19 Murray Stokely born in Jacksonville, Florida, United States, 1979 02/20 Anders Nordby born in Oslo, Norway, 1976 02/21 Alexey Zelkin born in Simferopol, Ukraine, 1978 02/22 Brooks Davis born in Longview, Washington, United States, 1976 02/22 Jake Burkholder born in Maynooth, Ontario, Canada, 1979 02/23 Peter Wemm born in Perth, Western Australia, Australia, 1971 02/23 Mathieu Arnold born in Champigny sur Marne, Val de Marne, France, 1978 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/24 Colin Percival born in Burnaby, Canada, 1981 02/26 Pietro Cerutti born in Faido, Switzerland, 1984 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 02/28 Ruslan Makhmatkhanov born in Rostov-on-Don, USSR, 1984 03/01 Hye-Shik Chang born in Daejeon, Republic of Korea, 1980 03/02 Cy Schubert born in Edmonton, Alberta, Canada, 1956 03/03 Sergey Matveychuk born in Moscow, Russian Federation, 1973 03/03 Doug White born in Eugene, Oregon, United States, 1977 03/03 Gordon Tetlow born in Reno, Nevada, United States, 1978 03/04 Oleksandr Tymoshenko born in Chernihiv, Ukraine, 1980 03/05 Baptiste Daroussin born in Beauvais, France, 1980 03/05 Philip Paeps born in Leuven, Belgium, 1983 03/05 Ulf Lilleengen born in Hamar, Norway, 1985 03/06 Christopher Piazza born in Kamloops, British Columbia, Canada, 1981 03/07 Michael P. Pritchard born in Los Angeles, California, United States, 1964 03/07 Giorgos Keramidas born in Athens, Greece, 1976 03/10 Andreas Klemm born in Duesseldorf, Nordrhein-Westfalen, Germany, 1963 03/10 Luiz Otavio O Souza born in Bauru, Sao Paulo, Brazil, 1978 03/10 Nikolai Lifanov born in Moscow, Russian Federation, 1989 03/11 Soeren Straarup born in Andst, Denmark, 1978 03/12 Greg Lewis born in Adelaide, South Australia, Australia, 1969 03/13 Alexander Leidinger born in Neunkirchen, Saarland, Germany, 1976 03/13 Will Andrews born in Pontiac, Michigan, United States, 1982 03/14 Bernhard Froehlich born in Graz, Styria, Austria, 1985 03/15 Paolo Pisati born in Lodi, Italy, 1977 03/15 Brian Fundakowski Feldman born in Alexandria, Virginia, United States, 1983 03/17 Michael Smith born in Bankstown, New South Wales, Australia, 1971 03/17 Alexander Motin born in Simferopol, Ukraine, 1979 03/18 Koop Mast born in Dokkum, the Netherlands, 1981 03/19 Mikhail Teterin born in Kyiv, Ukraine, 1972 03/20 Joseph S. Atkinson born in Batesville, Arkansas, United States, 1977 03/20 Henrik Brix Andersen born in Aarhus, Denmark, 1978 03/20 MANTANI Nobutaka born in Hiroshima, Japan, 1978 03/20 Cameron Grant died in Hemel Hempstead, United Kingdom, 2005 03/22 Brad Davis born in Farmington, New Mexico, United States, 1983 03/23 Daniel C. Sobral born in Brasilia, Distrito Federal, Brazil, 1971 03/23 Benno Rice born in Adelaide, South Australia, Australia, 1977 03/24 Marcel Moolenaar born in Hilversum, the Netherlands, 1968 03/24 Emanuel Haupt born in Zurich, Switzerland, 1979 03/25 Andrew R. Reiter born in Springfield, Massachusetts, United States, 1980 03/26 Jonathan Anderson born in Ottawa, Ontario, Canada, 1983 03/27 Josef El-Rayes born in Linz, Austria, 1982 03/28 Sean C. Farley born in Indianapolis, Indiana, United States, 1970 03/29 Dave Cottlehuber born in Christchurch, New Zealand, 1973 03/29 Thierry Thomas born in Luxeuil les Bains, France, 1961 03/30 Po-Chuan Hsieh born in Taipei, Taiwan, Republic of China, 1978 03/31 First quarter status reports are due on 04/15 04/01 Matthew Jacob born in San Francisco, California, United States, 1958 04/01 Alexander V. Chernikov born in Moscow, Russian Federation, 1984 04/01 Bill Fenner born in Bellefonte, Pennsylvania, United States, 1971 04/01 Peter Edwards born in Dublin, Ireland, 1973 04/03 Hellmuth Michaelis born in Kiel, Schleswig-Holstein, Germany, 1958 04/03 Tong Liu born in Beijing, People's Republic of China, 1981 04/03 Gabor Pali born in Kunhegyes, Hungary, 1982 04/04 Jason Unovitch born in Scranton, Pennsylvania, United States, 1986 04/05 Stacey Son born in Burley, Idaho, United States, 1967 04/06 Peter Jeremy born in Sydney, New South Wales, Australia, 1961 04/07 Edward Tomasz Napierala born in Wolsztyn, Poland, 1981 04/08 Jordan K. Hubbard born in Honolulu, Hawaii, United States, 1963 04/09 Ceri Davies born in Haverfordwest, Pembrokeshire, United Kingdom, 1976 04/11 Bruce A. Mah born in Fresno, California, United States, 1969 04/12 Patrick Gardella born in Columbus, Ohio, United States, 1967 04/12 Ed Schouten born in Oss, the Netherlands, 1986 04/12 Ruey-Cherng Yu born in Keelung, Taiwan, 1978 04/13 Oliver Braun born in Nuremberg, Bavaria, Germany, 1972 04/14 Crist J. Clark born in Milwaukee, Wisconsin, United States, 1970 04/14 Glen J. Barber born in Wilkes-Barre, Pennsylvania, United States, 1981 04/15 David Malone born in Dublin, Ireland, 1973 04/17 Alexey Degtyarev born in Ahtubinsk, Russian Federation, 1984 04/17 Dryice Liu born in Jinan, Shandong, China, 1975 04/22 Joerg Wunsch born in Dresden, Sachsen, Germany, 1962 04/22 Jun Kuriyama born in Matsue, Shimane, Japan, 1973 04/22 Jakub Klama born in Blachownia, Silesia, Poland, 1989 04/25 Richard Gallamore born in Kissimmee, Florida, United States, 1987 04/26 Rene Ladan born in Geldrop, the Netherlands, 1980 04/28 Oleg Bulyzhin born in Kharkov, USSR, 1976 04/28 Andriy Voskoboinyk born in Bila Tserkva, Ukraine, 1992 04/29 Adam Weinberger born in Berkeley, California, United States, 1980 04/29 Eric Anholt born in Portland, Oregon, United States, 1983 05/01 Randall Stewart born in Spokane, Washington, United States, 1959 05/02 Danilo G. Baio born in Maringa, Parana, Brazil, 1986 05/02 Wojciech A. Koszek born in Czestochowa, Poland, 1987 05/03 Brian Dean born in Elkins, West Virginia, United States, 1966 05/03 Patrick Kelsey born in Freehold, New Jersey, United States, 1976 05/03 Robert Nicholas Maxwell Watson born in Harrow, Middlesex, United Kingdom, 1977 05/04 Denis Peplin born in Nizhniy Novgorod, Russian Federation, 1977 05/08 Kirill Ponomarew born in Volgograd, Russian Federation, 1977 05/08 Sean Kelly born in Walnut Creek, California, United States, 1982 05/09 Daniel Eischen born in Syracuse, New York, United States, 1963 05/09 Aaron Dalton born in Boise, Idaho, United States, 1973 05/09 Jase Thew born in Abergavenny, Gwent, United Kingdom, 1974 05/10 Markus Brueffer born in Gronau, Nordrhein-Westfalen, Germany, 1977 05/11 Kurt Lidl born in Rockville, Maryland, United States, 1968 05/11 Jesus Rodriguez born in Barcelona, Spain, 1972 05/11 Marcin Wojtas born in Krakow, Poland, 1986 05/11 Roman Kurakin born in Moscow, USSR, 1979 05/11 Ulrich Spoerlein born in Schesslitz, Bayern, Germany, 1981 05/13 Pete Fritchman born in Lansdale, Pennsylvania, United States, 1983 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 05/15 Hans Petter Selasky born in Flekkefjord, Norway, 1982 05/16 Johann Kois born in Wolfsberg, Austria, 1975 05/16 Marcus Alves Grando born in Florianopolis, Santa Catarina, Brazil, 1979 05/17 Thomas Abthorpe born in Port Arthur, Ontario, Canada, 1968 05/19 Philippe Charnier born in Fontainebleau, France, 1966 05/19 Ian Dowse born in Dublin, Ireland, 1975 05/19 Sofian Brabez born in Toulouse, France, 1984 05/20 Dan Moschuk died in Burlington, Ontario, Canada, 2010 05/21 Kris Kennaway born in Winnipeg, Manitoba, Canada, 1978 05/22 James Gritton born in San Francisco, California, United States, 1967 05/22 Clive Tong-I Lin born in Changhua, Taiwan, Republic of China, 1978 05/22 Michael Bushkov born in Rostov-on-Don, Russian Federation, 1985 05/22 Rui Paulo born in Evora, Portugal, 1986 05/22 David Naylor born in Johannesburg, South Africa, 1988 05/23 Munechika Sumikawa born in Osaka, Osaka, Japan, 1972 05/24 Duncan McLennan Barclay born in London, Middlesex, United Kingdom, 1970 05/24 Oliver Lehmann born in Karlsburg, Germany, 1981 05/25 Pawel Pekala born in Swidnica, Poland, 1980 05/25 Tom Rhodes born in Ellwood City, Pennsylvania, United States, 1981 05/25 Roman Divacky born in Brno, Czech Republic, 1983 05/26 Jim Pirzyk born in Chicago, Illinois, United States, 1968 05/26 Florian Smeets born in Schwerte, Nordrhein-Westfalen, Germany, 1982 05/27 Ollivier Robert born in Paris, France, 1967 05/29 Wilko Bulte born in Arnhem, the Netherlands, 1965 05/29 Seigo Tanimura born in Kitakyushu, Fukuoka, Japan, 1976 05/30 Wen Heping born in Xiangxiang, Hunan, China, 1970 05/31 Ville Skytta born in Helsinki, Finland, 1974 06/02 Jean-Marc Zucconi born in Pontarlier, France, 1954 06/02 Alexander Botero-Lowry born in Austin, Texas, United States, 1986 06/03 CHOI Junho born in Seoul, Korea, 1974 06/03 Wesley Shields born in Binghamton, New York, United States, 1981 06/04 Julian Elischer born in Perth, Australia, 1959 06/04 Justin Gibbs born in San Pedro, California, United States, 1973 06/04 Jason Evans born in Greeley, Colorado, United States, 1973 06/04 Thomas Moestl born in Braunschweig, Niedersachsen, Germany, 1980 06/04 Devin Teske born in Arcadia, California, United States, 1982 06/04 Zack Kirsch born in Memphis, Tennessee, United States, 1982 06/04 Johannes Jost Meixner born in Wiesbaden, Germany, 1987 06/06 Sergei Kolobov born in Karpinsk, Russian Federation, 1972 06/06 Alan Eldridge died in Denver, Colorado, United States, 2003 06/07 Jimmy Olgeni born in Milano, Italy, 1976 06/07 Benjamin Close born in Adelaide, Australia, 1978 06/07 Roger Pau Monne born in Reus, Catalunya, Spain, 1986 06/08 Ravi Pokala born in Royal Oak, Michigan, United States, 1980 06/09 Stanislav Galabov born in Sofia, Bulgaria 1978 06/11 Alonso Cardenas Marquez born in Arequipa, Peru, 1979 06/14 Josh Paetzel born in Minneapolis, Minnesota, United States, 1973 06/17 Tilman Linneweh born in Weinheim, Baden-Wuerttemberg, Germany, 1978 06/18 Li-Wen Hsu born in Taipei, Taiwan, Republic of China, 1984 06/18 Roman Bogorodskiy born in Saratov, Russian Federation, 1986 06/19 Charlie Root born in Portland, Oregon, United States, 1993 06/21 Ganbold Tsagaankhuu born in Ulaanbaatar, Mongolia, 1971 06/21 Niels Heinen born in Markelo, the Netherlands, 1978 06/22 Andreas Tobler born in Heiden, Switzerland, 1968 06/24 Chris Faulhaber born in Springfield, Illinois, United States, 1971 06/26 Brian Somers born in Dundrum, Dublin, Ireland, 1967 06/28 Mark Santcroos born in Rotterdam, the Netherlands, 1979 06/28 Xin Li born in Beijing, People's Republic of China, 1982 06/28 Bradley T. Hughes born in Amarillo, Texas, United States, 1977 06/29 Wilfredo Sanchez Vega born in Majaguez, Puerto Rico, United States, 1972 06/29 Daniel Harris born in Lubbock, Texas, United States, 1985 06/29 Andrew Pantyukhin born in Moscow, Russian Federation, 1985 06/30 Guido van Rooij born in Best, Noord-Brabant, the Netherlands, 1965 06/30 Second quarter status reports are due on 07/15 07/01 Matthew Dillon born in San Francisco, California, United States, 1966 07/01 Mateusz Guzik born in Nowy Targ, Poland, 1986 07/02 Mark Christopher Ovens born in Preston, Lancashire, United Kingdom, 1958 07/02 Vasil Venelinov Dimov born in Shumen, Bulgaria, 1982 07/04 Motoyuki Konno born in Musashino, Tokyo, Japan, 1969 07/04 Florent Thoumie born in Montmorency, Val d'Oise, France, 1982 07/05 Olivier Cochard-Labbe born in Brest, France, 1977 07/05 Sergey Kandaurov born in Gubkin, Russian Federation, 1985 07/07 Andrew Thompson born in Lower Hutt, Wellington, New Zealand, 1979 07/07 Maxime Henrion born in Metz, France, 1981 07/07 George Reid born in Frimley, Hampshire, United Kingdom, 1983 07/10 Jung-uk Kim born in Seoul, Korea, 1971 07/10 Justin Seger born in Harvard, Massachusetts, United States, 1981 07/10 David Schultz born in Oakland, California, United States, 1982 07/10 Ben Woods born in Perth, Western Australia, Australia, 1984 07/11 Jesus R. Camou born in Hermosillo, Sonora, Mexico, 1983 07/14 Fernando Apesteguia born in Madrid, Spain, 1981 07/15 Gary Jennejohn born in Rochester, New York, United States, 1950 07/16 Suleiman Souhlal born in Roma, Italy, 1983 07/16 Davide Italiano born in Milazzo, Italy, 1989 07/17 Michael Chin-Yuan Wu born in Taipei, Taiwan, Republic of China, 1980 07/19 Masafumi NAKANE born in Okazaki, Aichi, Japan, 1972 07/19 Simon L. Nielsen born in Copenhagen, Denmark, 1980 07/19 Gleb Smirnoff born in Kharkov, USSR, 1981 07/20 Dru Lavigne born in Kingston, Ontario, Canada, 1965 07/20 Andrey V. Elsukov born in Kotelnich, Russian Federation, 1981 07/22 James Housley born in Chicago, Illinois, United States, 1965 07/22 Jens Schweikhardt born in Waiblingen, Baden-Wuerttemberg, Germany, 1967 07/22 Lukas Ertl born in Weissenbach/Enns, Steiermark, Austria, 1976 07/23 Sergey A. Osokin born in Krasnogorsky, Stepnogorsk, Akmolinskaya region, Kazakhstan, 1972 07/23 Andrey Zonov born in Kirov, Russian Federation, 1985 07/24 Alexander Nedotsukov born in Ulyanovsk, Russian Federation, 1974 07/24 Alberto Villa born in Vercelli, Italy, 1987 07/27 Andriy Gapon born in Kyrykivka, Sumy region, Ukraine, 1976 07/28 Jim Mock born in Bethlehem, Pennsylvania, United States, 1974 07/28 Tom Hukins born in Manchester, United Kingdom, 1976 07/29 Dirk Meyer born in Kassel, Hessen, Germany, 1965 07/29 Felippe M. Motta born in Maceio, Alagoas, Brazil, 1988 08/02 Gabor Kovesdan born in Budapest, Hungary, 1987 08/03 Peter Holm born in Copenhagen, Denmark, 1955 08/05 Alfred Perlstein born in Brooklyn, New York, United States, 1978 08/06 Anton Berezin born in Dnepropetrovsk, Ukraine, 1970 08/06 John-Mark Gurney born in Detroit, Michigan, United States, 1978 08/06 Damjan Marion born in Rijeka, Croatia, 1978 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/08 Mikolaj Golub born in Kharkov, USSR, 1977 08/08 Juergen Lock died in Bremen, Germany, 2015 08/09 Stefan Farfeleder died in Wien, Austria, 2015 08/10 Julio Merino born in Barcelona, Spain, 1984 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 08/12 Joe Marcus Clarke born in Lakeland, Florida, United States, 1976 08/12 Max Brazhnikov born in Leningradskaya, Russian Federation, 1979 08/14 Stefan Esser born in Cologne, Nordrhein-Westfalen, Germany, 1961 08/16 Andrey Chernov died in Moscow, Russian Federation, 2017 08/17 Olivier Houchard born in Nancy, France, 1980 08/19 Chin-San Huang born in Yi-Lan, Taiwan, Republic of China, 1979 08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 08/20 Michael Heffner born in Cleona, Pennsylvania, United States, 1981 08/22 Ilya Bakulin born in Tbilisi, USSR, 1986 08/24 Mark Linimon born in Houston, Texas, United States, 1955 08/24 Alexander Botero-Lowry died in San Francisco, California, United States, 2012 08/25 Beech Rintoul born in Oakland, California, United States, 1952 08/25 Jean Milanez Melo born in Divinopolis, Minas Gerais, Brazil, 1982 08/26 Scott Long born in Chicago, Illinois, United States, 1974 08/26 Dima Ruban born in Nalchik, USSR, 1970 08/26 Marc Fonvieille born in Avignon, France, 1972 08/26 Herve Quiroz born in Aix-en-Provence, France, 1977 08/27 Andrey Chernov born in Moscow, USSR, 1966 08/27 Tony Finch born in London, United Kingdom, 1974 08/27 Michael Johnson born in Morganton, North Carolina, United States, 1980 08/28 Norikatsu Shigemura born in Fujisawa, Kanagawa, Japan, 1974 08/29 Thomas Gellekum born in Moenchengladbach, Nordrhein-Westfalen, Germany, 1967 08/29 Max Laier born in Karlsruhe, Germany, 1981 09/01 Pyun YongHyeon born in Kimcheon, Korea, 1968 09/01 William Grzybowski born in Parana, Brazil, 1988 09/03 Max Khon born in Novosibirsk, USSR, 1976 09/03 Allan Jude born in Hamilton, Ontario, Canada, 1984 09/03 Cheng-Lung Sung born in Taipei, Taiwan, Republic of China, 1977 09/05 Mark Robert Vaughan Murray born in Harare, Mashonaland, Zimbabwe, 1961 09/05 Adrian Harold Chadd born in Perth, Western Australia, Australia, 1979 09/05 Rodrigo Osorio born in Montevideo, Uruguay, 1975 09/06 Eric Joyner born in Fairfax, Virginia, United States, 1991 09/07 Tim Bishop born in Cornwall, United Kingdom, 1978 09/07 Chris Rees born in Kettering, United Kingdom, 1987 09/08 Boris Samorodov born in Krasnodar, Russian Federation, 1963 09/09 Yoshio Mita born in Hiroshima, Japan, 1972 09/09 Steven Hartland born in Wordsley, United Kingdom, 1973 09/10 Wesley R. Peters born in Hartford, Alabama, United States, 1961 09/12 Weongyo Jeong born in Haman, Korea, 1980 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 09/14 Matthew Seaman born in Bristol, United Kingdom, 1965 09/15 Aleksandr Rybalko born in Odessa, Ukraine, 1977 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/16 Maksim Yevmenkin born in Taganrog, USSR, 1974 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 09/21 Alex Kozlov born in Bila Tserkva, Ukraine, 1970 09/21 Gleb Kurtsou born in Minsk, Belarus, 1984 09/22 Alan Somers born in San Antonio, Texas, United States, 1982 09/22 Bryan Drewery born in San Diego, California, United States, 1984 09/23 Martin Matuska born in Bratislava, Slovakia, 1979 09/24 Larry Rosenman born in Queens, New York, United States, 1957 09/27 Kyle Evans born in Oklahoma City, Oklahoma, United States, 1991 09/27 Neil Blakey-Milner born in Port Elizabeth, South Africa, 1978 09/27 Renato Botelho born in Araras, Sao Paulo, Brazil, 1979 09/28 Greg Lehey born in Melbourne, Victoria, Australia, 1948 09/28 Alex Dupre born in Milano, Italy, 1980 09/29 Matthew Hunt born in Johnstown, Pennsylvania, United States, 1976 09/30 Mark Felder born in Prairie du Chien, Wisconsin, United States, 1985 09/30 Hiten M. Pandya born in Dar-es-Salaam, Tanzania, East Africa, 1986 09/30 Third quarter status reports are due on 10/15 10/02 Beat Gaetzi born in Zurich, Switzerland, 1980 10/02 Grzegorz Blach born in Starachowice, Poland, 1985 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 10/11 Rick Macklem born in Ontario, Canada, 1955 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 10/15 Eugene Grosbein born in Novokuznetsk, Russian Republic, USSR, 1976 10/16 Remko Lodder born in Rotterdam, the Netherlands, 1983 10/17 Maho NAKATA born in Osaka, Japan, 1974 10/18 Sheldon Hearn born in Cape Town, Western Cape, South Africa, 1974 10/18 Vladimir Kondratyev born in Ryazan, USSR, 1975 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 10/19 Pedro Giffuni born in Bogotá, Colombia, 1968 10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 10/23 Mario Sergio Fujikawa Ferreira born in Brasilia, Distrito Federal, Brazil, 1976 10/23 Romain Tartière born in Clermont-Ferrand, France, 1984 10/25 Eric Melville born in Los Gatos, California, United States, 1980 10/25 Julien Laffaye born in Toulouse, France, 1988 10/25 Ashish SHUKLA born in Kanpur, India, 1985 10/25 Toomas Soome born Estonia, 1971 10/26 Matthew Ahrens born in United States, 1979 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 10/30 Olli Hauer born in Sindelfingen, Germany, 1968 10/31 Taras Korenko born in Cherkasy region, Ukraine, 1980 11/03 Ryan Stone born in Ottawa, Ontario, Canada, 1985 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 11/08 Joseph R. Mingrone born in Charlottetown, Prince Edward Island, Canada, 1976 11/09 Coleman Kane born in Cincinnati, Ohio, United States, 1980 11/09 Antoine Brodin born in Bagnolet, France, 1981 11/10 Gregory Neil Shapiro born in Providence, Rhode Island, United States, 1970 11/11 Danilo E. Gondolfo born in Lobato, Parana, Brazil, 1987 11/13 John Baldwin born in Stuart, Virginia, United States, 1977 11/14 Jeremie Le Hen born in Nancy, France, 1980 11/15 Lars Engels born in Hilden, Nordrhein-Westfalen, Germany, 1980 11/15 Tijl Coosemans born in Duffel, Belgium, 1983 11/16 Jose Maria Alcaide Salinas born in Madrid, Spain, 1962 11/16 Matt Joras born in Evanston, Illinois, United States, 1992 11/17 Ralf S. Engelschall born in Dachau, Bavaria, Germany, 1972 11/18 Thomas Quinot born in Paris, France, 1977 11/19 Konstantin Belousov born in Kiev, USSR, 1972 11/20 Dmitry Morozovsky born in Moscow, USSR, 1968 11/20 Gavin Atkinson born in Middlesbrough, United Kingdom, 1979 11/21 Mark Johnston born in Toronto, Ontario, Canada, 1989 11/22 Frederic Culot born in Saint-Germain-En-Laye, France, 1976 11/23 Josef Lawrence Karthauser born in Pembury, Kent, United Kingdom, 1972 11/23 Luca Pizzamiglio born in Casalpusterlengo, Italy, 1978 11/24 Andrey Zakhvatov born in Chelyabinsk, Russian Federation, 1974 11/24 Daniel Gerzo born in Bratislava, Slovakia, 1986 11/25 Fedor Uporov born in Yalta, Crimea, USSR, 1988 11/28 Nik Clayton born in Peterborough, United Kingdom, 1973 11/28 Stanislav Sedov born in Chelyabinsk, USSR, 1985 12/01 Hajimu Umemoto born in Nara, Japan, 1961 12/01 Alexey Dokuchaev born in Magadan, USSR, 1980 12/02 Ermal Luçi born in Tirane, Albania, 1980 12/03 Diane Bruce born in Ottawa, Ontario, Canada, 1952 12/04 Mariusz Zaborski born in Skierniewice, Poland, 1990 12/05 Ivan Voras born in Slavonski Brod, Croatia, 1981 12/06 Stefan Farfeleder born in Wien, Austria, 1980 12/08 Michael Tuexen born in Oldenburg, Germany, 1966 12/11 Ganael Laplanche born in Reims, France, 1980 12/15 James FitzGibbon born in Amersham, Buckinghamshire, United Kingdom, 1974 12/15 Timur I. Bakeyev born in Kazan, Republic of Tatarstan, USSR, 1974 12/18 Chris Timmons born in Ellensburg, Washington, United States, 1964 12/18 Dag-Erling Smorgrav born in Brussels, Belgium, 1977 12/18 Muhammad Moinur Rahman born in Dhaka, Bangladesh, 1983 12/18 Semen Ustimenko born in Novosibirsk, Russian Federation, 1979 12/19 Stephen Hurd born in Estevan, Saskatchewan, Canada, 1975 12/20 Sean Bruno born in Monterey, California, United States, 1974 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 12/22 Alan L. Cox born in Warren, Ohio, United States, 1964 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 12/23 Alejandro Pulver born in Buenos Aires, Argentina, 1989 12/24 Jochen Neumeister born in Heidenheim, Germany, 1975 12/24 Guido Falsi born in Firenze, Italy, 1978 12/25 Niclas Zeising born in Stockholm, Sweden, 1986 12/28 Soren Schmidt born in Maribo, Denmark, 1960 12/28 Ade Lovett born in London, England, 1969 12/28 Marius Strobl born in Cham, Bavaria, Germany, 1978 12/31 Edwin Groothuis born in Geldrop, the Netherlands, 1970 12/31 Fourth quarter status reports are due on 01/15 #endif /* !_calendar_freebsd_ */ Index: stable/11/usr.bin/du/tests/du_test.sh =================================================================== --- stable/11/usr.bin/du/tests/du_test.sh (revision 346919) +++ stable/11/usr.bin/du/tests/du_test.sh (revision 346920) @@ -1,168 +1,167 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ atf_test_case A_flag A_flag_head() { atf_set "descr" "Verify -A behavior" } A_flag_body() { # XXX: compressed volumes? atf_check truncate -s 10g sparse.file atf_check -o inline:'1\tsparse.file\n' du -g sparse.file atf_check -o inline:'10\tsparse.file\n' du -A -g sparse.file } atf_test_case H_flag H_flag_head() { atf_set "descr" "Verify -H behavior" } H_flag_body() { local paths1='testdir/A/B testdir/A testdir/C testdir' local paths2='testdir/A/B testdir/A testdir/C testdir' local sep='\n[0-9]+\t' atf_check mkdir testdir atf_check -x "cd testdir && mkdir A && touch A/B && ln -s A C" atf_check -o save:du.out du -aAH testdir atf_check egrep -q "[0-9]+\t$(echo $paths1 | tr ' ' "$sep")\n" du.out atf_check -o save:du_C.out du -aAH testdir/C atf_check egrep -q "[0-9]+\t$(echo $paths2 | tr ' ' "$sep")\n" du_C.out } atf_test_case I_flag I_flag_head() { atf_set "descr" "Verify -I behavior" } I_flag_body() { paths_sans_foo_named="a/motley/fool/of/sorts fool/parts/with/their/cache bar baz" paths_foo_named="foo foobar" paths="$paths_sans_foo_named $paths_foo_named" # cd'ing to testdir helps ensure that files from atf/kyua don't # pollute the results. atf_check -x "mkdir testdir && cd testdir && mkdir -p $paths" atf_check -o save:du.out -x "cd testdir && du -s $paths_sans_foo_named" atf_check -o save:du_I.out -x "cd testdir && du -I '*foo*' -s $paths" atf_check diff -u du.out du_I.out } atf_test_case c_flag c_flag_head() { atf_set "descr" "Verify -c output" } c_flag_body() { atf_check truncate -s 0 foo bar } atf_test_case g_flag g_flag_head() { atf_set "descr" "Verify -g output" } g_flag_body() { atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C atf_check truncate -s 1t D atf_check -o inline:'1\tA\n1\tB\n1\tC\n1024\tD\n' du -Ag A B C D } atf_test_case h_flag h_flag_head() { atf_set "descr" "Verify -h output" } h_flag_body() { atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C atf_check truncate -s 1t D atf_check -o inline:'1.0K\tA\n1.0M\tB\n1.0G\tC\n1.0T\tD\n' du -Ah A B C D } atf_test_case k_flag k_flag_head() { atf_set "descr" "Verify -k output" } k_flag_body() { atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check -o inline:'1\tA\n1024\tB\n' du -Ak A B } atf_test_case m_flag m_flag_head() { atf_set "descr" "Verify -m output" } m_flag_body() { atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C atf_check -o inline:'1\tA\n1\tB\n1024\tC\n' du -Am A B C } atf_test_case si_flag si_flag_head() { atf_set "descr" "Verify --si output" } si_flag_body() { atf_check truncate -s 1500000 A atf_check truncate -s 1572864 B atf_check -o inline:'1.4M\tA\n1.5M\tB\n' du -Ah A B atf_check -o inline:'1.5M\tA\n1.6M\tB\n' du -A --si A B } atf_init_test_cases() { atf_add_test_case A_flag atf_add_test_case H_flag atf_add_test_case I_flag atf_add_test_case g_flag atf_add_test_case h_flag atf_add_test_case k_flag atf_add_test_case m_flag atf_add_test_case si_flag } Index: stable/11/usr.bin/getconf/tests/arch_type.c =================================================================== --- stable/11/usr.bin/getconf/tests/arch_type.c (revision 346919) +++ stable/11/usr.bin/getconf/tests/arch_type.c (revision 346920) @@ -1,59 +1,58 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include __RCSID("$FreeBSD$"); #include #include #include #include int main(void) { bool known_arch_type; known_arch_type = false; #ifdef __LP64__ printf("LP64\n"); known_arch_type = true; #endif #ifdef __LP32__ printf("LP32\n"); known_arch_type = true; #endif #ifdef __ILP32__ printf("ILP32\n"); known_arch_type = true; #endif if (known_arch_type) exit(0); fprintf(stderr, "unknown architecture type detected\n"); assert(0); } Index: stable/11/usr.bin/procstat/tests/procstat_test.sh =================================================================== --- stable/11/usr.bin/procstat/tests/procstat_test.sh (revision 346919) +++ stable/11/usr.bin/procstat/tests/procstat_test.sh (revision 346920) @@ -1,156 +1,155 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $FreeBSD$ # MAX_TRIES=20 PROG_PID= PROG_PATH=$(atf_get_srcdir)/while1 SP='[[:space:]]' start_program() { echo "Starting program in background" PROG_COMM=while1 PROG_PATH=$(atf_get_srcdir)/$PROG_COMM $PROG_PATH $* & PROG_PID=$! try=0 while [ $try -lt $MAX_TRIES ] && ! kill -0 $PROG_PID; do sleep 0.5 : $(( try += 1 )) done if [ $try -ge $MAX_TRIES ]; then atf_fail "Polled for program start $MAX_TRIES tries and failed" fi } atf_test_case binary_info binary_info_head() { atf_set "descr" "Checks -b support" } binary_info_body() { start_program bogus-arg line_format="$SP*%s$SP+%s$SP+%s$SP+%s$SP*" 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 match:"$header_re" head -n 1 procstat.out atf_check -o match:"$line_re" tail -n 1 procstat.out } atf_test_case command_line_arguments command_line_arguments_head() { atf_set "descr" "Checks -c support" } command_line_arguments_body() { arguments="my arguments" start_program $arguments line_format="$SP*%s$SP+%s$SP+%s$SP*" 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 -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 } atf_test_case environment environment_head() { atf_set "descr" "Checks -e support" } environment_body() { var="MY_VARIABLE=foo" eval "export $var" start_program my arguments line_format="$SP*%s$SP+%s$SP+%s$SP*" 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 match:"$header_re" head -n 1 procstat.out atf_check -o match:"$line_re" tail -n 1 procstat.out } atf_test_case file_descriptor file_descriptor_head() { atf_set "descr" "Checks -f support" } file_descriptor_body() { start_program my arguments line_format="$SP*%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP%s$SP*" header_re=$(printf "$line_format" "PID" "COMM" "FD" "T" "V" "FLAGS" "REF" "OFFSET" "PRO" "NAME") # 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 match:"$header_re" head -n 1 procstat.out 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() { # Bug 237445: checks will fail because of missing MFCs on branch #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 } Index: stable/11/usr.bin/procstat/tests/while1.c =================================================================== --- stable/11/usr.bin/procstat/tests/while1.c (revision 346919) +++ stable/11/usr.bin/procstat/tests/while1.c (revision 346920) @@ -1,40 +1,39 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include __RCSID("$FreeBSD$"); #include #include int main(void) { for (;;) usleep(100); exit(1); } Index: stable/11/usr.sbin/sysrc/sysrc.8 =================================================================== --- stable/11/usr.sbin/sysrc/sysrc.8 (revision 346919) +++ stable/11/usr.sbin/sysrc/sysrc.8 (revision 346920) @@ -1,485 +1,485 @@ .\" Copyright (c) 2011-2016 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd February 2, 2016 .Dt SYSRC 8 .Os .Sh NAME .Nm sysrc .Nd safely edit system rc files .Sh SYNOPSIS .Nm .Op Fl cdDeEFhinNqvx .Op Fl s Ar name .Op Fl f Ar file .Op Fl j Ar jail | Fl R Ar dir .Ar name Ns Op Ns Oo +|- Oc Ns = Ns Ar value .Ar ... .Nm .Op Fl cdDeEFhinNqvx .Op Fl s Ar name .Op Fl f Ar file .Op Fl j Ar jail | Fl R Ar dir .Fl a | A .Nm .Op Fl E .Op Fl s Ar name .Op Fl f Ar file .Fl l .Nm .Op Fl eEqv .Fl L .Op Ar name ... .Sh DESCRIPTION The .Nm utility retrieves .Xr rc.conf 5 variables from the collection of system rc files and allows processes with appropriate privilege to change values in a safe and effective manner. .Pp The following options are available: .Bl -tag -width indent+ .It Fl a Dump a list of all non-default configuration variables. .It Fl A Dump a list of all configuration variables .Pq incl. defaults . .It Fl c Check only. For querying, return success if all requested variables are set .Pq even if NULL , otherwise return error status. For assignments, return success if no changes are required, otherwise failure. If verbose .Pq see Dq Fl v prints a message stating whether variables are set and/or changes are required. .It Fl d Print a description of the given variable. .It Fl D Show default value(s) only (this is the same as setting RC_CONFS to NULL or passing `-f' with a NULL file-argument). .It Fl e Print query results as .Xr sh 1 compatible syntax .Pq for example, Ql var=value . Ignored if either .Ql Fl n or .Ql Fl F is specified. .It Fl E When given .Sq Fl l or .Sq Fl L to list configuration files, only list those that exist. When changing a setting, prefer to modify existing files. .It Fl f Ar file Operate on the specified file(s) instead of the files obtained by reading the .Sq rc_conf_files entry in the .Ev RC_DEFAULTS file. This option can be specified multiple times for additional files. .It Fl F Show only the last .Xr rc.conf 5 file each directive is in. .It Fl h Print a short usage message to stderr and exit. .It Fl -help Print a full usage statement to stderr and exit. .It Fl i Ignore unknown variables. .It Fl j Ar jail The .Ar jid or name of the .Ar jail to operate within .Pq overrides So Fl R Ar dir Sc ; requires Xr jexec 8 . .It Fl l List configuration files used at startup on stdout and exit. .It Fl L List all configuration files including rc.conf.d entries on stdout and exit. Can be combined with .Sq Fl v or .Sq Fl e to show service names. .Nm exits with success if all named services are installed, failure otherwise. .It Fl n Show only variable values, not their names. .It Fl N Show only variable names, not their values. .It Fl q Quiet. Disable verbose and hide certain errors. When combined with .Sq Fl L and one or more .Li Ar name arguments, provide only exit status and no output. .It Fl R Ar dir Operate within the root directory .Sq Ar dir rather than .Sq / . .It Fl s Ar name If an .Li rc.d script of .Ar name exists .Po in .Dq /etc/rc.d or .Li local_startup directories .Pc , process its .Dq rc.conf.d entries as potential overrides to .Sq rc_conf_files . See .Xr rc.subr 8 for additional information on .Dq rc.conf.d . Can be combined with .Sq Fl l to list configuration files used by service at startup. .It Fl v Verbose. Print the pathname of the specific .Xr rc.conf 5 file where the directive was found. .It Fl -version Print version information to stdout and exit. .It Fl x Remove variable(s) from specified file(s). .El .Pp This utility has a similar syntax to .Xr sysctl 8 . It shares the `-e' and `-n' options .Pq detailed above and also has the same .Ql name[=value] syntax for making queries/assignments. In addition .Pq but unlike Xr sysctl 8 , .Ql name+=value is supported for adding items to values .Pq see APPENDING VALUES and .Ql name-=value is supported for removing items from values .Pq see SUBTRACTING VALUES . .Pp However, while .Xr sysctl 8 serves to query/modify MIBs in the entrant kernel, .Nm instead works on values in the system .Xr rc.conf 5 configuration files. .Pp The list of system configuration files is configured in the file .Ql /etc/defaults/rc.conf within the variable .Ql rc_conf_files , which by-default contains a space-separated list of pathnames. On all FreeBSD systems, this defaults to the value "/etc/rc.conf /etc/rc.conf.local". Each pathname is sourced in-order upon startup. It is in the same fashion that .Nm sources the configuration files before returning the value of the given variable. .Pp When supplied a variable name, .Nm will return the value of the variable. If the variable does not appear in any of the configured .Ql rc_conf_files , an error is printed and error status is returned. .Pp When changing values of a given variable, it does not matter if the variable appears in any of the .Ql rc_conf_files or not. If the variable does not appear in any of the files, it is appended to the end of the first pathname in the .Ql rc_conf_files variable. Otherwise, .Nm will replace only the last-occurrence in the last-file found to contain the variable. This gets the value to take effect next boot without heavily modifying these integral files (yet taking care not to allow the file to grow unwieldy should .Nm be called repeatedly). .Sh APPENDING VALUES When using the .Ql key+=value syntax to add items to existing values, the first character of the value is taken as the delimiter separating items .Pq usually Qo " " Qc or Qo , Qc . For example, in the following statement: .Bl -item -offset indent .It .Nm cloned_interfaces+=" gif0" .El .Pp the first character is a space, informing .Nm that existing values are to be considered separated by whitespace. If .Ql gif0 is not found in the existing value for .Va cloned_interfaces , it is added .Pq with delimiter only if existing value is non-NULL . .Pp For convenience, if the first character is alpha-numeric .Pq letters A-Z, a-z, or numbers 0-9 , dot .Pq Li . , or slash .Pq Li / , .Nm uses the default setting of whitespace as separator. For example, the above and below statements are equivalent since .Dq gif0 starts with an alpha-numeric character .Pq the letter Li g : .Bl -item -offset indent .It .Nm cloned_interfaces+=gif0 .El .Pp Take the following sequence for example: .Bl -item -offset indent .It .Nm cloned_interfaces= # start with NULL .It .Nm cloned_interfaces+=gif0 .Dl # NULL -> `gif0' Pq NB: no preceding delimiter .It .Nm cloned_interfaces+=gif0 # no change .It .Nm cloned_interfaces+="tun0 gif0" .Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication .El .Pp .Nm prevents the same value from being added if already there. .Sh SUBTRACTING VALUES When using the .Ql key-=value syntax to remove items from existing values, the first character of the value is taken as the delimiter separating items .Pq usually Qo " " Qc or Qo , Qc . For example, in the following statement: .Pp .Dl Nm cloned_interfaces-=" gif0" .Pp the first character is a space, informing .Nm that existing values are to be considered separated by whitespace. If .Ql gif0 is found in the existing value for .Va cloned_interfaces , it is removed .Pq extra delimiters removed . .Pp For convenience, if the first character is alpha-numeric .Pq letters A-Z, a-z, or numbers 0-9 , dot .Pq Li . , or slash .Pq Li / , .Nm uses the default setting of whitespace as separator. For example, the above and below statements are equivalent since .Dq gif0 starts with an alpha-numeric character .Pq the letter Li g : .Bl -item -offset indent .It .Nm cloned_interfaces-=gif0 .El .Pp Take the following sequence for example: .Bl -item -offset indent .It .Nm foo="bar baz" # start .It .Nm foo-=bar # `bar baz' -> `baz' .It .Nm foo-=baz # `baz' -> NULL .El .Pp .Nm removes all occurrences of all items provided and collapses extra delimiters between items. .Sh ENVIRONMENT The following environment variables are referenced by .Nm : .Bl -tag -width ".Ev RC_DEFAULTS" .It Ev RC_CONFS Override default .Ql rc_conf_files .Pq even if set to NULL . .It Ev RC_DEFAULTS Location of .Ql /etc/defaults/rc.conf file. .El .Sh DEPENDENCIES The following standard commands are required by .Nm : .Pp .Xr awk 1 , .Xr cat 1 , .Xr chmod 1 , .Xr env 1 , .Xr grep 1 , .Xr mktemp 1 , .Xr mv 1 , .Xr rm 1 , .Xr sh 1 , .Xr stat 1 , .Xr tail 1 , .Xr chown 8 , .Xr jls 8 , and .Xr jexec 8 . .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact .It Pa /etc/defaults/rc.conf .It Pa /etc/rc.conf .It Pa /etc/rc.conf.local .It Pa /etc/rc.conf.d/name .It Pa /etc/rc.conf.d/name/* .It Pa /usr/local/etc/rc.conf.d/name .It Pa /usr/local/etc/rc.conf.d/name/* .El .Sh EXAMPLES Below are some simple examples of how .Nm can be used to query certain values from the .Xr rc.conf 5 collection of system configuration files: .Pp .Nm sshd_enable .Dl returns the value of $sshd_enable, usually YES or NO . .Pp .Nm defaultrouter .Dl returns IP address of default router Pq if configured . .Pp Working on other files, such as .Xr crontab 5 : .Pp .Nm -f /etc/crontab MAILTO .Dl returns the value of the MAILTO setting Pq if configured . .Pp Appending to existing values: .Pp .Nm \&cloned_interfaces+=gif0 .Dl appends Qo gif0 Qc to $cloned_interfaces Pq see APPENDING VALUES . .Pp .Nm \&cloned_interfaces-=gif0 .Dl removes Qo gif0 Qc from $cloned_interfaces Pq see SUBTRACTING VALUES . .Pp In addition to the above syntax, .Nm also supports inline .Xr sh 1 PARAMETER expansion for changing the way values are reported, shown below: .Pp .Nm \&'hostname%%.*' .Dl returns $hostname up to (but not including) first `.' . .Pp .Nm \&'network_interfaces%%[$IFS]*' .Dl returns first word of $network_interfaces . .Pp .Nm \&'ntpdate_flags##*[$IFS]' .Dl returns last word of $ntpdate_flags (time server address) . .Pp .Nm usbd_flags-"default" .Dl returns $usbd_flags or "default" if unset or NULL . .Pp .Nm cloned_interfaces+"alternate" .Dl returns "alternate" if $cloned_interfaces is set . .Sh SEE ALSO .Xr rc.conf 5 , .Xr rc.subr 8 , .Xr jail 8 , .Xr jexec 8 , .Xr jls 8 , .Xr rc 8 , .Xr sysctl 8 .Sh HISTORY A .Nm utility first appeared in .Fx 9.2 . .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO -Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. Index: stable/11 =================================================================== --- stable/11 (revision 346919) +++ stable/11 (revision 346920) Property changes on: stable/11 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r346571-346572