blob: ef9ce396d570f874504c8f44f2f347ade52c0aaa [file] [log] [blame]
Yi Huang7990f092014-04-18 04:51:58 -07001#!/usr/bin/python2
2# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
3#
Eric Newberryc22afde2018-06-19 01:28:31 -07004# Copyright (C) 2014 Arizona Board of Regents.
Yi Huang7990f092014-04-18 04:51:58 -07005# 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_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 Newberryf3248ea2016-08-07 11:48:50 -070031 3 : "ndn-traffic-server should receive exactly 1 interest",
Yi Huang7990f092014-04-18 04:51:58 -070032 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])