| #!/usr/bin/python2 |
| # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| # |
| # Copyright (C) 2014 Washington University in St. Louis |
| # Author: Hila Ben Abraham <hila@wustl.edu> |
| # See COPYING for copyright and distribution information. |
| # |
| |
| import os |
| import unittest |
| import subprocess |
| |
| class test_nfdc(unittest.TestCase): |
| """Test case for testing nfdc and nfd-status applications""" |
| |
| def setUp(self): |
| print "\nTesting nfdc and nfd-status" |
| print "*****************************" |
| os.chdir("test_nfdc") |
| os.system("mkdir -p logs") |
| |
| def tearDown(self): |
| print "********************************" |
| os.chdir("..") |
| |
| def test_nfdc_A(self): |
| print ">>> TEST CASE A: test nfdc create / add-nexthop / destroy test case <<<" |
| ret = subprocess.call(["./nfdc-test.sh A"], shell=True) |
| if ret != 0: |
| self.fail(" >> TEST CASE A FAILED") |
| else: |
| print ">> TEST CASE A PASSED SUCCESSFULLY" |
| |
| def test_nfdc_B(self): |
| print ">>> TEST CASE B: test nfdc add-nexthop / remove-nexthop test case <<<" |
| ret = subprocess.call(["./nfdc-test.sh B"], shell=True) |
| if ret != 0: |
| self.fail(" >> TEST CASE B FAILED") |
| else: |
| print ">> TEST CASE B PASSED SUCCESSFULLY" |
| |
| def test_nfdc_C(self): |
| print ">>> TEST CASE C: test nfdc register / unregister test case <<<" |
| ret = subprocess.call(["./nfdc-test.sh C"], shell=True) |
| if ret != 0: |
| self.fail(" >> TEST CASE C FAILED") |
| else: |
| print ">> TEST CASE C PASSED SUCCESSFULLY" |