Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 1 | #!/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 | |
| 9 | import os |
| 10 | import unittest |
| 11 | import subprocess |
| 12 | |
| 13 | class 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" |