From nobody Wed Nov 20 09:42:20 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 4XtbxS6dX2z5dWY2; Wed, 20 Nov 2024 09:42:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XtbxS4bxLz4cQc; Wed, 20 Nov 2024 09:42:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732095740; 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=ErHziiX/SEwhfBJ4yYVIHHYJCpBwE8Cm+ZyEAgQzCpI=; b=t1Og6gYo7LcF9d+oC6Oy4OxuNsGjMI2nA2lQkoZ9CWH+wbgpW2Cm01wwi6f21U9eZMdpO4 Ef1NXEuQz5m/R9jwTqtmC/58HX9SWsco6Q6hMx+4MrUaiH90VtyJcy96z9c0FBeg176UvL oZquZ9VQgoObmcAc4hatvMCzhVG92xeZbzcsbtjfM2nOsT5qXCLqrUoBU6ZS75mzSPMMwy SO5X8Rb3BTuO7lCm5XGNQyFA7yXHrTY8uEskicJfbZGe7zu8c7ZsJwjhNJ3nCLQPqCCDp4 NabowzNII76bj5NbHLRVR2pclgrTcsTGOydbriNKAW596jkTQPyr5SqU/78fgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732095740; 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=ErHziiX/SEwhfBJ4yYVIHHYJCpBwE8Cm+ZyEAgQzCpI=; b=bpO9snmyDrK3s1Zsu07VyTuAEneHXViSyHLzeonopJmhkjz6ZSITP2zvt3+NcmXzl4N/hd ZGtZze5JYagTQLEApVlDew1F9FmlsR/AOf1wPOXdGxQiM+6+c++tY+YebJJCOCnljeZsFL 91xZ6p41U9QFDdjHe/rck4aZ+t9GJPGa2GJvGbhr4+iOOTQX28rYv36gV69MDlvkjRy/lV mmG65AuhDyo2YpKyiq8gc9lgEWppeba5qvGtqy0eL/9hKnW3DVn1JyOmojDOlWMzTYSdsd eiE7dRIJQ7t7f1++DHrvU4X4T8kP0lKHsJXlF3zCQ+H8hzzyW2lmH5eKIihIBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732095740; a=rsa-sha256; cv=none; b=hso6RJQSBWstriSKp+k6FG61DK0//onV98iga/nUPl8qYcECPMV1gTNBWhsVs8GQiOnXWR mk8ESt/7L1SmVJX2mtVILgfBng+ajiFWO/EGv0XUq7NVjpHjiEwLA5m+iDYSn9E6p0nLhO 7VualCNxDAThYYAzNvZy7wN3zKwGJzIFjgeNjZflyOYIBcTGIfBztzbN4dTWiZnt1Dgg+a 1yOarDTmzWJxNszJreoT31wnqrkIfikhUa7wbIFlq76YQoJIAx7qjv2zhhvOoMs5s9Dy5e HLPBw2sWV3daMHT2VoWoAnIAAMcSMhcABs6Eo1knRMo1Y7T/ZmIQ36ttGfpgVQ== 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 4XtbxS4C4vzpWx; Wed, 20 Nov 2024 09:42:20 +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 4AK9gKiX083978; Wed, 20 Nov 2024 09:42:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AK9gK7s083975; Wed, 20 Nov 2024 09:42:20 GMT (envelope-from git) Date: Wed, 20 Nov 2024 09:42:20 GMT Message-Id: <202411200942.4AK9gK7s083975@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: fc34a2463c16 - main - nuageinit: add test for the password 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 Sender: owner-dev-commits-src-all@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: fc34a2463c16fd47acbc8e5c3bbbb6b2ce1b1469 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=fc34a2463c16fd47acbc8e5c3bbbb6b2ce1b1469 commit fc34a2463c16fd47acbc8e5c3bbbb6b2ce1b1469 Author: Baptiste Daroussin AuthorDate: 2024-11-20 09:32:16 +0000 Commit: Baptiste Daroussin CommitDate: 2024-11-20 09:41:46 +0000 nuageinit: add test for the password --- libexec/nuageinit/tests/Makefile | 7 +++++++ libexec/nuageinit/tests/nuage.sh | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/libexec/nuageinit/tests/Makefile b/libexec/nuageinit/tests/Makefile index ccb81c090445..bb2f0d7c747e 100644 --- a/libexec/nuageinit/tests/Makefile +++ b/libexec/nuageinit/tests/Makefile @@ -1,10 +1,17 @@ PACKAGE= tests +.PATH: ${SRCTOP}/usr.sbin/pw/tests + +BINDIR= ${TESTSDIR} + +PROGS= crypt +LIBADD= crypt ATF_TESTS_SH= nuage utils nuageinit ${PACKAGE}FILES+= addgroup.lua ${PACKAGE}FILES+= addsshkey.lua ${PACKAGE}FILES+= adduser.lua +${PACKAGE}FILES+= adduser_passwd.lua ${PACKAGE}FILES+= dirname.lua ${PACKAGE}FILES+= err.lua ${PACKAGE}FILES+= sethostname.lua diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 293a0a4a9a83..a5451561202f 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -9,6 +9,7 @@ export NUAGE_FAKE_ROOTDIR="$PWD" atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser +atf_test_case adduser_passwd atf_test_case addgroup sethostname_body() @@ -48,6 +49,19 @@ adduser_body() atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd } +adduser_passwd_body() +{ + mkdir etc + printf "root:*:0:0::0:0:Charlie &:/root:/bin/sh\n" > etc/master.passwd + pwd_mkdb -d etc etc/master.passwd + printf "wheel:*:0:root\n" > etc/group + atf_check /usr/libexec/flua $(atf_get_srcdir)/adduser_passwd.lua + test -d home/foo || atf_fail "home not created" + passhash=`awk -F ':' '/^foo:/ {print $2}' etc/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "bar" +} + addgroup_body() { mkdir etc @@ -61,5 +75,6 @@ atf_init_test_cases() atf_add_test_case sethostname atf_add_test_case addsshkey atf_add_test_case adduser + atf_add_test_case adduser_passwd atf_add_test_case addgroup }