Blame


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