From nobody Fri Jan 14 20:39:30 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 92C73195E5E4; Fri, 14 Jan 2022 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JbCpB2bmDz3CZq; Fri, 14 Jan 2022 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642192770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGzZ5ILOeec+LaR+QgHiSJ8H6aNNsso+npKQaDC3Mro=; b=cgMu5IlKKphqrbJRpWyruKqS9s0nhuTJAJLG7Ugb0V2xfYLZ73HiLOeGXhgFQG/dCpAUMK a3jydANYstpTSq44Mtm6CU0+JS6cml8ph9DsFkzAykIXlPpu+YFNerXcBIh0VfiBneks18 ollfTasNucMH5k5W+by8mesanv/JT4tgVxhMhy4AM1AG1n2qVOFM+mQ2PXYODmUw74P3Xw vyzbXpN+Y/m5uoTlEtUj17g6b1Rc9UZfkaiUdqu1x4z+eCDot4LD2SK9IbTDbzU+dwq/es wGKUVawEifdAXPBY7DxabyOjafY+3he7MUFvLdLzLQpLpYRUlJb5PXK/41Qgaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 348721A3B7; Fri, 14 Jan 2022 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20EKdUma087479; Fri, 14 Jan 2022 20:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20EKdUH3087478; Fri, 14 Jan 2022 20:39:30 GMT (envelope-from git) Date: Fri, 14 Jan 2022 20:39:30 GMT Message-Id: <202201142039.20EKdUH3087478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 95c75073d3d1 - main - netbsd-tests: Fix the libc stat_socket test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95c75073d3d1ca9dcae41784453172f199bb2c0f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642192770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGzZ5ILOeec+LaR+QgHiSJ8H6aNNsso+npKQaDC3Mro=; b=aVOvsKpCmVewQoF2T5dTuPIzGWXkLSaDZ6psps1sjs1/WbDDsC0OzaLmOtlvdxGPLjmAta wZfYYPVJCBmpKyv4lT5OUXrJUQHADG5z/ulM2tZvX0anytJs5FiN8aZ9HXsZfSzf5YkXzD 0gsw7APHlu9eBcgTyPJn7Me0+iPkKwoQSuO8lU16npE7XVzGgddYLSCQYFLWPSCZK6D6nh PeAxY8KUEeZZf+SpmCGfluYImOhxX0qGwhbpxiiuNJQ+Ek2rt/4Tk723cK3jdd0Z0pnAhY 2a/KdH/BNOTgR+hvpiYRc1uBENvHrHQ+dJg3HT5s7A33tq/5nK42rFVSpv6jmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642192770; a=rsa-sha256; cv=none; b=Asoybmy+MzJsgajRSpsnQ0yQiNOUkP5tAMR8+Dlwjgq5IPYc8I4VDp27rXDtifESAssy+i bYjvUju6l96O6e6TC+KglV0tx6e1c+qODVwVdDGn06vO44nAof0dlfFPrhrb85CLe4gqPA zKRt9Qo8X8MBAUro4eSxolaUUDdGIcrCKOfA40MX3vBISdlv+tqZSrrS6CyGUaWK+dqdFK nXO+98TF+g6/HSeumXKDZ72kNRbX1zOFPxeG5+1EtL6cUrJ/K1f63PsvCA1EDfP+Rz4nIv T1Bu0S3w48ASPa2l2gQi8Lihy3usYEMjaQCp0cH5AUxTZziau+HXxAc/YMBSDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=95c75073d3d1ca9dcae41784453172f199bb2c0f commit 95c75073d3d1ca9dcae41784453172f199bb2c0f Author: Mark Johnston AuthorDate: 2022-01-14 20:00:01 +0000 Commit: Mark Johnston CommitDate: 2022-01-14 20:01:41 +0000 netbsd-tests: Fix the libc stat_socket test The test tries to connect a socket to a closed port at 127.0.0.1. It sets O_NONBLOCK on the socket first and expects to get EINPROGRESS from connect(2), but this is not guaranteed, ECONNREFUSED is possible. Handle both cases, and re-enable the test. PR: 240621 MFC after: 1 week Sponsored by: The FreeBSD Foundation --- contrib/netbsd-tests/lib/libc/sys/t_stat.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_stat.c b/contrib/netbsd-tests/lib/libc/sys/t_stat.c index 372a9093fac5..029ff8452d94 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_stat.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_stat.c @@ -332,9 +332,6 @@ ATF_TC_BODY(stat_socket, tc) uint32_t iaddr; int fd, flags; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/240621"); - (void)memset(&st, 0, sizeof(struct stat)); (void)memset(&addr, 0, sizeof(struct sockaddr_in)); @@ -353,14 +350,14 @@ ATF_TC_BODY(stat_socket, tc) errno = 0; - ATF_REQUIRE_ERRNO(EINPROGRESS, - connect(fd, (struct sockaddr *)&addr, - sizeof(struct sockaddr_in)) == -1); + ATF_REQUIRE(connect(fd, (struct sockaddr *)&addr, + sizeof(struct sockaddr_in)) == -1); + ATF_REQUIRE(errno == EINPROGRESS || errno == ECONNREFUSED); errno = 0; if (fstat(fd, &st) != 0 || errno != 0) - atf_tc_fail("fstat(2) failed for a EINPROGRESS socket"); + atf_tc_fail("fstat(2) failed for a socket"); (void)close(fd); }