1# A motd is one line of plain text, 72 characters at most (characters, not2# bytes): a longer one, an empty one or one with a control character is3# refused, saying why, and the page keeps the one it had.4. "$(dirname "$0")/../lib.sh"5user cat6git config --file "$FORGE_ROOT/.gitconfig" forge.admins cat7long=$(printf 'x%.0s' $(seq 73))8fails_with '^forge: motd: 73 characters; it can have 72 at most$' ssh_as cat motd "$long"9missing "$FORGE_ROOT/.forge/motd"10ok ssh_as cat motd "$(printf 'x%.0s' $(seq 72))"11ok ssh_as cat motd "$(printf 'é%.0s' $(seq 72))"12fails_with '72 at most' ssh_as cat motd "$(printf 'é%.0s' $(seq 73))"13has "$FORGE_ROOT/.forge/motd" "^$(printf 'é%.0s' $(seq 72))\$"14fails_with 'without control characters' forge motd "$(printf 'one\ntwo')"15fails_with 'without control characters' forge motd "$(printf 'a\tb')"16fails_with 'empty; motd --clear shows no line' ssh_as cat motd " "17has "$FORGE_ROOT/.forge/motd" "^$(printf 'é%.0s' $(seq 72))\$"