#!/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 /P/1 not answered with Data containing payload 'BBBBBBBB'",
            3 : "Interest /P/2 not answered with Data containing payload 'BBBBBBBB'",
            4 : "Interest /P/3 not answered with Data containing payload 'CCCCCCCC'",
            5 : "Interest /P/4 was not answered with a Nack and did not time out",
            6 : "Interest /P/5 was not answered with Data containing payload 'BBBBBBBB' and did not time out",
        }
        if (ret != 0):
            self.fail(errormsg[ret])
