| #!/usr/bin/python2 |
| # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| # |
| # Copyright (C) 2016 University of Arizona |
| # Author: Eric Newberry <enewberry@cs.arizona.edu> |
| # See COPYING for copyright and distribution information. |
| # |
| |
| import os |
| import unittest |
| import subprocess |
| |
| class test_nexthopfaceid(unittest.TestCase): |
| """Test case for NextHopFaceId field""" |
| |
| def setUp(self): |
| print "\nTesting NextHopFaceId" |
| print "*****************" |
| os.chdir("test_nexthopfaceid") |
| |
| def tearDown(self): |
| print "*****************" |
| os.chdir("..") |
| |
| def test_nexthopfaceid(self): |
| ret = subprocess.call(["./nexthopfaceid-test.sh"], shell=True) |
| print "Test script return value:", ret |
| errormsg = { |
| 1 : "Failed to create required routes", |
| 2 : "Interest ndn:/P/1 not answered with Data containing payload 'BBBBBBBB'", |
| 3 : "Interest ndn:/P/2 not answered with Data containing payload 'BBBBBBBB'", |
| 4 : "Interest ndn:/P/3 not answered with Data containing payload 'CCCCCCCC'", |
| 5 : "Interest ndn:/P/4 was not answered with a Nack and did not time out", |
| 6 : "Interest ndn:/P/5 was not answered with Data containing payload 'BBBBBBBB' and did not time out", |
| } |
| if (ret != 0): |
| self.fail(errormsg[ret]) |