blob: e830039baef5ca16fb5ed0156a5f8d6b54c88ce4 [file] [log] [blame]
Yi Huanga349b2c2014-04-27 16:46:03 -07001#!/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
9import os
10import unittest
11import subprocess
12
13class 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 Newberryf28295a2015-07-04 17:51:19 -070025 def test_broadcast(self):
Yi Huanga349b2c2014-04-27 16:46:03 -070026 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])