File: upstream-tests

package info (click to toggle)
dropbear 2025.89-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,580 kB
  • sloc: ansic: 108,210; sh: 4,765; perl: 774; python: 763; makefile: 715; java: 177
file content (41 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -ue
PATH="/usr/bin:/bin"
export PATH

DBCLIENT=/usr/bin/dbclient
DROPBEAR=/usr/sbin/dropbear
DROPBEARCONVERT=/usr/bin/dropbearconvert
DROPBEARKEY=/usr/bin/dropbearkey

if [ ! -d "${AUTOPKGTEST_TMP-}" ]; then
    echo "ERROR: Not run by autopkgtest(1)?" >&2
    exit 1
fi

cd ./test

if [ -d ~/.ssh ]; then
    chmod -c 0700 ~/.ssh
else
    mkdir -vm0700 ~/.ssh
fi
install -m0600 /dev/null ~/.ssh/authorized_keys
rm -vf ~/.ssh/id_dropbear ~/.ssh/id_dropbear_*

# setup as in .github/workflows/build.yml
$DROPBEARKEY -t ecdsa -f ~/.ssh/id_dropbear | grep ^ecdsa >>~/.ssh/authorized_keys
$DROPBEARCONVERT dropbear openssh ~/.ssh/id_dropbear ~/.ssh/id_ecdsa
$DROPBEARKEY -t ecdsa -f ~/.ssh/id_dropbear_key2 | grep ^ecdsa | sed 's/[^ ]*$/key2 extra/' >>~/.ssh/authorized_keys
$DROPBEARKEY -t ecdsa -f ~/.ssh/id_dropbear_key3 | grep ^ecdsa | sed 's/[^ ]*$/key3%char/' >>~/.ssh/authorized_keys
$DROPBEARKEY -t ecdsa -f ~/.ssh/id_dropbear_key4 | grep ^ecdsa | sed 's/[^ ]*$/key4,char/' >>~/.ssh/authorized_keys

export DBTEST_IN_ACTION=true

# from test/Makefile.in
SSH_HOST_KEY="$AUTOPKGTEST_TMP/ssh_host_key"
$DROPBEARKEY -t ecdsa -f "$SSH_HOST_KEY"
pytest-3 --hostkey="$SSH_HOST_KEY" --dbclient="$DBCLIENT" --dropbear="$DROPBEAR" \
    --dropbearconvert="$DROPBEARCONVERT" --dropbearkey="$DROPBEARKEY" \
    .