summaryrefslogtreecommitdiffstats
path: root/tests/python-coverage.sh
blob: ee471446f259c1d71a5f634b16f02cf207920546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -x
all_networks="admin_network private_network storage_network external_network"

# exercise help
coverage-3.4 run ../lib/python/apex-python-utils.py -l /dev/null > /dev/null

# exercise parse-net-settings
# throw debug on the first to exercise it
coverage-3.4 run -a ../lib/python/apex-python-utils.py --debug parse-net-settings -s ../config/network/network_settings.yaml -i True -e ../build/network-environment.yaml> /dev/null

# exercise proper nic-template runs
coverage-3.4 run -a ../lib/python/apex-python-utils.py -l /dev/null nic-template -t ../config/network/network_settings.yaml -n "$all_networks" -e interface -af 4 > /dev/null
coverage-3.4 run -a ../lib/python/apex-python-utils.py -l /dev/null nic-template -t ../config/network/network_settings.yaml -n "$all_networks" -e interface -af 6 > /dev/null
coverage-3.4 run -a ../lib/python/apex-python-utils.py -l /dev/null nic-template -t ../config/network/network_settings.yaml -n "$all_networks" -e br-ex -af 4 > /dev/null
coverage-3.4 run -a ../lib/python/apex-python-utils.py -l /dev/null nic-template -t ../config/network/network_settings.yaml -n "$all_networks" -e br-ex -af 6 > /dev/null

# exercise find-ip
coverage-3.4 run -a ../lib/python/apex-python-utils.py -l /dev/null find-ip -i $(ip a | grep 2: | cut -d \  -f 2 | head -n 1 | cut -d : -f 1) > /dev/null

# generate reports
coverage-3.4 report --include '*lib/python/*' -m
coverage-3.4 html --include '*lib/python/*'