#!/usr/bin/python2
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2014 University of Arizona
# Author: Yi Huang <ltr120@email.arizona.edu>
# See COPYING for copyright and distribution information.
#

import os
import unittest
import subprocess

class test_localhop(unittest.TestCase):
    """Test case for testing /localhop"""

    def setUp(self):
        print "\nTesting /localhop"
        print "*****************"
        os.chdir("test_localhop")

    def tearDown(self):
        print "*****************"
        os.chdir("..")

    def test_localhop(self):
        ret = subprocess.call(["./localhop-test.sh"], shell=True)
        print "Test script return value:", ret
        errormsg = {
            1 : "Invalid command line arguments",
            2 : "Failed to add nexthop of ndn:/localhop",
            3 : "Interest with name ndn:/localhop/test-localhop/1 was received on host C",
            4 : "Interest ndn:/localhop/test-localhop/1 answered with a Data.",
        }
        if (ret != 0):
            self.fail(errormsg[ret])
