#!/usr/bin/env python3

import unittest

from framework import VppTestCase, VppTestRunner


class TestFIB(VppTestCase):
    """ FIB Test Case """

    @classmethod
    def setUpClass(cls):
        super(TestFIB, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(TestFIB, cls).tearDownClass()

    def test_fib(self):
        """ FIB Unit Tests """
        error = self.vapi.cli("test fib")

        # shameless test of CLIs to bump lcov results...
        # no i mean to ensure they don't crash
        self.logger.info(self.vapi.cli("sh fib source"))
        self.logger.info(self.vapi.cli("sh fib source prio"))
        self.logger.info(self.vapi.cli("sh fib memory"))
        self.logger.info(self.vapi.cli("sh fib entry"))
        self.logger.info(self.vapi.cli("sh fib entry 0"))
        self.logger.info(self.vapi.cli("sh fib entry 10000"))
        self.logger.info(self.vapi.cli("sh fib entry-delegate"))
        self.logger.info(self.vapi.cli("sh fib paths"))
        self.logger.info(self.vapi.cli("sh fib paths 0"))
        self.logger.info(self.vapi.cli("sh fib paths 10000"))
        self.logger.info(self.vapi.cli("sh fib path-list"))
        self.logger.info(self.vapi.cli("sh fib path-list 0"))
        self.logger.info(self.vapi.cli("sh fib path-list 10000"))
        self.logger.info(self.vapi.cli("sh fib walk"))
        self.logger.info(self.vapi.cli("sh fib uRPF"))

        if error:
            self.logger.critical(error)
        self.assertNotIn("Failed", error)

if __name__ == '__main__':
    unittest.main(testRunner=VppTestRunner)
