From nobody Fri Jun 6 16:26:57 2025 X-Original-To: dev-commits-src-main@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 4bDRXy2w8Vz5xcxR; Fri, 06 Jun 2025 16:26:58 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bDRXy0gPXz3L67; Fri, 06 Jun 2025 16:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227218; 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=LNN2CryD8clc7H2u0Pq9/0U2cckTE2YmCBUX8hjEGKc=; b=wBoRm/+AC/AE7ZVpMuXfU+OcCacjiJprs37r6RRJuFIR+8ihJF7obcGPXyfFu5bwMS3gkn U8n2M0oQsbgoYzrouxnFgbjrPMclSrJtJpniPeprv6ROo4BT4xxuNIdz/IsU1vaMYvCFSx 053jXgzCCPWXx2U4y9QT5fb5lNsUoIHV24gOiCUvobKGWZZ8je0mpbT77CAVmErk3dGiNS B7p4nMqKs+xM6wJev4ytBo1nQbsdYS9NyWUCBUPOfhS9N2NofT+k4HmhcJvLfEXayEM2RD a+3dwJZoGWVUbMMvDztof04mCP8jckwP+waB1pK2Q+TEXqoLpLYrG9HUS4505Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749227218; 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=LNN2CryD8clc7H2u0Pq9/0U2cckTE2YmCBUX8hjEGKc=; b=N7hBisL14TCCDCSXVLZGYvuXbRMzhZnJtuhoagjs7uqEWCT3nmDEAFeanf+fydpaKqvt+g a2XC7gzo6UZgb3j55i3WcCiILEbnYgwpuY41QwKKqMiiS3q84f8oaK0HAyDuk8V42sJ3ee iJnxym3FhN/GoKPO0kzSYFREgsl28CjtmHfBQUV2Gz5Qr9DrkyJNW2zvDdafloX/SoVnsW ywhvVnKYhhbQbcrOQncc9Ayl6wVKOFqakWpVUzoDVJHBayuYLet/aAKfeQGOu1Q779WOVS iwujU2i7SDnSq+ovfNc4djQuATyu8PnBIKpsFC4l/+bNM33Wn+Z/JPBqNpH7PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749227218; a=rsa-sha256; cv=none; b=qRdA8Is2ksPa3bHhfJfJqquY+8wUK7n0V+S1eyQp6azasphD7kA6h2LGwz3gdeDRAmz8w+ y/TQJNbO/qPlZgfpgR3DLoRCko9L6ppZ02HApH0Qn0xuiA6FZqoERFvVR0ErKHwXvK96jb rmKXjiu9fYCkV6eYmD1qf+/a8hYakQHsB8YBwc7Hgg7seVGLvZz446jce5BhHi4kIsCJDV TvD9JZpX6NB+o4n4lbNcEJOj72cJ7GwJIE2vCHbLBYSEnKX1TsXq8dQLYpHzz/1oZkTLJ6 dQJESN/wdDTpaWUTxG7AMtN53LcASEV3uKVjOaRuNda3XOs17t1w+D3nV9M3MA== 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 4bDRXy07H8z12Zl; Fri, 06 Jun 2025 16:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 556GQv7K066402; Fri, 6 Jun 2025 16:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 556GQv6P066399; Fri, 6 Jun 2025 16:26:57 GMT (envelope-from git) Date: Fri, 6 Jun 2025 16:26:57 GMT Message-Id: <202506061626.556GQv6P066399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: e38f521f53d7 - main - nuageinit: helper function to setup adduser List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e38f521f53d70423064a987be08c3bd5debe3a2e Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e38f521f53d70423064a987be08c3bd5debe3a2e commit e38f521f53d70423064a987be08c3bd5debe3a2e Author: Sebastien Baylocq AuthorDate: 2025-06-05 20:52:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-06 16:26:35 +0000 nuageinit: helper function to setup adduser To carry out the userdata unit tests, you need to set up the environment in order to skip adding the default user (nuage.adduser(default_user) Sponsored by: OVHCloud --- libexec/nuageinit/tests/nuageinit.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 1b67468971a6..811eb9c0c73b 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -24,6 +24,22 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list +setup_test_adduser() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + mkdir -p etc/ssh + cat > etc/master.passwd << EOF +root:*:0:0::0:0:Charlie &:/root:/bin/csh +sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +EOF + pwd_mkdb -d etc ${here}/etc/master.passwd + cat > etc/group << EOF +wheel:*:0:root +users:*:1: +EOF +} + args_body() { atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit ( | )\n" /usr/libexec/nuageinit