multicast-test: multicast scenario
Refs: #1390
Change-Id: I28c713e1511618c3b708342227e858cfb0dfc08e
diff --git a/test_multicast/test_multicast.py b/test_multicast/test_multicast.py
new file mode 100644
index 0000000..2b87789
--- /dev/null
+++ b/test_multicast/test_multicast.py
@@ -0,0 +1,44 @@
+#!/usr/bin/python2
+# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2014 University of Arizona
+# Author: Yi Huang <ltr120@email.arizona.edu>
+# See COPYING for copyright and distribution information.
+#
+
+import os
+import unittest
+import subprocess
+
+class test_multicast(unittest.TestCase):
+ """Test case for multicast scenario"""
+
+ errormsg = {
+ 1 : "Interest ndn:/test-mcast/B/1 is unanswered.",
+ 2 : "Interest ndn:/test-mcast/C/1 is unanswered.",
+ 3 : "Interest ndn:/test-mcast/Z/1 is unanswered.",
+ 4 : "Interest ndn:/test-mcast/Z/2 is unanswered.",
+ }
+
+ def setUp(self):
+ print "\nTesting Multicast"
+ print "*****************"
+ os.chdir("test_multicast")
+
+ def tearDown(self):
+ print "*****************"
+ os.chdir("..")
+
+ def test_udp_multicast(self):
+ print ">>> Test UDP multicast <<<"
+ ret = subprocess.call(["./multicast-test.sh udp"], shell=True)
+ print "Test script return value:", ret
+ if ret != 0:
+ self.fail(self.errormsg[ret])
+
+ def test_eth_multicast(self):
+ print ">>> Test Ethernet multicast <<<"
+ ret = subprocess.call(["./multicast-test.sh eth"], shell=True)
+ print "Test script return value:", ret
+ if ret != 0:
+ self.fail(self.errormsg[ret])