blob: 97b7a760025ba3dc4f6ce1fe535f68770fd6341e [file] [log] [blame]
#!/usr/bin/python2
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2014-2018 Arizona Board of Regents.
# Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
# Author: Eric Newberry <enewberry@cs.arizona.edu>
# See COPYING for copyright and distribution information.
#
import os
import unittest
import subprocess
class test_ndntraffic(unittest.TestCase):
"""Test case for ndn-traffic-generator"""
def setUp(self):
print "\nTesting ndn-traffic-generator"
print "*****************************"
os.chdir("test_ndntraffic")
def tearDown(self):
print "*****************************"
os.chdir("..")
def test_ndntraffic(self):
ret = subprocess.call(["./ndntraffic-test.sh"], shell=True)
print "Test script return value:", ret
errormsg = {
1 : "ndn-traffic-client did not receive a Data satisfying its Interest",
2 : "ndn-traffic-server did not exit after sending a Data packet",
}
if (ret != 0):
self.fail(errormsg[ret])