diff --git a/scripts/portconfig b/scripts/portconfig index fde1d436d0..17b3255ef5 100755 --- a/scripts/portconfig +++ b/scripts/portconfig @@ -63,7 +63,7 @@ PORT_STATE_SUPPORTED_SPEEDS = "supported_speeds" VALID_INTERFACE_TYPE_SET = set(['CR','CR2','CR4','SR','SR2','SR4', 'LR','LR4','KR','KR4','CAUI','GMII', 'SFI','XLAUI','KR2','CAUI4','XAUI', - 'XFI','XGMII']) + 'XFI','XGMII', 'none']) class portconfig(object): """ @@ -166,7 +166,7 @@ class portconfig(object): def set_adv_interface_types(self, port, adv_interface_types): if self.verbose: print("Setting adv_interface_types %s on port %s" % (adv_interface_types, port)) - + if adv_interface_types != 'all': config_interface_type_list = [x.strip() for x in adv_interface_types.split(',')] config_interface_types = set(config_interface_type_list) @@ -179,7 +179,7 @@ class portconfig(object): print("Valid interface types:{}".format(','.join(VALID_INTERFACE_TYPE_SET))) exit(1) self.db.mod_entry(PORT_TABLE_NAME, port, {PORT_ADV_INTERFACE_TYPES_CONFIG_FIELD_NAME: adv_interface_types}) - + def get_supported_speeds(self, port): if not self.namespace: state_db = SonicV2Connector(host="127.0.0.1") diff --git a/tests/config_an_test.py b/tests/config_an_test.py index 8b5c1178df..3f9864ec71 100644 --- a/tests/config_an_test.py +++ b/tests/config_an_test.py @@ -17,7 +17,7 @@ @pytest.fixture(scope='module') def ctx(scope='module'): db = Db() - obj = {'config_db':db.cfgdb, 'namespace': ''} + obj = {'config_db':db.cfgdb, 'namespace': ''} yield obj @@ -56,6 +56,7 @@ def test_config_adv_speeds(self, ctx): def test_config_type(self, ctx): self.basic_check("type", ["Ethernet0", "CR4"], ctx) + self.basic_check("type", ["Ethernet0", "none"], ctx) self.basic_check("type", ["Invalid", "CR4"], ctx, operator.ne) self.basic_check("type", ["Ethernet0", ""], ctx, operator.ne) result = self.basic_check("type", ["Ethernet0", "Invalid"], ctx, operator.ne)