Page MenuHomeFreeBSD

stress2: Use tests as the default test user.
ClosedPublic

Authored by des on Tue, Dec 3, 8:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 12:21 AM
Unknown Object (File)
Thu, Dec 5, 11:25 PM
Unknown Object (File)
Wed, Dec 4, 1:14 PM
Subscribers

Details

Summary

This allows tests to run without prior configuration.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60923
Build 57807: arc lint + arc unit

Event Timeline

des requested review of this revision.Tue, Dec 3, 8:35 AM

That does not work for me. This is what I get on a pristine install:

root@x8:~ # uname -a
FreeBSD x8.osted.lan 15.0-CURRENT FreeBSD 15.0-CURRENT #0 main-n273322-22429a464a5f: Wed Oct 30 09:52:55 CET 2024     root@x8.osted.lan:/usr/src/sys/amd64/compile/PHO amd64
root@x8:~ # grep tests /etc/master.passwd 
tests:*:977:977::0:0:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
root@x8:~ # su tests -c date
This account is currently not available.
root@x8:~ #
This revision is now accepted and ready to land.Tue, Dec 3, 1:43 PM

I'm puzzled by how your change could work for you.

root@x8:/usr/src/tools/test/stress2/misc # git diff | cat
diff --git a/tools/test/stress2/default.cfg b/tools/test/stress2/default.cfg
index bff7f3f168a9..dbd1ca0bbc43 100644
--- a/tools/test/stress2/default.cfg
+++ b/tools/test/stress2/default.cfg
@@ -56,7 +56,7 @@ testcases/tcp/tcp
 
 export diskimage=${diskimage:-/tmp/diskimage}	# Location of 1G disk image
 export mntpoint=${mntpoint:-/mnt}		# Disk image mount point
-export testuser=${testuser:-TBD}		# Name of non root test user
+export testuser=${testuser:-tests}		# Name of non root test user
 export mdstart=${mdstart:-10}			# Start of free md units
 export newfs_flags=${newfs_flags:-"-U"}		# Default file system flags
 export stress2origin=${stress2origin:-`pwd`}
root@x8:/usr/src/tools/test/stress2/misc # ./all.sh -o vunref2.sh
Creating local configuration file: /tmp/stress2.d/x8.osted.lan.
Enter non-root test user name: tests
User "tests" not usable.
root@x8:/usr/src/tools/test/stress2/misc #

Note that none of the existing tests uses "su -m"

I only needed to run tmpfs24 which does not use $testuser but refuses to run if it is not defined. This patch does not fix every broken test, but it fixes some of them.

This revision was automatically updated to reflect the committed changes.
In D47875#1092294, @des wrote:

I only needed to run tmpfs24 which does not use $testuser but refuses to run if it is not defined. This patch does not fix every broken test, but it fixes some of them.

I really don't know how to respond to this.