blob: ed54fe94fa7088a83d0bf13e67d6144739b9cf15 [file] [log] [blame]
jeraldabrahamb2a26552014-04-16 21:08:09 -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.
jeraldabrahamb2a26552014-04-16 21:08:09 -07005# Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
Eric Newberryc22afde2018-06-19 01:28:31 -07006# Author: Eric Newberry <enewberry@cs.arizona.edu>
jeraldabrahamb2a26552014-04-16 21:08:09 -07007# See COPYING for copyright and distribution information.
8#
9
10import os
jeraldabrahamb2a26552014-04-16 21:08:09 -070011import unittest
Eric Newberryc22afde2018-06-19 01:28:31 -070012import subprocess
jeraldabrahamb2a26552014-04-16 21:08:09 -070013
Eric Newberryc22afde2018-06-19 01:28:31 -070014class test_interest_aggregation(unittest.TestCase):
15 """Test case for testing Interest aggregation"""
jeraldabrahamb2a26552014-04-16 21:08:09 -070016
17 def setUp(self):
18 print "\nTesting Interest Aggregation"
19 print "****************************"
Eric Newberryc22afde2018-06-19 01:28:31 -070020 os.chdir("test_interest_aggregation")
jeraldabrahamb2a26552014-04-16 21:08:09 -070021
22 def tearDown(self):
Eric Newberryc22afde2018-06-19 01:28:31 -070023 print "****************************"
24 os.chdir("..")
jeraldabrahamb2a26552014-04-16 21:08:09 -070025
26 def test_aggregation(self):
Eric Newberryc22afde2018-06-19 01:28:31 -070027 ret = subprocess.call(["./interest-aggregation-test.sh"], shell=True)
28 print "Test script return value:", ret
29 errormsg = {
30 1 : "Peek Client did not exit",
31 2 : "Peek Client did not Data packet or received Data packet containing incorrect content",
32 3 : "Traffic Server did not received correct count of Interests",
33 }
34 if (ret != 0):
35 self.fail(errormsg[ret])