| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
from neutron.services.logapi.drivers import base as log_base_driver |
| 17 |
from neutron_fwaas.tests import base |
| 18 |
|
| 19 |
SUPPORTED_LOGGING_TYPES = ['firewall_group'] |
| 20 |
|
| 21 |
|
| 22 |
class FakeDriver(log_base_driver.DriverBase): |
| 23 |
|
| 24 |
@staticmethod |
| 25 |
def create(): |
| 26 |
return FakeDriver( |
| 27 |
name='fake_driver', |
| 28 |
vif_types=[], |
| 29 |
vnic_types=[], |
| 30 |
supported_logging_types=SUPPORTED_LOGGING_TYPES, |
| 31 |
requires_rpc=True |
| 32 |
) |
| 33 |
|
| 34 |
|
| 35 |
class TestDriverBase(base.BaseTestCase): |
| 36 |
|
| 37 |
def setUp(self): |
| 38 |
super().setUp() |
| 39 |
self.driver = FakeDriver.create() |
| 40 |
|
| 41 |
def test_is_vif_type_compatible(self): |
| 42 |
self.assertFalse( |
| 43 |
self.driver.is_vif_type_compatible([])) |
| 44 |
|
| 45 |
def test_is_vnic_compatible(self): |
| 46 |
self.assertFalse( |
| 47 |
self.driver.is_vnic_compatible([])) |
| 48 |
|
| 49 |
def test_is_logging_type_supported(self): |
| 50 |
self.assertTrue( |
| 51 |
self.driver.is_logging_type_supported('firewall_group')) |
| 52 |
self.assertFalse( |
| 53 |
self.driver.is_logging_type_supported('security_group')) |