summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-05-20 12:29:55 -0400
committerDan Radez <dradez@redhat.com>2016-05-28 08:42:02 -0400
commitf7032844ca19b833b5ee05a7698ace2823aa2fc2 (patch)
tree38a8f53ebd64f4ae8253f81df0f33e201b95e357 /tests
parent1695a72d5680fae3cf35d6a6dbd64de5dd08daf3 (diff)
Adding python tests and updating for conventions
- adding tests dir with a script to run python coverage - adding main funtion to python per convention - replacing underscores with dashes in CLI params per convention Change-Id: I6f64174278e2a2e93eacdb7bee09aac49ce15d29 Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/python-coverage.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/python-coverage.sh b/tests/python-coverage.sh
new file mode 100755
index 00000000..2814363e
--- /dev/null
+++ b/tests/python-coverage.sh
@@ -0,0 +1,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 -f ../config/network/network_settings.yaml -i True > /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/*'