Blame


1 f2900386 2022-10-31 thomas Running server regression tests requires some manual system preparation.
2 f2900386 2022-10-31 thomas
3 f2900386 2022-10-31 thomas Two dedicated user accounts and a group must be created. Password login
4 280d0644 2022-10-31 thomas for these users should be disabled.
5 f2900386 2022-10-31 thomas
6 280d0644 2022-10-31 thomas $ doas groupadd gotsh
7 280d0644 2022-10-31 thomas $ doas useradd -m -G gotsh got
8 280d0644 2022-10-31 thomas $ doas useradd -m -G gotsh gotdev
9 f2900386 2022-10-31 thomas
10 f2900386 2022-10-31 thomas The above user and group names correspond to defaults used by the test suite.
11 f2900386 2022-10-31 thomas If needed, the defaults can be overridden on by passing values for the
12 f2900386 2022-10-31 thomas following variables to make(1): GOTD_USER, GOTD_DEVUSER, GOTD_GROUP
13 f2900386 2022-10-31 thomas
14 f2900386 2022-10-31 thomas An SSH key must be added to ~gotdev/.ssh/authorized_keys, such that the
15 f2900386 2022-10-31 thomas following command succeeds non-interactively:
16 f2900386 2022-10-31 thomas
17 f2900386 2022-10-31 thomas $ ssh gotdev@127.0.0.1
18 f2900386 2022-10-31 thomas
19 f2900386 2022-10-31 thomas The login shell of the gotdev user should be set to gotsh(1).
20 f2900386 2022-10-31 thomas It is recommended to run the test suite using a locally built gotsh binary,
21 f2900386 2022-10-31 thomas rather than /usr/local/bin/gotsh (which might be using messages in an
22 f2900386 2022-10-31 thomas out-of-date format on the gotd socket).
23 f2900386 2022-10-31 thomas For this to work, $HOME/bin/gotsh must be added to /etc/shells first.
24 f2900386 2022-10-31 thomas
25 f2900386 2022-10-31 thomas $ doas usermod -s $HOME/bin/gotsh gotdev
26 f2900386 2022-10-31 thomas
27 f2900386 2022-10-31 thomas If adding this file to /etc/shells is a problem, a locally built gotsh
28 f2900386 2022-10-31 thomas binary can be made available in the command search path of the gotdev
29 f2900386 2022-10-31 thomas user under the names git-receive-pack and git-upload-pack. When made
30 f2900386 2022-10-31 thomas available in a non-standard PATH directory such as ~gotdev/bin, the
31 f2900386 2022-10-31 thomas gotdev user's PATH must be set appropriately in sshd_config (see below).
32 f2900386 2022-10-31 thomas
33 f2900386 2022-10-31 thomas Tests will run the locally built gotd binary found in gotd/obj/gotd.
34 f2900386 2022-10-31 thomas The test suite creates the corresponding gotd socket in ~gotdev/gotd.sock.
35 f2900386 2022-10-31 thomas To make this work, the GOTD_UNIX_SOCKET variable must be set by sshd
36 f2900386 2022-10-31 thomas when the gotdev user logs in. The following should be added to the file
37 f2900386 2022-10-31 thomas /etc/ssh/sshd_config:
38 f2900386 2022-10-31 thomas
39 f2900386 2022-10-31 thomas Match User gotdev
40 f2900386 2022-10-31 thomas SetEnv GOTD_UNIX_SOCKET=/home/gotdev/gotd.sock
41 f2900386 2022-10-31 thomas # The following line is not needed when gotsh is used as login shell:
42 f2900386 2022-10-31 thomas SetEnv PATH=/home/gotdev/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
43 f2900386 2022-10-31 thomas DisableForwarding yes
44 f2900386 2022-10-31 thomas PermitTTY no
45 f2900386 2022-10-31 thomas
46 f2900386 2022-10-31 thomas sshd must be restarted for configuration changes to take effect:
47 f2900386 2022-10-31 thomas
48 f2900386 2022-10-31 thomas $ doas rcctl restart sshd
49 f2900386 2022-10-31 thomas
50 f2900386 2022-10-31 thomas The server test suite can now be run from the top-level directory:
51 f2900386 2022-10-31 thomas
52 f2900386 2022-10-31 thomas $ doas pkg_add git # if not already done
53 f2900386 2022-10-31 thomas $ doas make server-regress
54 f2900386 2022-10-31 thomas
55 f2900386 2022-10-31 thomas The suite must be started as root in order to be able to start and stop gotd.
56 f2900386 2022-10-31 thomas The test suite switches to non-root users as appropriate.