#!/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"