#!/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])
