blob: 7b56df94b682732c1d10b86cdc921572fe84346e [file] [log] [blame]
Eric Newberrya9907782016-11-30 13:37:14 -07001#!/usr/bin/python2
2# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
3#
4# Copyright (C) 2016 University of Arizona
5# Author: Eric Newberry <enewberry@cs.arizona.edu>
6# See COPYING for copyright and distribution information.
7#
8
9import os
10import unittest
11import subprocess
12
13class test_nexthopfaceid(unittest.TestCase):
14 """Test case for NextHopFaceId field"""
15
16 def setUp(self):
17 print "\nTesting NextHopFaceId"
18 print "*****************"
19 os.chdir("test_nexthopfaceid")
20
21 def tearDown(self):
22 print "*****************"
23 os.chdir("..")
24
25 def test_nexthopfaceid(self):
26 ret = subprocess.call(["./nexthopfaceid-test.sh"], shell=True)
27 print "Test script return value:", ret
28 errormsg = {
29 1 : "Failed to create required routes",
Eric Newberry7745c1a2017-04-20 00:23:05 -070030 2 : "Interest /P/1 not answered with Data containing payload 'BBBBBBBB'",
31 3 : "Interest /P/2 not answered with Data containing payload 'BBBBBBBB'",
32 4 : "Interest /P/3 not answered with Data containing payload 'CCCCCCCC'",
33 5 : "Interest /P/4 was not answered with a Nack and did not time out",
34 6 : "Interest /P/5 was not answered with Data containing payload 'BBBBBBBB' and did not time out",
Eric Newberrya9907782016-11-30 13:37:14 -070035 }
36 if (ret != 0):
37 self.fail(errormsg[ret])