File: install-linux_test_display_help_message.sh

package info (click to toggle)
opkssh 0.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,428 kB
  • sloc: sh: 1,981; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
export SHUNIT_RUNNING=1


# Source install-linux.sh
# shellcheck disable=SC1091
source "$(dirname "${BASH_SOURCE[0]}")/../install-linux.sh"

# Running tests

test_display_help_message() {
    output=$(display_help_message)
    expected_output=$(cat <<EOF
Usage: $0 [OPTIONS]

Options:
  --no-home-policy         Disables configuration that allows opkssh see policy files in user's home directory
                           (/home/<username>/auth_id). Greatly simplifies install, try this if you are having install failures.
  --no-sshd-restart        Do not restart SSH after installation
  --overwrite-config       Overwrite the currently active sshd configuration for AuthorizedKeysCommand and AuthorizedKeysCommandUser
                           directives. This may be necessary if the script cannot create a configuration with higher priority in /etc/ssh/sshd_config.d/.
  --install-from=FILEPATH  Install using a local file
  --install-version=VER    Install a specific version from GitHub
  --help                   Display this help message
EOF
)
    assertEquals "Expected display_help_message to match expected output exactly" "$expected_output" "$output"
}

# shellcheck disable=SC1091
source shunit2