blob: f2ea543a16d51804ce3842ece69b75be4d083635 [file] [log] [blame]
jeraldabrahama3c97d62014-04-14 01:29:45 -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.
jeraldabrahama3c97d62014-04-14 01:29:45 -07005# Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
Eric Newberryc22afde2018-06-19 01:28:31 -07006# Author: Eric Newberry <enewberry@cs.arizona.edu>
jeraldabrahama3c97d62014-04-14 01:29:45 -07007# See COPYING for copyright and distribution information.
8#
9
10import os
jeraldabrahama3c97d62014-04-14 01:29:45 -070011import unittest
Eric Newberryc22afde2018-06-19 01:28:31 -070012import subprocess
jeraldabrahama3c97d62014-04-14 01:29:45 -070013
Eric Newberryc22afde2018-06-19 01:28:31 -070014class test_ndnpeekpoke(unittest.TestCase):
15 """Test case for the ndnpeek and ndnpoke applications"""
jeraldabrahama3c97d62014-04-14 01:29:45 -070016
17 def setUp(self):
Eric Newberryc22afde2018-06-19 01:28:31 -070018 print "\nTesting ndnpeek and ndnpoke"
19 print "***************************"
20 os.chdir("test_ndnpeekpoke")
jeraldabrahama3c97d62014-04-14 01:29:45 -070021
22 def tearDown(self):
Eric Newberryc22afde2018-06-19 01:28:31 -070023 print "***************************"
24 os.chdir("..")
jeraldabrahama3c97d62014-04-14 01:29:45 -070025
Eric Newberryc22afde2018-06-19 01:28:31 -070026 def test_ndnpeekpoke(self):
27 ret = subprocess.call(["./ndnpeekpoke-test.sh"], shell=True)
28 print "Test script return value:", ret
29 errormsg = {
30 1 : "ndnpeek did not receive a Data packet satisfying its Interest",
31 2 : "ndnpoke did not exit after sending a Data packet",
32 }
33 if (ret != 0):
34 self.fail(errormsg[ret])