diff --git a/tests/ip_config_test.py b/tests/ip_config_test.py index 85a765bd65..7aed23deb9 100644 --- a/tests/ip_config_test.py +++ b/tests/ip_config_test.py @@ -177,6 +177,18 @@ def test_remove_interface_case_sensitive_mock_ipv6_w_apply_patch(self): print(result.exit_code, result.output) assert "converted ipv6 address to lowercase fc00::1~1126 with prefix /INTERFACE/Ethernet12| in value: /INTERFACE/Ethernet12|FC00::1~1126" in result.output + def test_intf_vrf_bind_unbind(self): + runner = CliRunner() + db = Db() + obj = {'config_db':db.cfgdb, 'namespace':db.db.namespace} + + result = runner.invoke(config.config.commands["interface"].commands["vrf"].commands["bind"], ["Ethernet64", "Vrf1"], obj=obj) + print(result.exit_code, result.output) + assert result.exit_code == 0 + + result = runner.invoke(config.config.commands["interface"].commands["vrf"].commands["unbind"], ["Ethernet64"], obj=obj) + print(result.exit_code, result.output) + assert result.exit_code == 0 @classmethod def teardown_class(cls): diff --git a/tests/mock_tables/dbconnector.py b/tests/mock_tables/dbconnector.py index f6db0d9794..4ccb392368 100644 --- a/tests/mock_tables/dbconnector.py +++ b/tests/mock_tables/dbconnector.py @@ -60,6 +60,8 @@ def connect_SonicV2Connector(self, db_name, retry_on=True): def _subscribe_keyspace_notification(self, db_name, client): pass +def mock_close(self, db_name): + pass def config_set(self, *args): pass @@ -201,6 +203,7 @@ def get(self, counter, name): swsssdk.interface.DBInterface._subscribe_keyspace_notification = _subscribe_keyspace_notification +swsssdk.interface.DBInterface.close = mock_close mockredis.MockRedis.config_set = config_set redis.StrictRedis = SwssSyncClient SonicV2Connector.connect = connect_SonicV2Connector