File: test.sh

package info (click to toggle)
shadowsocks-libev 3.3.5%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,932 kB
  • sloc: ansic: 13,971; sh: 1,339; makefile: 200; python: 111
file content (44 lines) | stat: -rwxr-xr-x 1,082 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

result=0

function run_test {
    printf '\e[0;36m'
    echo "running test: $command $@"
    printf '\e[0m'

    $command "$@"
    status=$?
    if [ $status -ne 0 ]; then
        printf '\e[0;31m'
        echo "test failed: $command $@"
        printf '\e[0m'
        echo
        result=1
    else
        printf '\e[0;32m'
        echo OK
        printf '\e[0m'
        echo
    fi
    return 0
}

[ -d src -a -x src/ss-local ] &&
    BIN="--bin src/"

if [ "$http_proxy" ]; then
    echo "SKIP: shadowsocks-libev does not support an upstream HTTP proxy"
    exit 0
fi

run_test python3 tests/test.py $BIN -c tests/aes.json
run_test python3 tests/test.py $BIN -c tests/aes-gcm.json
run_test python3 tests/test.py $BIN -c tests/aes-ctr.json
run_test python3 tests/test.py $BIN -c tests/rc4-md5.json
run_test python3 tests/test.py $BIN -c tests/salsa20.json
run_test python3 tests/test.py $BIN -c tests/chacha20.json
run_test python3 tests/test.py $BIN -c tests/chacha20-ietf.json
run_test python3 tests/test.py $BIN -c tests/chacha20-ietf-poly1305.json

exit $result