blob: 79afcc448ad8dfbbac44aef927bfbada52c5429c [file] [log] [blame]
Hila Ben Abraham47583d12014-05-22 04:39:31 -05001#!/usr/bin/python2
2# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
3#
4# Copyright (C) 2014 Washington University in St. Louis
5# Author: Hila Ben Abraham <hila@wustl.edu>
6# See COPYING for copyright and distribution information.
7#
8
9import os
10import unittest
11import subprocess
12
13class test_nfdc(unittest.TestCase):
14 """Test case for testing nfdc and nfd-status applications"""
15
16 def setUp(self):
17 print "\nTesting nfdc and nfd-status"
18 print "*****************************"
19 os.chdir("test_nfdc")
20 os.system("mkdir -p logs")
21
22 def tearDown(self):
23 print "********************************"
24 os.chdir("..")
25
26 def test_nfdc_A(self):
27 print ">>> TEST CASE A: test nfdc create / add-nexthop / destroy test case <<<"
28 ret = subprocess.call(["./nfdc-test.sh A"], shell=True)
29 if ret != 0:
30 self.fail(" >> TEST CASE A FAILED")
31 else:
32 print ">> TEST CASE A PASSED SUCCESSFULLY"
33
34 def test_nfdc_B(self):
35 print ">>> TEST CASE B: test nfdc add-nexthop / remove-nexthop test case <<<"
36 ret = subprocess.call(["./nfdc-test.sh B"], shell=True)
37 if ret != 0:
38 self.fail(" >> TEST CASE B FAILED")
39 else:
40 print ">> TEST CASE B PASSED SUCCESSFULLY"
41
42 def test_nfdc_C(self):
43 print ">>> TEST CASE C: test nfdc register / unregister test case <<<"
44 ret = subprocess.call(["./nfdc-test.sh C"], shell=True)
45 if ret != 0:
46 self.fail(" >> TEST CASE C FAILED")
47 else:
48 print ">> TEST CASE C PASSED SUCCESSFULLY"