-
Notifications
You must be signed in to change notification settings - Fork 80
/
amwa-test.yml
102 lines (87 loc) · 4.83 KB
/
amwa-test.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
- name: install wsl
if: runner.os == 'Windows'
run: |
& curl -L https://aka.ms/wsl-ubuntu-1804 -o ubuntu-1804.appx
Rename-Item .\ubuntu-1804.appx .\ubuntu-1804.zip
Expand-Archive .\ubuntu-1804.zip .\ubuntu-1804
cd ubuntu-1804
.\ubuntu1804.exe install --root
- name: AMWA test suite
shell: bash
working-directory: ${{ env.RUNNER_WORKSPACE }}
run:
|
set -x
root_dir=`pwd`
# Install AMWA NMOS Testing Tool
git clone https://github.com/AMWA-TV/nmos-testing.git
cd nmos-testing
# Configure the Testing Tool so all APIs are tested with TLS
printf "from . import Config as CONFIG\nCONFIG.ENABLE_HTTPS = True\n" > nmostesting/UserConfig.py
# Download testssl
cd testssl
curl -L https://github.com/drwetter/testssl.sh/archive/3.0.2.tar.gz | tar -xvzf - --strip-components=1
cd ..
# Create output directories
mkdir results
mkdir badges
if [[ "${{ env.DOCKER_TEST_SUITE }}" == "true" ]]; then
# run test suite in amwa/nmos-testing docker container
docker pull amwa/nmos-testing
docker run -d --name "nmos_testing" --entrypoint="/usr/bin/tail" -v `pwd`/results:/home/nmos-testing/results amwa/nmos-testing -f /dev/null
run_python="docker exec -i nmos_testing python3"
elif [[ "${{ env.VAGRANT_TEST_SUITE }}" == "true" ]]; then
# run test suite in vagrant VM
cp ${{ env.GITHUB_WORKSPACE_BASH }}/.github/workflows/mac_Vagrantfile ./Vagrantfile
vagrant plugin install vagrant-scp
vagrant up
vagrant ssh -- mkdir results
run_python="vagrant ssh -- python3"
else
# run test suite directly
pip install -r requirements.txt
# Install SDPoker
npm install -g git+https://git@github.com/AMWA-TV/sdpoker.git
run_python="python"
fi
pip install -r utilities/run-test-suites/gsheetsImport/requirements.txt
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
certutil -enterprise -addstore -user root test_data\\BCP00301\\ca\\certs\\ca.cert.pem
certutil -enterprise -addstore -user ca test_data\\BCP00301\\ca\\intermediate\\certs\\intermediate.cert.pem
certutil -importpfx -enterprise test_data\\BCP00301\\ca\\intermediate\\certs\\ecdsa.api.testsuite.nmos.tv.cert.chain.pfx
certutil -importpfx -enterprise test_data\\BCP00301\\ca\\intermediate\\certs\\rsa.api.testsuite.nmos.tv.cert.chain.pfx
# RSA
netsh http add sslcert ipport=0.0.0.0:1080 certhash=021d50df2177c07095485184206ee2297e50b65c appid="{00000000-0000-0000-0000-000000000000}"
# ECDSA
#netsh http add sslcert ipport=0.0.0.0:1080 certhash=875eca592c49120254b32bb8bed90ac3679015a5 appid="{00000000-0000-0000-0000-000000000000}"
# RSA
netsh http add sslcert ipport=0.0.0.0:8088 certhash=021d50df2177c07095485184206ee2297e50b65c appid="{00000000-0000-0000-0000-000000000000}"
# ECDSA
#netsh http add sslcert ipport=0.0.0.0:8088 certhash=875eca592c49120254b32bb8bed90ac3679015a5 appid="{00000000-0000-0000-0000-000000000000}"
fi
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
# force DNS lookups to IPv4 as mDNS lookups on macos seem to wait for the IPv6 lookup to timeout before returning the IPv4 result
mv nmostesting/GenericTest.py nmostesting/GenericTest.py.old
printf 'import socket\nold_getaddrinfo = socket.getaddrinfo\ndef new_getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):\n return old_getaddrinfo(host, port, socket.AF_INET, type, proto, flags)\nsocket.getaddrinfo = new_getaddrinfo\n' > nmostesting/GenericTest.py
cat nmostesting/GenericTest.py.old >> nmostesting/GenericTest.py
fi
if [[ "${{ runner.os }}" == "Linux" && "${{ matrix.install_mdns }}" == "false" ]]; then
# nmos-cpp-node doesn't currently support advertising hostnames to Avahi
avahi-publish -a -R nmos-api.local ${{ env.HOST_IP_ADDRESS }} &
fi
if [[ "${{ runner.os }}" == "Linux" && "${{ matrix.use_conan }}" == "false" ]]; then
# ubuntu 14 non-conan build uses boost 1.54.0 which doesn't support disabling TLS 1.1
mkdir -p ${{ env.GITHUB_WORKSPACE_BASH }}/Sandbox/nmos-testing-options/
echo "--ignore test_01" > ${{ env.GITHUB_WORKSPACE_BASH }}/Sandbox/nmos-testing-options/BCP-003-01.txt
echo "1" > ${{ env.GITHUB_WORKSPACE_BASH }}/Sandbox/nmos-testing-options/BCP-003-01_max_disabled.txt
fi
${{ env.GITHUB_WORKSPACE_BASH }}/Sandbox/run_nmos_testing.sh "$run_python" ${root_dir}/build/nmos-cpp-node ${root_dir}/build/nmos-cpp-registry results badges ${{ env.HOST_IP_ADDRESS }} "${{ env.GITHUB_COMMIT }}-${{ env.BUILD_NAME }}-"
if [[ "${{ env.DOCKER_TEST_SUITE }}" == "true" ]]; then
docker stop nmos_testing
docker rm nmos_testing
fi
if [[ "${{ env.VAGRANT_TEST_SUITE }}" == "true" ]]; then
vagrant scp :results/* results/
vagrant destroy -f
fi
exit 0