#!/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_localhost_scope(self):
        ret = subprocess.call(["./localhop-test.sh"], shell=True)
        print "Test script return value:", ret
        errormsg = {
            1 : "Invalid command line arguments",
            2 : "Fail to add nexthop of ndn:/localhop",
            3 : "Interest with name ndn:/localhop/test-localhop/A/1 was received on host C",
            4 : "ndn:/localhop/test-localhop/A/1 is answered.",
            5 : "ndn:/localhop/test-localhop/B/1 is not correctly answered.",
        }
        if (ret != 0):
            self.fail(errormsg[ret])
