blob: a2789c8bdbe9d15f2c56d42fa8271e6d630480c9 [file] [log] [blame]
#!/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])