Blame


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