jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 1 | #!/usr/bin/python2 |
| 2 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 3 | # |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 4 | # Copyright (C) 2014-2018 Arizona Board of Regents. |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 5 | # Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu> |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 6 | # Author: Eric Newberry <enewberry@cs.arizona.edu> |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 7 | # See COPYING for copyright and distribution information. |
| 8 | # |
| 9 | |
| 10 | import os |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 11 | import unittest |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 12 | import subprocess |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 13 | |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 14 | class test_fib_matching(unittest.TestCase): |
| 15 | """Test case for testing FIB matching""" |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 16 | |
| 17 | def setUp(self): |
| 18 | print "\nTesting FIB Matching" |
| 19 | print "********************" |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 20 | os.chdir("test_fib_matching") |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 21 | |
| 22 | def tearDown(self): |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 23 | print "********************" |
| 24 | os.chdir("..") |
jeraldabraham | ae8de47 | 2014-04-19 00:34:59 -0700 | [diff] [blame] | 25 | |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 26 | def test_fib_matching(self): |
Davide Pesavento | 78fc65c | 2019-01-10 18:14:06 -0500 | [diff] [blame] | 27 | ret = subprocess.call(["./fib-matching-test.sh"]) |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 28 | print "Test script return value:", ret |
| 29 | errormsg = { |
Davide Pesavento | 78fc65c | 2019-01-10 18:14:06 -0500 | [diff] [blame] | 30 | 1 : "Traffic Client did not receive Data or received Data did not contain expected content", |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 31 | } |
Davide Pesavento | 78fc65c | 2019-01-10 18:14:06 -0500 | [diff] [blame] | 32 | if ret != 0: |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 33 | self.fail(errormsg[ret]) |