diff options
author | Dan Radez <dradez@redhat.com> | 2016-05-31 22:58:00 -0400 |
---|---|---|
committer | Dan Radez <dradez@redhat.com> | 2016-06-07 09:26:24 -0400 |
commit | 4b7436673f7bc8422a793f94c9fed5c2fc671167 (patch) | |
tree | b35a9625290be117a09f292e54831e85ae2c46f4 /tests/python_coverage_ip_utils.py | |
parent | 5aa09cb2a69b677baf6e7614b734e155e8205a5b (diff) |
Enabling python coverage tests in build.sh
Change-Id: Iececedb03a60dd0bfc1ad6ef1275f6a0427350eb
Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'tests/python_coverage_ip_utils.py')
-rw-r--r-- | tests/python_coverage_ip_utils.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/python_coverage_ip_utils.py b/tests/python_coverage_ip_utils.py new file mode 100644 index 00000000..35280c18 --- /dev/null +++ b/tests/python_coverage_ip_utils.py @@ -0,0 +1,25 @@ +import sys +from apex import ip_utils + +iface = ip_utils.get_interface(sys.argv[1]) + +erroring_tests = ( + "ip_utils.get_interface('')", + "ip_utils.get_interface('lo', address_family=0)", + "ip_utils.get_interface('lo', address_family=6)", + "ip_utils.get_interface('lo')", + "ip_utils.get_ip_range()", + "ip_utils.get_ip_range(interface=iface)") + +for t in erroring_tests: + try: + eval(t) + except: + pass + +ip_utils.find_gateway(interface=iface) +ip_utils.get_ip(1, cidr="10.10.10.0/24") +ip_utils.get_ip(1, interface=iface) +ip_utils.get_ip_range(interface=iface, start_offset=1, end_offset=20) +ip_utils.get_ip_range(interface=iface, start_offset=1, count=10) +ip_utils.get_ip_range(interface=iface, end_offset=20, count=10) |