From nobody Sat Apr 13 00:36:42 2024 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 4VGZHt3g0Xz5GTK1; Sat, 13 Apr 2024 00:36:42 +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 4VGZHt362Hz54ck; Sat, 13 Apr 2024 00:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712968602; 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=t3NWN3hTBg/ii8VfkX1UJybMNPjQ7gAwASyMiploXsU=; b=JArTQo1bv2rzfa0SJl5/azaXExWUN/WBRNGyJUXavJpkIjkh6mKnhEtiZWO4zsCsTZj0aA 8pbYlVwB9eE92MzimG+Na4jubWiCIUjuRznAutvAqvZUh5OfuqLs34iXqnww+FF4wPjkw8 QQobiO4bI7SsnULjMS+nK4XrI0WIBh5wFNN+pcuQr2BS+wIJErd9wYjBG69S/o7mJSTYzr ocekE/996pqoznyF6pTnkxeybQY2iH7x5oLRcuMA4dKkC584Lk8DoD38qA+Xm5FKxMEdIZ 2UHPz80K4+sCJhhALD0JVa6RUuFQlAv2HfnP9zWBsOtIegJvVaDq87HVn7R/Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712968602; a=rsa-sha256; cv=none; b=Lt4W5LB7vay8WzhVlSLhJXBNVOiWJwMwAm/iqM7Ufqau+klhKis+WNFNZvUn1f1sl2+uwF K8XKZvKg6U6cMNhEhB9MaEPMwaMADHDriV+FmCh2mw+z7SzKj93rrIKqGlmdH62xFBBDCk EZIup3fqOuODSLaMGQ6IAeQMJAL3x/HEV68sZWgIqd54sqse1IjKHX+EgdrrHOb6ATJ/SS 9ooDt9s+900vvw6iUt21rBCSuMpgukfLH3Z81rltvg0EE+Ni5zEUHw5kQ7i+USaEiYjnOh KuLLq/jIeUIXDZLYKnZZS3kUrtI4ombVbI2jKVwc/CsPuO4WMfoxTqRV7wp5BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712968602; 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=t3NWN3hTBg/ii8VfkX1UJybMNPjQ7gAwASyMiploXsU=; b=uT6AVKMAnAoioYDOhHCFkrnR3GvH4F/Yv/oA7zq6f8D4y/Z3WDqOF3/lr+j4jVBXvpVPbs CJaPcZ7tCBwinseg1O9x5lEZERxhnaC/JoXgRMi8+wI1impEP+IJd2ouYVsDZ6J7fz3wcl jIjLjW04KD1UOhBmw1VUUS+/v8ybRhY6y3BlJv/ee2mLHOZtzSxnJzlCIBXjAuI+1RXSOl iVtMSfzgM2Q+YcgbseML3d0uaQ/pXdK85jCH+AODSuJRAnC/TFHmXZPZ+FBLqNNEUP7/83 0PE7waCXwW3jiddZuzGWehB4roikxXVxNoU43PhbTNXXP6fYsfZuPIXgo3LuBA== 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 4VGZHt2jBrz19YJ; Sat, 13 Apr 2024 00:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43D0agKB021840; Sat, 13 Apr 2024 00:36:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43D0ag1l021837; Sat, 13 Apr 2024 00:36:42 GMT (envelope-from git) Date: Sat, 13 Apr 2024 00:36:42 GMT Message-Id: <202404130036.43D0ag1l021837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 25038e8de6b4 - main - zfsd: fix unit tests after 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe 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: 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25038e8de6b4e5f2ffca821565b50a633eea499a Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=25038e8de6b4e5f2ffca821565b50a633eea499a commit 25038e8de6b4e5f2ffca821565b50a633eea499a Author: Alan Somers AuthorDate: 2024-04-10 20:55:03 +0000 Commit: Alan Somers CommitDate: 2024-04-13 00:34:23 +0000 zfsd: fix unit tests after 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe Reported by: markj MFC after: 1 week MFC with: 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe Sponsored by: Axcient Reviewed by: Alek Pinchuk Differential Revision: https://reviews.freebsd.org/D44744 --- cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc | 3 +++ cddl/usr.sbin/zfsd/vdev.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc index d76abb54c9ed..f1e925b0b4ef 100644 --- a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc +++ b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc @@ -134,6 +134,7 @@ public: MOCK_CONST_METHOD0(PoolGUID, Guid()); MOCK_CONST_METHOD0(State, vdev_state()); MOCK_CONST_METHOD0(PhysicalPath, string()); + MOCK_CONST_METHOD2(Name, string(zpool_handle_t * zhp, bool verbose)); }; MockVdev::MockVdev(nvlist_t *vdevConfig) @@ -431,6 +432,8 @@ protected: m_vdev = new MockVdev(m_vdevConfig); ON_CALL(*m_vdev, GUID()) .WillByDefault(::testing::Return(Guid(123))); + ON_CALL(*m_vdev, Name(::testing::_, ::testing::_)) + .WillByDefault(::testing::Return(string("/dev/da999"))); ON_CALL(*m_vdev, PoolGUID()) .WillByDefault(::testing::Return(Guid(456))); ON_CALL(*m_vdev, State()) diff --git a/cddl/usr.sbin/zfsd/vdev.h b/cddl/usr.sbin/zfsd/vdev.h index ace5d5a009fa..42278a3d7229 100644 --- a/cddl/usr.sbin/zfsd/vdev.h +++ b/cddl/usr.sbin/zfsd/vdev.h @@ -130,7 +130,7 @@ public: nvlist_t *Config() const; Vdev Parent(); Vdev RootVdev(); - std::string Name(zpool_handle_t *, bool verbose) const; + virtual std::string Name(zpool_handle_t *, bool verbose) const; bool IsSpare(); bool IsAvailableSpare() const; bool IsActiveSpare() const;