#!/usr/bin/env python

import unittest

from framework import VppTestCase, VppTestRunner


class TestCrypto(VppTestCase):
    """ Crypto Test Case """

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

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

    def test_crypto(self):
        """ Crypto Unit Tests """
        error = self.vapi.cli("test crypto")

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

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