Yi Huang | 7990f09 | 2014-04-18 04:51:58 -0700 | [diff] [blame] | 1 | #!/usr/bin/python2 |
| 2 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 3 | # |
Eric Newberry | c22afde | 2018-06-19 01:28:31 -0700 | [diff] [blame] | 4 | # Copyright (C) 2014 Arizona Board of Regents. |
Yi Huang | 7990f09 | 2014-04-18 04:51:58 -0700 | [diff] [blame] | 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_cs_freshness(unittest.TestCase): |
| 14 | """Test case for testing ContentStore and Freshness""" |
| 15 | |
| 16 | def setUp(self): |
| 17 | print "\nTesting ContentStore and Freshness" |
| 18 | print "**********************************" |
| 19 | os.chdir("test_cs_freshness") |
| 20 | |
| 21 | def tearDown(self): |
| 22 | print "**********************************" |
| 23 | os.chdir("..") |
| 24 | |
| 25 | def test_cs_freshness(self): |
| 26 | ret = subprocess.call(["./cs-freshness-test.sh"], shell=True) |
| 27 | print "Test script return value:", ret |
| 28 | errormsg = { |
| 29 | 1 : "No data received for first interest", |
| 30 | 2 : "No data received for second interest", |
Eric Newberry | f3248ea | 2016-08-07 11:48:50 -0700 | [diff] [blame] | 31 | 3 : "ndn-traffic-server should receive exactly 1 interest", |
Yi Huang | 7990f09 | 2014-04-18 04:51:58 -0700 | [diff] [blame] | 32 | 4 : "Data received for third interest (expected no data received)", |
| 33 | 5 : "No data received for fourth interest", |
| 34 | } |
| 35 | if (ret != 0): |
| 36 | self.fail(errormsg[ret]) |