blob: 1d7ec25d8596eb66a630ef4cb3c42f075457db57 [file] [log] [blame]
jeraldabrahamae8de472014-04-19 00:34:59 -07001#!/usr/bin/python2
2# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
3#
Eric Newberryc22afde2018-06-19 01:28:31 -07004# Copyright (C) 2014-2018 Arizona Board of Regents.
jeraldabrahamae8de472014-04-19 00:34:59 -07005# Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
Eric Newberryc22afde2018-06-19 01:28:31 -07006# Author: Eric Newberry <enewberry@cs.arizona.edu>
jeraldabrahamae8de472014-04-19 00:34:59 -07007# See COPYING for copyright and distribution information.
8#
9
10import os
jeraldabrahamae8de472014-04-19 00:34:59 -070011import unittest
Eric Newberryc22afde2018-06-19 01:28:31 -070012import subprocess
jeraldabrahamae8de472014-04-19 00:34:59 -070013
Eric Newberryc22afde2018-06-19 01:28:31 -070014class test_fib_matching(unittest.TestCase):
15 """Test case for testing FIB matching"""
jeraldabrahamae8de472014-04-19 00:34:59 -070016
17 def setUp(self):
18 print "\nTesting FIB Matching"
19 print "********************"
Eric Newberryc22afde2018-06-19 01:28:31 -070020 os.chdir("test_fib_matching")
jeraldabrahamae8de472014-04-19 00:34:59 -070021
22 def tearDown(self):
Eric Newberryc22afde2018-06-19 01:28:31 -070023 print "********************"
24 os.chdir("..")
jeraldabrahamae8de472014-04-19 00:34:59 -070025
Eric Newberryc22afde2018-06-19 01:28:31 -070026 def test_fib_matching(self):
Davide Pesavento78fc65c2019-01-10 18:14:06 -050027 ret = subprocess.call(["./fib-matching-test.sh"])
Eric Newberryc22afde2018-06-19 01:28:31 -070028 print "Test script return value:", ret
29 errormsg = {
Davide Pesavento78fc65c2019-01-10 18:14:06 -050030 1 : "Traffic Client did not receive Data or received Data did not contain expected content",
Eric Newberryc22afde2018-06-19 01:28:31 -070031 }
Davide Pesavento78fc65c2019-01-10 18:14:06 -050032 if ret != 0:
Eric Newberryc22afde2018-06-19 01:28:31 -070033 self.fail(errormsg[ret])