blob: b88ed591696d987ddd892170bb57bf92c915174c [file] [log] [blame]
jeraldabraham5d4d7352014-03-28 02:49:04 -07001#!/usr/bin/python2
2# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
3#
Eric Newberryc22afde2018-06-19 01:28:31 -07004# Copyright (C) 2014-2018 Arizona Board of Regents.
jeraldabraham5d4d7352014-03-28 02:49:04 -07005# Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
Eric Newberryc22afde2018-06-19 01:28:31 -07006# Author: Eric Newberry <enewberry@cs.arizona.edu>
jeraldabraham5d4d7352014-03-28 02:49:04 -07007# See COPYING for copyright and distribution information.
8#
9
Eric Newberryc22afde2018-06-19 01:28:31 -070010import os
jeraldabraham5d4d7352014-03-28 02:49:04 -070011import unittest
Eric Newberryc22afde2018-06-19 01:28:31 -070012import subprocess
jeraldabraham5d4d7352014-03-28 02:49:04 -070013
Eric Newberryc22afde2018-06-19 01:28:31 -070014class test_ndnping(unittest.TestCase):
15 """Test case for the ndnping application"""
jeraldabraham5d4d7352014-03-28 02:49:04 -070016
17 def setUp(self):
Eric Newberry86b00b92015-06-07 15:23:51 -070018 print "\nTesting ndnping"
Eric Newberryc22afde2018-06-19 01:28:31 -070019 print "***************"
20 os.chdir("test_ndnping")
jeraldabraham5d4d7352014-03-28 02:49:04 -070021
22 def tearDown(self):
Eric Newberryc22afde2018-06-19 01:28:31 -070023 print "***************"
24 os.chdir("..")
jeraldabraham5d4d7352014-03-28 02:49:04 -070025
Eric Newberryc22afde2018-06-19 01:28:31 -070026 def test_ndnping(self):
27 ret = subprocess.call(["./ndnping-test.sh"], shell=True)
28 print "Test script return value:", ret
29 errormsg = {
30 1 : "ndnping did not receive a Data packet satisfying its Interest",
31 2 : "ndnpingserver did not exit after sending 5 Data packets",
32 3 : "ndnpingserver did not receive 5 Interests",
33 }
34 if (ret != 0):
35 self.fail(errormsg[ret])