File: test-tinysshd-makekey.sh

package info (click to toggle)
tinyssh 20250501-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,388 kB
  • sloc: ansic: 20,245; sh: 1,582; python: 1,449; makefile: 913
file content (47 lines) | stat: -rw-r--r-- 726 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

LANG=C
export LANG

LC_ALL=C
export LC_ALL

cleanup() {
  ex=$?
  rm -rf -- keydirm -m
  exit "${ex}"
}
trap "cleanup" EXIT TERM INT

echo '--- tinysshd-makekey prints help'
echo
./tinysshd-makekey 2>/dev/null
echo $?
echo

echo '--- tinysshd-makekey creates key-directory'
echo
rm -rf keydirm
./tinysshd-makekey keydirm 2>&1
ls keydirm/*.pk | sort
echo $?
echo

echo '--- tinysshd-makekey fails when directory exists'
echo
rm -rf keydirm
mkdir keydirm
./tinysshd-makekey keydirm 2>&1
echo $?

echo "--- tinysshd-makekey handles '-m' parameter (prints help)"
echo
./tinysshd-makekey -m 2>/dev/null
echo $?
echo

echo "--- tinysshd-makekey creates '-m' key-directory"
echo
./tinysshd-makekey -- -m 2>&1
echo $?
echo