Junxiao Shi | f9ecac2 | 2015-08-28 10:02:51 -0700 | [diff] [blame^] | 1 | #!/usr/bin/python2 |
| 2 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 3 | |
| 4 | import os |
| 5 | import unittest |
| 6 | import subprocess |
| 7 | |
| 8 | class test_multicast_strategy(unittest.TestCase): |
| 9 | """Test suite for MulticastStrategy""" |
| 10 | |
| 11 | def setUp(self): |
| 12 | print "\nTesting MulticastStrategy scenario" |
| 13 | print "**************************" |
| 14 | os.chdir("test_multicast_strategy") |
| 15 | |
| 16 | def tearDown(self): |
| 17 | print "**************************" |
| 18 | os.chdir("..") |
| 19 | |
| 20 | def test_strategy(self): |
| 21 | ret = subprocess.call(["./test.sh"], shell=True) |
| 22 | print "Test script return value:", ret |
| 23 | errormsg = { |
| 24 | 1 : "B did not receive at least 80 Interests.", |
| 25 | 2 : "C did not receive at least 80 Interests.", |
| 26 | 3 : "Incoming Data packets in D exceeded 120.", |
| 27 | } |
| 28 | if ret != 0: |
| 29 | self.fail(errormsg[ret]) |