Yi Huang | a349b2c | 2014-04-27 16:46:03 -0700 | [diff] [blame] | 1 | #!/usr/bin/python2 |
| 2 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 3 | # |
| 4 | # Copyright (C) 2014 University of Arizona |
| 5 | # Author: Yi Huang <ltr120@email.arizona.edu> |
| 6 | # See COPYING for copyright and distribution information. |
| 7 | # |
| 8 | |
| 9 | import os |
| 10 | import unittest |
| 11 | import subprocess |
| 12 | |
| 13 | class test_broadcast(unittest.TestCase): |
| 14 | """Test case for broadcast scenario""" |
| 15 | |
| 16 | def setUp(self): |
| 17 | print "\nTesting Broadcast scenario" |
| 18 | print "**************************" |
| 19 | os.chdir("test_broadcast") |
| 20 | |
| 21 | def tearDown(self): |
| 22 | print "**************************" |
| 23 | os.chdir("..") |
| 24 | |
Eric Newberry | f28295a | 2015-07-04 17:51:19 -0700 | [diff] [blame] | 25 | def test_broadcast(self): |
Yi Huang | a349b2c | 2014-04-27 16:46:03 -0700 | [diff] [blame] | 26 | ret = subprocess.call(["./broadcast-test.sh"], shell=True) |
| 27 | print "Test script return value:", ret |
| 28 | errormsg = { |
| 29 | 1 : "B did not receive at least 80 Interests.", |
| 30 | 2 : "C did not receive at least 80 Interests.", |
| 31 | 3 : "Incoming Data packets in D exceeded 120.", |
| 32 | } |
| 33 | if ret != 0: |
| 34 | self.fail(errormsg[ret]) |