diff --git a/src/bash/Files/unittest/Makefile b/src/bash/Files/unittest/Makefile index 8eec2b07ab..c260e4f4b6 100644 --- a/src/bash/Files/unittest/Makefile +++ b/src/bash/Files/unittest/Makefile @@ -7,7 +7,7 @@ all: gcc plugin_test.c $(IFLAGS) $(CFLAGS) -o plugin_test.o gcc mock_helper.c $(IFLAGS) $(CFLAGS) -o mock_helper.o gcc ../plugin.c $(IFLAGS) $(CFLAGS) $(MFLAG) -o plugin.o - gcc plugin_test.o mock_helper.o plugin.o -o plugin_test -lc -lcunit + gcc plugin_test.o mock_helper.o plugin.o -o plugin_test -lc -lcunit test: # run unit test, if UT failed, build will break diff --git a/src/bash/Files/unittest/mock_helper.c b/src/bash/Files/unittest/mock_helper.c index dfbf3a6444..4b8d62bbfe 100644 --- a/src/bash/Files/unittest/mock_helper.c +++ b/src/bash/Files/unittest/mock_helper.c @@ -106,7 +106,7 @@ void *dlopen(const char *filename, int flags) mock_dlerror = mock_dlerror_failed; return NULL; } - + // all other case return mock handle mock_dlerror = NULL; return mock_plugin_handle; @@ -133,21 +133,21 @@ void *dlsym(void *restrict handle, const char *restrict symbol) mock_dlerror = mock_dlerror_failed; return NULL; } - + case TEST_SCEANRIO_PLUGIN_UNINIT_NOT_EXIT: if (strcmp(symbol, "plugin_uninit") == 0) { mock_dlerror = mock_dlerror_failed; return NULL; } - + case TEST_SCEANRIO_PLUGIN_INIT_NOT_EXIT: if (strcmp(symbol, "plugin_init") == 0) { mock_dlerror = mock_dlerror_failed; return NULL; } - + case TEST_SCEANRIO_PLUGIN_INIT_SUCCESS: if (strcmp(symbol, "plugin_init") == 0) { @@ -165,7 +165,7 @@ void *dlsym(void *restrict handle, const char *restrict symbol) return mock_on_shell_execve; } } - + return mock_plugin_default_function_handle; } diff --git a/src/bash/Files/unittest/plugin_test.c b/src/bash/Files/unittest/plugin_test.c index 83439f93a0..704c812add 100644 --- a/src/bash/Files/unittest/plugin_test.c +++ b/src/bash/Files/unittest/plugin_test.c @@ -16,7 +16,7 @@ int start_up() { /* Test plugin not exist scenario */ void testcase_try_load_plugin_by_path_not_exist() { set_test_scenario(TEST_SCEANRIO_PLUGIN_NOT_EXIT); - + try_load_plugin_by_path("./testplugin.so"); CU_ASSERT_STRING_EQUAL(mock_itrace_message_buffer, "Plugin: can't load plugin ./testplugin.so: MOCK error\n"); @@ -25,7 +25,7 @@ void testcase_try_load_plugin_by_path_not_exist() { /* Test plugin exist but not support shell_execve scenario */ void testcase_try_load_plugin_by_path_execve_not_exist() { set_test_scenario(TEST_SCEANRIO_PLUGIN_EXECVE_NOT_EXIT); - + try_load_plugin_by_path("./testplugin.so"); CU_ASSERT_STRING_EQUAL(mock_itrace_message_buffer, "Plugin: can't find on_shell_execve function ./testplugin.so: MOCK error\n"); @@ -34,18 +34,18 @@ void testcase_try_load_plugin_by_path_execve_not_exist() { /* Test plugin exist but not support plugin_uninit scenario */ void testcase_try_load_plugin_by_path_plugin_uninit_not_exist() { set_test_scenario(TEST_SCEANRIO_PLUGIN_UNINIT_NOT_EXIT); - + try_load_plugin_by_path("./testplugin.so"); - + CU_ASSERT_STRING_EQUAL(mock_itrace_message_buffer, "Plugin: can't find plugin_uninit function ./testplugin.so: MOCK error\n"); } /* Test plugin exist but not support plugin_init scenario */ void testcase_try_load_plugin_by_path_plugin_init_not_exist() { set_test_scenario(TEST_SCEANRIO_PLUGIN_INIT_NOT_EXIT); - + try_load_plugin_by_path("./testplugin.so"); - + CU_ASSERT_STRING_EQUAL(mock_itrace_message_buffer, "Plugin: can't find plugin_init function ./testplugin.so: MOCK error\n"); } @@ -54,22 +54,22 @@ void testcase_try_load_plugin_by_path_plugin_init_success() { set_test_scenario(TEST_SCEANRIO_PLUGIN_INIT_SUCCESS); set_memory_allocate_count(0); set_plugin_init_status(PLUGIN_NOT_INITIALIZE); - + try_load_plugin_by_path("./testplugin.so"); - + // check plugin init success CU_ASSERT_EQUAL(get_plugin_init_status(), PLUGIN_INITIALIZED); - + // check API success CU_ASSERT_STRING_EQUAL(mock_itrace_message_buffer, "Plugin: plugin ./testplugin.so loaded\n"); - + // check global plugin list not empty and contains correct pluginglobal_plugin_list CU_ASSERT_NOT_EQUAL(global_plugin_list, NULL); CU_ASSERT_EQUAL(global_plugin_list->plugin_handle, TEST_MOCK_PLUGIN_HANDLE); // release all loaded plugins free_loaded_plugins(); - + // check if memory fully released CU_ASSERT_EQUAL(global_plugin_list, NULL); CU_ASSERT_EQUAL(get_memory_allocate_count(), 0); @@ -80,16 +80,16 @@ void testcase_release_loaded_plugin() { set_test_scenario(TEST_SCEANRIO_PLUGIN_INIT_SUCCESS); set_memory_allocate_count(0); try_load_plugin_by_path("./testplugin.so"); - + // check memory allocated CU_ASSERT_NOT_EQUAL(get_memory_allocate_count(), 0); - + // check plugin init success CU_ASSERT_EQUAL(get_plugin_init_status(), PLUGIN_INITIALIZED); - + // release all loaded plugins free_loaded_plugins(); - + // check if memory fully released CU_ASSERT_EQUAL(global_plugin_list, NULL); CU_ASSERT_EQUAL(get_memory_allocate_count(), 0); @@ -100,22 +100,22 @@ void testcase_load_plugin_by_config() { set_test_scenario(TEST_SCEANRIO_PLUGIN_INIT_SUCCESS); set_memory_allocate_count(0); load_plugin_by_config("./bash_plugins.conf"); - + // check memory allocated CU_ASSERT_NOT_EQUAL(get_memory_allocate_count(), 0); - + // check plugin init success CU_ASSERT_EQUAL(get_plugin_init_status(), PLUGIN_INITIALIZED); // check target plugin in config file loaded CU_ASSERT_STRING_EQUAL(mock_itrace_message_buffer, "Plugin: plugin /usr/lib/bash-plugins/another_test_plugin.so loaded\n"); - + // check there are 2 plugins loaded CU_ASSERT_EQUAL(get_memory_allocate_count(), 2); - + // release all loaded plugins free_loaded_plugins(); - + // check if memory fully released CU_ASSERT_EQUAL(global_plugin_list, NULL); printf("Count %d\n", get_memory_allocate_count()); @@ -127,16 +127,16 @@ void testcase_invoke_plugin_on_shell_execve() { set_test_scenario(TEST_SCEANRIO_PLUGIN_INIT_SUCCESS); set_memory_allocate_count(0); load_plugin_by_config("./bash_plugins.conf"); - + // invoke plugin method char** pargv = (char**)0x5234; invoke_plugin_on_shell_execve("testuser", "testcommand", pargv); printf(mock_onshell_execve_command_buffer); CU_ASSERT_STRING_EQUAL(mock_onshell_execve_command_buffer, "on_shell_execve: user: testuser, level: 1, command: testcommand, argv: 0x5234\n"); - + // release all loaded plugins free_loaded_plugins(); - + // check if memory fully released CU_ASSERT_EQUAL(global_plugin_list, NULL); printf("Count %d\n", get_memory_allocate_count()); @@ -198,7 +198,7 @@ int main(void) { CU_cleanup_registry(); return CU_get_error(); } - + if (CU_get_error() != CUE_SUCCESS) { fprintf(stderr, "Error adding test: (%d)%s\n", CU_get_error(), CU_get_error_msg()); } @@ -211,7 +211,7 @@ int main(void) { } CU_basic_show_failures(CU_get_failure_list()); - + // use failed UT count as return value return CU_get_number_of_failure_records(); } diff --git a/src/ethtool/Makefile b/src/ethtool/Makefile index d122b6f4c8..6190a58aa3 100644 --- a/src/ethtool/Makefile +++ b/src/ethtool/Makefile @@ -19,7 +19,7 @@ else ifeq ($(CROSS_BUILD_ENVIRON), y) else dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) endif - + popd mv $(DERIVED_TARGET) $* $(DEST)/ diff --git a/src/gobgp/debian/control b/src/gobgp/debian/control index 7d534852a3..e45ed43a9c 100644 --- a/src/gobgp/debian/control +++ b/src/gobgp/debian/control @@ -6,7 +6,7 @@ Standards-Version: 3.9.3 Section: net Package: gobgp -Priority: extra +Priority: extra Architecture: amd64 -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Description: gobgp BGP daemon diff --git a/src/gobgp/debian/gobgp.init.d b/src/gobgp/debian/gobgp.init.d index 189fdad056..474475d484 100644 --- a/src/gobgp/debian/gobgp.init.d +++ b/src/gobgp/debian/gobgp.init.d @@ -31,7 +31,7 @@ case "$1" in echo /etc/gobgp/gobgpd.conf not found fi ;; - + stop) kill -9 $(echo /var/run/gobgpd.pid) ;; diff --git a/src/gobgp/debian/rules b/src/gobgp/debian/rules index b6bee2ee4e..3995a26d7f 100755 --- a/src/gobgp/debian/rules +++ b/src/gobgp/debian/rules @@ -1,3 +1,3 @@ -#!/usr/bin/make -f -%: +#!/usr/bin/make -f +%: dh $@ --with systemd diff --git a/src/iccpd/include/msg_format.h b/src/iccpd/include/msg_format.h index b10b2db161..6c8e74e90b 100644 --- a/src/iccpd/include/msg_format.h +++ b/src/iccpd/include/msg_format.h @@ -487,17 +487,17 @@ enum MCLAG_DOMAIN_CFG_OP_TYPE { MCLAG_CFG_OPER_ADD = 1, //Add domain MCLAG_CFG_OPER_DEL = 2, //Delete domain MCLAG_CFG_OPER_UPDATE = 3, //update domain - MCLAG_CFG_OPER_ATTR_DEL = 4 //Attribute del + MCLAG_CFG_OPER_ATTR_DEL = 4 //Attribute del }; enum MCLAG_DOMAIN_CFG_ATTR_BMAP_FLAGS { - MCLAG_CFG_ATTR_NONE = 0x0, - MCLAG_CFG_ATTR_SRC_ADDR = 0x1, - MCLAG_CFG_ATTR_PEER_ADDR = 0x2, - MCLAG_CFG_ATTR_PEER_LINK = 0x4, - MCLAG_CFG_ATTR_KEEPALIVE_INTERVAL = 0x8, - MCLAG_CFG_ATTR_SESSION_TIMEOUT = 0x10 + MCLAG_CFG_ATTR_NONE = 0x0, + MCLAG_CFG_ATTR_SRC_ADDR = 0x1, + MCLAG_CFG_ATTR_PEER_ADDR = 0x2, + MCLAG_CFG_ATTR_PEER_LINK = 0x4, + MCLAG_CFG_ATTR_KEEPALIVE_INTERVAL = 0x8, + MCLAG_CFG_ATTR_SESSION_TIMEOUT = 0x10 }; struct IccpSyncdHDr diff --git a/src/iccpd/include/system.h b/src/iccpd/include/system.h index c188d1a6d2..5e050af99f 100644 --- a/src/iccpd/include/system.h +++ b/src/iccpd/include/system.h @@ -270,9 +270,9 @@ typedef struct system_dbg_counter_info uint32_t peer_link_down_counter; uint32_t warmboot_counter; uint32_t rx_peer_invalid_msg_counter; //counts partial msgs received as sending end is not sending partial msgs - uint32_t rx_peer_hdr_read_sock_err_counter; //counts socket header read errors + uint32_t rx_peer_hdr_read_sock_err_counter; //counts socket header read errors uint32_t rx_peer_hdr_read_sock_zero_len_counter; //counts socket header read zero length - uint32_t rx_peer_tlv_read_sock_err_counter; //counts socket data/tlv read errors + uint32_t rx_peer_tlv_read_sock_err_counter; //counts socket data/tlv read errors uint32_t rx_peer_tlv_read_sock_zero_len_counter; //counts socket data/tlv read zero length uint32_t socket_close_err_counter; //socket close failure uint32_t socket_cleanup_counter; //socket cleanup outside of session down diff --git a/src/iccpd/src/iccp_cmd_show.c b/src/iccpd/src/iccp_cmd_show.c index 984984434d..babb8f07b1 100644 --- a/src/iccpd/src/iccp_cmd_show.c +++ b/src/iccpd/src/iccp_cmd_show.c @@ -103,7 +103,7 @@ int iccp_mclag_config_dump(char * *buf, int *num, int mclag_id) state_info.keepalive_time = csm->keepalive_time; state_info.session_timeout = csm->session_timeout; - + logconfig = logger_get_configuration(); memcpy(state_info.loglevel, log_level_to_string(logconfig->log_level), strlen( log_level_to_string(logconfig->log_level))); diff --git a/src/iccpd/src/iccp_csm.c b/src/iccpd/src/iccp_csm.c index 1560b41f3d..8dcae3992e 100644 --- a/src/iccpd/src/iccp_csm.c +++ b/src/iccpd/src/iccp_csm.c @@ -122,7 +122,7 @@ void iccp_csm_init(struct CSM* csm) memset(csm->peer_ip, 0, INET_ADDRSTRLEN); memset(csm->iccp_info.sender_name, 0, MAX_L_ICC_SENDER_NAME); csm->iccp_info.icc_rg_id = 0x0; - csm->keepalive_time = CONNECT_INTERVAL_SEC; + csm->keepalive_time = CONNECT_INTERVAL_SEC; csm->session_timeout = HEARTBEAT_TIMEOUT_SEC; } @@ -217,7 +217,7 @@ void iccp_csm_finalize(struct CSM* csm) LIST_REMOVE(cif,csm_next); free(cif); } - + /* Release iccp_csm */ pthread_mutex_destroy(&(csm->conn_mutex)); iccp_csm_msg_list_finalize(csm); diff --git a/src/iccpd/src/iccp_ifm.c b/src/iccpd/src/iccp_ifm.c index 5d6d0540e3..876547249a 100644 --- a/src/iccpd/src/iccp_ifm.c +++ b/src/iccpd/src/iccp_ifm.c @@ -515,7 +515,7 @@ static void do_ndisc_learn_from_kernel(struct ndmsg *ndm, struct rtattr *tb[], i } } } - } + } } if (!(csm && lif_po)) { @@ -1204,7 +1204,7 @@ void do_ndisc_update_from_reply_packet(unsigned int ifindex, char *ipv6_addr, ui ndisc_info->op_type = ndisc_msg->op_type; sprintf(ndisc_info->ifname, "%s", ndisc_msg->ifname); memcpy(ndisc_info->mac_addr, ndisc_msg->mac_addr, ETHER_ADDR_LEN); - ICCPD_LOG_DEBUG(__FUNCTION__, "Update ND for %s", show_ipv6_str((char *)ndisc_msg->ipv6_addr)); + ICCPD_LOG_DEBUG(__FUNCTION__, "Update ND for %s", show_ipv6_str((char *)ndisc_msg->ipv6_addr)); } break; } @@ -1330,7 +1330,7 @@ int add_pending_vlan_mbr(struct PendingVlanMbrIf* mbr_if, uint16_t vid) struct VLAN_ID *vlan = NULL; struct VLAN_ID vlan_key = { 0 }; char vlan_name[16] = ""; - if (!mbr_if) + if (!mbr_if) { return MCLAG_ERROR; } @@ -1340,7 +1340,7 @@ int add_pending_vlan_mbr(struct PendingVlanMbrIf* mbr_if, uint16_t vid) vlan_key.vid = vid; vlan = RB_FIND(vlan_rb_tree, &(mbr_if->vlan_tree), &vlan_key); - + if (!vlan) { vlan = (struct VLAN_ID*)malloc(sizeof(struct VLAN_ID)); @@ -1364,7 +1364,7 @@ void del_pending_vlan_mbr(struct PendingVlanMbrIf* mbr_if, uint16_t vid) { struct VLAN_ID *vlan = NULL; struct VLAN_ID vlan_key = { 0 }; - if (!mbr_if) + if (!mbr_if) { return; } @@ -1372,7 +1372,7 @@ void del_pending_vlan_mbr(struct PendingVlanMbrIf* mbr_if, uint16_t vid) vlan_key.vid = vid; vlan = RB_FIND(vlan_rb_tree, &(mbr_if->vlan_tree), &vlan_key); - + if (vlan != NULL) { VLAN_RB_REMOVE(vlan_rb_tree, &(mbr_if->vlan_tree), vlan); @@ -1398,7 +1398,7 @@ void del_all_pending_vlan_mbrs(struct PendingVlanMbrIf* lif) return; } -//update vlan membership for a given interface; this function can be called +//update vlan membership for a given interface; this function can be called //whenever vlan membership is received from mclagsyncd and local interface is not found void update_pending_vlan_mbr(char *mbr_if_name, unsigned int vlan_id, int add_flag) { @@ -1414,10 +1414,10 @@ void update_pending_vlan_mbr(char *mbr_if_name, unsigned int vlan_id, int add_f ICCPD_LOG_DEBUG(__FUNCTION__, "update pending vlan:%d member for if:%s event:%s \n", vlan_id, mbr_if_name, add_flag ? "add":"delete"); mbr_if = find_pending_vlan_mbr_if(sys, mbr_if_name); - //if mbr_if not found create + //if mbr_if not found create if (!mbr_if) { - if (!add_flag) + if (!add_flag) { return; } @@ -1432,12 +1432,12 @@ void update_pending_vlan_mbr(char *mbr_if_name, unsigned int vlan_id, int add_f RB_INIT(vlan_rb_tree, &mbr_if->vlan_tree); LIST_INSERT_HEAD(&(sys->pending_vlan_mbr_if_list), mbr_if, if_next); } - if (add_flag) + if (add_flag) { //add to pending vlan member if add_pending_vlan_mbr(mbr_if, vlan_id); - } - else + } + else { //delete from pending vlan member if del_pending_vlan_mbr(mbr_if, vlan_id); @@ -1445,13 +1445,13 @@ void update_pending_vlan_mbr(char *mbr_if_name, unsigned int vlan_id, int add_f } -//move pending vlan membership from pending member interface to system lif +//move pending vlan membership from pending member interface to system lif void move_pending_vlan_mbr_to_lif(struct System *sys, struct LocalInterface* lif) { struct PendingVlanMbrIf *mbr_if; struct VLAN_ID* vlan = NULL; struct VLAN_ID* vlan_temp = NULL; - if (!sys || !lif) + if (!sys || !lif) { return; } @@ -1504,7 +1504,7 @@ void vlan_mbrship_change_handler(unsigned int vlan_id, char *mbr_if_name, int ad if (!lif) { ICCPD_LOG_NOTICE(__FUNCTION__, "Rx vlan:%d mbr if:%s event %s; No MCLAG If", vlan_id, mbr_if_name, add_flag ? "add":"delete"); - update_pending_vlan_mbr(mbr_if_name, vlan_id, add_flag); + update_pending_vlan_mbr(mbr_if_name, vlan_id, add_flag); return; } ICCPD_LOG_DEBUG(__FUNCTION__, "Rx vlan:%d mbr if:%s event %s", vlan_id, mbr_if_name, add_flag ? "add":"delete"); diff --git a/src/iccpd/src/iccp_netlink.c b/src/iccpd/src/iccp_netlink.c index 6464a20989..a3e2702956 100644 --- a/src/iccpd/src/iccp_netlink.c +++ b/src/iccpd/src/iccp_netlink.c @@ -573,7 +573,7 @@ static int iccp_netlink_set_portchannel_iff_flag( char* saveptr; struct LocalInterface* member_if; char *tmp_member_buf = NULL; - + if (!lif_po) return MCLAG_ERROR; @@ -649,7 +649,7 @@ void update_if_ipmac_on_standby(struct LocalInterface* lif_po, int dir) return; pif = peer_if_find_by_name(csm, lif_po->name); - + /*Set new mac only if remote MLAG interface also exists */ if (pif && (memcmp( lif_po->mac_addr, MLACP(csm).remote_system.system_id, ETHER_ADDR_LEN) != 0)) { @@ -659,7 +659,7 @@ void update_if_ipmac_on_standby(struct LocalInterface* lif_po, int dir) ICCPD_LOG_NOTICE(__FUNCTION__, "%s Change the system-id of %s from [%02X:%02X:%02X:%02X:%02X:%02X] to [%02X:%02X:%02X:%02X:%02X:%02X], dir %d", (csm->role_type == STP_ROLE_STANDBY) ? "Standby" : "Active", - lif_po->name, lif_po->mac_addr[0], lif_po->mac_addr[1], lif_po->mac_addr[2], + lif_po->name, lif_po->mac_addr[0], lif_po->mac_addr[1], lif_po->mac_addr[2], lif_po->mac_addr[3], lif_po->mac_addr[4], lif_po->mac_addr[5], MLACP(csm).remote_system.system_id[0], MLACP(csm).remote_system.system_id[1], MLACP(csm).remote_system.system_id[2], MLACP(csm).remote_system.system_id[3], @@ -776,9 +776,9 @@ void recover_if_ipmac_on_standby(struct LocalInterface *lif_po, int dir) iccp_netlink_if_shutdown_set(lif_po->ifindex); iccp_netlink_if_startup_set(lif_po->ifindex); /* Set the interface MAC address back to its local address so that subsequent vlan member - * add processing (local_if_add_vlan) will not use the old MAC address for + * add processing (local_if_add_vlan) will not use the old MAC address for * update_if_ipmac_on_standby() - */ + */ memcpy(lif_po->mac_addr, MLACP(csm).system_id, ETHER_ADDR_LEN); } @@ -986,14 +986,14 @@ void iccp_event_handler_obj_input_newlink(struct nl_object *obj, void *arg) if ((strncmp(ifname, if_whitelist[i].ifname, strlen(if_whitelist[i].ifname)) == 0)) { - + /*if the iface exists, but the ifindex changed, then delete old * interface and add the new interface * possible scenario is due to many kernel events, there is * possiblility of losing if deletion event and just * getting a add of same iface with new ifindex. * to address this possibility if add event of interface is - * received with new ifindex different from old interace, + * received with new ifindex different from old interace, * then delete the old ifindex interface and add new if with new * ifindex */ @@ -2174,7 +2174,7 @@ int iccp_handle_events(struct System * sys) int i; int err; int max_nfds; - struct mLACPHeartbeatTLV dummy_tlv; + struct mLACPHeartbeatTLV dummy_tlv; max_nfds = ICCP_EVENT_FDS_COUNT + sys->readfd_count; @@ -2230,7 +2230,7 @@ int iccp_handle_events(struct System * sys) { if (scheduler_csm_read_callback(csm) != MCLAG_ERROR) { - //consider any msg from peer as heartbeat update, this will be in scenarios of scaled msg sync b/w peers + //consider any msg from peer as heartbeat update, this will be in scenarios of scaled msg sync b/w peers mlacp_fsm_update_heartbeat(csm, &dummy_tlv); } break; @@ -2334,7 +2334,7 @@ void update_vlan_if_mac_on_standby(struct LocalInterface* lif_vlan, int dir) ICCPD_LOG_DEBUG(__FUNCTION__, "%s Change the system-id of %s from [%02X:%02X:%02X:%02X:%02X:%02X] to [%02X:%02X:%02X:%02X:%02X:%02X], dir %d", (csm->role_type == STP_ROLE_STANDBY) ? "Standby" : "Active", - lif_vlan->name, lif_vlan->mac_addr[0], lif_vlan->mac_addr[1], lif_vlan->mac_addr[2], + lif_vlan->name, lif_vlan->mac_addr[0], lif_vlan->mac_addr[1], lif_vlan->mac_addr[2], lif_vlan->mac_addr[3], lif_vlan->mac_addr[4], lif_vlan->mac_addr[5], system_mac[0], system_mac[1], system_mac[2], system_mac[3], system_mac[4], system_mac[5], dir); diff --git a/src/iccpd/src/mlacp_fsm.c b/src/iccpd/src/mlacp_fsm.c index b643697754..a8e32e6c26 100644 --- a/src/iccpd/src/mlacp_fsm.c +++ b/src/iccpd/src/mlacp_fsm.c @@ -867,7 +867,7 @@ void mlacp_fsm_transit(struct CSM* csm) if (csm->warm_reboot_disconn_time != 0) { - /*After peer warm reboot and disconnect, if peer connection is not establised more than 90s, + /*After peer warm reboot and disconnect, if peer connection is not establised more than 90s, recover peer disconnection to normal process, such as add peer age flag for MACs etc*/ if ((time(NULL) - csm->warm_reboot_disconn_time) >= WARM_REBOOT_TIMEOUT) { @@ -1017,7 +1017,7 @@ void mlacp_sync_mac(struct CSM* csm) RB_FOREACH (mac_msg, mac_rb_tree, &MLACP(csm).mac_rb) { /*If MAC with local age flag, dont sync to peer. Such MAC only exist when peer is warm-reboot. - If peer is warm-reboot, peer age flag is not set when connection is lost. + If peer is warm-reboot, peer age flag is not set when connection is lost. When MAC is aged in local switch, this MAC is not deleted for no peer age flag. After warm-reboot, this MAC must be learnt by peer and sync to local switch*/ if (!(mac_msg->age_flag & MAC_AGE_LOCAL)) diff --git a/src/iccpd/src/mlacp_link_handler.c b/src/iccpd/src/mlacp_link_handler.c index c0e561988e..cf3e99bd0e 100644 --- a/src/iccpd/src/mlacp_link_handler.c +++ b/src/iccpd/src/mlacp_link_handler.c @@ -559,7 +559,7 @@ void set_peerlink_mlag_port_learn(struct LocalInterface *lif, int enable) return; } -/* Send request to Mclagsyncd to enable or disable traffic on +/* Send request to Mclagsyncd to enable or disable traffic on * MLAG interface */ static int mlacp_link_set_traffic_dist_mode( @@ -1939,7 +1939,7 @@ static void update_l2_mac_state(struct CSM *csm, } // Dont set local learn unless learned from MCLAGSYNCD. -// When interface is UP MAC addresses gets re-learned +// When interface is UP MAC addresses gets re-learned #if 0 /*this may be peerlink is not configured and portchannel is down*/ /*when this portchannel up, add the mac back to ASIC*/ @@ -2130,7 +2130,7 @@ void mlacp_mlag_intf_detach_handler(struct CSM* csm, struct LocalInterface* loca ICCPD_LOG_DEBUG("ICCP_FSM", "MLAG_IF(%s) %s Detach: state %s, po_active %d, traffic_dis %d, sync_state %s", local_if_is_l3_mode(local_if) ? "L3" : "L2", - local_if->name, + local_if->name, (local_if->state == PORT_STATE_UP) ? "up" : "down", local_if->po_active, local_if->is_traffic_disable, mlacp_state(csm)); @@ -2147,14 +2147,14 @@ void mlacp_mlag_intf_detach_handler(struct CSM* csm, struct LocalInterface* loca else update_l3_po_state(csm, local_if, 0); - + //If the traffic is disabled due to interface flap; while coming up, if //mclag interface is removed before receiving ack, it will be in //blocked state; to address timing scenario unblock Tx/Rx of //traffic on this portchannel if the traffic is blocked on this port if(local_if->is_traffic_disable) { - if ( !csm->peer_link_if || !(strcmp(csm->peer_link_if->name, local_if->name)) ) + if ( !csm->peer_link_if || !(strcmp(csm->peer_link_if->name, local_if->name)) ) { mlacp_link_enable_traffic_distribution(local_if); } @@ -2178,7 +2178,7 @@ void mlacp_peer_mlag_intf_delete_handler(struct CSM* csm, char *mlag_if_name) ICCPD_LOG_DEBUG("ICCP_FSM", "MLAG_IF(%s) %s Peer IF Delete Event: state %s, po_active %d, traffic_dis %d, sync_state %s", local_if_is_l3_mode(local_if) ? "L3" : "L2", - local_if->name, + local_if->name, (local_if->state == PORT_STATE_UP) ? "up" : "down", local_if->po_active, local_if->is_traffic_disable, mlacp_state(csm)); @@ -3084,11 +3084,11 @@ int iccp_mclagsyncd_mclag_domain_cfg_handler(struct System *sys, char *msg_buf) struct mclag_domain_cfg_info* cfg_info; int count, i = 0; char system_mac_str[ETHER_ADDR_STR_LEN]; - + msg_hdr = (struct IccpSyncdHDr *)msg_buf; count = (msg_hdr->len- sizeof(struct IccpSyncdHDr ))/sizeof(struct mclag_domain_cfg_info); - ICCPD_LOG_DEBUG(__FUNCTION__, "recv domain cfg msg ; count %d ",count); + ICCPD_LOG_DEBUG(__FUNCTION__, "recv domain cfg msg ; count %d ",count); for (i = 0; i < count; i++) { @@ -3096,7 +3096,7 @@ int iccp_mclagsyncd_mclag_domain_cfg_handler(struct System *sys, char *msg_buf) memcpy(system_mac_str, mac_addr_to_str(cfg_info->system_mac), sizeof(system_mac_str)); - ICCPD_LOG_NOTICE(__FUNCTION__, "recv cfg msg ; domain_id:%d op_type:%d attr_bmap:0x%x local_ip:%s peer_ip:%s peer_ifname:%s system_mac:%s session_timeout:%d keepalive_time:%d",cfg_info->domain_id, cfg_info->op_type, cfg_info->attr_bmap, cfg_info->local_ip, cfg_info->peer_ip, cfg_info->peer_ifname, system_mac_str, cfg_info->session_timeout, cfg_info->keepalive_time); + ICCPD_LOG_NOTICE(__FUNCTION__, "recv cfg msg ; domain_id:%d op_type:%d attr_bmap:0x%x local_ip:%s peer_ip:%s peer_ifname:%s system_mac:%s session_timeout:%d keepalive_time:%d",cfg_info->domain_id, cfg_info->op_type, cfg_info->attr_bmap, cfg_info->local_ip, cfg_info->peer_ip, cfg_info->peer_ifname, system_mac_str, cfg_info->session_timeout, cfg_info->keepalive_time); if (cfg_info->op_type == MCLAG_CFG_OPER_ADD || cfg_info->op_type == MCLAG_CFG_OPER_UPDATE) //mclag domain create/update { @@ -3153,7 +3153,7 @@ int iccp_mclagsyncd_mclag_domain_cfg_handler(struct System *sys, char *msg_buf) if(cfg_info->attr_bmap & MCLAG_CFG_ATTR_PEER_LINK) { unset_peer_link(cfg_info->domain_id); - } + } else if(cfg_info->attr_bmap & MCLAG_CFG_ATTR_KEEPALIVE_INTERVAL) { //reset to default @@ -3183,16 +3183,16 @@ int iccp_mclagsyncd_mclag_iface_cfg_handler(struct System *sys, char *msg_buf) struct IccpSyncdHDr * msg_hdr; struct mclag_iface_cfg_info* cfg_info; int count, i = 0; - + msg_hdr = (struct IccpSyncdHDr *)msg_buf; count = (msg_hdr->len- sizeof(struct IccpSyncdHDr))/sizeof(struct mclag_iface_cfg_info); - ICCPD_LOG_DEBUG(__FUNCTION__, "recv domain cfg msg ; count %d ",count); + ICCPD_LOG_DEBUG(__FUNCTION__, "recv domain cfg msg ; count %d ",count); for (i =0; idomain_id, cfg_info->op_type, cfg_info->mclag_iface); + ICCPD_LOG_NOTICE(__FUNCTION__, "recv mclag iface cfg msg ; domain_id:%d op_type:%d mclag_iface:%s ",cfg_info->domain_id, cfg_info->op_type, cfg_info->mclag_iface); if (cfg_info->op_type == MCLAG_CFG_OPER_ADD) { @@ -3236,7 +3236,7 @@ int iccp_mclagsyncd_mclag_unique_ip_cfg_handler(struct System *sys, char *msg_bu } } - if (!unq_ip_if) + if (!unq_ip_if) { unq_ip_if = (struct Unq_ip_If_info *)malloc(sizeof(struct Unq_ip_If_info)); if (!unq_ip_if) @@ -3359,7 +3359,7 @@ int iccp_receive_fdb_handler_from_syncd(struct System *sys, char *msg_buf) msg_hdr = (struct IccpSyncdHDr *)msg_buf; count = (msg_hdr->len- sizeof(struct IccpSyncdHDr))/sizeof(struct mclag_fdb_info); - ICCPD_LOG_DEBUG(__FUNCTION__, "recv msg fdb count %d ",count ); + ICCPD_LOG_DEBUG(__FUNCTION__, "recv msg fdb count %d ",count ); for (i =0; itype); pos += msg_hdr->len; @@ -3612,10 +3612,10 @@ int iccp_mclagsyncd_msg_handler(struct System *sys) { int rc; - /* Update traffic distribution only if local interface is still bound to MLAG */ + /* Update traffic distribution only if local interface is still bound to MLAG */ if (!lif || !lif->csm) return; - + /* Expecting ACK from peer only after reaching EXCHANGE state */ if (MLACP(lif->csm).current_state != MLACP_STATE_EXCHANGE) return; @@ -4197,7 +4197,7 @@ int mclagd_ctl_interactive_process(int client_fd) case INFO_TYPE_DUMP_MAC: mclagd_ctl_handle_dump_mac(client_fd, req->mclag_id); - break; + break; case INFO_TYPE_DUMP_LOCAL_PORTLIST: mclagd_ctl_handle_dump_local_portlist(client_fd, req->mclag_id); @@ -4218,7 +4218,7 @@ int mclagd_ctl_interactive_process(int client_fd) case INFO_TYPE_CONFIG_LOGLEVEL: mclagd_ctl_handle_config_loglevel(client_fd, req->mclag_id); break; - + default: return MCLAG_ERROR; } diff --git a/src/iccpd/src/port.c b/src/iccpd/src/port.c index 7e233a7c20..7e0463ebd7 100644 --- a/src/iccpd/src/port.c +++ b/src/iccpd/src/port.c @@ -579,7 +579,7 @@ int local_if_add_vlan(struct LocalInterface* local_if, uint16_t vid) vlan_key.vid = vid; vlan = RB_FIND(vlan_rb_tree, &(local_if->vlan_tree), &vlan_key); - + if (!vlan) { vlan = (struct VLAN_ID*)malloc(sizeof(struct VLAN_ID)); @@ -609,7 +609,7 @@ int local_if_add_vlan(struct LocalInterface* local_if, uint16_t vid) update_vlan_if_mac_on_standby(vlan->vlan_itf, 1); } } - else + else { ICCPD_LOG_WARN(__FUNCTION__, "skip VLAN MAC update for vlan %d interface %s ", vid, local_if->name); } @@ -625,7 +625,7 @@ void local_if_del_vlan(struct LocalInterface* local_if, uint16_t vid) vlan_key.vid = vid; vlan = RB_FIND(vlan_rb_tree, &(local_if->vlan_tree), &vlan_key); - + if (vlan != NULL) { VLAN_RB_REMOVE(vlan_rb_tree, &(local_if->vlan_tree), vlan); @@ -666,7 +666,7 @@ int peer_if_add_vlan(struct PeerInterface* peer_if, uint16_t vlan_id) vlan_key.vid = vlan_id; peer_vlan = RB_FIND(vlan_rb_tree, &(peer_if->vlan_tree), &vlan_key); - + if (!peer_vlan) { peer_vlan = (struct VLAN_ID*)malloc(sizeof(struct VLAN_ID)); diff --git a/src/iccpd/src/scheduler.c b/src/iccpd/src/scheduler.c index fb2c7f5937..731f457964 100644 --- a/src/iccpd/src/scheduler.c +++ b/src/iccpd/src/scheduler.c @@ -48,7 +48,7 @@ * ******************************************************/ -//this needs to be fine tuned +//this needs to be fine tuned #define PEER_SOCK_SND_BUF_LEN (6 * 1024 * 1024) #define PEER_SOCK_RCV_BUF_LEN (6 * 1024 * 1024) #define RECV_RETRY_INTERVAL_USEC 100000 @@ -388,7 +388,7 @@ void scheduler_init() //no need to create iccpd config from startup file, it will be done through //cli iccp_config_from_file(sys->config_file_path); - + /*Get kernel ARP info */ iccp_neigh_get_init(); diff --git a/src/libnl3/debian/changelog b/src/libnl3/debian/changelog index c51ae11217..58b6851057 100644 --- a/src/libnl3/debian/changelog +++ b/src/libnl3/debian/changelog @@ -822,7 +822,7 @@ libnl3 (3.0-2) unstable; urgency=low libnl3 (3.0-1.1) unstable; urgency=low * Non-maintainer upload with agreement from Heiko Stuebner - * Add libnl3-udeb package with seperate build for + * Add libnl3-udeb package with seperate build for debian-installer (Closes: #635962). -- Gaudenz Steinlin Fri, 29 Jul 2011 23:25:48 +0200 @@ -876,7 +876,7 @@ libnl (1.1-5) unstable; urgency=low libnl (1.1-4) unstable; urgency=low - * debian/control + * debian/control - Add ${misc:Depends} to all binary packages. - Bump Build-Depends on debhelper to (>= 7). * debian/compat @@ -958,7 +958,7 @@ libnl (1.0~pre6-5) unstable; urgency=low - Add XS-Vcs-* fields. - Replace Build-Depends: tetex-bin with texlive-latex-base. teTeX is now gone, superseded by texlive. - - Add Build-Depends: graphviz, gs-gpl | gs-esp. + - Add Build-Depends: graphviz, gs-gpl | gs-esp. The "dot" program is needed for generating the diagram image and "gs" for the ps to png conversion. @@ -967,7 +967,7 @@ libnl (1.0~pre6-5) unstable; urgency=low libnl (1.0~pre6-4) unstable; urgency=medium * Autobuilders do not distinguish between build-arch and build-indep, they - simply run build. So we have to move doxygen and tetex-bin from + simply run build. So we have to move doxygen and tetex-bin from Build-Depends-Indep to Build-Depends. Closes: #408719 * Urgency medium, as it fixes a FTBFS bug. @@ -989,7 +989,7 @@ libnl (1.0~pre6-3) unstable; urgency=low libnl (1.0~pre6-2) unstable; urgency=low - * Update maintainer email address to biebl@debian.org. + * Update maintainer email address to biebl@debian.org. -- Michael Biebl Thu, 19 Oct 2006 20:16:09 +0200 @@ -997,7 +997,7 @@ libnl (1.0~pre6-1) unstable; urgency=low * New upstream release. * Removed 20-autoconf-dirs.patch, merged upstream. - * Updated debian/copyright, libnl is now licensed under the LGPL 2.1. + * Updated debian/copyright, libnl is now licensed under the LGPL 2.1. * Updated debian/watch. -- Michael Biebl Fri, 18 Aug 2006 00:40:34 +0200 @@ -1015,7 +1015,7 @@ libnl (1.0~pre6~svn30-1) unstable; urgency=low libnl (0.99+1.0.svn21-4) unstable; urgency=low - * Do not create bogus /usr/lib/pkg-config directory. Closes: #364601 + * Do not create bogus /usr/lib/pkg-config directory. Closes: #364601 -- Michael Biebl Mon, 24 Apr 2006 15:40:23 +0200 diff --git a/src/libnl3/debian/control b/src/libnl3/debian/control index ba5062607b..68063806a0 100644 --- a/src/libnl3/debian/control +++ b/src/libnl3/debian/control @@ -15,7 +15,7 @@ Section: libs Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Multi-Arch: same -Description: library for dealing with netlink sockets +Description: library for dealing with netlink sockets This is a library for applications dealing with netlink sockets. The library provides an interface for raw netlink messaging and various netlink family specific interfaces. @@ -133,8 +133,8 @@ Section: libdevel Depends: libnl-3-dev (= ${binary:Version}), libnl-genl-3-dev (= ${binary:Version}), libnl-nf-3-dev (= ${binary:Version}), libnl-route-3-dev (= ${binary:Version}), libnl-cli-3-200 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: development library and headers for libnl-cli-3 - This is a library for applications dealing with netlink sockets. - The library provides an interface for raw netlink messaging and various + This is a library for applications dealing with netlink sockets. + The library provides an interface for raw netlink messaging and various netlink family specific interfaces. . This package contains the files that are needed to build applications using @@ -225,7 +225,7 @@ Architecture: linux-any XC-Package-Type: udeb Section: debian-installer Depends: ${misc:Depends}, ${shlibs:Depends} -Description: library for dealing with netlink sockets +Description: library for dealing with netlink sockets This is a library for applications dealing with netlink sockets. The library provides an interface for raw netlink messaging and various netlink family specific interfaces. diff --git a/src/libnl3/debian/copyright b/src/libnl3/debian/copyright index 07457363bf..a654869d80 100644 --- a/src/libnl3/debian/copyright +++ b/src/libnl3/debian/copyright @@ -9,9 +9,9 @@ Upstream Author: Thomas Graf -Copyright: +Copyright: -lib/route/addr.c +lib/route/addr.c include/netlink/route/addr.h Copyright (c) Thomas Graf @@ -90,7 +90,7 @@ src/cls/basic.c src/nl-addr-delete.c: This library is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published + it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. This program is distributed in the hope that it will be useful, but @@ -147,7 +147,7 @@ lib/xfrm/lifetime.c All other *.c and *.h files not mentioned above: This library is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation version 2.1 of the License. This program is distributed in the hope that it will be useful, but @@ -156,5 +156,5 @@ All other *.c and *.h files not mentioned above: General Public License for more details. On Debian GNU/Linux systems, the complete text of the GNU Lesser General -Public License can be found in /usr/share/common-licenses/LGPL-2.1 +Public License can be found in /usr/share/common-licenses/LGPL-2.1 diff --git a/src/libyang/Makefile b/src/libyang/Makefile index 53c4d59d1e..da09a8424a 100644 --- a/src/libyang/Makefile +++ b/src/libyang/Makefile @@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Apply patch series stg init stg import -s ../patch/series - + ifeq ($(CROSS_BUILD_ENVIRON), y) dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) else diff --git a/src/ntp/Makefile b/src/ntp/Makefile index c0103ba781..f449d2125b 100644 --- a/src/ntp/Makefile +++ b/src/ntp/Makefile @@ -39,7 +39,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : sed -i 's/\/usr\/sbin\/ntpd {/\/usr\/sbin\/ntpd flags=(attach_disconnected complain) {/' debian/apparmor-profile ifeq ($(CROSS_BUILD_ENVIRON), y) - sed -i 's/dh_auto_configure \--/dh_auto_configure -- --with-yielding-select=yes /g' debian/rules + sed -i 's/dh_auto_configure \--/dh_auto_configure -- --with-yielding-select=yes /g' debian/rules echo ". $(CONFIG_SITE)" > fix.ntp.cross-config.$(CONFIGURED_ARCH) echo "unset with_openssl_libdir" >> fix.ntp.cross-config.$(CONFIGURED_ARCH) echo "unset with_openssl_incdir" >> fix.ntp.cross-config.$(CONFIGURED_ARCH) diff --git a/src/radius/nss/debian/rules b/src/radius/nss/debian/rules index cc56dd92cf..c608a55921 100755 --- a/src/radius/nss/debian/rules +++ b/src/radius/nss/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f %: - dh $@ + dh $@ override_dh_fixperms: dh_fixperms diff --git a/src/radius/nss/libnss-radius/Makefile b/src/radius/nss/libnss-radius/Makefile index a6d070d08d..6883d1deee 100644 --- a/src/radius/nss/libnss-radius/Makefile +++ b/src/radius/nss/libnss-radius/Makefile @@ -37,7 +37,7 @@ test: test_nss_radius.c $(LIBNSS_SOURCE) $(CACHE_SOURCE) \ $(LIBNSS_SOURCE) test_nss_radius.c $(CC) $(CFLAGS) $(LDFLAGS) -g -DTEST_RADIUS_NSS -o test_cache_radius \ $(CACHE_SOURCE) - + .PHONY: all clean distclean test diff --git a/src/radius/pam/debian/changelog b/src/radius/pam/debian/changelog index 541c3efde8..80dde71d73 100644 --- a/src/radius/pam/debian/changelog +++ b/src/radius/pam/debian/changelog @@ -11,7 +11,7 @@ libpam-radius-auth (1.4.0-3~deb10u1) buster; urgency=medium * Rebuild for buster. * Revert packaging changes: - Lower Standards-Version to 4.2.0 - - Lower Debhelper compat level to 11 + - Lower Debhelper compat level to 11 -- Salvatore Bonaccorso Sat, 11 Jul 2020 21:24:48 +0200 diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py b/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py index 68c48b044f..76dcee1c17 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py @@ -51,7 +51,7 @@ class AdvertiseRouteMgr(Manager): APP which config the data should be responsible to pass a valid IP prefix """ return True - + log_err("BGPAdvertiseRouteMgr:: Invalid data %s for advertised route %s" % (data, key)) return False diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py b/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py index 4bdd488fc2..ee33d36a2a 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py @@ -267,8 +267,8 @@ class BGPAllowListMgr(Manager): log_debug("BGPAllowListMgr::__update_prefix_list. af='%s' prefix-list name=%s" % (af, pl_name)) ''' Need to check exist and equality of the allowed prefix list. - A. If exist and equal, no operation needed. - B. If exist but not equal, first delete then add prefix based on the data from condig db and constants. + A. If exist and equal, no operation needed. + B. If exist but not equal, first delete then add prefix based on the data from condig db and constants. C. If non-exist, directly add prefix based on the data from condig db and constants. ''' exist, correct = self.__is_prefix_list_valid(af, pl_name, allow_list, constant_list) @@ -308,7 +308,7 @@ class BGPAllowListMgr(Manager): 2001:cdba:0000:0000:0000:0000:3257:9652 2001:cdba:0:0:0:0:3257:9652 2001:cdba::3257:9652 - after normalize, all would be normalized to + after normalize, all would be normalized to 2001:cdba::3257:9652 ''' normalize_list = [] @@ -347,7 +347,7 @@ class BGPAllowListMgr(Manager): config_list.append(rule) # Return double Ture, when running configuraiton is identical with config db + constants. - return True, expect_set == set(self.__normalize_ipnetwork(af, config_list)) + return True, expect_set == set(self.__normalize_ipnetwork(af, config_list)) def __update_community(self, community_name, community_value): """ diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index 4cd2437137..e88dc60b8c 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -128,7 +128,7 @@ class BGPPeerMgrBase(Manager): if self.check_deployment_id: deps.append(("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/deployment_id")) - if self.peer_type == 'internal': + if self.peer_type == 'internal': deps.append(("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback4096")) super(BGPPeerMgrBase, self).__init__( diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index 982ba3afca..4f7c28cbd5 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -47,7 +47,7 @@ class DeviceGlobalCfgMgr(Manager): self.cfg_mgr.update() self.isolate_unisolate_device(data["tsa_enabled"]) self.directory.put(self.db_name, self.table_name, "tsa_enabled", data["tsa_enabled"]) - return True + return True return False def del_handler(self, key): @@ -62,7 +62,7 @@ class DeviceGlobalCfgMgr(Manager): if tsa_status == "true": cmds = cfg.replace("#012", "\n").split("\n") log_notice("DeviceGlobalCfgMgr:: Device is isolated. Applying TSA route-maps") - cmd = self.get_ts_routemaps(cmds, self.tsa_template) + cmd = self.get_ts_routemaps(cmds, self.tsa_template) return cmd def isolate_unisolate_device(self, tsa_status): @@ -88,22 +88,22 @@ class DeviceGlobalCfgMgr(Manager): def __generate_routemaps_from_template(self, route_map_names, template): cmd = "\n" for rm in sorted(route_map_names): - # For packet-based chassis, the bgp session between the linecards are also considered internal sessions + # For packet-based chassis, the bgp session between the linecards are also considered internal sessions # While isolating a single linecard, these sessions should not be skipped if "_INTERNAL_" in rm or "VOQ_" in rm: - continue + continue if "V4" in rm: ipv="V4" ; ipp="ip" elif "V6" in rm: - ipv="V6" ; ipp="ipv6" + ipv="V6" ; ipp="ipv6" else: - continue + continue cmd += template.render(route_map_name=rm,ip_version=ipv,ip_protocol=ipp, constants=self.constants) cmd += "\n" return cmd def __extract_out_route_map_names(self, cmds): - route_map_names = set() + route_map_names = set() out_route_map = re.compile(r'^\s*neighbor \S+ route-map (\S+) out$') for line in cmds: result = out_route_map.match(line) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py b/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py index fae7a5365a..9593913b7e 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py @@ -21,7 +21,7 @@ class StaticRouteMgr(Manager): db, table, ) - + self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"),], self.on_bgp_asn_change) self.static_routes = {} self.vrf_pending_redistribution = set() @@ -41,7 +41,7 @@ class StaticRouteMgr(Manager): intf_list = arg_list(data['ifname']) if 'ifname' in data else None dist_list = arg_list(data['distance']) if 'distance' in data else None nh_vrf_list = arg_list(data['nexthop-vrf']) if 'nexthop-vrf' in data else None - route_tag = self.ROUTE_ADVERTISE_DISABLE_TAG if 'advertise' in data and data['advertise'] == "false" else self.ROUTE_ADVERTISE_ENABLE_TAG + route_tag = self.ROUTE_ADVERTISE_DISABLE_TAG if 'advertise' in data and data['advertise'] == "false" else self.ROUTE_ADVERTISE_ENABLE_TAG try: ip_nh_set = IpNextHopSet(is_ipv6, bkh_list, nh_list, intf_list, dist_list, nh_vrf_list) diff --git a/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_all.json b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_all.json index 355e4b6b58..ac2d533314 100644 --- a/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_all.json +++ b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_all.json @@ -1,6 +1,6 @@ { "CONFIG_DB__DEVICE_METADATA": { - "localhost": { + "localhost": { "type": "LeafRouter" } }, diff --git a/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_chassis.json b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_chassis.json index a09a731b1e..5c40842cca 100644 --- a/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_chassis.json +++ b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_chassis.json @@ -1,6 +1,6 @@ { "CONFIG_DB__DEVICE_METADATA": { - "localhost": { + "localhost": { "type": "SpineRouter" } } diff --git a/src/sonic-bgpcfgd/tests/test_allow_list.py b/src/sonic-bgpcfgd/tests/test_allow_list.py index c5bec039c3..84e3dde6e6 100644 --- a/src/sonic-bgpcfgd/tests/test_allow_list.py +++ b/src/sonic-bgpcfgd/tests/test_allow_list.py @@ -204,9 +204,9 @@ def test_set_handler_with_community_and_deny_action(): 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', - 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', - ' set community no-export additive', - 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', ' set community no-export additive' ] ) @@ -325,9 +325,9 @@ def test_set_handler_no_community_with_deny_action(): ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', - 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', - ' set community no-export additive', - 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', ' set community no-export additive' ] ) diff --git a/src/sonic-bgpcfgd/tests/test_bgp.py b/src/sonic-bgpcfgd/tests/test_bgp.py index d332dc4348..bd6f34c4b6 100644 --- a/src/sonic-bgpcfgd/tests/test_bgp.py +++ b/src/sonic-bgpcfgd/tests/test_bgp.py @@ -17,7 +17,7 @@ def load_constant_files(): for path in paths: constant_files += [os.path.abspath(os.path.join(path, name)) for name in os.listdir(path) if os.path.isfile(os.path.join(path, name)) and name.startswith("constants")] - + return constant_files @@ -55,7 +55,7 @@ def constructor(constants_path): return m @patch('bgpcfgd.managers_bgp.log_info') -def test_update_peer_up(mocked_log_info): +def test_update_peer_up(mocked_log_info): for constant in load_constant_files(): m = constructor(constant) res = m.set_handler("10.10.10.1", {"admin_status": "up"}) @@ -63,7 +63,7 @@ def test_update_peer_up(mocked_log_info): mocked_log_info.assert_called_with("Peer 'default|10.10.10.1' admin state is set to 'up'") @patch('bgpcfgd.managers_bgp.log_info') -def test_update_peer_up_ipv6(mocked_log_info): +def test_update_peer_up_ipv6(mocked_log_info): for constant in load_constant_files(): m = constructor(constant) res = m.set_handler("fc00:10::1", {"admin_status": "up"}) @@ -71,7 +71,7 @@ def test_update_peer_up_ipv6(mocked_log_info): mocked_log_info.assert_called_with("Peer 'default|fc00:10::1' admin state is set to 'up'") @patch('bgpcfgd.managers_bgp.log_info') -def test_update_peer_down(mocked_log_info): +def test_update_peer_down(mocked_log_info): for constant in load_constant_files(): m = constructor(constant) res = m.set_handler("10.10.10.1", {"admin_status": "down"}) diff --git a/src/sonic-bgpcfgd/tests/test_config.py b/src/sonic-bgpcfgd/tests/test_config.py index c8bd0c9ca2..bd0d51f88e 100644 --- a/src/sonic-bgpcfgd/tests/test_config.py +++ b/src/sonic-bgpcfgd/tests/test_config.py @@ -126,9 +126,9 @@ def test_to_canonical_empty(): ! ! ! - + ! - + """ to_canonical_common(raw_config, []) @@ -139,11 +139,11 @@ router bgp 12345 bgp router-id 1020 address-family ipv4 neighbor PEER_V4 peer-group - neighbor PEER_V4 route-map A10 in + neighbor PEER_V4 route-map A10 in exit-address-family address-family ipv6 neighbor PEER_V6 peer-group - neighbor PEER_V6 route-map A20 in + neighbor PEER_V6 route-map A20 in exit-address-family route-map A10 permit 10 ! diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index ad79158aaa..2a912c3d05 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -37,7 +37,7 @@ def constructor(): cfg_mgr.update = update cfg_mgr.push = push cfg_mgr.get_config = get_config - + constants = deepcopy(global_constants) common_objs = { 'directory': Directory(), @@ -46,12 +46,12 @@ def constructor(): 'constants': constants } mgr = bgpcfgd.managers_device_global.DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME) - cfg_mgr.update() + cfg_mgr.update() return mgr @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device(mocked_log_info): +def test_isolate_device(mocked_log_info): m = constructor() res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" @@ -59,7 +59,7 @@ def test_isolate_device(mocked_log_info): assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device(mocked_log_info): +def test_unisolate_device(mocked_log_info): m = constructor() res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" @@ -75,8 +75,8 @@ def test_check_state_and_get_tsa_routemaps(): m.set_handler("STATE", {"tsa_enabled": "false"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == "" - -def test_get_tsa_routemaps(): + +def test_get_tsa_routemaps(): m = constructor() assert m.get_ts_routemaps([], m.tsa_template) == "" @@ -84,7 +84,7 @@ def test_get_tsa_routemaps(): expected_res = get_string_from_file("/result_isolate.conf") assert res == expected_res -def test_get_tsb_routemaps(): +def test_get_tsb_routemaps(): m = constructor() assert m.get_ts_routemaps([], m.tsb_template) == "" @@ -100,13 +100,13 @@ def get_string_from_file(filename): return cfg @patch('bgpcfgd.managers_device_global.log_err') -def test_set_handler_failure_case(mocked_log_info): +def test_set_handler_failure_case(mocked_log_info): m = constructor() res = m.set_handler("STATE", {}) assert res == False, "Expect False return value for invalid data passed to set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr:: data is None") -def test_del_handler(): +def test_del_handler(): m = constructor() res = m.del_handler("STATE") assert res, "Expect True return value for del_handler" diff --git a/src/sonic-build-hooks/debian/control b/src/sonic-build-hooks/debian/control index 9e2454be9d..e7e31b5259 100644 --- a/src/sonic-build-hooks/debian/control +++ b/src/sonic-build-hooks/debian/control @@ -3,7 +3,7 @@ Version: 1.0 Section: devel Priority: optional Architecture: all -Depends: +Depends: Maintainer: SONiC Description: sonic build hooks Hooks the build tools, such as apt-get, wget, pip, etc. diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index 85ecbaaefb..a83a5dc679 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -373,7 +373,7 @@ update_version_file() done sort -u $tmp_file > $version_file rm -f $tmp_file - + if [[ "${version_name}" == *-deb ]]; then update_preference_deb fi diff --git a/src/sonic-build-hooks/scripts/collect_version_files b/src/sonic-build-hooks/scripts/collect_version_files index 081ded342c..6d14a7577d 100755 --- a/src/sonic-build-hooks/scripts/collect_version_files +++ b/src/sonic-build-hooks/scripts/collect_version_files @@ -12,7 +12,7 @@ DIST=$(grep VERSION_CODENAME /etc/os-release | cut -d= -f2) mkdir -p $TARGET_PATH chmod a+rw $TARGET_PATH -# Skip the package that does have a static build version. +# Skip the package that does have a static build version. # SAI package versions are changed too frequently. SKIP_VERSION_PACKAGE="libsaibcm|libpaibcm|linuxptp|@ file://" dpkg-query -W -f '${Package}==${Version}\n' | grep -Ev "${SKIP_VERSION_PACKAGE}" > "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" diff --git a/src/sonic-build-hooks/scripts/post_run_buildinfo b/src/sonic-build-hooks/scripts/post_run_buildinfo index b703edf44f..7bb5fda5b3 100755 --- a/src/sonic-build-hooks/scripts/post_run_buildinfo +++ b/src/sonic-build-hooks/scripts/post_run_buildinfo @@ -21,6 +21,6 @@ if [ ! -z "$(get_version_cache_option)" ]; then DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; }; APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; }; EOF - + fi - + diff --git a/src/sonic-build-hooks/scripts/post_run_cleanup b/src/sonic-build-hooks/scripts/post_run_cleanup index 8fcc43c57e..934d1dea5e 100755 --- a/src/sonic-build-hooks/scripts/post_run_cleanup +++ b/src/sonic-build-hooks/scripts/post_run_cleanup @@ -4,7 +4,7 @@ IMAGENAME=$1 . /usr/local/share/buildinfo/scripts/buildinfo_base.sh -set -x +set -x if [ ! -z "$(get_version_cache_option)" ]; then @@ -18,7 +18,7 @@ fi apt-get -s clean -y apt-get -s autoclean -y apt-get -s autoremove -y -#apt-get -s autoremove -y --purge +#apt-get -s autoremove -y --purge rm -f /var/cache/apt/archives/*.deb /var/cache/apt/*.bin if [[ ! ${IMAGENAME} =~ -slave- ]]; then diff --git a/src/sonic-config-engine/config_samples.py b/src/sonic-config-engine/config_samples.py index 0606c19056..2fc9480cdc 100644 --- a/src/sonic-config-engine/config_samples.py +++ b/src/sonic-config-engine/config_samples.py @@ -118,7 +118,7 @@ def generate_l2_config(data): if 'uplinks' in data: uplinks = data['uplinks'] data.pop('uplinks') - + if 'downlinks' in data: downlinks = data['downlinks'] data.pop('downlinks') diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 419ffb6fb4..846b0a6b6d 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -48,7 +48,7 @@ BACKEND_ASIC_SUB_ROLE = 'BackEnd' dualtor_cable_types = ["active-active", "active-standby"] -# Default Virtual Network Index (VNI) +# Default Virtual Network Index (VNI) vni_default = 8000 # Defination of custom acl table types @@ -475,7 +475,7 @@ def parse_dpg(dpg, hname): tunnelintfs_qos_remap_config = defaultdict(dict) for child in dpg: - """ + """ In Multi-NPU platforms the acl intfs are defined only for the host not for individual asic. There is just one aclintf node in the minigraph Get the aclintfs node first. @@ -499,7 +499,7 @@ def parse_dpg(dpg, hname): if vni_element.text.isdigit(): vni = int(vni_element.text) else: - print("VNI must be an integer (use default VNI %d instead)" % vni_default, file=sys.stderr) + print("VNI must be an integer (use default VNI %d instead)" % vni_default, file=sys.stderr) ipintfs = child.find(str(QName(ns, "IPInterfaces"))) intfs = {} @@ -553,7 +553,7 @@ def parse_dpg(dpg, hname): pc_intfs = [] pcs = {} pc_members = {} - intfs_inpc = [] # List to hold all the LAG member interfaces + intfs_inpc = [] # List to hold all the LAG member interfaces for pcintf in pcintfs.findall(str(QName(ns, "PortChannel"))): pcintfname = pcintf.find(str(QName(ns, "Name"))).text pcintfmbr = pcintf.find(str(QName(ns, "AttachTo"))).text @@ -787,7 +787,7 @@ def parse_dpg(dpg, hname): else: is_bmc_data = True acl_table_types['BMCDATA'] = acl_table_type_defination['BMCDATA'] - # if acl is classified as mirror (erpsan) or acl interface + # if acl is classified as mirror (erpsan) or acl interface # are binded then do not classify as Control plane. # For multi-asic platforms it's possible there is no # interface are binded to everflow in host namespace. @@ -838,9 +838,9 @@ def parse_dpg(dpg, hname): mg_tunnels = child.find(str(QName(ns, "TunnelInterfaces"))) if mg_tunnels is not None: - table_key_to_mg_key_map = {"encap_ecn_mode": "EcnEncapsulationMode", - "ecn_mode": "EcnDecapsulationMode", - "dscp_mode": "DifferentiatedServicesCodePointMode", + table_key_to_mg_key_map = {"encap_ecn_mode": "EcnEncapsulationMode", + "ecn_mode": "EcnDecapsulationMode", + "dscp_mode": "DifferentiatedServicesCodePointMode", "ttl_mode": "TtlMode"} tunnel_qos_remap_table_key_to_mg_key_map = { @@ -860,7 +860,7 @@ def parse_dpg(dpg, hname): # If the minigraph has the key, add the corresponding config DB key to the table if mg_key in mg_tunnel.attrib: tunnelintfs[tunnel_type][tunnel_name][table_key] = mg_tunnel.attrib[mg_key] - + tunnelintfs_qos_remap_config[tunnel_type][tunnel_name] = { "tunnel_type": mg_tunnel.attrib["Type"].upper(), } @@ -1209,12 +1209,12 @@ def parse_deviceinfo(meta, hwsku): return port_speeds, port_descriptions, sys_ports -# Function to check if IP address is present in the key. +# Function to check if IP address is present in the key. # If it is present, then the key would be a tuple. def is_ip_prefix_in_key(key): return (isinstance(key, tuple)) -# Special parsing for spine chassis frontend +# Special parsing for spine chassis frontend def parse_spine_chassis_fe(results, vni, lo_intfs, phyport_intfs, pc_intfs, pc_members, devices): chassis_vnet ='VnetFE' chassis_vxlan_tunnel = 'TunnelInt' @@ -1239,29 +1239,29 @@ def parse_spine_chassis_fe(results, vni, lo_intfs, phyport_intfs, pc_intfs, pc_m # For each IP interface for intf in phyport_intfs: - # A IP interface may have multiple entries. + # A IP interface may have multiple entries. # For example, "Ethernet0": {}", "Ethernet0|192.168.1.1": {}" # We only care about the one without IP information if is_ip_prefix_in_key(intf) == True: - continue - + continue + neighbor_router = results['DEVICE_NEIGHBOR'][intf]['name'] - - # If the neighbor router is an external router + + # If the neighbor router is an external router if devices[neighbor_router]['type'] != chassis_backend_role: # Enslave the interface to a Vnet phyport_intfs[intf] = {'vnet_name': chassis_vnet} - + # For each port channel IP interface for pc_intf in pc_intfs: - # A port channel IP interface may have multiple entries. + # A port channel IP interface may have multiple entries. # For example, "Portchannel0": {}", "Portchannel0|192.168.1.1": {}" # We only care about the one without IP information if is_ip_prefix_in_key(pc_intf) == True: - continue + continue - intf_name = None - # Get a physical interface that belongs to this port channel + intf_name = None + # Get a physical interface that belongs to this port channel for pc_member in pc_members: if pc_member[0] == pc_intf: intf_name = pc_member[1] @@ -1274,10 +1274,10 @@ def parse_spine_chassis_fe(results, vni, lo_intfs, phyport_intfs, pc_intfs, pc_m # Get the neighbor router of this port channel interface neighbor_router = results['DEVICE_NEIGHBOR'][intf_name]['name'] - # If the neighbor router is an external router + # If the neighbor router is an external router if devices[neighbor_router]['type'] != chassis_backend_role: # Enslave the port channel interface to a Vnet - pc_intfs[pc_intf] = {'vnet_name': chassis_vnet} + pc_intfs[pc_intf] = {'vnet_name': chassis_vnet} ############################################################################### # @@ -1306,10 +1306,10 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, pc_members, sub_ro return filter_acl_table_for_backend(acls, vlan_members) filter_acls = {} - + # If the asic role is BackEnd no ACL Table (Ctrl/Data/Everflow) is binded. # This will be applicable in Multi-NPU Platforms. - + if sub_role == BACKEND_ASIC_SUB_ROLE: return filter_acls @@ -1317,7 +1317,7 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, pc_members, sub_ro # List of Backplane ports backplane_port_list = [v for k,v in port_alias_map.items() if v.startswith(backplane_prefix())] - + # Get the front panel port channel. for port_channel_intf in port_channels: backend_port_channel = any(lag_member[1] in backplane_port_list \ @@ -1349,12 +1349,12 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, pc_members, sub_ro if port in port_channels and port not in front_port_channel_intf: continue front_panel_ports.append(port) - + # Filters out inactive front-panel ports from the binding list for mirror # ACL tables. We define an "active" port as one that is a member of a # front pannel port channel or one that is connected to a neighboring device via front panel port. active_ports = [port for port in front_panel_ports if port in neighbors.keys() or port in front_port_channel_intf] - + if not active_ports: print('Warning: mirror table {} in ACL_TABLE does not have any ports bound to it'.format(acl_table), file=sys.stderr) @@ -1421,7 +1421,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw filename -- minigraph file name platform -- device platform port_config_file -- port config file name - asic_name -- asic name; to parse multi-asic device minigraph to + asic_name -- asic name; to parse multi-asic device minigraph to generate asic specific configuration. """ @@ -1501,7 +1501,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw docker_routing_config_mode = child.text (ports, alias_map, alias_asic_map) = get_port_config(hwsku=hwsku, platform=platform, port_config_file=port_config_file, asic_name=asic_name, hwsku_config_file=hwsku_config_file) - + port_names_map.update(ports) port_alias_map.update(alias_map) port_alias_asic_map.update(alias_asic_map) @@ -1592,7 +1592,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw print("Warning: more than one peer switch was found. Only the first will be parsed: {}".format(results['PEER_SWITCH'].keys()[0])) results['DEVICE_METADATA']['localhost']['peer_switch'] = list(results['PEER_SWITCH'].keys())[0] - + # Enable tunnel_qos_remap if downstream_redundancy_types(T1) or redundancy_type(T0) = Gemini/Libra enable_tunnel_qos_map = False if platform and 'kvm' in platform: @@ -1607,8 +1607,8 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if len(system_defaults) > 0: results['SYSTEM_DEFAULTS'] = system_defaults - - # for this hostname, if sub_role is defined, add sub_role in + + # for this hostname, if sub_role is defined, add sub_role in # device_metadata if sub_role is not None: current_device['sub_role'] = sub_role @@ -1743,7 +1743,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw port_default_speed = port_speeds_default.get(port_name, None) port_png_speed = port_speed_png[port_name] - # when the port speed is changes from 400g to 100g/40g + # when the port speed is changes from 400g to 100g/40g # update the port lanes, use the first 4 lanes of the 400G port to support 100G/40G port if port_default_speed == '400000' and (port_png_speed == '100000' or port_png_speed == '40000'): port_lanes = ports[port_name].get('lanes', '').split(',') diff --git a/src/sonic-config-engine/openconfig_acl.py b/src/sonic-config-engine/openconfig_acl.py index 5939bce44d..7bb9c287e7 100644 --- a/src/sonic-config-engine/openconfig_acl.py +++ b/src/sonic-config-engine/openconfig_acl.py @@ -4,9 +4,9 @@ # Detail step to regenerate this file: # 1. Sync openconfig ACL yang models from https://github.com/openconfig/public/tree/master/release/models/acl # 2. Sync inet yang models which contain type dependencies for openconfig ACL yang models from https://github.com/YangModels/yang/tree/master/standard/ietf/RFC , and put them in the same folder with models from step 1. -# 3. Install PyangBind: +# 3. Install PyangBind: # pip3 install pyangbind -# 4. Get PyangBind install path: +# 4. Get PyangBind install path: # export PYBINDPLUGIN=`/usr/bin/env python3 -c \ # 'import pyangbind; import os; print "%s/plugin" % os.path.dirname(pyangbind.__file__)'` # 5. Generate this file with pyang: @@ -43,7 +43,7 @@ class sonic_acl_extension(PybindBase): """ _pyangbind_elements = {} - + class yc_state_openconfig_acl__acl_state(PybindBase): """ @@ -102,7 +102,7 @@ class yc_state_openconfig_acl__acl_state(PybindBase): by the target """ return self.__counter_capability - + def _set_counter_capability(self, v, load=False): """ Setter method for counter_capability, mapped from YANG variable /acl/state/counter_capability (identityref) @@ -195,7 +195,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_config(PybindBase): YANG Description: The name of the access-list set """ return self.__name - + def _set_name(self, v, load=False): """ Setter method for name, mapped from YANG variable /acl/acl_sets/acl_set/config/name (string) @@ -232,7 +232,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_config(PybindBase): YANG Description: Description, or comment, for the ACL set """ return self.__description - + def _set_description(self, v, load=False): """ Setter method for description, mapped from YANG variable /acl/acl_sets/acl_set/config/description (string) @@ -325,7 +325,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_state(PybindBase): YANG Description: The name of the access-list set """ return self.__name - + def _set_name(self, v, load=False): """ Setter method for name, mapped from YANG variable /acl/acl_sets/acl_set/state/name (string) @@ -362,7 +362,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_state(PybindBase): YANG Description: Description, or comment, for the ACL set """ return self.__description - + def _set_description(self, v, load=False): """ Setter method for description, mapped from YANG variable /acl/acl_sets/acl_set/state/description (string) @@ -459,7 +459,7 @@ rules in the order determined by sequence id, rather than the relying only on order in the list. """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/config/sequence_id (uint32) @@ -501,7 +501,7 @@ the relying only on order in the list. Entry. """ return self.__description - + def _set_description(self, v, load=False): """ Setter method for description, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/config/description (string) @@ -601,7 +601,7 @@ rules in the order determined by sequence id, rather than the relying only on order in the list. """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/state/sequence_id (uint32) @@ -643,7 +643,7 @@ the relying only on order in the list. Entry. """ return self.__description - + def _set_description(self, v, load=False): """ Setter method for description, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/state/description (string) @@ -694,7 +694,7 @@ e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed. """ return self.__matched_packets - + def _set_matched_packets(self, v, load=False): """ Setter method for matched_packets, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/state/matched_packets (yang:counter64) @@ -757,7 +757,7 @@ e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed. """ return self.__matched_octets - + def _set_matched_octets(self, v, load=False): """ Setter method for matched_octets, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/state/matched_octets (yang:counter64) @@ -869,7 +869,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: Source IEEE 802 MAC address. """ return self.__source_mac - + def _set_source_mac(self, v, load=False): """ Setter method for source_mac, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/source_mac (yang:mac-address) @@ -906,7 +906,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: Source IEEE 802 MAC address mask. """ return self.__source_mac_mask - + def _set_source_mac_mask(self, v, load=False): """ Setter method for source_mac_mask, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/source_mac_mask (yang:mac-address) @@ -943,7 +943,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: Destination IEEE 802 MAC address. """ return self.__destination_mac - + def _set_destination_mac(self, v, load=False): """ Setter method for destination_mac, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/destination_mac (yang:mac-address) @@ -980,7 +980,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: Destination IEEE 802 MAC address mask. """ return self.__destination_mac_mask - + def _set_destination_mac_mask(self, v, load=False): """ Setter method for destination_mac_mask, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/destination_mac_mask (yang:mac-address) @@ -1017,7 +1017,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: Ethertype field to match in Ethernet packets """ return self.__ethertype - + def _set_ethertype(self, v, load=False): """ Setter method for ethertype, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/ethertype (oc-pkt-match-types:ethertype-type) @@ -1054,7 +1054,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: VLAN ID field to match in DOT1Q packets """ return self.__vlan_id - + def _set_vlan_id(self, v, load=False): """ Setter method for vlan_id, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/vlan_id (vlan-id-type) @@ -1154,7 +1154,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_sta YANG Description: Source IEEE 802 MAC address. """ return self.__source_mac - + def _set_source_mac(self, v, load=False): """ Setter method for source_mac, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/state/source_mac (yang:mac-address) @@ -1191,7 +1191,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_sta YANG Description: Source IEEE 802 MAC address mask. """ return self.__source_mac_mask - + def _set_source_mac_mask(self, v, load=False): """ Setter method for source_mac_mask, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/state/source_mac_mask (yang:mac-address) @@ -1228,7 +1228,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_sta YANG Description: Destination IEEE 802 MAC address. """ return self.__destination_mac - + def _set_destination_mac(self, v, load=False): """ Setter method for destination_mac, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/state/destination_mac (yang:mac-address) @@ -1265,7 +1265,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_sta YANG Description: Destination IEEE 802 MAC address mask. """ return self.__destination_mac_mask - + def _set_destination_mac_mask(self, v, load=False): """ Setter method for destination_mac_mask, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/state/destination_mac_mask (yang:mac-address) @@ -1302,7 +1302,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_sta YANG Description: Ethertype field to match in Ethernet packets """ return self.__ethertype - + def _set_ethertype(self, v, load=False): """ Setter method for ethertype, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/state/ethertype (oc-pkt-match-types:ethertype-type) @@ -1398,7 +1398,7 @@ class yc_l2_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2(Pybind YANG Description: Configuration data """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config (container) @@ -1435,7 +1435,7 @@ class yc_l2_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2(Pybind YANG Description: State Information. """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/state (container) @@ -1534,7 +1534,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: IP version of the header. """ return self.__ip_version - + def _set_ip_version(self, v, load=False): """ Setter method for ip_version, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/ip_version (inet:ip-version) @@ -1571,7 +1571,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Destination IP address prefix. """ return self.__source_ip_address - + def _set_source_ip_address(self, v, load=False): """ Setter method for source_ip_address, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/source_ip_address (inet:ip-prefix) @@ -1608,7 +1608,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Source IPv6 Flow label. """ return self.__source_ip_flow_label - + def _set_source_ip_flow_label(self, v, load=False): """ Setter method for source_ip_flow_label, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/source_ip_flow_label (inet:ipv6-flow-label) @@ -1645,7 +1645,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Destination IP address prefix. """ return self.__destination_ip_address - + def _set_destination_ip_address(self, v, load=False): """ Setter method for destination_ip_address, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/destination_ip_address (inet:ip-prefix) @@ -1682,7 +1682,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Destination IPv6 Flow label. """ return self.__destination_ip_flow_label - + def _set_destination_ip_flow_label(self, v, load=False): """ Setter method for destination_ip_flow_label, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/destination_ip_flow_label (inet:ipv6-flow-label) @@ -1719,7 +1719,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Value of diffserv codepoint. """ return self.__dscp - + def _set_dscp(self, v, load=False): """ Setter method for dscp, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/dscp (inet:dscp) @@ -1756,7 +1756,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Internet Protocol number. """ return self.__protocol - + def _set_protocol(self, v, load=False): """ Setter method for protocol, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/protocol (oc-pkt-match-types:ip-protocol-type) @@ -1794,7 +1794,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co IPv4 packets, and hop limit in IPv6 """ return self.__hop_limit - + def _set_hop_limit(self, v, load=False): """ Setter method for hop_limit, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config/hop_limit (uint8) @@ -1900,7 +1900,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: IP version of the header. """ return self.__ip_version - + def _set_ip_version(self, v, load=False): """ Setter method for ip_version, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/ip_version (inet:ip-version) @@ -1937,7 +1937,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: Destination IP address prefix. """ return self.__source_ip_address - + def _set_source_ip_address(self, v, load=False): """ Setter method for source_ip_address, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/source_ip_address (inet:ip-prefix) @@ -1974,7 +1974,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: Source IPv6 Flow label. """ return self.__source_ip_flow_label - + def _set_source_ip_flow_label(self, v, load=False): """ Setter method for source_ip_flow_label, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/source_ip_flow_label (inet:ipv6-flow-label) @@ -2011,7 +2011,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: Destination IP address prefix. """ return self.__destination_ip_address - + def _set_destination_ip_address(self, v, load=False): """ Setter method for destination_ip_address, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/destination_ip_address (inet:ip-prefix) @@ -2048,7 +2048,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: Destination IPv6 Flow label. """ return self.__destination_ip_flow_label - + def _set_destination_ip_flow_label(self, v, load=False): """ Setter method for destination_ip_flow_label, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/destination_ip_flow_label (inet:ipv6-flow-label) @@ -2085,7 +2085,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: Value of diffserv codepoint. """ return self.__dscp - + def _set_dscp(self, v, load=False): """ Setter method for dscp, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/dscp (inet:dscp) @@ -2122,7 +2122,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: Internet Protocol number. """ return self.__protocol - + def _set_protocol(self, v, load=False): """ Setter method for protocol, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/protocol (oc-pkt-match-types:ip-protocol-type) @@ -2160,7 +2160,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta IPv4 packets, and hop limit in IPv6 """ return self.__hop_limit - + def _set_hop_limit(self, v, load=False): """ Setter method for hop_limit, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state/hop_limit (uint8) @@ -2260,7 +2260,7 @@ class yc_ip_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip(Pybind YANG Description: Configuration data """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/config (container) @@ -2297,7 +2297,7 @@ class yc_ip_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip(Pybind YANG Description: State information """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip/state (container) @@ -2391,7 +2391,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_trans YANG Description: Source port or range """ return self.__source_port - + def _set_source_port(self, v, load=False): """ Setter method for source_port, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/config/source_port (oc-pkt-match-types:port-num-range) @@ -2428,7 +2428,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_trans YANG Description: Destination port or range """ return self.__destination_port - + def _set_destination_port(self, v, load=False): """ Setter method for destination_port, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/config/destination_port (oc-pkt-match-types:port-num-range) @@ -2465,7 +2465,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_trans YANG Description: List of TCP flags to match """ return self.__tcp_flags - + def _set_tcp_flags(self, v, load=False): """ Setter method for tcp_flags, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/config/tcp_flags (identityref) @@ -2560,7 +2560,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transp YANG Description: Source port or range """ return self.__source_port - + def _set_source_port(self, v, load=False): """ Setter method for source_port, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/state/source_port (oc-pkt-match-types:port-num-range) @@ -2597,7 +2597,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transp YANG Description: Destination port or range """ return self.__destination_port - + def _set_destination_port(self, v, load=False): """ Setter method for destination_port, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/state/destination_port (oc-pkt-match-types:port-num-range) @@ -2634,7 +2634,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transp YANG Description: List of TCP flags to match """ return self.__tcp_flags - + def _set_tcp_flags(self, v, load=False): """ Setter method for tcp_flags, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/state/tcp_flags (identityref) @@ -2728,7 +2728,7 @@ class yc_transport_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_tr YANG Description: Configuration data """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/config (container) @@ -2765,7 +2765,7 @@ class yc_transport_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_tr YANG Description: State data """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport/state (container) @@ -2860,7 +2860,7 @@ subinterface is required, this leaf must be specified to indicate the base interface. """ return self.__interface - + def _set_interface(self, v, load=False): """ Setter method for interface, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref/config/interface (leafref) @@ -2902,7 +2902,7 @@ this container. If only a reference to a base interface is requuired, this leaf should not be set. """ return self.__subinterface - + def _set_subinterface(self, v, load=False): """ Setter method for subinterface, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref/config/subinterface (leafref) @@ -3000,7 +3000,7 @@ subinterface is required, this leaf must be specified to indicate the base interface. """ return self.__interface - + def _set_interface(self, v, load=False): """ Setter method for interface, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref/state/interface (leafref) @@ -3042,7 +3042,7 @@ this container. If only a reference to a base interface is requuired, this leaf should not be set. """ return self.__subinterface - + def _set_subinterface(self, v, load=False): """ Setter method for subinterface, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref/state/subinterface (leafref) @@ -3138,7 +3138,7 @@ class yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entr YANG Description: Configured reference to interface / subinterface """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref/config (container) @@ -3175,7 +3175,7 @@ class yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entr YANG Description: Operational state for interface-ref """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref/state (container) @@ -3267,7 +3267,7 @@ class yc_input_interface_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_en YANG Description: Reference to an interface or subinterface """ return self.__interface_ref - + def _set_interface_ref(self, v, load=False): """ Setter method for interface_ref, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface/interface_ref (container) @@ -3360,7 +3360,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actio must be specified for each ACL entry """ return self.__forwarding_action - + def _set_forwarding_action(self, v, load=False): """ Setter method for forwarding_action, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions/config/forwarding_action (identityref) @@ -3400,7 +3400,7 @@ matched packets. The default is not to log the packet. """ return self.__log_action - + def _set_log_action(self, v, load=False): """ Setter method for log_action, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions/config/log_action (identityref) @@ -3496,7 +3496,7 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_action must be specified for each ACL entry """ return self.__forwarding_action - + def _set_forwarding_action(self, v, load=False): """ Setter method for forwarding_action, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions/state/forwarding_action (identityref) @@ -3536,7 +3536,7 @@ matched packets. The default is not to log the packet. """ return self.__log_action - + def _set_log_action(self, v, load=False): """ Setter method for log_action, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions/state/log_action (identityref) @@ -3632,7 +3632,7 @@ with an entry YANG Description: Config data for ACL actions """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions/config (container) @@ -3669,7 +3669,7 @@ with an entry YANG Description: State information for ACL actions """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions/state (container) @@ -3760,7 +3760,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_ YANG Description: ICMP(V6) type. """ return self.__type - + def _set_type(self, v, load=False): """ Setter method for type, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config/type (icmp-type-type) @@ -3797,7 +3797,7 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_ YANG Description: ICMP(V6) code. """ return self.__code - + def _set_code(self, v, load=False): """ Setter method for code, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config/code (icmp-code-type) @@ -3885,7 +3885,7 @@ class yc_icmp_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp(Py Getter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config (container) """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config (container) @@ -3982,7 +3982,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: references the list key """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/sequence_id (leafref) @@ -4024,7 +4024,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: Access list entries config """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/config (container) @@ -4061,7 +4061,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: State information for ACL entries """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/state (container) @@ -4098,7 +4098,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: Ethernet header fields """ return self.__l2 - + def _set_l2(self, v, load=False): """ Setter method for l2, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2 (container) @@ -4135,7 +4135,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: Top level container """ return self.__ip - + def _set_ip(self, v, load=False): """ Setter method for ip, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/ip (container) @@ -4172,7 +4172,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: Transport fields container """ return self.__transport - + def _set_transport(self, v, load=False): """ Setter method for transport, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/transport (container) @@ -4209,7 +4209,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: Input interface container """ return self.__input_interface - + def _set_input_interface(self, v, load=False): """ Setter method for input_interface, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/input_interface (container) @@ -4247,7 +4247,7 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py with an entry """ return self.__actions - + def _set_actions(self, v, load=False): """ Setter method for actions, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/actions (container) @@ -4283,7 +4283,7 @@ with an entry Getter method for icmp, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp (container) """ return self.__icmp - + def _set_icmp(self, v, load=False): """ Setter method for icmp, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp (container) @@ -4380,7 +4380,7 @@ class yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries(PybindBase YANG Description: List of ACL entries comprising an ACL set """ return self.__acl_entry - + def _set_acl_entry(self, v, load=False): """ Setter method for acl_entry, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry (list) @@ -4475,7 +4475,7 @@ entries YANG Description: Reference to the name list key """ return self.__name - + def _set_name(self, v, load=False): """ Setter method for name, mapped from YANG variable /acl/acl_sets/acl_set/name (leafref) @@ -4517,7 +4517,7 @@ entries YANG Description: Access list config """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/config (container) @@ -4554,7 +4554,7 @@ entries YANG Description: Access list state information """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/acl_sets/acl_set/state (container) @@ -4591,7 +4591,7 @@ entries YANG Description: Access list entries container """ return self.__acl_entries - + def _set_acl_entries(self, v, load=False): """ Setter method for acl_entries, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries (container) @@ -4686,7 +4686,7 @@ class yc_acl_sets_openconfig_acl__acl_acl_sets(PybindBase): entries """ return self.__acl_set - + def _set_acl_set(self, v, load=False): """ Setter method for acl_set, mapped from YANG variable /acl/acl_sets/acl_set (list) @@ -4779,7 +4779,7 @@ class yc_config_openconfig_acl__acl_interfaces_interface_config(PybindBase): convention could be '.' """ return self.__id - + def _set_id(self, v, load=False): """ Setter method for id, mapped from YANG variable /acl/interfaces/interface/config/id (oc-if:interface-id) @@ -4872,7 +4872,7 @@ class yc_state_openconfig_acl__acl_interfaces_interface_state(PybindBase): convention could be '.' """ return self.__id - + def _set_id(self, v, load=False): """ Setter method for id, mapped from YANG variable /acl/interfaces/interface/state/id (oc-if:interface-id) @@ -4967,7 +4967,7 @@ subinterface is required, this leaf must be specified to indicate the base interface. """ return self.__interface - + def _set_interface(self, v, load=False): """ Setter method for interface, mapped from YANG variable /acl/interfaces/interface/interface_ref/config/interface (leafref) @@ -5009,7 +5009,7 @@ this container. If only a reference to a base interface is requuired, this leaf should not be set. """ return self.__subinterface - + def _set_subinterface(self, v, load=False): """ Setter method for subinterface, mapped from YANG variable /acl/interfaces/interface/interface_ref/config/subinterface (leafref) @@ -5107,7 +5107,7 @@ subinterface is required, this leaf must be specified to indicate the base interface. """ return self.__interface - + def _set_interface(self, v, load=False): """ Setter method for interface, mapped from YANG variable /acl/interfaces/interface/interface_ref/state/interface (leafref) @@ -5149,7 +5149,7 @@ this container. If only a reference to a base interface is requuired, this leaf should not be set. """ return self.__subinterface - + def _set_subinterface(self, v, load=False): """ Setter method for subinterface, mapped from YANG variable /acl/interfaces/interface/interface_ref/state/subinterface (leafref) @@ -5245,7 +5245,7 @@ class yc_interface_ref_openconfig_acl__acl_interfaces_interface_interface_ref(Py YANG Description: Configured reference to interface / subinterface """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/interfaces/interface/interface_ref/config (container) @@ -5282,7 +5282,7 @@ class yc_interface_ref_openconfig_acl__acl_interfaces_interface_interface_ref(Py YANG Description: Operational state for interface-ref """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/interfaces/interface/interface_ref/state (container) @@ -5325,7 +5325,7 @@ class yc_config_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingres the container is represented as a class variable - with a specific YANG type. - YANG Description: Configuration data + YANG Description: Configuration data """ __slots__ = ('_path_helper', '_extmethods', '__set_name',) @@ -5374,7 +5374,7 @@ class yc_config_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingres YANG Description: Reference to the ACL set applied on ingress """ return self.__set_name - + def _set_set_name(self, v, load=False): """ Setter method for set_name, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/config/set_name (leafref) @@ -5465,7 +5465,7 @@ class yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress YANG Description: Reference to the ACL set applied on ingress """ return self.__set_name - + def _set_set_name(self, v, load=False): """ Setter method for set_name, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/state/set_name (leafref) @@ -5559,7 +5559,7 @@ class yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress interface """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries/acl_entry/state/sequence_id (leafref) @@ -5610,7 +5610,7 @@ e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed. """ return self.__matched_packets - + def _set_matched_packets(self, v, load=False): """ Setter method for matched_packets, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries/acl_entry/state/matched_packets (yang:counter64) @@ -5673,7 +5673,7 @@ e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed. """ return self.__matched_octets - + def _set_matched_octets(self, v, load=False): """ Setter method for matched_octets, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries/acl_entry/state/matched_octets (yang:counter64) @@ -5780,7 +5780,7 @@ class yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ing YANG Description: Reference to per-interface acl entry key """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries/acl_entry/sequence_id (leafref) @@ -5822,7 +5822,7 @@ class yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ing YANG Description: Operational state data for per-interface ACL entries """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries/acl_entry/state (container) @@ -5914,7 +5914,7 @@ class yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_i YANG Description: List of ACL entries assigned to an interface """ return self.__acl_entry - + def _set_acl_entry(self, v, load=False): """ Setter method for acl_entry, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries/acl_entry (list) @@ -6008,7 +6008,7 @@ class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_se YANG Description: Reference to set name list key """ return self.__set_name - + def _set_set_name(self, v, load=False): """ Setter method for set_name, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/set_name (leafref) @@ -6047,10 +6047,10 @@ class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_se """ Getter method for config, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/config (container) - YANG Description: Configuration data + YANG Description: Configuration data """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/config (container) @@ -6059,7 +6059,7 @@ class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_se method. Backends looking to populate this variable should do so via calling thisObj._set_config() directly. - YANG Description: Configuration data + YANG Description: Configuration data """ if hasattr(v, "_utype"): v = v._utype(v) @@ -6087,7 +6087,7 @@ class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_se YANG Description: Operational state data for interface ingress ACLs """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/state (container) @@ -6124,7 +6124,7 @@ class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_se YANG Description: Enclosing container for list of references to ACLs """ return self.__acl_entries - + def _set_acl_entries(self, v, load=False): """ Setter method for acl_entries, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set/acl_entries (container) @@ -6219,7 +6219,7 @@ interface YANG Description: List of ingress ACLs on the interface """ return self.__ingress_acl_set - + def _set_ingress_acl_set(self, v, load=False): """ Setter method for ingress_acl_set, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets/ingress_acl_set (list) @@ -6261,7 +6261,7 @@ class yc_config_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_ the container is represented as a class variable - with a specific YANG type. - YANG Description: Configuration data + YANG Description: Configuration data """ __slots__ = ('_path_helper', '_extmethods', '__set_name',) @@ -6310,7 +6310,7 @@ class yc_config_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_ YANG Description: Reference to the ACL set applied on egress """ return self.__set_name - + def _set_set_name(self, v, load=False): """ Setter method for set_name, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/config/set_name (leafref) @@ -6401,7 +6401,7 @@ class yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_a YANG Description: Reference to the ACL set applied on egress """ return self.__set_name - + def _set_set_name(self, v, load=False): """ Setter method for set_name, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/state/set_name (leafref) @@ -6495,7 +6495,7 @@ class yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_a interface """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries/acl_entry/state/sequence_id (leafref) @@ -6546,7 +6546,7 @@ e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed. """ return self.__matched_packets - + def _set_matched_packets(self, v, load=False): """ Setter method for matched_packets, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries/acl_entry/state/matched_packets (yang:counter64) @@ -6609,7 +6609,7 @@ e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed. """ return self.__matched_octets - + def _set_matched_octets(self, v, load=False): """ Setter method for matched_octets, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries/acl_entry/state/matched_octets (yang:counter64) @@ -6716,7 +6716,7 @@ class yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egre YANG Description: Reference to per-interface acl entry key """ return self.__sequence_id - + def _set_sequence_id(self, v, load=False): """ Setter method for sequence_id, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries/acl_entry/sequence_id (leafref) @@ -6758,7 +6758,7 @@ class yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egre YANG Description: Operational state data for per-interface ACL entries """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries/acl_entry/state (container) @@ -6850,7 +6850,7 @@ class yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_eg YANG Description: List of ACL entries assigned to an interface """ return self.__acl_entry - + def _set_acl_entry(self, v, load=False): """ Setter method for acl_entry, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries/acl_entry (list) @@ -6944,7 +6944,7 @@ class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets YANG Description: Reference to set name list key """ return self.__set_name - + def _set_set_name(self, v, load=False): """ Setter method for set_name, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/set_name (leafref) @@ -6983,10 +6983,10 @@ class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets """ Getter method for config, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/config (container) - YANG Description: Configuration data + YANG Description: Configuration data """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/config (container) @@ -6995,7 +6995,7 @@ class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets method. Backends looking to populate this variable should do so via calling thisObj._set_config() directly. - YANG Description: Configuration data + YANG Description: Configuration data """ if hasattr(v, "_utype"): v = v._utype(v) @@ -7023,7 +7023,7 @@ class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets YANG Description: Operational state data for interface egress ACLs """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/state (container) @@ -7060,7 +7060,7 @@ class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets YANG Description: Enclosing container for list of references to ACLs """ return self.__acl_entries - + def _set_acl_entries(self, v, load=False): """ Setter method for acl_entries, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set/acl_entries (container) @@ -7155,7 +7155,7 @@ interface YANG Description: List of egress ACLs on the interface """ return self.__egress_acl_set - + def _set_egress_acl_set(self, v, load=False): """ Setter method for egress_acl_set, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets/egress_acl_set (list) @@ -7251,7 +7251,7 @@ class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): YANG Description: Reference to the interface id list key """ return self.__id - + def _set_id(self, v, load=False): """ Setter method for id, mapped from YANG variable /acl/interfaces/interface/id (leafref) @@ -7293,7 +7293,7 @@ class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): YANG Description: Configuration for ACL per-interface data """ return self.__config - + def _set_config(self, v, load=False): """ Setter method for config, mapped from YANG variable /acl/interfaces/interface/config (container) @@ -7330,7 +7330,7 @@ class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): YANG Description: Operational state for ACL per-interface data """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/interfaces/interface/state (container) @@ -7367,7 +7367,7 @@ class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): YANG Description: Reference to an interface or subinterface """ return self.__interface_ref - + def _set_interface_ref(self, v, load=False): """ Setter method for interface_ref, mapped from YANG variable /acl/interfaces/interface/interface_ref (container) @@ -7405,7 +7405,7 @@ class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): interface """ return self.__ingress_acl_sets - + def _set_ingress_acl_sets(self, v, load=False): """ Setter method for ingress_acl_sets, mapped from YANG variable /acl/interfaces/interface/ingress_acl_sets (container) @@ -7444,7 +7444,7 @@ interface interface """ return self.__egress_acl_sets - + def _set_egress_acl_sets(self, v, load=False): """ Setter method for egress_acl_sets, mapped from YANG variable /acl/interfaces/interface/egress_acl_sets (container) @@ -7542,7 +7542,7 @@ ACLs are set YANG Description: List of interfaces on which ACLs are set """ return self.__interface - + def _set_interface(self, v, load=False): """ Setter method for interface, mapped from YANG variable /acl/interfaces/interface (list) @@ -7636,7 +7636,7 @@ and operational state data YANG Description: Global operational state data for ACLs """ return self.__state - + def _set_state(self, v, load=False): """ Setter method for state, mapped from YANG variable /acl/state (container) @@ -7673,7 +7673,7 @@ and operational state data YANG Description: Access list entries variables enclosing container """ return self.__acl_sets - + def _set_acl_sets(self, v, load=False): """ Setter method for acl_sets, mapped from YANG variable /acl/acl_sets (container) @@ -7711,7 +7711,7 @@ and operational state data ACLs are set """ return self.__interfaces - + def _set_interfaces(self, v, load=False): """ Setter method for interfaces, mapped from YANG variable /acl/interfaces (container) @@ -7819,7 +7819,7 @@ layer matches. and operational state data """ return self.__acl - + def _set_acl(self, v, load=False): """ Setter method for acl, mapped from YANG variable /acl (container) diff --git a/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml b/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml index 236b63f771..0444f25da7 100644 --- a/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml +++ b/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml @@ -411,7 +411,7 @@ etp19
200.200.200.10
FineGrainedECMPGroupMember - + IPNextHop @@ -481,7 +481,7 @@ etp19
200:200:200:200::10
FineGrainedECMPGroupMember -
+ diff --git a/src/sonic-config-engine/tests/mock_tables/config_db.json b/src/sonic-config-engine/tests/mock_tables/config_db.json index 25937ca0da..2e1a72721d 100644 --- a/src/sonic-config-engine/tests/mock_tables/config_db.json +++ b/src/sonic-config-engine/tests/mock_tables/config_db.json @@ -1,11 +1,11 @@ { "PORT|Ethernet0": { - "lanes": "29,30,31,32", - "description": "config_db:switch-01t1:port1", - "pfc_asym": "off", - "mtu": "9100", - "alias": "fortyGigE0/0", - "admin_status": "up", + "lanes": "29,30,31,32", + "description": "config_db:switch-01t1:port1", + "pfc_asym": "off", + "mtu": "9100", + "alias": "fortyGigE0/0", + "admin_status": "up", "speed": "10000" }, "PORT|Ethernet4": { diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini index b6b0379f60..2e932da6c1 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini @@ -1,9 +1,9 @@ -# name lanes alias index asic_port_name role +# name lanes alias index asic_port_name role Ethernet0 33,34,35,36 Ethernet1/1 0 Eth0-ASIC0 Ext -Ethernet4 29,30,31,32 Ethernet1/2 1 Eth1-ASIC0 Ext -Ethernet8 41,42,43,44 Ethernet1/3 2 Eth2-ASIC0 Ext -Ethernet12 37,38,39,40 Ethernet1/4 3 Eth3-ASIC0 Ext -Ethernet-BP0 13,14,15,16 Eth4-ASIC0 0 Eth4-ASIC0 Int -Ethernet-BP4 17,18,19,20 Eth5-ASIC0 1 Eth5-ASIC0 Int -Ethernet-BP8 21,22,23,24 Eth6-ASIC0 2 Eth6-ASIC0 Int -Ethernet-BP12 25,26,27,28 Eth7-ASIC0 3 Eth7-ASIC0 Int +Ethernet4 29,30,31,32 Ethernet1/2 1 Eth1-ASIC0 Ext +Ethernet8 41,42,43,44 Ethernet1/3 2 Eth2-ASIC0 Ext +Ethernet12 37,38,39,40 Ethernet1/4 3 Eth3-ASIC0 Ext +Ethernet-BP0 13,14,15,16 Eth4-ASIC0 0 Eth4-ASIC0 Int +Ethernet-BP4 17,18,19,20 Eth5-ASIC0 1 Eth5-ASIC0 Int +Ethernet-BP8 21,22,23,24 Eth6-ASIC0 2 Eth6-ASIC0 Int +Ethernet-BP12 25,26,27,28 Eth7-ASIC0 3 Eth7-ASIC0 Int diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini index d2cdb5fedd..c689722ee8 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index asic_port_name role +# name lanes alias index asic_port_name role Ethernet0 33,34,35,36 Ethernet1/1 0 Eth0-ASIC0 Ext Ethernet4 29,30,31,32 Ethernet1/2 1 Eth1-ASIC0 Ext Ethernet8 41,42,43,44 Ethernet1/3 2 Eth2-ASIC0 Ext diff --git a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml index 2ee9fdac8c..6ee3b56b9c 100644 --- a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml @@ -910,9 +910,9 @@ true 0 - Arista-7050-QX-32S + Arista-7050-QX-32S - + diff --git a/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml index 9ffb8230a6..c6fdc68586 100644 --- a/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml +++ b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml @@ -806,7 +806,7 @@ Server
192.168.0.2/26 -
+ fc02:1000::2/96 @@ -836,7 +836,7 @@ Server
192.168.0.3/26 -
+ fc02:1000::3/96 @@ -866,7 +866,7 @@ Server
192.168.0.4/26 -
+ fc02:1000::4/96 @@ -896,7 +896,7 @@ Server
192.168.0.5/26 -
+ fc02:1000::5/96 @@ -926,7 +926,7 @@ Server
192.168.0.6/26 -
+ fc02:1000::6/96 @@ -956,7 +956,7 @@ Server
192.168.0.7/26 -
+ fc02:1000::7/96 @@ -986,7 +986,7 @@ Server
192.168.0.8/26 -
+ fc02:1000::8/96 @@ -1016,7 +1016,7 @@ Server
192.168.0.9/26 -
+ fc02:1000::9/96 @@ -1046,7 +1046,7 @@ Server
192.168.0.10/26 -
+ fc02:1000::a/96 @@ -1076,7 +1076,7 @@ Server
192.168.0.11/26 -
+ fc02:1000::b/96 @@ -1106,7 +1106,7 @@ Server
192.168.0.12/26 -
+ fc02:1000::c/96 @@ -1136,7 +1136,7 @@ Server
192.168.0.13/26 -
+ fc02:1000::d/96 @@ -1166,7 +1166,7 @@ Server
192.168.0.14/26 -
+ fc02:1000::e/96 @@ -1196,7 +1196,7 @@ Server
192.168.0.15/26 -
+ fc02:1000::f/96 @@ -1226,7 +1226,7 @@ Server
192.168.0.16/26 -
+ fc02:1000::10/96 @@ -1256,7 +1256,7 @@ Server
192.168.0.17/26 -
+ fc02:1000::11/96 @@ -1286,7 +1286,7 @@ Server
192.168.0.18/26 -
+ fc02:1000::12/96 @@ -1316,7 +1316,7 @@ Server
192.168.0.19/26 -
+ fc02:1000::13/96 @@ -1346,7 +1346,7 @@ Server
192.168.0.20/26 -
+ fc02:1000::14/96 @@ -1376,7 +1376,7 @@ Server
192.168.0.21/26 -
+ fc02:1000::15/96 @@ -1406,7 +1406,7 @@ Server
192.168.0.22/26 -
+ fc02:1000::16/96 @@ -1436,7 +1436,7 @@ Server
192.168.0.23/26 -
+ fc02:1000::17/96 @@ -1466,7 +1466,7 @@ Server
192.168.0.24/26 -
+ fc02:1000::18/96 @@ -1496,7 +1496,7 @@ Server
192.168.0.25/26 -
+ fc02:1000::19/96 diff --git a/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml index 521b5c5ae0..e7e7d5eccc 100644 --- a/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml @@ -806,7 +806,7 @@ Server
192.168.0.2/26 -
+ fc02:1000::2/96 @@ -836,7 +836,7 @@ Server
192.168.0.3/26 -
+ fc02:1000::3/96 @@ -866,7 +866,7 @@ Server
192.168.0.4/26 -
+ fc02:1000::4/96 @@ -896,7 +896,7 @@ Server
192.168.0.5/26 -
+ fc02:1000::5/96 @@ -926,7 +926,7 @@ Server
192.168.0.6/26 -
+ fc02:1000::6/96 @@ -956,7 +956,7 @@ Server
192.168.0.7/26 -
+ fc02:1000::7/96 @@ -986,7 +986,7 @@ Server
192.168.0.8/26 -
+ fc02:1000::8/96 @@ -1016,7 +1016,7 @@ Server
192.168.0.9/26 -
+ fc02:1000::9/96 @@ -1046,7 +1046,7 @@ Server
192.168.0.10/26 -
+ fc02:1000::a/96 @@ -1076,7 +1076,7 @@ Server
192.168.0.11/26 -
+ fc02:1000::b/96 @@ -1106,7 +1106,7 @@ Server
192.168.0.12/26 -
+ fc02:1000::c/96 @@ -1136,7 +1136,7 @@ Server
192.168.0.13/26 -
+ fc02:1000::d/96 @@ -1166,7 +1166,7 @@ Server
192.168.0.14/26 -
+ fc02:1000::e/96 @@ -1196,7 +1196,7 @@ Server
192.168.0.15/26 -
+ fc02:1000::f/96 @@ -1226,7 +1226,7 @@ Server
192.168.0.16/26 -
+ fc02:1000::10/96 @@ -1256,7 +1256,7 @@ Server
192.168.0.17/26 -
+ fc02:1000::11/96 @@ -1286,7 +1286,7 @@ Server
192.168.0.18/26 -
+ fc02:1000::12/96 @@ -1316,7 +1316,7 @@ Server
192.168.0.19/26 -
+ fc02:1000::13/96 @@ -1346,7 +1346,7 @@ Server
192.168.0.20/26 -
+ fc02:1000::14/96 @@ -1376,7 +1376,7 @@ Server
192.168.0.21/26 -
+ fc02:1000::15/96 @@ -1406,7 +1406,7 @@ Server
192.168.0.22/26 -
+ fc02:1000::16/96 @@ -1436,7 +1436,7 @@ Server
192.168.0.23/26 -
+ fc02:1000::17/96 @@ -1466,7 +1466,7 @@ Server
192.168.0.24/26 -
+ fc02:1000::18/96 @@ -1496,7 +1496,7 @@ Server
192.168.0.25/26 -
+ fc02:1000::19/96 diff --git a/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml index 01a42f9347..2339a55d1c 100644 --- a/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml +++ b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml @@ -1254,7 +1254,7 @@ Server
192.168.0.2/26 -
+ fc02:1000::2/96 @@ -1284,7 +1284,7 @@ Server
192.168.0.3/26 -
+ fc02:1000::3/96 @@ -1314,7 +1314,7 @@ Server
192.168.0.4/26 -
+ fc02:1000::4/96 @@ -1344,7 +1344,7 @@ Server
192.168.0.5/26 -
+ fc02:1000::5/96 @@ -1374,7 +1374,7 @@ Server
192.168.0.6/26 -
+ fc02:1000::6/96 @@ -1404,7 +1404,7 @@ Server
192.168.0.7/26 -
+ fc02:1000::7/96 @@ -1434,7 +1434,7 @@ Server
192.168.0.8/26 -
+ fc02:1000::8/96 @@ -1464,7 +1464,7 @@ Server
192.168.0.9/26 -
+ fc02:1000::9/96 @@ -1494,7 +1494,7 @@ Server
192.168.0.10/26 -
+ fc02:1000::a/96 @@ -1524,7 +1524,7 @@ Server
192.168.0.11/26 -
+ fc02:1000::b/96 @@ -1554,7 +1554,7 @@ Server
192.168.0.12/26 -
+ fc02:1000::c/96 @@ -1584,7 +1584,7 @@ Server
192.168.0.13/26 -
+ fc02:1000::d/96 @@ -1614,7 +1614,7 @@ Server
192.168.0.14/26 -
+ fc02:1000::e/96 @@ -1644,7 +1644,7 @@ Server
192.168.0.15/26 -
+ fc02:1000::f/96 @@ -1674,7 +1674,7 @@ Server
192.168.0.16/26 -
+ fc02:1000::10/96 @@ -1704,7 +1704,7 @@ Server
192.168.0.17/26 -
+ fc02:1000::11/96 @@ -1734,7 +1734,7 @@ Server
192.168.0.18/26 -
+ fc02:1000::12/96 @@ -1764,7 +1764,7 @@ Server
192.168.0.19/26 -
+ fc02:1000::13/96 @@ -1794,7 +1794,7 @@ Server
192.168.0.20/26 -
+ fc02:1000::14/96 @@ -1824,7 +1824,7 @@ Server
192.168.0.21/26 -
+ fc02:1000::15/96 @@ -1854,7 +1854,7 @@ Server
192.168.0.22/26 -
+ fc02:1000::16/96 @@ -1884,7 +1884,7 @@ Server
192.168.0.23/26 -
+ fc02:1000::17/96 @@ -1914,7 +1914,7 @@ Server
192.168.0.24/26 -
+ fc02:1000::18/96 @@ -1944,7 +1944,7 @@ Server
192.168.0.25/26 -
+ fc02:1000::19/96 @@ -1974,7 +1974,7 @@ Server
192.168.0.26/26 -
+ fc02:1000::1a/96 @@ -2004,7 +2004,7 @@ Server
192.168.0.27/26 -
+ fc02:1000::1b/96 @@ -2034,7 +2034,7 @@ Server
192.168.0.28/26 -
+ fc02:1000::1c/96 @@ -2064,7 +2064,7 @@ Server
192.168.0.29/26 -
+ fc02:1000::1d/96 @@ -2094,7 +2094,7 @@ Server
192.168.0.30/26 -
+ fc02:1000::1e/96 @@ -2124,7 +2124,7 @@ Server
192.168.0.31/26 -
+ fc02:1000::1f/96 @@ -2154,7 +2154,7 @@ Server
192.168.0.32/26 -
+ fc02:1000::20/96 @@ -2184,7 +2184,7 @@ Server
192.168.0.33/26 -
+ fc02:1000::21/96 @@ -2214,7 +2214,7 @@ Server
192.168.0.34/26 -
+ fc02:1000::22/96 @@ -2244,7 +2244,7 @@ Server
192.168.0.35/26 -
+ fc02:1000::23/96 @@ -2274,7 +2274,7 @@ Server
192.168.0.36/26 -
+ fc02:1000::24/96 @@ -2304,7 +2304,7 @@ Server
192.168.0.37/26 -
+ fc02:1000::25/96 @@ -2334,7 +2334,7 @@ Server
192.168.0.38/26 -
+ fc02:1000::26/96 @@ -2364,7 +2364,7 @@ Server
192.168.0.39/26 -
+ fc02:1000::27/96 @@ -2394,7 +2394,7 @@ Server
192.168.0.40/26 -
+ fc02:1000::28/96 @@ -2424,7 +2424,7 @@ Server
192.168.0.41/26 -
+ fc02:1000::29/96 @@ -2454,7 +2454,7 @@ Server
192.168.0.42/26 -
+ fc02:1000::2a/96 @@ -2484,7 +2484,7 @@ Server
192.168.0.43/26 -
+ fc02:1000::2b/96 @@ -2514,7 +2514,7 @@ Server
192.168.0.44/26 -
+ fc02:1000::2c/96 @@ -2544,7 +2544,7 @@ Server
192.168.0.45/26 -
+ fc02:1000::2d/96 @@ -2574,7 +2574,7 @@ Server
192.168.0.46/26 -
+ fc02:1000::2e/96 @@ -2604,7 +2604,7 @@ Server
192.168.0.47/26 -
+ fc02:1000::2f/96 @@ -2634,7 +2634,7 @@ Server
192.168.0.48/26 -
+ fc02:1000::30/96 @@ -2664,7 +2664,7 @@ Server
192.168.0.49/26 -
+ fc02:1000::31/96 @@ -2694,7 +2694,7 @@ Server
192.168.0.50/26 -
+ fc02:1000::32/96 @@ -2724,7 +2724,7 @@ Server
192.168.0.51/26 -
+ fc02:1000::33/96 @@ -2754,7 +2754,7 @@ Server
192.168.0.52/26 -
+ fc02:1000::34/96 @@ -2784,7 +2784,7 @@ Server
192.168.0.53/26 -
+ fc02:1000::35/96 @@ -2814,7 +2814,7 @@ Server
192.168.0.54/26 -
+ fc02:1000::36/96 @@ -2844,7 +2844,7 @@ Server
192.168.0.55/26 -
+ fc02:1000::37/96 @@ -2874,7 +2874,7 @@ Server
192.168.0.56/26 -
+ fc02:1000::38/96 @@ -2904,7 +2904,7 @@ Server
192.168.0.57/26 -
+ fc02:1000::39/96 diff --git a/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml index 37e1a87288..af0bab8c71 100644 --- a/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml @@ -1254,7 +1254,7 @@ Server
192.168.0.2/26 -
+ fc02:1000::2/96 @@ -1284,7 +1284,7 @@ Server
192.168.0.3/26 -
+ fc02:1000::3/96 @@ -1314,7 +1314,7 @@ Server
192.168.0.4/26 -
+ fc02:1000::4/96 @@ -1344,7 +1344,7 @@ Server
192.168.0.5/26 -
+ fc02:1000::5/96 @@ -1374,7 +1374,7 @@ Server
192.168.0.6/26 -
+ fc02:1000::6/96 @@ -1404,7 +1404,7 @@ Server
192.168.0.7/26 -
+ fc02:1000::7/96 @@ -1434,7 +1434,7 @@ Server
192.168.0.8/26 -
+ fc02:1000::8/96 @@ -1464,7 +1464,7 @@ Server
192.168.0.9/26 -
+ fc02:1000::9/96 @@ -1494,7 +1494,7 @@ Server
192.168.0.10/26 -
+ fc02:1000::a/96 @@ -1524,7 +1524,7 @@ Server
192.168.0.11/26 -
+ fc02:1000::b/96 @@ -1554,7 +1554,7 @@ Server
192.168.0.12/26 -
+ fc02:1000::c/96 @@ -1584,7 +1584,7 @@ Server
192.168.0.13/26 -
+ fc02:1000::d/96 @@ -1614,7 +1614,7 @@ Server
192.168.0.14/26 -
+ fc02:1000::e/96 @@ -1644,7 +1644,7 @@ Server
192.168.0.15/26 -
+ fc02:1000::f/96 @@ -1674,7 +1674,7 @@ Server
192.168.0.16/26 -
+ fc02:1000::10/96 @@ -1704,7 +1704,7 @@ Server
192.168.0.17/26 -
+ fc02:1000::11/96 @@ -1734,7 +1734,7 @@ Server
192.168.0.18/26 -
+ fc02:1000::12/96 @@ -1764,7 +1764,7 @@ Server
192.168.0.19/26 -
+ fc02:1000::13/96 @@ -1794,7 +1794,7 @@ Server
192.168.0.20/26 -
+ fc02:1000::14/96 @@ -1824,7 +1824,7 @@ Server
192.168.0.21/26 -
+ fc02:1000::15/96 @@ -1854,7 +1854,7 @@ Server
192.168.0.22/26 -
+ fc02:1000::16/96 @@ -1884,7 +1884,7 @@ Server
192.168.0.23/26 -
+ fc02:1000::17/96 @@ -1914,7 +1914,7 @@ Server
192.168.0.24/26 -
+ fc02:1000::18/96 @@ -1944,7 +1944,7 @@ Server
192.168.0.25/26 -
+ fc02:1000::19/96 @@ -1974,7 +1974,7 @@ Server
192.168.0.26/26 -
+ fc02:1000::1a/96 @@ -2004,7 +2004,7 @@ Server
192.168.0.27/26 -
+ fc02:1000::1b/96 @@ -2034,7 +2034,7 @@ Server
192.168.0.28/26 -
+ fc02:1000::1c/96 @@ -2064,7 +2064,7 @@ Server
192.168.0.29/26 -
+ fc02:1000::1d/96 @@ -2094,7 +2094,7 @@ Server
192.168.0.30/26 -
+ fc02:1000::1e/96 @@ -2124,7 +2124,7 @@ Server
192.168.0.31/26 -
+ fc02:1000::1f/96 @@ -2154,7 +2154,7 @@ Server
192.168.0.32/26 -
+ fc02:1000::20/96 @@ -2184,7 +2184,7 @@ Server
192.168.0.33/26 -
+ fc02:1000::21/96 @@ -2214,7 +2214,7 @@ Server
192.168.0.34/26 -
+ fc02:1000::22/96 @@ -2244,7 +2244,7 @@ Server
192.168.0.35/26 -
+ fc02:1000::23/96 @@ -2274,7 +2274,7 @@ Server
192.168.0.36/26 -
+ fc02:1000::24/96 @@ -2304,7 +2304,7 @@ Server
192.168.0.37/26 -
+ fc02:1000::25/96 @@ -2334,7 +2334,7 @@ Server
192.168.0.38/26 -
+ fc02:1000::26/96 @@ -2364,7 +2364,7 @@ Server
192.168.0.39/26 -
+ fc02:1000::27/96 @@ -2394,7 +2394,7 @@ Server
192.168.0.40/26 -
+ fc02:1000::28/96 @@ -2424,7 +2424,7 @@ Server
192.168.0.41/26 -
+ fc02:1000::29/96 @@ -2454,7 +2454,7 @@ Server
192.168.0.42/26 -
+ fc02:1000::2a/96 @@ -2484,7 +2484,7 @@ Server
192.168.0.43/26 -
+ fc02:1000::2b/96 @@ -2514,7 +2514,7 @@ Server
192.168.0.44/26 -
+ fc02:1000::2c/96 @@ -2544,7 +2544,7 @@ Server
192.168.0.45/26 -
+ fc02:1000::2d/96 @@ -2574,7 +2574,7 @@ Server
192.168.0.46/26 -
+ fc02:1000::2e/96 @@ -2604,7 +2604,7 @@ Server
192.168.0.47/26 -
+ fc02:1000::2f/96 @@ -2634,7 +2634,7 @@ Server
192.168.0.48/26 -
+ fc02:1000::30/96 @@ -2664,7 +2664,7 @@ Server
192.168.0.49/26 -
+ fc02:1000::31/96 @@ -2694,7 +2694,7 @@ Server
192.168.0.50/26 -
+ fc02:1000::32/96 @@ -2724,7 +2724,7 @@ Server
192.168.0.51/26 -
+ fc02:1000::33/96 @@ -2754,7 +2754,7 @@ Server
192.168.0.52/26 -
+ fc02:1000::34/96 @@ -2784,7 +2784,7 @@ Server
192.168.0.53/26 -
+ fc02:1000::35/96 @@ -2814,7 +2814,7 @@ Server
192.168.0.54/26 -
+ fc02:1000::36/96 @@ -2844,7 +2844,7 @@ Server
192.168.0.55/26 -
+ fc02:1000::37/96 @@ -2874,7 +2874,7 @@ Server
192.168.0.56/26 -
+ fc02:1000::38/96 @@ -2904,7 +2904,7 @@ Server
192.168.0.57/26 -
+ fc02:1000::39/96 diff --git a/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-c36-lc-t2-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-c36-lc-t2-minigraph.xml index 16f9f8fe86..8afcaf9d8d 100644 --- a/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-c36-lc-t2-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-c36-lc-t2-minigraph.xml @@ -914,8 +914,8 @@ 10 3 - - + + ASIC0 ASIC1 diff --git a/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-d36-lc-t2-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-d36-lc-t2-minigraph.xml index 98cb393373..2ba497bb99 100644 --- a/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-d36-lc-t2-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7800r3a-36dm2-d36-lc-t2-minigraph.xml @@ -914,8 +914,8 @@ 10 3 - - + + ASIC0 str3-7800-lc2-1 diff --git a/src/sonic-config-engine/tests/sample-cisco-8101-t1-port-config.ini b/src/sonic-config-engine/tests/sample-cisco-8101-t1-port-config.ini index 434b31e777..0743f2a310 100644 --- a/src/sonic-config-engine/tests/sample-cisco-8101-t1-port-config.ini +++ b/src/sonic-config-engine/tests/sample-cisco-8101-t1-port-config.ini @@ -1,57 +1,57 @@ -# name lanes alias index speed -Ethernet0 2304,2305,2306,2307 etp0a 0 100000 -Ethernet4 2308,2309,2310,2311 etp0b 0 100000 -Ethernet8 2320,2321,2322,2323 etp1a 1 100000 -Ethernet12 2324,2325,2326,2327 etp1b 1 100000 -Ethernet16 2312,2313,2314,2315 etp2a 2 100000 -Ethernet20 2316,2317,2318,2319 etp2b 2 100000 -Ethernet24 2056,2057,2058,2059 etp3a 3 100000 -Ethernet28 2060,2061,2062,2063 etp3b 3 100000 -Ethernet32 1792,1793,1794,1795 etp4a 4 100000 -Ethernet36 1796,1797,1798,1799 etp4b 4 100000 -Ethernet40 2048,2049,2050,2051 etp5a 5 100000 -Ethernet44 2052,2053,2054,2055 etp5b 5 100000 -Ethernet48 2560,2561,2562,2563 etp6a 6 100000 -Ethernet52 2564,2565,2566,2567 etp6b 6 100000 -Ethernet56 2824,2825,2826,2827 etp7a 7 100000 -Ethernet60 2828,2829,2830,2831 etp7b 7 100000 -Ethernet64 2832,2833,2834,2835 etp8a 8 100000 -Ethernet68 2836,2837,2838,2839 etp8b 8 100000 -Ethernet72 2816,2817,2818,2819 etp9a 9 100000 -Ethernet76 2820,2821,2822,2823 etp9b 9 100000 -Ethernet80 2568,2569,2570,2571 etp10a 10 100000 -Ethernet84 2572,2573,2574,2575 etp10b 10 100000 -Ethernet88 2576,2577,2578,2579 etp11a 11 100000 -Ethernet92 2580,2581,2582,2583 etp11b 11 100000 -Ethernet96 1536,1537,1538,1539,1540,1541,1542,1543 etp12 12 400000 -Ethernet104 1800,1801,1802,1803,1804,1805,1806,1807 etp13 13 400000 -Ethernet112 1552,1553,1554,1555,1556,1557,1558,1559 etp14 14 400000 -Ethernet120 1544,1545,1546,1547,1548,1549,1550,1551 etp15 15 400000 -Ethernet128 1296,1297,1298,1299,1300,1301,1302,1303 etp16 16 400000 -Ethernet136 1288,1289,1290,1291,1292,1293,1294,1295 etp17 17 400000 -Ethernet144 1280,1281,1282,1283,1284,1285,1286,1287 etp18 18 400000 -Ethernet152 1032,1033,1034,1035,1036,1037,1038,1039 etp19 19 400000 -Ethernet160 264,265,266,267 etp20a 20 100000 -Ethernet164 268,269,270,271 etp20b 20 100000 -Ethernet168 272,273,274,275 etp21a 21 100000 -Ethernet172 276,277,278,279 etp21b 21 100000 -Ethernet176 16,17,18,19 etp22a 22 100000 -Ethernet180 20,21,22,23 etp22b 22 100000 -Ethernet184 0,1,2,3 etp23a 23 100000 -Ethernet188 4,5,6,7 etp23b 23 100000 -Ethernet192 256,257,258,259 etp24a 24 100000 -Ethernet196 260,261,262,263 etp24b 24 100000 -Ethernet200 8,9,10,11 etp25a 25 100000 -Ethernet204 12,13,14,15 etp25b 25 100000 -Ethernet208 1024,1025,1026,1027 etp26a 26 100000 -Ethernet212 1028,1029,1030,1031 etp26b 26 100000 -Ethernet216 768,769,770,771 etp27a 27 100000 -Ethernet220 772,773,774,775 etp27b 27 100000 -Ethernet224 524,525,526,527 etp28a 28 100000 -Ethernet228 520,521,522,523 etp28b 28 100000 -Ethernet232 776,777,778,779 etp29a 29 100000 -Ethernet236 780,781,782,783 etp29b 29 100000 -Ethernet240 516,517,518,519 etp30a 30 100000 -Ethernet244 512,513,514,515 etp30b 30 100000 -Ethernet248 528,529,530,531 etp31a 31 100000 +# name lanes alias index speed +Ethernet0 2304,2305,2306,2307 etp0a 0 100000 +Ethernet4 2308,2309,2310,2311 etp0b 0 100000 +Ethernet8 2320,2321,2322,2323 etp1a 1 100000 +Ethernet12 2324,2325,2326,2327 etp1b 1 100000 +Ethernet16 2312,2313,2314,2315 etp2a 2 100000 +Ethernet20 2316,2317,2318,2319 etp2b 2 100000 +Ethernet24 2056,2057,2058,2059 etp3a 3 100000 +Ethernet28 2060,2061,2062,2063 etp3b 3 100000 +Ethernet32 1792,1793,1794,1795 etp4a 4 100000 +Ethernet36 1796,1797,1798,1799 etp4b 4 100000 +Ethernet40 2048,2049,2050,2051 etp5a 5 100000 +Ethernet44 2052,2053,2054,2055 etp5b 5 100000 +Ethernet48 2560,2561,2562,2563 etp6a 6 100000 +Ethernet52 2564,2565,2566,2567 etp6b 6 100000 +Ethernet56 2824,2825,2826,2827 etp7a 7 100000 +Ethernet60 2828,2829,2830,2831 etp7b 7 100000 +Ethernet64 2832,2833,2834,2835 etp8a 8 100000 +Ethernet68 2836,2837,2838,2839 etp8b 8 100000 +Ethernet72 2816,2817,2818,2819 etp9a 9 100000 +Ethernet76 2820,2821,2822,2823 etp9b 9 100000 +Ethernet80 2568,2569,2570,2571 etp10a 10 100000 +Ethernet84 2572,2573,2574,2575 etp10b 10 100000 +Ethernet88 2576,2577,2578,2579 etp11a 11 100000 +Ethernet92 2580,2581,2582,2583 etp11b 11 100000 +Ethernet96 1536,1537,1538,1539,1540,1541,1542,1543 etp12 12 400000 +Ethernet104 1800,1801,1802,1803,1804,1805,1806,1807 etp13 13 400000 +Ethernet112 1552,1553,1554,1555,1556,1557,1558,1559 etp14 14 400000 +Ethernet120 1544,1545,1546,1547,1548,1549,1550,1551 etp15 15 400000 +Ethernet128 1296,1297,1298,1299,1300,1301,1302,1303 etp16 16 400000 +Ethernet136 1288,1289,1290,1291,1292,1293,1294,1295 etp17 17 400000 +Ethernet144 1280,1281,1282,1283,1284,1285,1286,1287 etp18 18 400000 +Ethernet152 1032,1033,1034,1035,1036,1037,1038,1039 etp19 19 400000 +Ethernet160 264,265,266,267 etp20a 20 100000 +Ethernet164 268,269,270,271 etp20b 20 100000 +Ethernet168 272,273,274,275 etp21a 21 100000 +Ethernet172 276,277,278,279 etp21b 21 100000 +Ethernet176 16,17,18,19 etp22a 22 100000 +Ethernet180 20,21,22,23 etp22b 22 100000 +Ethernet184 0,1,2,3 etp23a 23 100000 +Ethernet188 4,5,6,7 etp23b 23 100000 +Ethernet192 256,257,258,259 etp24a 24 100000 +Ethernet196 260,261,262,263 etp24b 24 100000 +Ethernet200 8,9,10,11 etp25a 25 100000 +Ethernet204 12,13,14,15 etp25b 25 100000 +Ethernet208 1024,1025,1026,1027 etp26a 26 100000 +Ethernet212 1028,1029,1030,1031 etp26b 26 100000 +Ethernet216 768,769,770,771 etp27a 27 100000 +Ethernet220 772,773,774,775 etp27b 27 100000 +Ethernet224 524,525,526,527 etp28a 28 100000 +Ethernet228 520,521,522,523 etp28b 28 100000 +Ethernet232 776,777,778,779 etp29a 29 100000 +Ethernet236 780,781,782,783 etp29b 29 100000 +Ethernet240 516,517,518,519 etp30a 30 100000 +Ethernet244 512,513,514,515 etp30b 30 100000 +Ethernet248 528,529,530,531 etp31a 31 100000 Ethernet252 532,533,534,535 etp31b 31 100000 diff --git a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml index fef3526bee..306d06d649 100644 --- a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml @@ -725,7 +725,7 @@
-
+ diff --git a/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x100g-t2-minigraph.xml b/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x100g-t2-minigraph.xml index f6d1e2e4da..7bb8229839 100644 --- a/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x100g-t2-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x100g-t2-minigraph.xml @@ -914,8 +914,8 @@ 10 3 - - + + ASIC0 ASIC1 diff --git a/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x400g-t2-minigraph.xml b/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x400g-t2-minigraph.xml index 30f5cce8ae..ff923b5091 100644 --- a/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x400g-t2-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-nokia-ixr7250e-36x400g-t2-minigraph.xml @@ -154,8 +154,8 @@ 10 3 - - + + ASIC0 ASIC1 diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json index 40768edc93..8b06ecee09 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json @@ -15,7 +15,7 @@ "AZURE": { "0": "0", "1": "1", - "2": "1", + "2": "1", "3": "3", "4": "4", "5": "5", @@ -26,7 +26,7 @@ "AZURE_UPLINK": { "0": "0", "1": "1", - "2": "2", + "2": "2", "3": "3", "4": "4", "5": "5", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-d48c40-t0.json b/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-d48c40-t0.json index 90190f9b13..6c15a0fd98 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-d48c40-t0.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-d48c40-t0.json @@ -289,7 +289,7 @@ "PORT_QOS_MAP": { "Ethernet2": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -298,7 +298,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -307,7 +307,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet6": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -316,7 +316,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -325,7 +325,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet10": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -334,7 +334,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -343,7 +343,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet14": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -352,7 +352,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -361,7 +361,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet18": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -370,7 +370,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -379,7 +379,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet22": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -388,7 +388,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -397,7 +397,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet26": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -406,7 +406,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -415,7 +415,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet30": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -424,7 +424,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -433,7 +433,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet34": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -442,7 +442,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -451,7 +451,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet38": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", @@ -460,7 +460,7 @@ "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { - + "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-acl-test.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-acl-test.xml index 13dbbd17a2..45ed5c02d9 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-acl-test.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-acl-test.xml @@ -379,7 +379,7 @@ 10.7.0.196/26 - + Force10-S6000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml index 91c0aa46c1..4ae1b33023 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml @@ -314,7 +314,7 @@ 10.7.0.196/26 - + Force10-S6000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml index a88bc4e2ad..6bc2a6db1b 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml @@ -314,7 +314,7 @@ 10.7.0.196/26 - + Force10-S6000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml index 406c613a9c..8c69f04962 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml @@ -314,7 +314,7 @@ 10.7.0.196/26 - + Force10-S6000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index aaade89d5d..69b27c33e7 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -359,7 +359,7 @@ 10.7.0.196/26 - + Force10-S6000 diff --git a/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml b/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml index 552d219964..afac4da7d9 100644 --- a/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml +++ b/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml @@ -109,7 +109,7 @@ -
10.1.0.32
+
10.1.0.32
BGPSLBPassive 10.10.10.10/26;100.100.100.100/26
diff --git a/src/sonic-config-engine/tests/t0-sample-deployment-id.xml b/src/sonic-config-engine/tests/t0-sample-deployment-id.xml index 30517dfee1..2beb891775 100644 --- a/src/sonic-config-engine/tests/t0-sample-deployment-id.xml +++ b/src/sonic-config-engine/tests/t0-sample-deployment-id.xml @@ -109,7 +109,7 @@ -
10.1.0.32
+
10.1.0.32
BGPSLBPassive 10.10.10.10/26;100.100.100.100/26
diff --git a/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml b/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml index cc6f5e9594..39e73fc42f 100644 --- a/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml +++ b/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml @@ -2133,9 +2133,9 @@ true 0 - ACS-MSN2700 + ACS-MSN2700 - + diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml index 212d9c76a6..8f11691513 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml @@ -127,7 +127,7 @@ PortChannel8 Ethernet16;Ethernet20 - + @@ -201,11 +201,11 @@ SpineFront01 - Force10-S6000 + Force10-S6000 SpineFront02 - Force10-S6000 + Force10-S6000 Leaf01 @@ -611,9 +611,9 @@ false 0 - Force10-S6000 + Force10-S6000 - + diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml index 9384446aa9..96d89c985e 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml @@ -165,11 +165,11 @@ SpineFront01 - Force10-S6000 + Force10-S6000 SpineFront02 - Force10-S6000 + Force10-S6000 Leaf01 @@ -575,9 +575,9 @@ false 0 - Force10-S6000 + Force10-S6000 - + diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml index 3fd8ed01c2..8c79fb8402 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml @@ -164,11 +164,11 @@ SpineFront01 - Force10-S6000 + Force10-S6000 SpineFront02 - Force10-S6000 + Force10-S6000 Leaf01 @@ -574,9 +574,9 @@ false 0 - Force10-S6000 + Force10-S6000 - + diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 316a276374..29d21f6b55 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -304,7 +304,7 @@ class TestCfgGen(TestCase): argument = ['-m', self.ecmp_graph, '-p', self.mlnx_port_config, '-v', 'FG_NHG'] output = self.run_script(argument) print(output.strip()) - self.assertEqual(utils.to_dict(output.strip()), + self.assertEqual(utils.to_dict(output.strip()), utils.to_dict( "{'fgnhg_v4': {'match_mode': 'nexthop-based', 'bucket_size': 120}, " "'fgnhg_v6': {'match_mode': 'nexthop-based', 'bucket_size': 120}}" @@ -378,7 +378,7 @@ class TestCfgGen(TestCase): utils.to_dict( "{'Ethernet124': {'name': 'ARISTA04T1', 'port': 'Ethernet1/1'}, " "'Ethernet120': {'name': 'ARISTA03T1', 'port': 'Ethernet1/1'}, " - "'Ethernet4': {'name': 'Servers0', 'port': 'eth0'}, " + "'Ethernet4': {'name': 'Servers0', 'port': 'eth0'}, " "'Ethernet116': {'name': 'ARISTA02T1', 'port': 'Ethernet1/1'}, " "'Ethernet100': {'name': 'Servers100', 'port': 'eth0'}, " "'Ethernet112': {'name': 'ARISTA01T1', 'port': 'Ethernet1/1'}}") @@ -619,7 +619,7 @@ class TestCfgGen(TestCase): ) def test_minigraph_extra_ethernet_interfaces(self, **kwargs): - graph_file = kwargs.get('graph_file', self.sample_graph_simple) + graph_file = kwargs.get('graph_file', self.sample_graph_simple) argument = ['-m', graph_file, '-p', self.port_config, '-v', "PORT"] output = self.run_script(argument) @@ -982,7 +982,7 @@ class TestCfgGen(TestCase): "'Vlan2000': {'dhcpv6_servers': ['fc02:2000::3', 'fc02:2000::4']}}" ) ) - + def test_minigraph_bgp_packet_chassis_peer(self): argument = ['-m', self.packet_chassis_graph, '-p', self.packet_chassis_port_ini, '-n', "asic1", '-v', "BGP_INTERNAL_NEIGHBOR[\'8.0.0.1\']"] output = self.run_script(argument) @@ -1052,7 +1052,7 @@ class TestCfgGen(TestCase): "'Ethernet120': {'lanes': '16,17,18,19', 'alias': 'Ethernet16/1', 'index': '16', 'role': 'Ext', 'speed': '100000', 'asic_port_name': 'Eth120-ASIC0', 'fec': 'rs', 'description': 'ARISTA17T3:Ethernet1', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}, " "'Ethernet128': {'lanes': '8,9,10,11', 'alias': 'Ethernet17/1', 'index': '17', 'role': 'Ext', 'speed': '100000', 'asic_port_name': 'Eth128-ASIC0', 'fec': 'rs', 'description': 'ARISTA18T3:Ethernet1', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}, " "'Ethernet136': {'lanes': '0,1,2,3', 'alias': 'Ethernet18/1', 'index': '18', 'role': 'Ext', 'speed': '100000', 'asic_port_name': 'Eth136-ASIC0', 'fec': 'rs', 'description': 'ARISTA18T3:Ethernet2', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}, " - "'Ethernet-Rec0': {'lanes': '221', 'alias': 'Recirc0/0', 'index': '37', 'role': 'Rec', 'speed': '400000', 'asic_port_name': 'Rcy0-ASIC0', 'description': 'Recirc0/0', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}," + "'Ethernet-Rec0': {'lanes': '221', 'alias': 'Recirc0/0', 'index': '37', 'role': 'Rec', 'speed': '400000', 'asic_port_name': 'Rcy0-ASIC0', 'description': 'Recirc0/0', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}," "'Ethernet-IB0': {'lanes': '222', 'alias': 'Recirc0/1', 'index': '38', 'role': 'Inb', 'speed': '400000', 'asic_port_name': 'Rcy1-ASIC0', 'description': 'Recirc0/1', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}}" ) ) diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 4892fbc49f..48221a74ab 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -227,13 +227,13 @@ class TestCfgGenCaseInsensitive(TestCase): 'hwsku': 'server-sku', 'type': 'Server' }, - 'switch-01t1': { + 'switch-01t1': { 'lo_addr': '10.1.0.186/32', 'deployment_id': '2', 'hwsku': 'Force10-S6000', 'type': 'LeafRouter', - 'mgmt_addr': '10.7.0.196/26' - }, + 'mgmt_addr': '10.7.0.196/26' + }, 'server1-SC': { 'lo_addr_v6': '::/0', 'mgmt_addr': '0.0.0.0/0', @@ -299,7 +299,7 @@ class TestCfgGenCaseInsensitive(TestCase): 'address_ipv4': "25.1.1.10" } } - + output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), @@ -308,7 +308,7 @@ class TestCfgGenCaseInsensitive(TestCase): def test_mux_cable_parsing(self): result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config) - + expected_mux_cable_ports = ["Ethernet4", "Ethernet8"] port_table = result['PORT'] for port_name, port in port_table.items(): @@ -349,7 +349,7 @@ class TestCfgGenCaseInsensitive(TestCase): output = subprocess.check_output(["sed", "-i", 's/%s/%s/g' % (BACKEND_TOR_ROUTER, TOR_ROUTER), graph_file], stderr=subprocess.STDOUT) else: output = subprocess.check_output(["sed", "-i", 's/%s/%s/g' % (BACKEND_TOR_ROUTER, TOR_ROUTER), graph_file]) - + def test_minigraph_tunnel_table(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "TUNNEL"] expected_tunnel = { @@ -436,7 +436,7 @@ class TestCfgGenCaseInsensitive(TestCase): utils.to_dict(output.strip()), expected_table ) - + def test_dhcp_table(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "DHCP_RELAY"] expected = { @@ -458,12 +458,12 @@ class TestCfgGenCaseInsensitive(TestCase): utils.to_dict(output.strip()), expected ) - + def test_minigraph_mirror_dscp(self): result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config) self.assertTrue('EVERFLOW_DSCP' in result['ACL_TABLE']) everflow_dscp_entry = result['ACL_TABLE']['EVERFLOW_DSCP'] - + self.assertEqual(everflow_dscp_entry['type'], 'MIRROR_DSCP') self.assertEqual(everflow_dscp_entry['stage'], 'ingress') expected_ports = ['PortChannel01', 'Ethernet12', 'Ethernet8', 'Ethernet0'] diff --git a/src/sonic-config-engine/tests/voq-sample-400g-port-config.ini b/src/sonic-config-engine/tests/voq-sample-400g-port-config.ini index f86cdb335e..a905c53d3f 100644 --- a/src/sonic-config-engine/tests/voq-sample-400g-port-config.ini +++ b/src/sonic-config-engine/tests/voq-sample-400g-port-config.ini @@ -1,21 +1,21 @@ -# name lanes alias index role speed asic_port_name -Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0-ASIC0 -Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8-ASIC0 -Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16-ASIC0 -Ethernet24 96,97,98,99,100,101,102,103 Ethernet4/1 4 Ext 400000 Eth24-ASIC0 -Ethernet32 104,105,106,107,108,109,110,111 Ethernet5/1 5 Ext 400000 Eth32-ASIC0 -Ethernet40 112,113,114,115,116,117,118,119 Ethernet6/1 6 Ext 400000 Eth40-ASIC0 -Ethernet48 120,121,122,123,124,125,126,127 Ethernet7/1 7 Ext 400000 Eth48-ASIC0 -Ethernet56 128,129,130,131,132,133,134,135 Ethernet8/1 8 Ext 400000 Eth56-ASIC0 -Ethernet64 136,137,138,139,140,141,142,143 Ethernet9/1 9 Ext 400000 Eth64-ASIC0 -Ethernet72 64,65,66,67,68,69,70,71 Ethernet10/1 10 Ext 400000 Eth72-ASIC0 -Ethernet80 56,57,58,59,60,61,62,63 Ethernet11/1 11 Ext 400000 Eth80-ASIC0 -Ethernet88 48,49,50,51,52,53,54,55 Ethernet12/1 12 Ext 400000 Eth88-ASIC0 -Ethernet96 40,41,42,43,44,45,46,47 Ethernet13/1 13 Ext 400000 Eth96-ASIC0 -Ethernet104 32,33,34,35,36,37,38,39 Ethernet14/1 14 Ext 400000 Eth104-ASIC0 -Ethernet112 24,25,26,27,28,29,30,31 Ethernet15/1 15 Ext 400000 Eth112-ASIC0 -Ethernet120 16,17,18,19,20,21,22,23 Ethernet16/1 16 Ext 400000 Eth120-ASIC0 -Ethernet128 8,9,10,11,12,13,14,15 Ethernet17/1 17 Ext 400000 Eth128-ASIC0 -Ethernet136 0,1,2,3,4,5,6,7 Ethernet18/1 18 Ext 400000 Eth136-ASIC0 -Ethernet-Rec0 221 Recirc0/0 37 Rec 400000 Rcy0-ASIC0 -Ethernet-IB0 222 Recirc0/1 38 Inb 400000 Rcy1-ASIC0 +# name lanes alias index role speed asic_port_name +Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0-ASIC0 +Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8-ASIC0 +Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16-ASIC0 +Ethernet24 96,97,98,99,100,101,102,103 Ethernet4/1 4 Ext 400000 Eth24-ASIC0 +Ethernet32 104,105,106,107,108,109,110,111 Ethernet5/1 5 Ext 400000 Eth32-ASIC0 +Ethernet40 112,113,114,115,116,117,118,119 Ethernet6/1 6 Ext 400000 Eth40-ASIC0 +Ethernet48 120,121,122,123,124,125,126,127 Ethernet7/1 7 Ext 400000 Eth48-ASIC0 +Ethernet56 128,129,130,131,132,133,134,135 Ethernet8/1 8 Ext 400000 Eth56-ASIC0 +Ethernet64 136,137,138,139,140,141,142,143 Ethernet9/1 9 Ext 400000 Eth64-ASIC0 +Ethernet72 64,65,66,67,68,69,70,71 Ethernet10/1 10 Ext 400000 Eth72-ASIC0 +Ethernet80 56,57,58,59,60,61,62,63 Ethernet11/1 11 Ext 400000 Eth80-ASIC0 +Ethernet88 48,49,50,51,52,53,54,55 Ethernet12/1 12 Ext 400000 Eth88-ASIC0 +Ethernet96 40,41,42,43,44,45,46,47 Ethernet13/1 13 Ext 400000 Eth96-ASIC0 +Ethernet104 32,33,34,35,36,37,38,39 Ethernet14/1 14 Ext 400000 Eth104-ASIC0 +Ethernet112 24,25,26,27,28,29,30,31 Ethernet15/1 15 Ext 400000 Eth112-ASIC0 +Ethernet120 16,17,18,19,20,21,22,23 Ethernet16/1 16 Ext 400000 Eth120-ASIC0 +Ethernet128 8,9,10,11,12,13,14,15 Ethernet17/1 17 Ext 400000 Eth128-ASIC0 +Ethernet136 0,1,2,3,4,5,6,7 Ethernet18/1 18 Ext 400000 Eth136-ASIC0 +Ethernet-Rec0 221 Recirc0/0 37 Rec 400000 Rcy0-ASIC0 +Ethernet-IB0 222 Recirc0/1 38 Inb 400000 Rcy1-ASIC0 diff --git a/src/sonic-config-engine/tests/voq-sample-masic-graph.xml b/src/sonic-config-engine/tests/voq-sample-masic-graph.xml index cda6c1a6a3..b56f09a437 100644 --- a/src/sonic-config-engine/tests/voq-sample-masic-graph.xml +++ b/src/sonic-config-engine/tests/voq-sample-masic-graph.xml @@ -914,8 +914,8 @@ 10 3
- - + + ASIC0 ASIC1 diff --git a/src/sonic-ctrmgrd/ctrmgr/container b/src/sonic-ctrmgrd/ctrmgr/container index 9be2a5b3fe..74212ee310 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container +++ b/src/sonic-ctrmgrd/ctrmgr/container @@ -98,7 +98,7 @@ def read_data(is_config, feature, fields): def read_config(feature): """ Read requried feature config """ - set_owner, no_fallback, state = read_data(True, feature, + set_owner, no_fallback, state = read_data(True, feature, [(SET_OWNER, "local"), (NO_FALLBACK, False), (STATE, "disabled")]) return (set_owner, not no_fallback, state) @@ -143,13 +143,13 @@ def container_version(feature): for env in envs: if env.startswith("IMAGE_VERSION="): version = env.split('=')[1] - + syslog.syslog(syslog.LOG_INFO, "docker get image version for {}".format(feature)) - + except (docker.errors.NotFound, docker.errors.APIError) as err: syslog.syslog(syslog.LOG_ERR, "docker get image version for {} failed with {}". format(feature, str(err))) - + return version @@ -164,11 +164,11 @@ def set_label(feature, create): # redundant set (data already exist) can still raise subscriber # notification. So check & set. - # Redundant delete (data doesn't exist) does not raise any + # Redundant delete (data doesn't exist) does not raise any # subscriber notification. So no need to pre-check for delete. # tbl.set(KUBE_LABEL_SET_KEY, [(fld, "true" if create else "false")]) - + def update_data(feature, data): if remote_ctr_enabled: @@ -180,13 +180,13 @@ def update_data(feature, data): def container_id(feature): """ Return the container ID for the feature. - + if current_owner is local, use feature name as the start/stop - of local image is synchronous. + of local image is synchronous. Else get it from FEATURE table in STATE-DB :param feature: Name of the feature to start. - + """ init() @@ -202,19 +202,19 @@ def container_id(feature): def container_start(feature, **kwargs): """ Starts a container for given feature. - + Starts from local image and/or trigger kubernetes to deploy the image for this feature. Marks the feature state up in STATE-DB FEATURE table. If feature's set_owner is local, invoke docker start. If feature's set_owner is kube, it creates a node label that - would trigger kubernetes to start the container. With kube as + would trigger kubernetes to start the container. With kube as owner, if fallback is enabled and remote_state==none, it starts the local image using docker, which will run until kube deployment occurs. :param feature: Name of the feature to start. - + """ START_LOCAL = 1 START_KUBE = 2 @@ -279,7 +279,7 @@ def container_stop(feature, **kwargs): Marks the feature state down in STATE-DB FEATURE table. :param feature: Name of the feature to stop. - + """ debug_msg("BEGIN") @@ -336,7 +336,7 @@ def container_kill(feature, **kwargs): Instruct/ensure kube terminates, by removing label. :param feature: Name of the feature to kill. - + """ debug_msg("BEGIN") @@ -383,7 +383,7 @@ def container_wait(feature, **kwargs): table and exit. :param feature: Name of the feature to wait. - + """ debug_msg("BEGIN") diff --git a/src/sonic-ctrmgrd/ctrmgr/container_startup.py b/src/sonic-ctrmgrd/ctrmgr/container_startup.py index 2eb5fae291..0388258c14 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container_startup.py +++ b/src/sonic-ctrmgrd/ctrmgr/container_startup.py @@ -70,7 +70,7 @@ def read_data(feature): def read_fields(state_db, feature, fields): # Read directly from STATE-DB, given fields - # for given feature. + # for given feature. # Fields is a list of tuples (, ) # tbl = swsscommon.Table(state_db, 'FEATURE') @@ -100,11 +100,11 @@ def drop_label(state_db, feature, version): # Mark given feature version as dropped in labels. # Update is done in state-db. # ctrmgrd sets it with kube API server per reaschability - + tbl = swsscommon.Table(state_db, KUBE_LABEL_TABLE) name = _get_local_version_key(feature) tbl.set(KUBE_LABEL_SET_KEY, [(name, version)]) - + def update_data(state_db, feature, data): # Update STATE-DB entry for this feature with given data @@ -166,7 +166,7 @@ def update_state(state_db, feature, owner=None, version=None): sets owner, version & container-id for this feature in state-db. If owner is local, update label to block remote deploying same version or - if kube, sets state to "running". + if kube, sets state to "running". """ data = { @@ -197,7 +197,7 @@ def do_freeze(feat, m): if UNIT_TESTING: break time.sleep(60) - + def container_up(feature, owner, version): """ @@ -208,7 +208,7 @@ def container_up(feature, owner, version): This call does the basic check for if this starting-container can be allowed to run based on current state, and owner & version of this starting - container. + container. If allowed to proceed, this info is recorded in state-db and return to enable container start the main application. Else it proceeds to @@ -245,7 +245,7 @@ def container_up(feature, owner, version): else: debug_msg("{}: Skip remote_state({}) update".format(feature, mode)) - + i = 0 while (mode != "ready"): if (i % 10) == 0: @@ -253,7 +253,7 @@ def container_up(feature, owner, version): i += 1 time.sleep(2) - mode, db_version = read_fields(state_db, + mode, db_version = read_fields(state_db, feature, [(REMOTE_STATE, "none"), (VERSION, "")]) if version != db_version: # looks like another instance has overwritten. Exit for now. @@ -279,7 +279,7 @@ def main(): parser.add_argument("-f", "--feature", required=True) parser.add_argument("-o", "--owner", choices=["local", "kube"], required=True) parser.add_argument("-v", "--version", required=True) - + args = parser.parse_args() container_up(args.feature, args.owner, args.version) diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py index aae2131a49..efaa51d1ae 100644 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py @@ -12,7 +12,7 @@ UNIT_TESTING = 0 # NOTE: # Unable to use python-iptables as that does not create rules per ip-tables default # which is nf_tables. So rules added via iptc package will not be listed under -# "sudo iptables -t nat -L -n". But available in kernel. To list, we need to +# "sudo iptables -t nat -L -n". But available in kernel. To list, we need to # use legacy mode as "sudo iptables-legacy -t nat -L -n". # As we can't use two modes and using non-default could make any debugging effort # very tough. diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py index 028ced0c21..9bf12f4a83 100755 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py @@ -194,7 +194,7 @@ class MainServer: def register_timer(self, ts, handler, args=None): - """ Register timer based handler. + """ Register timer based handler. The handler will be called on/after give timestamp, ts """ self.timer_handlers[ts].append((handler, args)) @@ -232,7 +232,7 @@ class MainServer: def set_db_entry(self, db_name, table_name, key, data): - """ Set given data as complete data, which includes + """ Set given data as complete data, which includes removing any fields that are in DB but not in data """ conn = self.db_connectors[db_name] @@ -459,7 +459,7 @@ class RemoteServerHandler: # Handle Set_owner change: # restart service and/or label add/drop # -# Handle remote_state change: +# Handle remote_state change: # When pending, trigger restart # class FeatureTransitionHandler: @@ -526,10 +526,10 @@ class FeatureTransitionHandler: log_debug("No change in feat={} set_owner={}. Bail out.".format( key, set_owner)) return - + if key in self.st_data: log_debug("{} init={} old_set_owner={} owner={}".format(key, init, old_set_owner, set_owner)) - self.handle_update(key, set_owner, + self.handle_update(key, set_owner, self.st_data[key][ST_FEAT_OWNER], self.st_data[key][ST_FEAT_REMOTE_STATE]) @@ -557,7 +557,7 @@ class FeatureTransitionHandler: start_time = datetime.datetime.now() + datetime.timedelta( seconds=remote_ctr_config[TAG_IMAGE_LATEST]) self.server.register_timer(start_time, self.do_tag_latest, ( - key, + key, self.st_data[key][ST_FEAT_CTR_ID], self.st_data[key][ST_FEAT_CTR_VER])) @@ -578,7 +578,7 @@ class FeatureTransitionHandler: self.st_data[key][ST_FEAT_OWNER], remote_state) return - + def do_tag_latest(self, feat, docker_id, image_ver): ret = kube_commands.tag_latest(feat, docker_id, image_ver) if ret != 0: diff --git a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py index fe37c0c842..8a8aad41bc 100755 --- a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py +++ b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py @@ -103,7 +103,7 @@ def kube_read_labels(): return (ret, labels) - + def kube_write_labels(set_labels): """ Set given set_labels. """ @@ -147,7 +147,7 @@ def kube_write_labels(set_labels): return ret - + def func_get_labels(args): """ args parser default function for get labels""" ret, node_labels = kube_read_labels() @@ -157,7 +157,7 @@ def func_get_labels(args): log_debug(json.dumps(node_labels, indent=4)) return 0 - + def is_connected(server=""): """ Check if we are currently connected """ @@ -218,7 +218,7 @@ def _download_file(server, port, insecure): def _gen_cli_kubeconf(server, port, insecure): - """generate identity which can help authenticate and + """generate identity which can help authenticate and authorization to k8s cluster """ client_kubeconfig_template = """ @@ -387,7 +387,7 @@ def kube_join_master(server, port, insecure, force=False): log_debug("join: ret={} out:{} err:{}".format(ret, out, err)) return (ret, out, err) - + def kube_reset_master(force): err = "" @@ -440,7 +440,7 @@ def _do_tag(docker_id, image_ver): else: out = "New version {} is not running.".format(image_ver) ret = -1 - + return (ret, out, err) def _remove_container(feat): @@ -465,7 +465,7 @@ def _remove_container(feat): else: err = "Failed to docker inspect {} |jq -r .[].State.Running. Err: {}".format(feat, err) ret = 1 - + return (ret, out, err) def tag_latest(feat, docker_id, image_ver): @@ -519,10 +519,10 @@ def _do_clean(feat, current_version, last_version): ret = 1 err = "Failed to tag {} local version images. Err: {}".format(feat, err) return ret, out, err - + if last_version in version_dict: del version_dict[last_version] - + versions = [item[DOCKER_ID] for item in version_dict.values()] if versions: clean_res, _, err = _run_command("docker rmi {} --force".format(" ".join(versions))) diff --git a/src/sonic-ctrmgrd/tests/common_test.py b/src/sonic-ctrmgrd/tests/common_test.py index 45f81d150d..385ec80ff2 100755 --- a/src/sonic-ctrmgrd/tests/common_test.py +++ b/src/sonic-ctrmgrd/tests/common_test.py @@ -318,13 +318,13 @@ class Table: d = self.data[key] for (k, v) in items: d[k] = v - + def check(self): expected = self.get_val(current_test_data, [POST, self.db, self.tbl]) ret = check_subset(expected, self.data) - + if ret != 0: print("Failed test={} no={} ret={}".format( current_test_name, current_test_no, ret)) @@ -430,7 +430,7 @@ class mock_subscriber: return (key, "", mock_tbl.get(key)[1]) else: return ("", "", {}) - + def getDbConnector(self): return self.dbconn @@ -507,7 +507,7 @@ def kube_join_side_effect(ip, port, insecure): else: kube_return = 0 return (1, "not joined", "error") - + def kube_reset_side_effect(flag): global kube_actions @@ -529,10 +529,10 @@ def check_kube_actions(): ret = 0 expected = {} expected[KUBE_CMD] = current_test_data.get(KUBE_CMD, {}) - + if expected[KUBE_CMD]: ret = check_subset(expected, kube_actions) - + if ret != 0: print("Failed test={} no={} ret={}".format( current_test_name, current_test_no, ret)) @@ -540,7 +540,7 @@ def check_kube_actions(): print("expect: {}".format(json.dumps(expected, indent=4))) return -1 return 0 - + def set_mock_kube(kube_labels, kube_join, kube_reset): kube_labels.side_effect = kube_labels_side_effect diff --git a/src/sonic-ctrmgrd/tests/container_test.py b/src/sonic-ctrmgrd/tests/container_test.py index 8d1534f8b0..f88ce58433 100755 --- a/src/sonic-ctrmgrd/tests/container_test.py +++ b/src/sonic-ctrmgrd/tests/container_test.py @@ -260,11 +260,11 @@ stop_test_data = { # container_kill test cases -# test case 0 -- container kill local -# -- no change in state-db +# test case 0 -- container kill local +# -- no change in state-db # -- no label update # test case 1 -- container kill kube -- set label -# -- no change in state-db +# -- no change in state-db # -- label update # kill_test_data = { @@ -356,7 +356,7 @@ kill_test_data = { # container_kill test cases # test case 0 -- container kill local disabled container -# -- no change in state-db +# -- no change in state-db # -- no label update # invalid_kill_test_data = { @@ -380,11 +380,11 @@ invalid_kill_test_data = { # container_wait test cases -# test case 0 -- container wait local -# -- no change in state-db +# test case 0 -- container wait local +# -- no change in state-db # -- no label update # test case 1 -- container wait kube with fallback -# -- change in state-db +# -- change in state-db # -- no label update # wait_test_data = { diff --git a/src/sonic-ctrmgrd/tests/ctrmgr_iptables_test.py b/src/sonic-ctrmgrd/tests/ctrmgr_iptables_test.py index cb7178fb43..028c585464 100755 --- a/src/sonic-ctrmgrd/tests/ctrmgr_iptables_test.py +++ b/src/sonic-ctrmgrd/tests/ctrmgr_iptables_test.py @@ -108,7 +108,7 @@ def mock_subproc_run(cmd, shell, capture_output): ins_cmd = ["sudo", "iptables", "-t", "nat", "-A", "OUTPUT", "-p", "tcp", "-d"] assert shell == False - + print("cmd={}".format(cmd)) if list_cmd == cmd[:len(list_cmd)]: if len(cmd) == len(list_cmd) + 1: diff --git a/src/sonic-ctrmgrd/tests/kube_commands_test.py b/src/sonic-ctrmgrd/tests/kube_commands_test.py index 40b8ab180b..62a0b5053b 100755 --- a/src/sonic-ctrmgrd/tests/kube_commands_test.py +++ b/src/sonic-ctrmgrd/tests/kube_commands_test.py @@ -524,7 +524,7 @@ clusters:\n\ # test to_str() f = "abcd" f == kube_commands.to_str(str.encode(f)) - + @patch("kube_commands.subprocess.Popen") def test_reset(self, mock_subproc): diff --git a/src/sonic-device-data/tests/LICENSE b/src/sonic-device-data/tests/LICENSE index fd8968a9bd..0c3e8a78b6 100644 --- a/src/sonic-device-data/tests/LICENSE +++ b/src/sonic-device-data/tests/LICENSE @@ -11,8 +11,8 @@ Broadcom expressly reserves all rights in and to the Software and all intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE -ALL USE OF THE SOFTWARE. - +ALL USE OF THE SOFTWARE. + Except as expressly set forth in the Authorized License, 1. This program, including its structure, sequence and organization, diff --git a/src/sonic-device-data/tests/permitted_list b/src/sonic-device-data/tests/permitted_list index 2ce2cbdfaf..82c92126e6 100644 --- a/src/sonic-device-data/tests/permitted_list +++ b/src/sonic-device-data/tests/permitted_list @@ -167,7 +167,7 @@ xgxs_tx_lane_map ifp_inports_support_enable port_flex_enable pdma_descriptor_prefetch_enable -pktdma_poll_mode_channel_bitmap +pktdma_poll_mode_channel_bitmap num_queues_pci num_queues_uc0 num_queues_uc1 @@ -179,7 +179,7 @@ flowtracker_drop_monitor_enable flowtracker_export_interval_usecs flowtracker_max_export_pkt_length flowtracker_fsp_reinject_max_length -host_as_route_disable +host_as_route_disable sai_fast_convergence_support ccm_dma_enable ccmdma_intr_enable @@ -298,7 +298,7 @@ lb_port_pipe1_int ing_origin_id_device_id_mask egr_origin_id_device_id_mask port_count_in_pb_stream -cancun_dir +cancun_dir pcie_file capi_level phy_pin_compatibility_enable @@ -308,7 +308,7 @@ sap_rx_polarity_flip sap_tx_polarity_flip sap_mdio_num dport_map_port_9 -cancun_dir +cancun_dir pcie_file capi_level phy_pin_compatibility_enable diff --git a/src/sonic-eventd/debian/changelog b/src/sonic-eventd/debian/changelog index eba3bf10ea..22a4997a10 100644 --- a/src/sonic-eventd/debian/changelog +++ b/src/sonic-eventd/debian/changelog @@ -2,4 +2,4 @@ sonic-eventd (1.0.0-0) UNRELEASED; urgency=medium * Initial release. --- Renuka Manavalan +-- Renuka Manavalan diff --git a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp index 3786c5f0fe..c660486f74 100644 --- a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp +++ b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp @@ -28,7 +28,7 @@ bool RsyslogPlugin::onMessage(string msg, lua_State* luaState) { void parseParams(vector params, vector& eventParams) { for(long unsigned int i = 0; i < params.size(); i++) { if(params[i].empty()) { - SWSS_LOG_ERROR("Empty param provided in regex file\n"); + SWSS_LOG_ERROR("Empty param provided in regex file\n"); continue; } EventParam ep = EventParam(); @@ -62,7 +62,7 @@ bool RsyslogPlugin::createRegexList() { } string regexString; - string timestampRegex = "^([a-zA-Z]{3})?\\s*([0-9]{1,2})?\\s*([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{0,6})?\\s*"; + string timestampRegex = "^([a-zA-Z]{3})?\\s*([0-9]{1,2})?\\s*([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{0,6})?\\s*"; regex expression; vector regexList; @@ -71,7 +71,7 @@ bool RsyslogPlugin::createRegexList() { vector eventParams; try { string eventRegex = jsonList[i]["regex"]; - regexString = timestampRegex + eventRegex; + regexString = timestampRegex + eventRegex; string tag = jsonList[i]["tag"]; vector params = jsonList[i]["params"]; vector timestampParams = { "month", "day", "time" }; diff --git a/src/sonic-eventd/rsyslog_plugin/syslog_parser.cpp b/src/sonic-eventd/rsyslog_plugin/syslog_parser.cpp index ebf7c598d1..399e319680 100644 --- a/src/sonic-eventd/rsyslog_plugin/syslog_parser.cpp +++ b/src/sonic-eventd/rsyslog_plugin/syslog_parser.cpp @@ -19,7 +19,7 @@ bool SyslogParser::parseMessage(string message, string& eventTag, event_params_t } string formattedTimestamp; if(!matchResults[1].str().empty() && !matchResults[2].str().empty() && !matchResults[3].str().empty()) { // found timestamp components - formattedTimestamp = m_timestampFormatter->changeTimestampFormat({ matchResults[1].str(), matchResults[2].str(), matchResults[3].str() }); + formattedTimestamp = m_timestampFormatter->changeTimestampFormat({ matchResults[1].str(), matchResults[2].str(), matchResults[3].str() }); } if(!formattedTimestamp.empty()) { paramMap["timestamp"] = formattedTimestamp; @@ -29,7 +29,7 @@ bool SyslogParser::parseMessage(string message, string& eventTag, event_params_t // found matching regex eventTag = m_regexList[i].tag; - // check params for lua code + // check params for lua code for(long unsigned int j = 3; j < m_regexList[i].params.size(); j++) { string resultValue = matchResults[j + 1].str(); string paramName = m_regexList[i].params[j].paramName; diff --git a/src/sonic-eventd/rsyslog_plugin/syslog_parser.h b/src/sonic-eventd/rsyslog_plugin/syslog_parser.h index 6293eb3c4a..f912cf7e82 100644 --- a/src/sonic-eventd/rsyslog_plugin/syslog_parser.h +++ b/src/sonic-eventd/rsyslog_plugin/syslog_parser.h @@ -36,7 +36,7 @@ struct RegexStruct { */ class SyslogParser { -public: +public: unique_ptr m_timestampFormatter; vector m_regexList; bool parseMessage(string message, string& tag, event_params_t& paramDict, lua_State* luaState); diff --git a/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp b/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp index 00bde81e2d..4777f7376b 100644 --- a/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp +++ b/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp @@ -32,14 +32,14 @@ vector createEventParams(vector params, vector luaCo return eventParams; } -TEST(syslog_parser, matching_regex) { +TEST(syslog_parser, matching_regex) { json jList = json::array(); vector regexList; string regexString = "^([a-zA-Z]{3})?\\s*([0-9]{1,2})?\\s*([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{0,6})?\\s*message (.*) other_data (.*) even_more_data (.*)"; vector params = { "month", "day", "time", "message", "other_data", "even_more_data" }; vector luaCodes = { "", "", "", "", "", "" }; regex expression(regexString); - + RegexStruct rs = RegexStruct(); rs.tag = "test_tag"; rs.regexExpression = expression; @@ -63,11 +63,11 @@ TEST(syslog_parser, matching_regex) { EXPECT_EQ(true, success); EXPECT_EQ("test_tag", tag); EXPECT_EQ(expectedDict, paramDict); - + lua_close(luaState); } -TEST(syslog_parser, matching_regex_timestamp) { +TEST(syslog_parser, matching_regex_timestamp) { json jList = json::array(); vector regexList; string regexString = "^([a-zA-Z]{3})?\\s*([0-9]{1,2})?\\s*([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{0,6})?\\s*message (.*) other_data (.*)"; @@ -101,7 +101,7 @@ TEST(syslog_parser, matching_regex_timestamp) { EXPECT_EQ(true, success); EXPECT_EQ("test_tag", tag); EXPECT_EQ(expectedDict, paramDict); - + lua_close(luaState); } @@ -165,7 +165,7 @@ TEST(syslog_parser, lua_code_valid_1) { EXPECT_EQ(true, success); EXPECT_EQ("test_tag", tag); EXPECT_EQ(expectedDict, paramDict); - + lua_close(luaState); } @@ -204,7 +204,7 @@ TEST(syslog_parser, lua_code_valid_2) { EXPECT_EQ(true, success); EXPECT_EQ("test_tag", tag); EXPECT_EQ(expectedDict, paramDict); - + lua_close(luaState); } @@ -255,10 +255,10 @@ TEST(rsyslog_plugin, onMessage_noParams) { TEST(timestampFormatter, changeTimestampFormat) { unique_ptr formatter(new TimestampFormatter()); - + vector timestampOne = { "Jul", "20", "10:09:40.230874" }; vector timestampTwo = { "Jan", "1", "00:00:00.000000" }; - vector timestampThree = { "Dec", "31", "23:59:59.000000" }; + vector timestampThree = { "Dec", "31", "23:59:59.000000" }; formatter->m_storedTimestamp = "010100:00:00.000000"; formatter->m_storedYear = g_stored_year; diff --git a/src/sonic-eventd/src/eventd.cpp b/src/sonic-eventd/src/eventd.cpp index 1ff9dd8be2..31da3d6849 100644 --- a/src/sonic-eventd/src/eventd.cpp +++ b/src/sonic-eventd/src/eventd.cpp @@ -8,7 +8,7 @@ * (0) main thread -- Runs eventd service that accepts commands event_req_type_t * This can be used to control caching events and a no-op echo service. * - * (1) capture/cache service + * (1) capture/cache service * Saves all the events between cache start & stop. * Update missed cached counter in memory. * @@ -111,7 +111,7 @@ stats_collector::set_heartbeat_interval(int val) { if (val > 0) { /* Round to highest possible multiples of MIN */ - m_heartbeats_interval_cnt = + m_heartbeats_interval_cnt = (((val * 1000) + STATS_HEARTBEAT_MIN - 1) / STATS_HEARTBEAT_MIN); } else if (val == 0) { @@ -269,7 +269,7 @@ stats_collector::run_collector() out: /* - * NOTE: A shutdown could lose messages in cache. + * NOTE: A shutdown could lose messages in cache. * But consider, that eventd shutdown is a critical shutdown as it would * bring down all other features. Hence done only at system level shutdown, * hence losing few messages in flight is acceptable. Any more complex code @@ -317,7 +317,7 @@ validate_event(const internal_event_t &event, runtime_id_t &rid, sequence_t &seq return ret; } - + /* * Initialize cache with set of events provided. @@ -358,10 +358,10 @@ capture_service::do_capture() typedef enum { /* - * In this state every event read is compared with init cache given + * In this state every event read is compared with init cache given * Only new events are saved. */ - CAP_STATE_INIT = 0, + CAP_STATE_INIT = 0, /* In this state, all events read are cached until max limit */ CAP_STATE_ACTIVE, @@ -399,7 +399,7 @@ capture_service::do_capture() /* * The cache service connects but defers any reading until caller provides * the startup cache. But all events that arrived since connect, though not read - * will be held by ZMQ in its local cache. + * will be held by ZMQ in its local cache. * * When cache service starts reading, check against the initial stock for duplicates. * m_pre_exist_id caches the last seq number in initial stock for each runtime id. @@ -482,7 +482,7 @@ capture_service::do_capture() } break; } - catch (bad_alloc& e) + catch (bad_alloc& e) { stringstream ss; ss << e.what(); @@ -535,7 +535,7 @@ capture_service::set_control(capture_control_t ctrl, event_serialized_lst_t *lst break; case START_CAPTURE: - + /* * Reserve a MAX_PUBLISHERS_COUNT entries for last events, as we use it only * upon m_events/vector overflow, which might block adding new entries in map @@ -545,7 +545,7 @@ capture_service::set_control(capture_control_t ctrl, event_serialized_lst_t *lst for (int i=0; iempty())) { init_capture_cache(*lst); } @@ -663,7 +663,7 @@ run_eventd_service() RET_ON_ERR(stats_instance.is_running(), "Failed to start stats instance"); while(code != EVENT_EXIT) { - int resp = -1; + int resp = -1; event_serialized_lst_t req_data, resp_data; RET_ON_ERR(service.channel_read(code, req_data) == 0, @@ -684,7 +684,7 @@ run_eventd_service() } break; - + case EVENT_CACHE_START: if (capture == NULL) { SWSS_LOG_ERROR("Cache is not initialized to start"); @@ -697,7 +697,7 @@ run_eventd_service() resp = capture->set_control(START_CAPTURE, &req_data); break; - + case EVENT_CACHE_STOP: if (capture == NULL) { SWSS_LOG_ERROR("Cache is not initialized to stop"); diff --git a/src/sonic-eventd/src/eventd.h b/src/sonic-eventd/src/eventd.h index 8411223b35..706863667e 100644 --- a/src/sonic-eventd/src/eventd.h +++ b/src/sonic-eventd/src/eventd.h @@ -136,7 +136,7 @@ class stats_collector void run_collector(); void run_writer(); - + atomic m_updated; counters_t m_lst_counters[COUNTERS_EVENTS_TOTAL]; @@ -192,13 +192,13 @@ class stats_collector * * We add to the vector as much as allowed by vector and max limit, * whichever comes first. - * + * * The sequence number in internal event will help assess the missed count * by the consumer of the cache data. * */ typedef enum { - NEED_INIT = 0, + NEED_INIT = 0, INIT_CAPTURE, START_CAPTURE, STOP_CAPTURE diff --git a/src/sonic-eventd/src/subdir.mk b/src/sonic-eventd/src/subdir.mk index a1e2b55f8d..eb067fd6e8 100644 --- a/src/sonic-eventd/src/subdir.mk +++ b/src/sonic-eventd/src/subdir.mk @@ -1,6 +1,6 @@ CC := g++ -TEST_OBJS += ./src/eventd.o +TEST_OBJS += ./src/eventd.o OBJS += ./src/eventd.o ./src/main.o C_DEPS += ./src/eventd.d ./src/main.d diff --git a/src/sonic-eventd/tests/eventd_ut.cpp b/src/sonic-eventd/tests/eventd_ut.cpp index 399255edb2..e793ddf588 100644 --- a/src/sonic-eventd/tests/eventd_ut.cpp +++ b/src/sonic-eventd/tests/eventd_ut.cpp @@ -699,7 +699,7 @@ TEST(eventd, service) void wait_for_heartbeat(stats_collector &stats_instance, long unsigned int cnt, - int wait_ms = 3000) + int wait_ms = 3000) { int diff = 0; @@ -749,7 +749,7 @@ TEST(eventd, heartbeat) /* Pause heartbeat */ stats_instance.heartbeat_ctrl(true); - + /* Sleep to ensure the other thread noticed the pause request. */ this_thread::sleep_for(chrono::milliseconds(200)); @@ -870,7 +870,7 @@ TEST(eventd, testDB) if (db.exists(key)) { try { m = db.hgetall(key); - unordered_map::const_iterator itc = + unordered_map::const_iterator itc = m.find(string(EVENTS_STATS_FIELD_NAME)); if (itc != m.end()) { int expect = (counter_keys[i] == string(COUNTERS_EVENTS_PUBLISHED) ? diff --git a/src/sonic-eventd/tests/main.cpp b/src/sonic-eventd/tests/main.cpp index 4b869e8c30..fdc175e645 100644 --- a/src/sonic-eventd/tests/main.cpp +++ b/src/sonic-eventd/tests/main.cpp @@ -73,7 +73,7 @@ public: } // Get this info handy - try + try { DBConnector db("TEST_DB", 0, true); g_is_redis_available = true; diff --git a/src/sonic-eventd/tools/events_monit_test.py b/src/sonic-eventd/tools/events_monit_test.py index dea7cbdd4c..d0cc5f18d7 100755 --- a/src/sonic-eventd/tools/events_monit_test.py +++ b/src/sonic-eventd/tools/events_monit_test.py @@ -74,7 +74,7 @@ def test_receiver(event_obj, cnt): while cnt_done < cnt: p = event_receive_op_t() rc = event_receive(sh, p) - + if rc > 0 and publish_cnt < 2: # ignore timeout as test code has not yet published an event yet continue diff --git a/src/sonic-eventd/tools/events_tool.cpp b/src/sonic-eventd/tools/events_tool.cpp index 97b17c1d75..d07f5887a8 100644 --- a/src/sonic-eventd/tools/events_tool.cpp +++ b/src/sonic-eventd/tools/events_tool.cpp @@ -80,7 +80,7 @@ t_map_to_str(const Map &m) _ss << sep << "{" << elem.first << "," << elem.second << "}"; if (sep.empty()) { sep = ", "; - } + } } _ss << "}"; return _ss.str(); @@ -99,7 +99,7 @@ do_receive(const event_subscribe_sources_t filter, const string outfile, int cnt fp = &fout; printf("outfile=%s set\n", outfile.c_str()); } - } + } event_handle_t h = events_init_subscriber(use_cache, 2000, filter.empty() ? NULL : &filter); printf("Subscribed with use_cache=%d timeout=2000 filter %s\n", use_cache, filter.empty() ? "empty" : "non-empty"); @@ -124,7 +124,7 @@ do_receive(const event_subscribe_sources_t filter, const string outfile, int cnt evtOp[evt.key] = t_map_to_str(evt.params); (*fp) << t_map_to_str(evtOp) << "\n"; fp->flush(); - + if ((++index % PRINT_CHUNK_SZ) == 0) { printf("Received index %d\n", index); } @@ -178,7 +178,7 @@ do_send(const string infile, int cnt, int pause) source.c_str(), key.substr(0, key.find(":")).c_str()); } evt.tag = key.substr(key.find(":")+1); - + const auto &val = data.begin().value(); ASSERT(val.is_object(), "Parsed params is not object"); ASSERT((int)val.size() >= 1, "Expect non empty params"); @@ -200,7 +200,7 @@ do_send(const string infile, int cnt, int pause) }; lst.push_back(evt); } - + h = events_init_publisher(source); ASSERT(h != NULL, "failed to init publisher"); @@ -214,7 +214,7 @@ do_send(const string infile, int cnt, int pause) if ((++index % PRINT_CHUNK_SZ) == 0) { printf("Sending index %d\n", index); } - + int rc = event_publish(h, evt.tag, evt.params.empty() ? NULL : &evt.params); ASSERT(rc == 0, "Failed to publish index=%d rc=%d", index, rc); diff --git a/src/sonic-eventd/tools/events_volume_test.py b/src/sonic-eventd/tools/events_volume_test.py index af830e2651..e3811f095a 100644 --- a/src/sonic-eventd/tools/events_volume_test.py +++ b/src/sonic-eventd/tools/events_volume_test.py @@ -30,7 +30,7 @@ def run_test(process, file, count, duplicate): # log messages to see if events have been received tool_proc = start_tool(file) - time.sleep(2) # buffer for events_tool to startup + time.sleep(2) # buffer for events_tool to startup logging.info("Generating logger messages\n") sub_cmd = ["logger", "-p", "local0.notice", "-t", process, "test", "message"] for i in range(count): diff --git a/src/sonic-eventd/tools/subdir.mk b/src/sonic-eventd/tools/subdir.mk index 5f13043dd6..05692afe0a 100644 --- a/src/sonic-eventd/tools/subdir.mk +++ b/src/sonic-eventd/tools/subdir.mk @@ -1,6 +1,6 @@ CC := g++ -TOOL_OBJS = ./tools/events_tool.o +TOOL_OBJS = ./tools/events_tool.o C_DEPS += ./tools/events_tool.d diff --git a/src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py b/src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py index 6bee64a6d4..8db49bf327 100755 --- a/src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py +++ b/src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py @@ -522,7 +522,7 @@ class BGPKeyMapInfo: ret_str += ' DFT: %s' % self.data[2] ret_str += ']' return ret_str - + class BGPKeyMapList(list): def __init__(self, key_map_list, table_name, table_key = None): super(BGPKeyMapList, self).__init__() @@ -1038,9 +1038,9 @@ def hdl_ospf_log(daemon, cmd_str, op, st_idx, args, data): def handle_ospf_area_auth(daemon, cmd_str, op, st_idx, args, data): cmd_list = [] - + no_op = 'no ' if op == CachedDataWithOp.OP_DELETE else '' - + if (args[1] == "MD5HMAC"): cmd_list.append(cmd_str.format(CommandArgument(daemon, True, no_op), CommandArgument(daemon, True, args[0]), @@ -1053,7 +1053,7 @@ def handle_ospf_area_auth(daemon, cmd_str, op, st_idx, args, data): elif (args[1] == "NONE"): cmd_list.append(cmd_str.format(CommandArgument(daemon, True, 'no '), CommandArgument(daemon, True, args[0]), - CommandArgument(daemon, True, ""))) + CommandArgument(daemon, True, ""))) return cmd_list def handle_ospf_area_shortcut(daemon, cmd_str, op, st_idx, args, data): @@ -1083,13 +1083,13 @@ def handle_ospf_area_vlink_auth(daemon, cmd_str, op, st_idx, args, data): if (args[2] == "MD5HMAC"): cmd_list.append(cmd_str.format(CommandArgument(daemon, True, no_op), - CommandArgument(daemon, True, args[0]), - CommandArgument(daemon, True, args[1]), + CommandArgument(daemon, True, args[0]), + CommandArgument(daemon, True, args[1]), CommandArgument(daemon, True, "message-digest"))) elif (args[2] == "NONE"): cmd_list.append(cmd_str.format(CommandArgument(daemon, True, no_op), - CommandArgument(daemon, True, args[0]), - CommandArgument(daemon, True, args[1]), + CommandArgument(daemon, True, args[0]), + CommandArgument(daemon, True, args[1]), CommandArgument(daemon, True, "null"))) return cmd_list @@ -1368,17 +1368,17 @@ def hdl_leaf_list_expansion(daemon, cmd_str, op, st_idx, args, data, table_key, syslog.syslog(syslog.LOG_DEBUG, 'cmd_list {}'.format(cmd_list)) return cmd_list -def hdl_import_list(daemon, cmd_str, op, st_idx, args, data): +def hdl_import_list(daemon, cmd_str, op, st_idx, args, data): return hdl_leaf_list_expansion(daemon, cmd_str, op, st_idx, args, data, daemon.tmp_cache_key, 'import-rts') -def hdl_export_list(daemon, cmd_str, op, st_idx, args, data): +def hdl_export_list(daemon, cmd_str, op, st_idx, args, data): return hdl_leaf_list_expansion(daemon, cmd_str, op, st_idx, args, data, daemon.tmp_cache_key, 'export-rts') -def hdl_enum_conversion(daemon, cmd_str, op, st_idx, args, data): - cmd_list = [] +def hdl_enum_conversion(daemon, cmd_str, op, st_idx, args, data): + cmd_list = [] syslog.syslog(syslog.LOG_DEBUG, 'handle_enum_conversion {} op {} st_idx {} args {} data {}'.format( cmd_str, op, st_idx, args, data)) - cmd_list.append(cmd_str.format(CommandArgument(daemon, True, args[st_idx].lower().replace('_','-')), + cmd_list.append(cmd_str.format(CommandArgument(daemon, True, args[st_idx].lower().replace('_','-')), no = CommandArgument(daemon, (op != CachedDataWithOp.OP_DELETE)))) syslog.syslog(syslog.LOG_DEBUG, 'cmd_list {}'.format(cmd_list)) return cmd_list @@ -1879,18 +1879,18 @@ class BGPConfigDaemon: ('set_ext_community_ref', '[bgpd]{no:no-prefix}set extcommunity {:ext-com-ref}', hdl_set_extcomm, False) ] - bfd_peer_shop_key_map = [('enabled', '{no:no-prefix}shutdown', ['false', 'true']), - ('desired-minimum-tx-interval', '{no:no-prefix}transmit-interval {}'), - ('required-minimum-receive', '{no:no-prefix}receive-interval {}'), - ('desired-minimum-echo-receive', '{no:no-prefix}echo-interval {}'), - ('detection-multiplier', '{no:no-prefix}detect-multiplier {}'), + bfd_peer_shop_key_map = [('enabled', '{no:no-prefix}shutdown', ['false', 'true']), + ('desired-minimum-tx-interval', '{no:no-prefix}transmit-interval {}'), + ('required-minimum-receive', '{no:no-prefix}receive-interval {}'), + ('desired-minimum-echo-receive', '{no:no-prefix}echo-interval {}'), + ('detection-multiplier', '{no:no-prefix}detect-multiplier {}'), ('echo-active', '{no:no-prefix}echo-mode', ['true', 'false']) - ] + ] - bfd_peer_mhop_key_map = [('enabled', '{no:no-prefix}shutdown', ['false', 'true']), - ('desired-minimum-tx-interval', '{no:no-prefix}transmit-interval {}'), - ('required-minimum-receive', '{no:no-prefix}receive-interval {}'), - ('detection-multiplier', '{no:no-prefix}detect-multiplier {}'), + bfd_peer_mhop_key_map = [('enabled', '{no:no-prefix}shutdown', ['false', 'true']), + ('desired-minimum-tx-interval', '{no:no-prefix}transmit-interval {}'), + ('required-minimum-receive', '{no:no-prefix}receive-interval {}'), + ('detection-multiplier', '{no:no-prefix}detect-multiplier {}'), ] listen_prefix_key_map = [('peer_group', '{no:no-prefix}bgp listen range {} peer-group {}')] @@ -1932,7 +1932,7 @@ class BGPConfigDaemon: ('distance-all', '{no:no-prefix}distance {}'), ('distance-external', '{no:no-prefix}distance ospf external {}'), ('distance-inter-area', '{no:no-prefix}distance ospf inter-area {}'), - ('distance-intra-area', '{no:no-prefix}distance ospf intra-area {}')] + ('distance-intra-area', '{no:no-prefix}distance ospf intra-area {}')] ospfv2_area_key_map = [('stub', '{no:no-prefix}area {} stub'), ('stub-no-summary', '{no:no-prefix}area {} stub no-summary'), @@ -1992,7 +1992,7 @@ class BGPConfigDaemon: ('ecmp-enabled', '{no:no-prefix}ip pim ecmp', ['true', 'false']), ('ecmp-rebalance-enabled', '{no:no-prefix}ip pim ecmp rebalance',['true', 'false']), ] - + igmp_mcast_grp_key_map =[('enable', '{no:no-prefix}ip igmp join {} {}'), ] @@ -2042,7 +2042,7 @@ class BGPConfigDaemon: 'BGP_GLOBALS_AF_AGGREGATE_ADDR': af_aggregate_key_map, 'BGP_GLOBALS_AF_NETWORK': af_network_key_map, 'BGP_GLOBALS_EVPN_VNI': global_evpn_vni_key_map, - 'BFD_PEER_SINGLE_HOP': bfd_peer_shop_key_map, + 'BFD_PEER_SINGLE_HOP': bfd_peer_shop_key_map, 'BFD_PEER_MULTI_HOP': bfd_peer_mhop_key_map, 'IP_SLA': ip_sla_key_map, 'OSPFV2_ROUTER': ospfv2_global_key_map, @@ -2236,7 +2236,7 @@ class BGPConfigDaemon: ('ROUTE_REDISTRIBUTE', self.bgp_table_handler_common), ('BGP_GLOBALS_AF_AGGREGATE_ADDR', self.bgp_table_handler_common), ('BGP_GLOBALS_AF_NETWORK', self.bgp_table_handler_common), - ('BFD_PEER_SINGLE_HOP', self.bgp_table_handler_common), + ('BFD_PEER_SINGLE_HOP', self.bgp_table_handler_common), ('BFD_PEER_MULTI_HOP', self.bgp_table_handler_common), ('IP_SLA', self.bgp_table_handler_common), ('OSPFV2_ROUTER', self.bgp_table_handler_common), @@ -2280,7 +2280,7 @@ class BGPConfigDaemon: @staticmethod def __run_command(table, command, daemons = None): return g_run_command(table, command, True, daemons) - + def metadata_handler(self, table, key, data): if key != 'localhost': syslog.syslog(syslog.LOG_DEBUG, 'not localhost data update') @@ -2326,7 +2326,7 @@ class BGPConfigDaemon: elif param == 'admin_status' and data[param] == 'down': command = command + " -c 'shutdown'" self.__run_command(table, command) - + def vrf_handler(self, table, key, data): syslog.syslog(syslog.LOG_INFO, '[bgp cfgd](vrf) value for {} changed to {}'.format(key, data)) #get vrf key @@ -2486,7 +2486,7 @@ class BGPConfigDaemon: if len(cfg_data) == 0: for dkey, dval in data.items(): dval.status = CachedDataWithOp.STAT_SUCC - else : + else : for dkey, dval in data.items(): if dkey in cfg_data.keys(): if cfg_data[dkey] not in op_list : @@ -2500,7 +2500,7 @@ class BGPConfigDaemon: for dkey, dval in data.items(): dval.status = CachedDataWithOp.STAT_SUCC dval.op = CachedDataWithOp.OP_DELETE - + def __ospf_delete (self, data): for dkey, dval in data.items(): # force delete all peer attributes in cache @@ -2509,7 +2509,7 @@ class BGPConfigDaemon: def __ospf_apply_config(self, data, rmapoper, metricoper, metrictypeoper, alwaysoper, acclistoper): for dkey, dval in data.items(): - + if 'route-map' == dkey: dval.status = CachedDataWithOp.STAT_SUCC dval.op = rmapoper @@ -3178,7 +3178,7 @@ class BGPConfigDaemon: icmp_cmd_str = "-".join(icmp_cmd) icmp_cmd_mode = icmp_cmd_str + " " + entry['icmp_dst_ip'] syslog.syslog(syslog.LOG_INFO, 'Data: icmp_cmd_str %s icmp_cmd_mode %s' % (icmp_cmd_str, icmp_cmd_mode)) - + cmd_prefix = ['configure terminal','ip sla {}'.format(sla_id), icmp_cmd_mode] chk_icmp_attrs = ['icmp_source_interface', 'icmp_source_ip', 'icmp_size', 'icmp_vrf', 'icmp_tos', 'icmp_ttl'] chk_icmp_attrs_dict = {'icmp_source_interface':'source-interface ', 'icmp_source_ip':'source-address ', 'icmp_size':'request-data-size ', 'icmp_vrf':'source-vrf ', 'icmp_tos':'tos ', 'icmp_ttl':'ttl '} @@ -3190,7 +3190,7 @@ class BGPConfigDaemon: if not self.__run_command(table, command): syslog.syslog(syslog.LOG_ERR, 'failed to add icmp config for ip sla {}'.format(sla_id)) continue - + syslog.syslog(syslog.LOG_INFO, 'Done with Icmp {}'.format(sla_id)) if not key_map.run_command(self, table, data, cmd_prefix, sla_id): syslog.syslog(syslog.LOG_ERR, 'failed running ip sla command') @@ -3217,7 +3217,7 @@ class BGPConfigDaemon: if not self.__run_command(table, command): syslog.syslog(syslog.LOG_ERR, 'failed to add Tcp config for ip sla {}'.format(sla_id)) continue - + syslog.syslog(syslog.LOG_INFO, 'Done with Tcp {}'.format(sla_id)) if not key_map.run_command(self, table, data, cmd_prefix, sla_id): syslog.syslog(syslog.LOG_ERR, 'failed running ip sla command') @@ -3228,7 +3228,7 @@ class BGPConfigDaemon: if not key_map.run_command(self, table, data, cmd_prefix, sla_id): syslog.syslog(syslog.LOG_ERR, 'failed running ip sla command') continue - + elif icmp_config == False or tcp_config == False: syslog.syslog(syslog.LOG_INFO, 'Basic mode Configure for ip sla {}'.format(sla_id)) cmd_prefix = ['configure terminal'] @@ -3248,7 +3248,7 @@ class BGPConfigDaemon: vrf = prefix if not del_table: syslog.syslog(syslog.LOG_INFO, 'Create router ospf vrf {}'.format(vrf)) - + cmd_prefix = ['configure terminal', 'router ospf vrf {}'.format(vrf)] @@ -3276,7 +3276,7 @@ class BGPConfigDaemon: continue elif table == 'OSPFV2_ROUTER_AREA_VIRTUAL_LINK': vrf = prefix - + keyvals = key.split('|') area = keyvals[0] vlinkid = keyvals[1] @@ -3317,8 +3317,8 @@ class BGPConfigDaemon: keyvals = key.split('|') area = keyvals[0] network = keyvals[1] - - if not del_table: + + if not del_table: command = "vtysh -c 'configure terminal' -c 'router ospf vrf {}' -c 'network {} area {}'".\ format(vrf, network, area) @@ -3433,7 +3433,7 @@ class BGPConfigDaemon: (acclistoper == CachedDataWithOp.OP_DELETE)): cmd_oper = "no" - + if (alwaysoper == CachedDataWithOp.OP_DELETE): del_cmd_suffix = alwayscmd if (rmapoper == CachedDataWithOp.OP_DELETE): @@ -3501,9 +3501,9 @@ class BGPConfigDaemon: if not self.__run_command(table, command): syslog.syslog(syslog.LOG_ERR, 'failed to delete distribute-list {} {}'.format(protocol, direction)) continue - + self.__ospf_delete(data) - + elif table == 'OSPFV2_INTERFACE': key = prefix + '|' + key @@ -3529,7 +3529,7 @@ class BGPConfigDaemon: for key, data in cache_tbl_data.items() : cached_op_data = CachedDataWithOp(data, CachedDataWithOp.OP_DELETE) - cmd_data.update({ key : cached_op_data } ) + cmd_data.update({ key : cached_op_data } ) syslog.syslog(syslog.LOG_INFO, 'Row delete cmd data {} '.format(cmd_data)) @@ -3548,7 +3548,7 @@ class BGPConfigDaemon: if 'area-id' in data.keys(): dval = data['area-id'] if dval.op == CachedDataWithOp.OP_NONE : - dval.op = CachedDataWithOp.OP_ADD + dval.op = CachedDataWithOp.OP_ADD if not key_map.run_command(self, table, data, cmd_prefix, if_name, if_addr): syslog.syslog(syslog.LOG_ERR, 'failed running interface ip ospf config command') @@ -3560,7 +3560,7 @@ class BGPConfigDaemon: syslog.syslog(syslog.LOG_INFO, 'area-id delete enforced') continue else : - self.__apply_config_op_success(data) + self.__apply_config_op_success(data) elif table == 'OSPFV2_ROUTER_PASSIVE_INTERFACE': syslog.syslog(syslog.LOG_INFO, 'Create passive interface') diff --git a/src/sonic-frr-mgmt-framework/templates/bfdd/bfdd.conf.j2 b/src/sonic-frr-mgmt-framework/templates/bfdd/bfdd.conf.j2 index a4c07c0263..9700c4e5d0 100644 --- a/src/sonic-frr-mgmt-framework/templates/bfdd/bfdd.conf.j2 +++ b/src/sonic-frr-mgmt-framework/templates/bfdd/bfdd.conf.j2 @@ -23,10 +23,10 @@ bfd {% if peer_key[3] != 'null' %} {% set peer_args = peer_args~' '~'local-address'~' '~peer_key[3] %} {% endif %} -{{ peer_args }} +{{ peer_args }} {# set the bfd peer timers #} {% if (peer_info['desired-minimum-tx-interval'] is defined and peer_info['desired-minimum-tx-interval'] | int != 300) %} - transmit-interval {{ peer_info['desired-minimum-tx-interval'] }} + transmit-interval {{ peer_info['desired-minimum-tx-interval'] }} {% endif %} {% if (peer_info['required-minimum-receive'] is defined and peer_info['required-minimum-receive'] | int != 300) %} receive-interval {{ peer_info['required-minimum-receive'] }} diff --git a/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.evpn.j2 b/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.evpn.j2 index c0db96c24d..a0014ddb65 100644 --- a/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.evpn.j2 +++ b/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.evpn.j2 @@ -41,7 +41,7 @@ {% if BGP_GLOBALS_EVPN_RT is defined and BGP_GLOBALS_EVPN_RT|length > 0 %} {% for evpn_rt_key, evpn_rt_val in BGP_GLOBALS_EVPN_RT.items() %} {% if vrf == evpn_rt_key[0] %} - route-target {{evpn_rt_val['route-target-type']}} {{evpn_rt_key[2]}} + route-target {{evpn_rt_val['route-target-type']}} {{evpn_rt_key[2]}} {% endif %} {% endfor %} {% endif %} @@ -65,7 +65,7 @@ {% if BGP_GLOBALS_EVPN_VNI_RT is defined and BGP_GLOBALS_EVPN_VNI_RT|length > 0 %} {% for vni_rt_key, vni_rt_val in BGP_GLOBALS_EVPN_VNI_RT.items() %} {% if vrf == vni_rt_key[0] and vni_key[2] == vni_rt_key[2] %} - route-target {{vni_rt_val['route-target-type']}} {{vni_rt_key[3]}} + route-target {{vni_rt_val['route-target-type']}} {{vni_rt_key[3]}} {% endif %} {% endfor %} {% endif %} diff --git a/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.j2 b/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.j2 index 9bf005518c..d6fc8a87f5 100644 --- a/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.j2 +++ b/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.j2 @@ -20,10 +20,10 @@ distance bgp {{af_val['ebgp_route_distance']}} {{af_val['ibgp_route_distance']}} {{af_val['local_route_distance']}} {% endif %} {% if 'import_vrf' in af_val %} - import vrf {{af_val['import_vrf']}} + import vrf {{af_val['import_vrf']}} {% endif %} {% if 'import_vrf_route_map' in af_val %} - import vrf route-map {{af_val['import_vrf_route_map']}} + import vrf route-map {{af_val['import_vrf_route_map']}} {% endif %} {% endif %} {% endfor %} diff --git a/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.comm_list.j2 b/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.comm_list.j2 index 3fcce07ddc..508418aee4 100644 --- a/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.comm_list.j2 +++ b/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.comm_list.j2 @@ -1,5 +1,5 @@ {# ------------------------------------------------------------------------------------ #} -{% if (COMMUNITY_SET is defined and COMMUNITY_SET|length > 0) or +{% if (COMMUNITY_SET is defined and COMMUNITY_SET|length > 0) or (EXTENDED_COMMUNITY_SET is defined and EXTENDED_COMMUNITY_SET|length >0) %} ! {% endif %} diff --git a/src/sonic-frr-mgmt-framework/templates/ospfd/ospfd.conf.db.comm_list.j2 b/src/sonic-frr-mgmt-framework/templates/ospfd/ospfd.conf.db.comm_list.j2 index f6fcfe897f..96f70e020e 100644 --- a/src/sonic-frr-mgmt-framework/templates/ospfd/ospfd.conf.db.comm_list.j2 +++ b/src/sonic-frr-mgmt-framework/templates/ospfd/ospfd.conf.db.comm_list.j2 @@ -29,13 +29,13 @@ router ospf vrf {{ vrf }} {% endif %} {% endif %} {% if 'passive-interface-default' in ospf_instance %} - passive-interface default + passive-interface default {% endif %} {% if 'write-multiplier' in ospf_instance %} - write-multiplier {{ ospf_instance['write-multiplier'] }} + write-multiplier {{ ospf_instance['write-multiplier'] }} {% endif %} {% if 'spf-throttle-delay' in ospf_instance and 'spf-initial-delay' in ospf_instance and 'spf-maximum-delay' in ospf_instance %} - timers throttle spf {{ ospf_instance['spf-throttle-delay'] }} {{ ospf_instance['spf-initial-delay'] }} {{ ospf_instance['spf-maximum-delay'] }} + timers throttle spf {{ ospf_instance['spf-throttle-delay'] }} {{ ospf_instance['spf-initial-delay'] }} {{ ospf_instance['spf-maximum-delay'] }} {% endif %} {% if 'lsa-min-interval-timer' in ospf_instance %} timers throttle lsa all {{ ospf_instance['lsa-min-interval-timer'] }} @@ -87,7 +87,7 @@ router ospf vrf {{ vrf }} {% for networkkey, ospf_network_instance in OSPFV2_ROUTER_AREA_NETWORK.items() %} {% set networkareaid = networkkey[1] %} {% set networkid = networkkey[2] %} - network {{ networkid }} area {{ networkareaid }} + network {{ networkid }} area {{ networkareaid }} {% endfor %} {% endif %} {# -------OSPFV2_ROUTER_AREA_NETWORK end --------------------------- #} diff --git a/src/sonic-frr/Makefile b/src/sonic-frr/Makefile index 289c3de6bc..704786daae 100644 --- a/src/sonic-frr/Makefile +++ b/src/sonic-frr/Makefile @@ -16,7 +16,7 @@ ifeq ($(CROSS_BUILD_ENVIRON), y) endif stg branch --create $(STG_BRANCH) $(FRR_TAG) stg import -s ../patch/series - gbp dch --ignore-branch --new-version=$(FRR_VERSION)-sonic-$(FRR_SUBVERSION) --dch-opt="--force-bad-version" --commit --git-author + gbp dch --ignore-branch --new-version=$(FRR_VERSION)-sonic-$(FRR_SUBVERSION) --dch-opt="--force-bad-version" --commit --git-author ifeq ($(CROSS_BUILD_ENVIRON), y) CFLAGS="-I $$CROSS_PERL_CORE_PATH" dpkg-buildpackage -rfakeroot -b -d -us -uc -Ppkg.frr.nortrlib -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) diff --git a/src/sonic-py-common/.gitignore b/src/sonic-py-common/.gitignore index 5f621ff9e2..6561b7ffd5 100644 --- a/src/sonic-py-common/.gitignore +++ b/src/sonic-py-common/.gitignore @@ -1,12 +1,12 @@ **/*.pyc -# Distribution / packaging +# Distribution / packaging *.egg-info/ .eggs/ build/ dist/ -# Unit test / coverage reports +# Unit test / coverage reports .cache .coverage coverage.xml diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index bf756a13e3..f7b1beb75d 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -493,7 +493,7 @@ def is_macsec_supported(): def get_device_runtime_metadata(): chassis_metadata = {} if is_chassis(): - chassis_metadata = {'CHASSIS_METADATA': {'module_type' : 'supervisor' if is_supervisor() else 'linecard', + chassis_metadata = {'CHASSIS_METADATA': {'module_type' : 'supervisor' if is_supervisor() else 'linecard', 'chassis_type': 'voq' if is_voq_chassis() else 'packet'}} port_metadata = {'ETHERNET_PORTS_PRESENT': True if get_path_to_port_config_file(hwsku=None, asic="0" if is_multi_npu() else None) else False} @@ -702,10 +702,10 @@ def is_warm_restart_enabled(container_name): def is_fast_reboot_enabled(): state_db = SonicV2Connector(host='127.0.0.1') state_db.connect(state_db.STATE_DB, False) - + TABLE_NAME_SEPARATOR = '|' prefix = 'FAST_RESTART_ENABLE_TABLE' + TABLE_NAME_SEPARATOR - + # Get the system warm reboot enable state _hash = '{}{}'.format(prefix, 'system') fb_system_state = state_db.get(state_db.STATE_DB, _hash, "enable") diff --git a/src/sonic-py-common/sonic_py_common/multi_asic.py b/src/sonic-py-common/sonic_py_common/multi_asic.py index bdc1cd7ddf..792f1557ce 100644 --- a/src/sonic-py-common/sonic_py_common/multi_asic.py +++ b/src/sonic-py-common/sonic_py_common/multi_asic.py @@ -52,9 +52,9 @@ def connect_config_db_for_ns(namespace=DEFAULT_NAMESPACE): def connect_to_all_dbs_for_ns(namespace=DEFAULT_NAMESPACE): """ The function connects to the DBs for a given namespace and - returns the handle - - For voq chassis systems, the db list includes databases from + returns the handle + + For voq chassis systems, the db list includes databases from supervisor card. Avoid connecting to these databases from linecards If no namespace is provided, it will connect to the db in the @@ -463,7 +463,7 @@ def get_asic_presence_list(): for inserted and detected fabric cards. For non-supervisor cards, e.g. line card, the list should contain all supported asics by the card. The function gets the asic list from CHASSIS_ASIC_TABLE from CHASSIS_STATE_DB. The function assumes that the first N asic ids (asic0 to asic(N-1)) in - CHASSIS_ASIC_TABLE belongs to the supervisor, where N is the max number of asics supported by the Chassis + CHASSIS_ASIC_TABLE belongs to the supervisor, where N is the max number of asics supported by the Chassis @return: List of asics present """ asics_list = [] diff --git a/src/sonic-py-common/tests/device_info_test.py b/src/sonic-py-common/tests/device_info_test.py index 055ced2a66..8596acd178 100644 --- a/src/sonic-py-common/tests/device_info_test.py +++ b/src/sonic-py-common/tests/device_info_test.py @@ -66,15 +66,15 @@ libswsscommon: 1.0.0 sonic_utilities: 1.2""" SONIC_VERISON_YML_RESULT = { - 'build_version': 'test_branch.1-a8fbac59d', - 'debian_version': '11.4', - 'kernel_version': '5.10.0-18-2-amd64', - 'asic_type': 'mellanox', - 'asic_subtype': 'mellanox', - 'commit_id': 'a8fbac59d', - 'branch': 'test_branch', - 'release': 'master', - 'libswsscommon': '1.0.0', + 'build_version': 'test_branch.1-a8fbac59d', + 'debian_version': '11.4', + 'kernel_version': '5.10.0-18-2-amd64', + 'asic_type': 'mellanox', + 'asic_subtype': 'mellanox', + 'commit_id': 'a8fbac59d', + 'branch': 'test_branch', + 'release': 'master', + 'libswsscommon': '1.0.0', 'sonic_utilities': 1.2 } @@ -104,8 +104,8 @@ class TestDeviceInfo(object): def test_get_chassis_info(self): with mock.patch("sonic_py_common.device_info.SonicV2Connector", new=SonicV2Connector): result = device_info.get_chassis_info() - truth = {"serial": SonicV2Connector.TEST_SERIAL, - "model": SonicV2Connector.TEST_MODEL, + truth = {"serial": SonicV2Connector.TEST_SERIAL, + "model": SonicV2Connector.TEST_MODEL, "revision": SonicV2Connector.TEST_REV} assert result == truth @@ -118,7 +118,7 @@ class TestDeviceInfo(object): assert device_info.get_sonic_version_info() == SONIC_VERISON_YML_RESULT # Assert the file was read only once open_mocked.assert_called_once_with(device_info.SONIC_VERSION_YAML_PATH) - + @mock.patch("sonic_py_common.device_info.get_platform_info") def test_is_chassis(self, mock_platform_info): mock_platform_info.return_value = {"switch_type": "npu"} diff --git a/src/sonic-py-common/tests/mock_swsscommon.py b/src/sonic-py-common/tests/mock_swsscommon.py index df6affaf18..8a619fe0e4 100644 --- a/src/sonic-py-common/tests/mock_swsscommon.py +++ b/src/sonic-py-common/tests/mock_swsscommon.py @@ -5,10 +5,10 @@ class SonicV2Connector: def __init__(self): self.STATE_DB = 'STATE_DB' - self.data = {"serial": self.TEST_SERIAL, - "model": self.TEST_MODEL, + self.data = {"serial": self.TEST_SERIAL, + "model": self.TEST_MODEL, "revision": self.TEST_REV} - + def connect(self, db): pass diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 0bcd861dba..100929ba7c 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -4,86 +4,86 @@ Table of Contents ================= - * [Introduction](#introduction) - * [Configuration](#configuration) - * [Config Load and Save](#config-load-and-save) - * [Incremental Configuration](#incremental-configuration) - * [Redis and Json Schema](#redis-and-json-schema) - * [ACL and Mirroring](#acl-and-mirroring) - * [BGP Device Global](#bgp-device-global) - * [BGP Sessions](#bgp-sessions) - * [BUFFER_PG](#buffer_pg) - * [Buffer pool](#buffer-pool) - * [Buffer profile](#buffer-profile) - * [Buffer queue](#buffer-queue) - * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) - * [Buffer port egress profile list](#buffer-port-egress-profile-list) - * [Cable length](#cable-length) - * [Chassis module](#chassis-module) - * [COPP_TABLE](#copp_table) - * [Console](#console) - * [CRM](#crm) - * [CRM DASH](#crm-dash) - * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) - * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) - * [Device Metadata](#device-metadata) + * [Introduction](#introduction) + * [Configuration](#configuration) + * [Config Load and Save](#config-load-and-save) + * [Incremental Configuration](#incremental-configuration) + * [Redis and Json Schema](#redis-and-json-schema) + * [ACL and Mirroring](#acl-and-mirroring) + * [BGP Device Global](#bgp-device-global) + * [BGP Sessions](#bgp-sessions) + * [BUFFER_PG](#buffer_pg) + * [Buffer pool](#buffer-pool) + * [Buffer profile](#buffer-profile) + * [Buffer queue](#buffer-queue) + * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) + * [Buffer port egress profile list](#buffer-port-egress-profile-list) + * [Cable length](#cable-length) + * [Chassis module](#chassis-module) + * [COPP_TABLE](#copp_table) + * [Console](#console) + * [CRM](#crm) + * [CRM DASH](#crm-dash) + * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) + * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) + * [Device Metadata](#device-metadata) * [Device neighbor metada](#device-neighbor-metada) * [DHCP_RELAY](#dhcp_relay) - * [DSCP_TO_TC_MAP](#dscp_to_tc_map) - * [FG_NHG](#fg_nhg) - * [FG_NHG_MEMBER](#fg_nhg_member) - * [FG_NHG_PREFIX](#fg_nhg_prefix) + * [DSCP_TO_TC_MAP](#dscp_to_tc_map) + * [FG_NHG](#fg_nhg) + * [FG_NHG_MEMBER](#fg_nhg_member) + * [FG_NHG_PREFIX](#fg_nhg_prefix) * [FABRIC_MONITOR](#fabric-monitor) - * [FLEX_COUNTER_TABLE](#flex_counter_table) - * [Hash](#hash) + * [FLEX_COUNTER_TABLE](#flex_counter_table) + * [Hash](#hash) * [IPv6 Link-local] (#ipv6-link-local) - * [KDUMP](#kdump) - * [Kubernetes Master](#kubernetes-master) - * [L2 Neighbors](#l2-neighbors) - * [Loopback Interface](#loopback-interface) - * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) - * [Management Interface](#management-interface) - * [Management port](#management-port) - * [Management VRF](#management-vrf) - * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) - * [MUX_CABLE](#mux_cable) + * [KDUMP](#kdump) + * [Kubernetes Master](#kubernetes-master) + * [L2 Neighbors](#l2-neighbors) + * [Loopback Interface](#loopback-interface) + * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) + * [Management Interface](#management-interface) + * [Management port](#management-port) + * [Management VRF](#management-vrf) + * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) + * [MUX_CABLE](#mux_cable) * [NEIGH](#neigh) - * [NTP Global Configuration](#ntp-global-configuration) - * [NTP and SYSLOG servers](#ntp-and-syslog-servers) - * [Peer Switch](#peer-switch) - * [Policer](#policer) - * [Port](#port) - * [Port Channel](#port-channel) - * [Portchannel member](#portchannel-member) - * [Scheduler](#scheduler) - * [Port QoS Map](#port-qos-map) - * [Queue](#queue) - * [Syslog Rate Limit](#syslog-rate-limit) - * [Sflow](#sflow) - * [Restapi](#restapi) - * [System Port](#system-port) - * [Tacplus Server](#tacplus-server) - * [TC to Priority group map](#tc-to-priority-group-map) - * [TC to Queue map](#tc-to-queue-map) - * [Telemetry](#telemetry) + * [NTP Global Configuration](#ntp-global-configuration) + * [NTP and SYSLOG servers](#ntp-and-syslog-servers) + * [Peer Switch](#peer-switch) + * [Policer](#policer) + * [Port](#port) + * [Port Channel](#port-channel) + * [Portchannel member](#portchannel-member) + * [Scheduler](#scheduler) + * [Port QoS Map](#port-qos-map) + * [Queue](#queue) + * [Syslog Rate Limit](#syslog-rate-limit) + * [Sflow](#sflow) + * [Restapi](#restapi) + * [System Port](#system-port) + * [Tacplus Server](#tacplus-server) + * [TC to Priority group map](#tc-to-priority-group-map) + * [TC to Queue map](#tc-to-queue-map) + * [Telemetry](#telemetry) * [Tunnel](#tunnel) - * [Versions](#versions) - * [VLAN](#vlan) - * [VLAN_MEMBER](#vlan_member) + * [Versions](#versions) + * [VLAN](#vlan) + * [VLAN_MEMBER](#vlan_member) * [VNET](#vnet) - * [VOQ Inband Interface](#voq-inband-interface) - * [VXLAN](#vxlan) - * [Virtual router](#virtual-router) - * [LOGGER](#logger) - * [WRED_PROFILE](#wred_profile) - * [PASSWORD_HARDENING](#password_hardening) - * [SYSTEM_DEFAULTS table](#systemdefaults-table) - * [RADIUS](#radius) - * [Static DNS](#static-dns) - * [For Developers](#for-developers) + * [VOQ Inband Interface](#voq-inband-interface) + * [VXLAN](#vxlan) + * [Virtual router](#virtual-router) + * [LOGGER](#logger) + * [WRED_PROFILE](#wred_profile) + * [PASSWORD_HARDENING](#password_hardening) + * [SYSTEM_DEFAULTS table](#systemdefaults-table) + * [RADIUS](#radius) + * [Static DNS](#static-dns) + * [For Developers](#for-developers) * [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template) * [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb) - + # Introduction @@ -1109,7 +1109,7 @@ The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desi ### Hash -Generic hash allows user to configure which hash fields are suppose to be used by a hashing algorithm. +Generic hash allows user to configure which hash fields are suppose to be used by a hashing algorithm. The configuration is applied globally for each ECMP and LAG on a switch. ***ECMP/LAG HASH*** @@ -1402,8 +1402,8 @@ Resolve case: ``` { "NEIGH": { - "Vlan100|100.1.1.3": { - "family": "IPv4" + "Vlan100|100.1.1.3": { + "family": "IPv4" } } } @@ -1412,9 +1412,9 @@ Static Nbr: ``` { "NEIGH": { - "Vlan100|100.1.1.5": { + "Vlan100|100.1.1.5": { "neigh": "00:02:02:03:04:05", - "family": "IPv4" + "family": "IPv4" } } } @@ -2364,7 +2364,7 @@ The RADIUS and RADIUS_SERVER tables define RADIUS configuration parameters. RADI "timeout": "5" } } - + "RADIUS_SERVER": { "192.168.1.2": { "priority": "4", diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 0a410daf11..eab62ddcab 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -97,7 +97,7 @@ setup( './yang-models/sonic-buffer-profile.yang', './yang-models/sonic-buffer-queue.yang', './yang-models/sonic-cable-length.yang', - './yang-models/sonic-chassis-module.yang', + './yang-models/sonic-chassis-module.yang', './yang-models/sonic-copp.yang', './yang-models/sonic-console.yang', './yang-models/sonic-crm.yang', @@ -118,7 +118,7 @@ setup( './yang-models/sonic-extension.yang', './yang-models/sonic-fabric-monitor.yang', './yang-models/sonic-flex_counter.yang', - './yang-models/sonic-fine-grained-ecmp.yang', + './yang-models/sonic-fine-grained-ecmp.yang', './yang-models/sonic-feature.yang', './yang-models/sonic-hash.yang', './yang-models/sonic-system-defaults.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 1751582b83..f75a8602fc 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2296,7 +2296,7 @@ "SNMP_USER_AUTH_TYPE": "", "SNMP_USER_AUTH_PASSWORD": "", "SNMP_USER_ENCRYPTION_TYPE": "", - "SNMP_USER_ENCRYPTION_PASSWORD": "" + "SNMP_USER_ENCRYPTION_PASSWORD": "" }, "testuser_AuthNoPriv": { "SNMP_USER_TYPE": "AuthNoPriv", @@ -2304,7 +2304,7 @@ "SNMP_USER_AUTH_TYPE": "SHA", "SNMP_USER_AUTH_PASSWORD": "auth_pass", "SNMP_USER_ENCRYPTION_TYPE": "", - "SNMP_USER_ENCRYPTION_PASSWORD": "" + "SNMP_USER_ENCRYPTION_PASSWORD": "" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json index 536736f82d..233f23f3d6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json @@ -6,7 +6,7 @@ "desc": "Load bgp device global table with tsa_enabled set to true" }, "BGP_DEVICE_GLOBAL_WITH_TSB_TEST": { - "desc": "Load bgp device global table with tsa_enabled set to false" + "desc": "Load bgp device global table with tsa_enabled set to false" }, "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE": { "desc": "Load bgp device global table with invalid value", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_port.json index 9c2bd9b4e1..3530c7754b 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_port.json @@ -21,7 +21,7 @@ "MGMT_PORT_INVALID_MTU": { "desc": "INVALID MTU", "eStrKey": "Range", - "eStr": "1500..9216" + "eStr": "1500..9216" }, "MGMT_PORT_DEFAULT_MTU": { "desc": "VALIDATE DEFAULT MTU", @@ -35,5 +35,5 @@ "MGMT_PORT_INVALID_AUTONEG": { "desc": "INVALID AUTONEG CONFIGURATION", "eStrKey": "Pattern" - } + } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json b/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json index 189cec177a..47905cadf1 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json @@ -46,7 +46,7 @@ "WRED_PROFILE_VALID": { "desc": "Configure WRED profile." }, - + "WRED_PROFILE_INVALID_DROP_PROBABILITY": { "desc": "Configure invalid drop probability in WRED profile.", "eStrKey" : "Pattern" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json index 0528e0e3fe..db068f714f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json @@ -90,7 +90,7 @@ "PORT_QOS_MAP_APPLY_MAP_TO_GLOBAL": { "desc": "Configure qos maps on switch level." }, - + "PORT_QOS_MAP_APPLY_NON_EXISTS_MAPS": { "desc": "Configure non exists qos maps on port.", "eStrKey": "LeafRef" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/route_filter.json b/src/sonic-yang-models/tests/yang_model_tests/tests/route_filter.json index da4e0dd2a2..a1993ff523 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/route_filter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/route_filter.json @@ -2,7 +2,7 @@ "ROUTE_REDISTRIBUTE_VALID": { "desc": "Configure route redistribution table." }, - + "ROUTE_REDISTRIBUTE_INVALID_RT_MAP_CNT": { "desc": "Referring 2 route map, when 1 allowed", "eStrKey" : "LeafRef" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/sflow.json b/src/sonic-yang-models/tests/yang_model_tests/tests/sflow.json index c631bf6979..b98cc85fd3 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/sflow.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/sflow.json @@ -42,7 +42,7 @@ }, "SFLOW_SESSION_TEST_WITH_INCORRECT_SAMPLE_RATE": { "desc": "Configure sflow session in SFLOW_SESSION table with an out of range sample rate.", - "eStr": ["sFlow sample rate must be [256-8388608]"] + "eStr": ["sFlow sample rate must be [256-8388608]"] }, "SFLOW_SESSION_TEST_WITH_INCORRECT_PORT_TYPE_IN_SAMPLE_RATE": { "desc": "Configure sflow session in SFLOW_SESSION table with an incorrect port type in sample rate.", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/snmp.json b/src/sonic-yang-models/tests/yang_model_tests/tests/snmp.json index dbecc453f9..14c387d5ef 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/snmp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/snmp.json @@ -94,7 +94,7 @@ "desc": "Load SNMP user with user type Priv without encyrption type", "eStrKey": "Must" }, - "SNMP_USER_PRIV_INVALID_ENCRYPT_TYPE_NEG_TEST": { + "SNMP_USER_PRIV_INVALID_ENCRYPT_TYPE_NEG_TEST": { "desc": "Load SNMP user with user type Priv with invalid encryption type", "eStrKey": "Must" }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json index a6a30bd405..e18e0bea8f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json @@ -238,7 +238,7 @@ } } }, - + "BGP_PEERGROUP_ALL_VALID": { "sonic-port:sonic-port": { "sonic-port:PORT": { @@ -381,7 +381,7 @@ ] } } - }, + }, "BGP_GLOBAL_NEG_VRF_NOT_EXIST": { "sonic-bgp-global:sonic-bgp-global": { "sonic-bgp-global:BGP_GLOBALS": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_egress_profile_list.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_egress_profile_list.json index 72e31ef9c3..e4a90411d1 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_egress_profile_list.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_egress_profile_list.json @@ -53,7 +53,7 @@ "port": "Ethernet4", "profile_list": ["lossless_buffer_profile", "lossless_buffer_profile2"] } - ] + ] } } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_ingress_profile_list.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_ingress_profile_list.json index aef66e1b01..2fc4a219f5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_ingress_profile_list.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_port_ingress_profile_list.json @@ -53,7 +53,7 @@ "port": "Ethernet4", "profile_list": ["lossless_buffer_profile", "lossless_buffer_profile2"] } - ] + ] } } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json index 35c76c7c4d..a742f91ef5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json @@ -11,7 +11,7 @@ "name": "LINE-CARD1", "admin_status": "up" }, - { + { "name": "FABRIC-CARD0", "admin_status": "up" }, @@ -20,7 +20,7 @@ "admin_status": "up" } ] - } + } } }, "CHASSIS_MODULE_WITH_LINECARD_ADMIN_DOWN": { @@ -36,7 +36,7 @@ "admin_status": "down" } ] - } + } } }, "CHASSIS_MODULE_WITH_LINECARD_ADMIN_INVALID_VALUE": { @@ -48,7 +48,7 @@ "admin_status": "false" } ] - } + } } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fine_grained_ecmp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fine_grained_ecmp.json index 2bfbbb6239..9ddb5bfe64 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fine_grained_ecmp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fine_grained_ecmp.json @@ -188,7 +188,7 @@ ] } } - }, + }, "FG_NHG_TEST_DUPLICATE_NAME": { "sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": { "sonic-fine-grained-ecmp:FG_NHG": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/logger.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/logger.json index 8ee308c848..66ae166177 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/logger.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/logger.json @@ -26,7 +26,7 @@ "LOGGER_LIST": [{ "name": "orchagent", "LOGLEVEL": "wrong", - "LOGOUTPUT": "SYSLOG" + "LOGOUTPUT": "SYSLOG" }] } } @@ -37,7 +37,7 @@ "LOGGER_LIST": [{ "name": "orchagent", "LOGLEVEL": "NOTICE", - "LOGOUTPUT": "wrong" + "LOGOUTPUT": "wrong" }] } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_port.json index caedda4b41..adc3fd7198 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_port.json @@ -10,15 +10,15 @@ "speed": 100, "autoneg": "off", "description": "management interface", - "mtu": 1500 - } + "mtu": 1500 + } ] } } }, "MGMT_PORT_INVALID_NAME_PATTERN": { "sonic-mgmt_port:sonic-mgmt_port": { - "sonic-mgmt_port:MGMT_PORT": { + "sonic-mgmt_port:MGMT_PORT": { "MGMT_PORT_LIST": [ { "name": "ethernet0" @@ -60,7 +60,7 @@ } ] } - } + } }, "MGMT_PORT_INVALID_AUTONEG": { "sonic-mgmt_port:sonic-mgmt_port": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_vrf.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_vrf.json index fa92275502..57509ac4fb 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_vrf.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_vrf.json @@ -2,8 +2,8 @@ "MGMT_VRF_TEST": { "sonic-mgmt_vrf:sonic-mgmt_vrf": { "sonic-mgmt_vrf:MGMT_VRF_CONFIG": { - "sonic-mgmt_vrf:vrf_global": { - "mgmtVrfEnabled": true + "sonic-mgmt_vrf:vrf_global": { + "mgmtVrfEnabled": true } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json index 815171306b..1a7030a77b 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json @@ -77,7 +77,7 @@ } } }, - + "MUX_CABLE_INVALID_IP": { "sonic-mux-cable:sonic-mux-cable": { "sonic-mux-cable:MUX_CABLE": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/nat.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nat.json index 015aebf8fb..68f73d026c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/nat.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nat.json @@ -27,11 +27,11 @@ "local_ip": "12.0.0.1", "local_port": "200", "nat_type": "dnat", - "twice_nat_id": "100" - } - ] - } - } + "twice_nat_id": "100" + } + ] + } + } }, "STATIC_NAPT_ENTRY_WRONG_IP_PROTOCOL": { "sonic-nat:sonic-nat": { @@ -62,10 +62,10 @@ "local_port": "200", "nat_type": "dnat", "twice_nat_id": "100" - } - ] - } - } + } + ] + } + } }, "STATIC_NAPT_ENTRY_WITHOUT_LOCAL_IP": { "sonic-nat:sonic-nat": { @@ -139,7 +139,7 @@ "local_ip": "12.0.0.1", "nat_type": "dnat", "twice_nat_id": "100" - } + } ] } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json index b2974b4981..5b9ab1495a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json @@ -52,32 +52,32 @@ "NTP_DEFAULT_VRF_1_TEST": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "vrf": "default" - } + } } } }, "NTP_DEFAULT_VRF_TEST": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "vrf": "default" - } + } } } }, "NTP_MGMT_VRF_TEST": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "vrf": "mgmt" } } }, "sonic-mgmt_vrf:sonic-mgmt_vrf": { "sonic-mgmt_vrf:MGMT_VRF_CONFIG": { - "sonic-mgmt_vrf:vrf_global": { + "sonic-mgmt_vrf:vrf_global": { "mgmtVrfEnabled": "true" } } @@ -86,14 +86,14 @@ "NTP_MGMT_VRF_INVALID_MGMT_VRF_STATE_TEST": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "vrf": "mgmt" } } }, "sonic-mgmt_vrf:sonic-mgmt_vrf": { "sonic-mgmt_vrf:MGMT_VRF_CONFIG": { - "sonic-mgmt_vrf:vrf_global": { + "sonic-mgmt_vrf:vrf_global": { "mgmtVrfEnabled": "false" } } @@ -102,7 +102,7 @@ "NTP_MGMT_VRF_WITH_NOEXIST_MGMT_VRF_TEST": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "vrf": "mgmt" } } @@ -111,7 +111,7 @@ "NTP_VRF_INVALID_NAME": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "vrf": "Vrf_1" } } @@ -121,7 +121,7 @@ "NTP_SRC_INTF": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "src_intf": [ "Ethernet0", "Loopback100", @@ -178,7 +178,7 @@ "NTP_SRC_INTF_WITH_NONEXIST_ETH_PORT": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "src_intf": [ "Ethernet0" ] @@ -189,7 +189,7 @@ "NTP_SRC_INTF_WITH_NONEXIST_LOOPBACK_INTF": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "src_intf": [ "Loopback100" ] @@ -200,7 +200,7 @@ "NTP_SRC_INTF_WITH_NONEXIST_PORTCHANNEL_INTF": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "src_intf": [ "PortChannel10" ] @@ -221,7 +221,7 @@ "NTP_SRC_INTF_WITH_NONEXIST_MGMT_INTF": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP": { - "sonic-ntp:global": { + "sonic-ntp:global": { "src_intf": [ "eth1" ] diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json index 869d00ded1..b557e183e9 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json @@ -476,7 +476,7 @@ } } }, - + "PORT_VALID_MUX_CABLE_TEST": { "sonic-port:sonic-port": { "sonic-port:PORT": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json index 67775b11db..3b846d4ecf 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json @@ -20,7 +20,7 @@ "meter_type": "bytes", "pbs": 2048, "pir": 2560000, - "type": "STRICT", + "type": "STRICT", "priority": 0 }, { @@ -116,7 +116,7 @@ } } }, - + "SCHEDULER_VALID_NAME": { "sonic-scheduler:sonic-scheduler":{ "sonic-scheduler:SCHEDULER": { @@ -138,7 +138,7 @@ "meter_type": "bytes", "pbs": 2048, "pir": 2560000, - "type": "STRICT", + "type": "STRICT", "priority": 0 }, { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json index 0992f8776d..3082bb10e9 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json @@ -529,7 +529,7 @@ ] } }, - + "sonic-dot1p-tc-map:sonic-dot1p-tc-map": { "sonic-dot1p-tc-map:DOT1P_TO_TC_MAP": { "DOT1P_TO_TC_MAP_LIST": [ @@ -701,7 +701,7 @@ ] } }, - + "sonic-port-qos-map:sonic-port-qos-map": { "sonic-port-qos-map:PORT_QOS_MAP": { "PORT_QOS_MAP_LIST": [ @@ -750,7 +750,7 @@ } } }, - + "PORT_QOS_MAP_APPLY_NON_EXISTS_PORT": { "sonic-port:sonic-port": { "sonic-port:PORT": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/route_filter.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/route_filter.json index c599744142..55ba644ae6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/route_filter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/route_filter.json @@ -7,7 +7,7 @@ "vrf_name": "default", "src_protocol": "connected", "dst_protocol": "bgp", - "addr_family": "ipv4" + "addr_family": "ipv4" } ] } @@ -393,7 +393,7 @@ } } }, - + "ROUTE_PREFIX_INVALID_MODE_ENUM": { "sonic-routing-policy-sets:sonic-routing-policy-sets":{ "sonic-routing-policy-sets:PREFIX_SET": { @@ -463,14 +463,14 @@ "set_type": "STANDARD", "match_action": "ANY", "action": "permit", - "community_member": ["1:1"] + "community_member": ["1:1"] }, { "name": "com2", "set_type": "STANDARD", "match_action": "ALL", "action": "permit", - "community_member": ["1:2"] + "community_member": ["1:2"] } ] } @@ -486,7 +486,7 @@ "set_type": "STANDARD", "match_action": "ANY", "action": "allow", - "community_member": ["1:1"] + "community_member": ["1:1"] } ] } @@ -502,14 +502,14 @@ "set_type": "STANDARD", "match_action": "ANY", "action": "permit", - "community_member": ["rt:1:1"] + "community_member": ["rt:1:1"] }, { "name": "extcom2", "set_type": "STANDARD", "match_action": "ALL", "action": "permit", - "community_member": ["rt:1:2"] + "community_member": ["rt:1:2"] } ] } @@ -522,12 +522,12 @@ { "name": "aspath1", "action": "permit", - "as_path_set_member": ["65001","65003"] + "as_path_set_member": ["65001","65003"] }, { "name": "aspath2", "action": "deny", - "as_path_set_member": ["65002"] + "as_path_set_member": ["65002"] } ] } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-dhcp-relay.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-dhcp-relay.json index 335d836280..9d68a99c58 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-dhcp-relay.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-dhcp-relay.json @@ -5,7 +5,7 @@ "ifname": "Eth", "timestamp": "1985-04-12T23:20:50.52Z" } - } + } }, "SONIC_EVENTS_DHCP_RELAY_DHCP_RELAY_DISCARD_INCORRECT_TIMESTAMP": { "sonic-events-dhcp-relay:sonic-events-dhcp-relay": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vnet.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vnet.json index a79c7ebaa4..9dcb675302 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vnet.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vnet.json @@ -45,7 +45,7 @@ "advertise_prefix": "true", "overlay_dmac": "22:33:44:55:66:77" } - ] + ] } } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/voq-inband-interface.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/voq-inband-interface.json index 7fdb07bb2b..226610989a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/voq-inband-interface.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/voq-inband-interface.json @@ -48,7 +48,7 @@ "sonic-voq-inband-interface:VOQ_INBAND_INTERFACE": { "VOQ_INBAND_INTERFACE_LIST": [ { - "name": "Ethernet-IB0" + "name": "Ethernet-IB0" } ], "VOQ_INBAND_INTERFACE_IPPREFIX_LIST": [ diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/warm_restart.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/warm_restart.json index 970767e00f..e6a55c463d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/warm_restart.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/warm_restart.json @@ -4,7 +4,7 @@ "sonic-warm-restart:WARM_RESTART": { "WARM_RESTART_LIST": [{ "module": "bgp", - "bgp_eoiu": true, + "bgp_eoiu": true, "bgp_timer": 500 }] } diff --git a/src/sonic-yang-models/yang-models/sonic-auto_techsupport.yang b/src/sonic-yang-models/yang-models/sonic-auto_techsupport.yang index 078609c0e1..076818d131 100644 --- a/src/sonic-yang-models/yang-models/sonic-auto_techsupport.yang +++ b/src/sonic-yang-models/yang-models/sonic-auto_techsupport.yang @@ -18,7 +18,7 @@ module sonic-auto_techsupport { typedef decimal-repr { type decimal64 { fraction-digits 2; - range 0.0..99.99; + range 0.0..99.99; } } @@ -27,9 +27,9 @@ module sonic-auto_techsupport { container AUTO_TECHSUPPORT { description "AUTO_TECHSUPPORT part of config_db.json"; - + container GLOBAL { - + leaf state { description "Knob to make techsupport invocation event-driven based on core-dump generation"; type stypes:admin_mode; @@ -65,17 +65,17 @@ module sonic-auto_techsupport { type decimal-repr; default 10.0; } - + leaf min_available_mem { description "Minimum Free memory (in MB) that should be available for the techsupport execution to start"; type uint32; default 200; } - + leaf since { /* - Any valid date string of the formats specified here (https://www.gnu.org/software/coreutils/manual/html_node/Date-input-formats.html) - can be used. + Any valid date string of the formats specified here (https://www.gnu.org/software/coreutils/manual/html_node/Date-input-formats.html) + can be used. */ description "Only collect the logs & core-dumps generated since the time provided. A default value of '2 days ago' is used if this value is not set explicitly or a non-valid string is provided"; type string { @@ -86,7 +86,7 @@ module sonic-auto_techsupport { /* end of container GLOBAL */ } /* end of container AUTO_TECHSUPPORT */ - + container AUTO_TECHSUPPORT_FEATURE { description "AUTO_TECHSUPPORT_FEATURE part of config_db.json"; diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-common.yang b/src/sonic-yang-models/yang-models/sonic-bgp-common.yang index 5d9f710263..9e3d1638b2 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-common.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-common.yang @@ -6,7 +6,7 @@ module sonic-bgp-common { import sonic-types { prefix stypes; } - + import ietf-inet-types { prefix inet; } @@ -69,12 +69,12 @@ module sonic-bgp-common { type enumeration { enum tx_all_paths { description - "Send multiple path advertisements for an NLRI from + "Send multiple path advertisements for an NLRI from the neighbor or group"; } enum tx_best_path_per_as { description - "Send only best path per AS advertisements for an NLRI from + "Send only best path per AS advertisements for an NLRI from the neighbor or group"; } } diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang index 3ae4d89d52..a48b422863 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang @@ -65,7 +65,7 @@ module sonic-bgp-neighbor { } list BGP_NEIGHBOR_LIST { - description "This list is to support generic BGP neighbor configuration handled by frrcfgd and + description "This list is to support generic BGP neighbor configuration handled by frrcfgd and frr_mgmt_framework_config field should be set to true in DEVICE_METADATA talbe for accepting the generic BGP table configurations."; key "vrf_name neighbor"; diff --git a/src/sonic-yang-models/yang-models/sonic-console.yang b/src/sonic-yang-models/yang-models/sonic-console.yang index 65a8e0dc5b..341abaf8d2 100644 --- a/src/sonic-yang-models/yang-models/sonic-console.yang +++ b/src/sonic-yang-models/yang-models/sonic-console.yang @@ -33,7 +33,7 @@ module sonic-console { list CONSOLE_PORT_LIST { key "name"; - + leaf name { description "Configure console port name"; type uint16; diff --git a/src/sonic-yang-models/yang-models/sonic-dash.yang b/src/sonic-yang-models/yang-models/sonic-dash.yang index f3c431d078..806a05e881 100644 --- a/src/sonic-yang-models/yang-models/sonic-dash.yang +++ b/src/sonic-yang-models/yang-models/sonic-dash.yang @@ -35,7 +35,7 @@ module sonic-dash { container DASH_VNET { - description "DASH VNET configuration, part of APP_DB. Used for gNMI clients to configure SONiC"; + description "DASH VNET configuration, part of APP_DB. Used for gNMI clients to configure SONiC"; list DASH_VNET_LIST { key "name"; @@ -47,7 +47,7 @@ module sonic-dash { error-app-tag vnet-name-invalid; } } - } + } leaf vni { type uint32 { @@ -70,7 +70,7 @@ module sonic-dash { } /* end of container DASH_VNET */ container DASH_QOS { - description "DASH QOS configs to specify bandwidth, cps, part of APP_DB"; + description "DASH QOS configs to specify bandwidth, cps, part of APP_DB"; list DASH_QOS_LIST { key "name"; @@ -110,9 +110,9 @@ module sonic-dash { } /* end of list DASH_QOS_LIST */ } /* end of container DASH_QOS */ - + container DASH_ENI { - description "DASH ENI object to specify eni params; part of APP_DB"; + description "DASH ENI object to specify eni params; part of APP_DB"; list DASH_ENI_LIST { key "name"; @@ -148,9 +148,9 @@ module sonic-dash { } /* end of list DASH_ENI_LIST */ } /* end of container DASH_ENI */ - + container DASH_ACL_IN { - description "DASH Ingress ACL to specify stage and group; part of APP_DB"; + description "DASH Ingress ACL to specify stage and group; part of APP_DB"; list DASH_ACL_IN_LIST { key "eni stage"; @@ -177,7 +177,7 @@ module sonic-dash { } /* end of container DASH_ACL_IN */ container DASH_ACL_OUT { - description "DASH Egress ACL to specify stage and group; part of APP_DB"; + description "DASH Egress ACL to specify stage and group; part of APP_DB"; list DASH_ACL_OUT_LIST { key "eni stage"; @@ -204,7 +204,7 @@ module sonic-dash { } /* end of container DASH_ACL_OUT */ container DASH_ACL_GROUP { - description "DASH ACL group to specify IP version; part of APP_DB"; + description "DASH ACL group to specify IP version; part of APP_DB"; list DASH_ACL_GROUP_LIST { key "name"; @@ -232,7 +232,7 @@ module sonic-dash { } /* end of container DASH_ACL_GROUP */ container DASH_ACL_RULE { - description "DASH ACL rule; part of APP_DB"; + description "DASH ACL rule; part of APP_DB"; list DASH_ACL_RULE_LIST { key "acl_group_id name"; @@ -270,7 +270,7 @@ module sonic-dash { leaf-list ip_protocol { description "IP Protocol (tcp or udp or icmp etc)"; type stypes:ip-protocol-type; - } + } leaf-list src_addr { type stypes:sonic-ip-prefix; @@ -298,7 +298,7 @@ module sonic-dash { } /* end of container DASH_ACL_RULE */ container DASH_APPLIANCE { - description "DASH general appliance configs; part of APP_DB"; + description "DASH general appliance configs; part of APP_DB"; list DASH_APPLIANCE_LIST { key "name"; @@ -324,7 +324,7 @@ module sonic-dash { } /* end of container DASH_APPLIANCE */ container DASH_ROUTING_TYPE { - description "DASH Routing types and actions; part of APP_DB"; + description "DASH Routing types and actions; part of APP_DB"; list DASH_ROUTING_TYPE_LIST { key "name"; @@ -363,7 +363,7 @@ module sonic-dash { } /* end of container DASH_ROUTING_TYPE */ container DASH_ROUTE_TABLE { - description "DASH Route table (LPM) associated to an ENI for outbound routing; part of APP_DB"; + description "DASH Route table (LPM) associated to an ENI for outbound routing; part of APP_DB"; list DASH_ROUTE_TABLE_LIST { key "eni prefix"; @@ -377,7 +377,7 @@ module sonic-dash { leaf prefix { type stypes:sonic-ip-prefix; } - + leaf action_type { type leafref { path /dash:sonic-dash/dash:DASH_ROUTING_TYPE/dash:DASH_ROUTING_TYPE_LIST/dash:name; @@ -432,7 +432,7 @@ module sonic-dash { } /* end of container DASH_ROUTE_TABLE */ container DASH_VNET_MAPPING_TABLE { - description "DASH Mapping table associated to a Vnet; part of APP_DB"; + description "DASH Mapping table associated to a Vnet; part of APP_DB"; list DASH_VNET_MAPPING_TABLE_LIST { key "vnet ip_addr"; diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 39df414660..52a5aa37fb 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -18,9 +18,9 @@ module sonic-device_metadata { } description "DEVICE_METADATA YANG Module for SONiC OS"; - + revision 2021-02-27 { - description "Added frr_mgmt_framework_config field to handle BGP + description "Added frr_mgmt_framework_config field to handle BGP config DB schema events to configure FRR protocols."; } @@ -111,7 +111,7 @@ module sonic-device_metadata { leaf frr_mgmt_framework_config { type boolean; - description "FRR configurations are handled by sonic-frr-mgmt-framework module when set to true, + description "FRR configurations are handled by sonic-frr-mgmt-framework module when set to true, otherwise, sonic-bgpcfgd handles the FRR configurations based on the predefined templates."; default "false"; } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang b/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang index 4a0bf60708..cd32ca9666 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang @@ -29,7 +29,7 @@ module sonic-dhcpv6-relay { list DHCP_RELAY_LIST { key "name"; - + leaf name { type string; } diff --git a/src/sonic-yang-models/yang-models/sonic-dot1p-tc-map.yang b/src/sonic-yang-models/yang-models/sonic-dot1p-tc-map.yang index 12564956b1..78d8376747 100644 --- a/src/sonic-yang-models/yang-models/sonic-dot1p-tc-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-dot1p-tc-map.yang @@ -24,14 +24,14 @@ module sonic-dot1p-tc-map { "Initial revision."; } - container sonic-dot1p-tc-map { + container sonic-dot1p-tc-map { container DOT1P_TO_TC_MAP { description "DOT1P_TO_TC_MAP part of config_db.json"; list DOT1P_TO_TC_MAP_LIST { - + key "name"; leaf name { diff --git a/src/sonic-yang-models/yang-models/sonic-dscp-tc-map.yang b/src/sonic-yang-models/yang-models/sonic-dscp-tc-map.yang index 8bfc02fdf5..9f60fb5d28 100644 --- a/src/sonic-yang-models/yang-models/sonic-dscp-tc-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-dscp-tc-map.yang @@ -24,7 +24,7 @@ module sonic-dscp-tc-map { "Initial revision."; } - container sonic-dscp-tc-map { + container sonic-dscp-tc-map { container DSCP_TO_TC_MAP { diff --git a/src/sonic-yang-models/yang-models/sonic-events-bgp.yang b/src/sonic-yang-models/yang-models/sonic-events-bgp.yang index df9945d783..9eadf47032 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-bgp.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-bgp.yang @@ -5,7 +5,7 @@ module sonic-events-bgp { import sonic-events-common { prefix evtcmn; - revision-date 2022-12-01; + revision-date 2022-12-01; } import sonic-types { @@ -14,7 +14,7 @@ module sonic-events-bgp { import ietf-inet-types { prefix inet; - } + } organization "SONiC"; diff --git a/src/sonic-yang-models/yang-models/sonic-events-common.yang b/src/sonic-yang-models/yang-models/sonic-events-common.yang index 822a6eefaf..778f2ecbda 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-common.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-common.yang @@ -19,7 +19,7 @@ module sonic-events-common { revision 2022-12-01 { description "Common reusable definitions"; - } + } grouping sonic-events-cmn { leaf timestamp { @@ -37,7 +37,7 @@ module sonic-events-common { } description "Percentage in use"; } - + leaf limit { type uint8 { range "0..100" { @@ -65,16 +65,16 @@ module sonic-events-common { extension ALARM_SEVERITY_MINOR { description - "Indicates the existence of a non-service affecting fault condition + "Indicates the existence of a non-service affecting fault condition and that corrective action should be taken in order to prevent a more serious - (for example, service affecting) fault. Such a severity can be reported, + (for example, service affecting) fault. Such a severity can be reported, for example, when the detected alarm condition is not currently degrading the capacity of the resource"; } extension ALARM_SEVERITY_MAJOR { description - "Indicates that a service affecting condition has developed and an urgent corrective - action is required. Such a severity can be reported, for example, when there is a severe + "Indicates that a service affecting condition has developed and an urgent corrective + action is required. Such a severity can be reported, for example, when there is a severe degradation in the capability of the resource and its full capability must be restored."; } } diff --git a/src/sonic-yang-models/yang-models/sonic-events-host.yang b/src/sonic-yang-models/yang-models/sonic-events-host.yang index edd98d247c..1992d829bf 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-host.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-host.yang @@ -32,7 +32,7 @@ module sonic-events-host { description " Declares an event for disk usage crossing set limit The parameters describe the usage & limit set."; - + leaf fs { type string; description "Name of the file system"; @@ -49,7 +49,7 @@ module sonic-events-host { description " Declares an event for memory usage crossing set limit The parameters describe the usage & limit set."; - + uses evtcmn:sonic-events-usage; uses evtcmn:sonic-events-cmn; @@ -60,7 +60,7 @@ module sonic-events-host { description " Declares an event for cpu usage crossing set limit The parameters describe the usage & limit set."; - + uses evtcmn:sonic-events-usage; uses evtcmn:sonic-events-cmn; @@ -126,7 +126,7 @@ module sonic-events-host { description " Declares an container that is expected to be up is down. Reported by monit periodically."; - + leaf ctr_name { type string; description "Name of the container not running"; @@ -141,7 +141,7 @@ module sonic-events-host { description " Declare an event at the time point of container stopping. event-down-ctr fires periodically until it starts up."; - + leaf ctr_name { type string; description "Name of the container"; @@ -236,7 +236,7 @@ module sonic-events-host { Declares an event in which a critical process exits unexpectedly."; leaf process_name { - type stypes:process_name; + type stypes:process_name; description "Name of process that is not running"; } diff --git a/src/sonic-yang-models/yang-models/sonic-events-swss.yang b/src/sonic-yang-models/yang-models/sonic-events-swss.yang index a6246faefa..af5bfd9056 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-swss.yang @@ -34,7 +34,7 @@ module sonic-events-swss { evtcmn:ALARM_SEVERITY_MINOR; description " - Declares an event for i/f flap. + Declares an event for i/f flap. The name of the flapping i/f and status are the only params."; leaf ifname { diff --git a/src/sonic-yang-models/yang-models/sonic-fine-grained-ecmp.yang b/src/sonic-yang-models/yang-models/sonic-fine-grained-ecmp.yang index b5811f06f0..8ac62f88db 100644 --- a/src/sonic-yang-models/yang-models/sonic-fine-grained-ecmp.yang +++ b/src/sonic-yang-models/yang-models/sonic-fine-grained-ecmp.yang @@ -56,7 +56,7 @@ module sonic-fine-grained-ecmp { container sonic-fine-grained-ecmp { - container FG_NHG { + container FG_NHG { description "FG_NHG part of config_db.json"; @@ -72,8 +72,8 @@ module sonic-fine-grained-ecmp { leaf bucket_size{ type uint16; mandatory true; - description "total hash bucket size desired, - recommended value of Lowest Common Multiple + description "total hash bucket size desired, + recommended value of Lowest Common Multiple of 1..{max # of next-hops}"; } diff --git a/src/sonic-yang-models/yang-models/sonic-kubernetes_master.yang b/src/sonic-yang-models/yang-models/sonic-kubernetes_master.yang index 331270122e..c36d883f6b 100644 --- a/src/sonic-yang-models/yang-models/sonic-kubernetes_master.yang +++ b/src/sonic-yang-models/yang-models/sonic-kubernetes_master.yang @@ -15,7 +15,7 @@ module sonic-kubernetes_master { } description "KUBERNETES_MASTER YANG Module for SONiC OS"; - + revision 2022-10-09 { description "First Revision"; } diff --git a/src/sonic-yang-models/yang-models/sonic-logger.yang b/src/sonic-yang-models/yang-models/sonic-logger.yang index f9a89bda49..76c7afde88 100644 --- a/src/sonic-yang-models/yang-models/sonic-logger.yang +++ b/src/sonic-yang-models/yang-models/sonic-logger.yang @@ -10,7 +10,7 @@ module sonic-logger{ } description "Logger Table yang Module for SONiC"; - + typedef swss_loglevel { type enumeration { enum EMERG; @@ -23,7 +23,7 @@ module sonic-logger{ enum DEBUG; } } - + typedef sai_loglevel { type enumeration { enum SAI_LOG_LEVEL_CRITICAL; @@ -34,7 +34,7 @@ module sonic-logger{ enum SAI_LOG_LEVEL_DEBUG; } } - + container sonic-logger { container LOGGER { @@ -66,7 +66,7 @@ module sonic-logger{ enum STDERR; } default SYSLOG; - } + } }/* end of list LOGGER_LIST */ }/* end of LOGGER container */ }/* end of sonic-logger container */ diff --git a/src/sonic-yang-models/yang-models/sonic-mclag.yang b/src/sonic-yang-models/yang-models/sonic-mclag.yang index 59799baf4e..85720358bf 100644 --- a/src/sonic-yang-models/yang-models/sonic-mclag.yang +++ b/src/sonic-yang-models/yang-models/sonic-mclag.yang @@ -47,7 +47,7 @@ module sonic-mclag { container MCLAG_DOMAIN { - list MCLAG_DOMAIN_LIST { + list MCLAG_DOMAIN_LIST { key "domain_id"; max-elements 1; @@ -106,9 +106,9 @@ module sonic-mclag { } } - container MCLAG_INTERFACE { + container MCLAG_INTERFACE { - list MCLAG_INTERFACE_LIST { + list MCLAG_INTERFACE_LIST { description "List of MCLAG interfaces"; key "domain_id if_name"; diff --git a/src/sonic-yang-models/yang-models/sonic-mgmt_interface.yang b/src/sonic-yang-models/yang-models/sonic-mgmt_interface.yang index 119e02f478..d45c403270 100644 --- a/src/sonic-yang-models/yang-models/sonic-mgmt_interface.yang +++ b/src/sonic-yang-models/yang-models/sonic-mgmt_interface.yang @@ -46,7 +46,7 @@ module sonic-mgmt_interface { } leaf gwaddr { - must "(contains(current(), ':') and contains(../ip_prefix, ':')) or (contains(current(), '.') and contains(../ip_prefix, '.'))"; + must "(contains(current(), ':') and contains(../ip_prefix, ':')) or (contains(current(), '.') and contains(../ip_prefix, '.'))"; type inet:ip-address; } @@ -57,11 +57,11 @@ module sonic-mgmt_interface { } description - "This configuration allows addtional routes to be added to default VRF table + "This configuration allows addtional routes to be added to default VRF table or mgmt VRF table, based on if Management VRF is configured. Details can be found in interfaces.j2."; } - + } /* end of list MGMT_INTERFACE_IPADDR_LIST */ } /* end of container MGMT_INTERFACE */ diff --git a/src/sonic-yang-models/yang-models/sonic-mgmt_port.yang b/src/sonic-yang-models/yang-models/sonic-mgmt_port.yang index 96a2dfaf3f..2fe8336e31 100644 --- a/src/sonic-yang-models/yang-models/sonic-mgmt_port.yang +++ b/src/sonic-yang-models/yang-models/sonic-mgmt_port.yang @@ -33,7 +33,7 @@ module sonic-mgmt_port { leaf speed { type uint16 { - range "10|100|1000"; + range "10|100|1000"; } description @@ -56,7 +56,7 @@ module sonic-mgmt_port { leaf mtu{ type uint16 { - range "1500..9216"; + range "1500..9216"; } default 1500; } diff --git a/src/sonic-yang-models/yang-models/sonic-mux-cable.yang b/src/sonic-yang-models/yang-models/sonic-mux-cable.yang index c70002afdd..c1f51e67ee 100644 --- a/src/sonic-yang-models/yang-models/sonic-mux-cable.yang +++ b/src/sonic-yang-models/yang-models/sonic-mux-cable.yang @@ -26,11 +26,11 @@ module sonic-mux-cable { } container sonic-mux-cable { - + container MUX_CABLE { - + list MUX_CABLE_LIST { - + key "ifname"; leaf ifname { diff --git a/src/sonic-yang-models/yang-models/sonic-nat.yang b/src/sonic-yang-models/yang-models/sonic-nat.yang index c1e5540125..fce7a63466 100644 --- a/src/sonic-yang-models/yang-models/sonic-nat.yang +++ b/src/sonic-yang-models/yang-models/sonic-nat.yang @@ -66,26 +66,26 @@ module sonic-nat { description "Global ip for the Static NAPT entry."; type inet:ipv4-address; - } - + } + leaf ip_protocol { description "IP Protocol (tcp or udp) for the Static NAPT entry."; type stypes:ip-protocol-type; - } - + } + leaf global_l4_port { description "Global L4 port for the Static NAPT entry."; type inet:port-number; - } + } leaf local_ip { description "Local ip for the Static NAPT entry."; mandatory true; type inet:ipv4-address; - } + } leaf local_port { description "Local port for the Static NAPT entry."; @@ -93,23 +93,23 @@ module sonic-nat { mandatory true; type inet:port-number ; } - + leaf nat_type { description "Nat type for the static napt entry - snat or dnat"; type nat-type; default dnat; - } - + } + leaf twice_nat_id { description "Twice nat id for the static napt to achieve the twice napt"; - type uint16 { + type uint16 { range "1..9999" { error-message "Invalid twice nat id for the static NAPT."; error-app-tag twice-nat-id-invalid; - } - } + } + } } } } @@ -144,12 +144,12 @@ module sonic-nat { leaf twice_nat_id { description "Twice nat id for the static nat to achieve the twice nat"; - type uint16 { + type uint16 { range "1..9999" { error-message "Invalid twice nat id for the static NAT."; - error-app-tag twice-nat-id-invalid; - } - } + error-app-tag twice-nat-id-invalid; + } + } } } } diff --git a/src/sonic-yang-models/yang-models/sonic-ntp.yang b/src/sonic-yang-models/yang-models/sonic-ntp.yang index 65ee51052d..f28e105209 100644 --- a/src/sonic-yang-models/yang-models/sonic-ntp.yang +++ b/src/sonic-yang-models/yang-models/sonic-ntp.yang @@ -32,7 +32,7 @@ module sonic-ntp { import sonic-mgmt_port { prefix mprt; } - + description "NTP yang Module for SONiC OS"; @@ -48,7 +48,7 @@ module sonic-ntp { container global { description "Global NTP part of config_db.json"; - + leaf-list src_intf { type union { type leafref { @@ -72,9 +72,9 @@ module sonic-ntp { description "This is the interface whose IP address is used as the source IP address for - generating NTP traffic. User is required to make sure that the NTP server - is reachable via this IP address and the same IP address is reachable - from the NTP server. The source interface should be in the same VRF as the + generating NTP traffic. User is required to make sure that the NTP server + is reachable via this IP address and the same IP address is reachable + from the NTP server. The source interface should be in the same VRF as the VRF NTP is enabled in."; } @@ -89,7 +89,7 @@ module sonic-ntp { description "NTP can be enabled only in one VRF at a time. In this revision, it is either - default VRF or Management VRF."; + default VRF or Management VRF."; } } /* end of container global */ @@ -97,9 +97,9 @@ module sonic-ntp { } /* end of container NTP */ container NTP_SERVER { - + description "NTP SERVER part of config_db.json"; - + list NTP_SERVER_LIST { max-elements 10; description @@ -112,7 +112,7 @@ module sonic-ntp { leaf server_address { type inet:host; } - } /* end of list NTP_SERVER_LIST */ + } /* end of list NTP_SERVER_LIST */ } /* end of container NTP_SERVER */ diff --git a/src/sonic-yang-models/yang-models/sonic-peer-switch.yang b/src/sonic-yang-models/yang-models/sonic-peer-switch.yang index 7f953c71bd..25b1e1adf0 100644 --- a/src/sonic-yang-models/yang-models/sonic-peer-switch.yang +++ b/src/sonic-yang-models/yang-models/sonic-peer-switch.yang @@ -6,7 +6,7 @@ module sonic-peer-switch { import ietf-inet-types { prefix inet; } - + import sonic-types { prefix stypes; } @@ -31,7 +31,7 @@ module sonic-peer-switch { max-elements 1; key "peer_switch"; - + leaf peer_switch { type stypes:hostname; diff --git a/src/sonic-yang-models/yang-models/sonic-pfc-priority-priority-group-map.yang b/src/sonic-yang-models/yang-models/sonic-pfc-priority-priority-group-map.yang index 8c537aa7a6..9a1fb705d9 100644 --- a/src/sonic-yang-models/yang-models/sonic-pfc-priority-priority-group-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-pfc-priority-priority-group-map.yang @@ -20,7 +20,7 @@ module sonic-pfc-priority-priority-group-map { "Initial revision."; } - container sonic-pfc-priority-priority-group-map { + container sonic-pfc-priority-priority-group-map { container PFC_PRIORITY_TO_PRIORITY_GROUP_MAP { diff --git a/src/sonic-yang-models/yang-models/sonic-pfc-priority-queue-map.yang b/src/sonic-yang-models/yang-models/sonic-pfc-priority-queue-map.yang index 805cf84178..7c5a51646b 100644 --- a/src/sonic-yang-models/yang-models/sonic-pfc-priority-queue-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-pfc-priority-queue-map.yang @@ -20,7 +20,7 @@ module sonic-pfc-priority-queue-map { "Initial revision."; } - container sonic-pfc-priority-queue-map { + container sonic-pfc-priority-queue-map { container MAP_PFC_PRIORITY_TO_QUEUE { diff --git a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang index 6a2c69ab99..346b08bd1b 100644 --- a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang @@ -99,7 +99,7 @@ module sonic-port-qos-map { path "/ppqm:sonic-pfc-priority-queue-map/ppqm:MAP_PFC_PRIORITY_TO_QUEUE/ppqm:MAP_PFC_PRIORITY_TO_QUEUE_LIST/ppqm:name"; } } - + leaf pfc_to_pg_map { type leafref { path "/pppgm:sonic-pfc-priority-priority-group-map/pppgm:PFC_PRIORITY_TO_PRIORITY_GROUP_MAP/pppgm:PFC_PRIORITY_TO_PRIORITY_GROUP_MAP_LIST/pppgm:name"; diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index ce091bad57..f5b5a936ab 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -83,7 +83,7 @@ module sonic-port{ leaf-list adv_speeds { description "Port advertised speeds, valid value could be a list of interger or all"; - + type union { type uint32 { range 1..800000; @@ -114,7 +114,7 @@ module sonic-port{ } must "(count(adv_interface_types[text()='all']) = 0) or (count(adv_interface_types) = 1)"; - + leaf mtu { type uint16 { range 68..9216; diff --git a/src/sonic-yang-models/yang-models/sonic-queue.yang b/src/sonic-yang-models/yang-models/sonic-queue.yang index e764f8149a..c29c61387c 100644 --- a/src/sonic-yang-models/yang-models/sonic-queue.yang +++ b/src/sonic-yang-models/yang-models/sonic-queue.yang @@ -41,7 +41,7 @@ module sonic-queue { container QUEUE { description "QUEUE part of config_db.json"; - + list QUEUE_LIST { key "ifname qindex"; @@ -60,7 +60,7 @@ module sonic-queue { } description "Interface name."; } - // qindex format is (X) | (X-Y). X is start and Y is end index. + // qindex format is (X) | (X-Y). X is start and Y is end index. // X and Y value depends on platform, example for physical ports 0-7 and // for CPU port 0-48. Example qindex is 3-4 leaf qindex { diff --git a/src/sonic-yang-models/yang-models/sonic-route-map.yang b/src/sonic-yang-models/yang-models/sonic-route-map.yang index cdfe5c6eda..3a5d1f256f 100644 --- a/src/sonic-yang-models/yang-models/sonic-route-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-route-map.yang @@ -139,7 +139,7 @@ module sonic-route-map { type uint16 { range 1..65535; } - description "Statement name, this helps to provide multiple statements + description "Statement name, this helps to provide multiple statements under a particular route-map"; } @@ -304,7 +304,7 @@ module sonic-route-map { description "Set IPv6 global next hop"; } - leaf set_ipv6_next_hop_prefer_global { + leaf set_ipv6_next_hop_prefer_global { type boolean; description "Set to prefer IPv6 nexthop global address"; } diff --git a/src/sonic-yang-models/yang-models/sonic-routing-policy-sets.yang b/src/sonic-yang-models/yang-models/sonic-routing-policy-sets.yang index 9b3e18960c..cf469730f6 100644 --- a/src/sonic-yang-models/yang-models/sonic-routing-policy-sets.yang +++ b/src/sonic-yang-models/yang-models/sonic-routing-policy-sets.yang @@ -62,7 +62,7 @@ module sonic-routing-policy-sets { container PREFIX { - list PREFIX_LIST { + list PREFIX_LIST { key "name sequence_number ip_prefix masklength_range"; //ext:custom-validation ValidateIpPrefixListCfg; @@ -71,7 +71,7 @@ module sonic-routing-policy-sets { path "../../../PREFIX_SET/PREFIX_SET_LIST/name"; } description "Prefix name"; - } + } leaf sequence_number { type uint32 { diff --git a/src/sonic-yang-models/yang-models/sonic-scheduler.yang b/src/sonic-yang-models/yang-models/sonic-scheduler.yang index 7e580d848d..c89e51f663 100644 --- a/src/sonic-yang-models/yang-models/sonic-scheduler.yang +++ b/src/sonic-yang-models/yang-models/sonic-scheduler.yang @@ -31,7 +31,7 @@ module sonic-scheduler { key "name"; leaf name { - type string; + type string; description "Scheduler name"; } @@ -85,7 +85,7 @@ module sonic-scheduler { "Committed information rate for the dual-rate token bucket policer.This value represents the rate at which tokens are added to the primary bucket.nt Units is - Bps(Bytes per second) for meter type is bytes else + Bps(Bytes per second) for meter type is bytes else Pps(packets per second) for meter type is packets"; } diff --git a/src/sonic-yang-models/yang-models/sonic-snmp.yang b/src/sonic-yang-models/yang-models/sonic-snmp.yang index 9ae2c2f828..f49c28f980 100644 --- a/src/sonic-yang-models/yang-models/sonic-snmp.yang +++ b/src/sonic-yang-models/yang-models/sonic-snmp.yang @@ -109,8 +109,8 @@ module sonic-snmp { } leaf SNMP_USER_AUTH_TYPE { type string; - must "(current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '') or - ((current()/../SNMP_USER_TYPE = 'AuthNoPriv' or current()/../SNMP_USER_TYPE = 'Priv') + must "(current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '') or + ((current()/../SNMP_USER_TYPE = 'AuthNoPriv' or current()/../SNMP_USER_TYPE = 'Priv') and (current() = 'SHA' or current() = 'MD5' or current() = 'HMAC-SHA-2'))"; default ""; description @@ -120,20 +120,20 @@ module sonic-snmp { type string { length "0..64"; pattern '[^ @:]*' { - error-message 'Invalid snmp user authentication password (Valid chars are ASCII + error-message 'Invalid snmp user authentication password (Valid chars are ASCII printable except ":" and"@")'; } } - must "(current()/../SNMP_USER_TYPE = 'AuthNoPriv' and string-length(current()) >= 8) or - (current()/../SNMP_USER_TYPE = 'Priv' and string-length(current()) >= 8) or + must "(current()/../SNMP_USER_TYPE = 'AuthNoPriv' and string-length(current()) >= 8) or + (current()/../SNMP_USER_TYPE = 'Priv' and string-length(current()) >= 8) or (current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '')"; description "Authentication password for the user."; } leaf SNMP_USER_ENCRYPTION_TYPE { type string; - must "(current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '') or - (current()/../SNMP_USER_TYPE = 'AuthNoPriv' and current() = '') or + must "(current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '') or + (current()/../SNMP_USER_TYPE = 'AuthNoPriv' and current() = '') or (current()/../SNMP_USER_TYPE = 'Priv' and (current() = 'DES' or current() = 'AES'))"; default ""; description @@ -148,8 +148,8 @@ module sonic-snmp { printable except ":" and"@")'; } } - must "(current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '') or - (current()/../SNMP_USER_TYPE = 'AuthNoPriv' and current() = '') or + must "(current()/../SNMP_USER_TYPE = 'noAuthNoPriv' and current() = '') or + (current()/../SNMP_USER_TYPE = 'AuthNoPriv' and current() = '') or (current()/../SNMP_USER_TYPE = 'Priv' and string-length(current()) >= 8)"; description "Encryption password for the user."; diff --git a/src/sonic-yang-models/yang-models/sonic-storm-control.yang b/src/sonic-yang-models/yang-models/sonic-storm-control.yang index 3f0e48d413..0d6e2aad57 100644 --- a/src/sonic-yang-models/yang-models/sonic-storm-control.yang +++ b/src/sonic-yang-models/yang-models/sonic-storm-control.yang @@ -8,21 +8,21 @@ module sonic-storm-control { prefix prt; } - organization + organization "SONiC"; - contact + contact "SONiC"; description "This module defines configuration and operational state - data for broadcast, unknown-unicast and unknown-multicast (BUM) storm-control. - storm-control can be enabled on ethernet interfaces. - Rate is defined in bits-per-second. All three types of storm-control can be + data for broadcast, unknown-unicast and unknown-multicast (BUM) storm-control. + storm-control can be enabled on ethernet interfaces. + Rate is defined in bits-per-second. All three types of storm-control can be enabled on an interface."; revision 2021-12-13 { - description + description "Initial revision"; } @@ -33,7 +33,7 @@ module sonic-storm-control { /*scommon:key-pattern "PORT_STORM_CONTROL|{ifname}|{storm_type}";*/ leaf ifname { type leafref { - path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name"; + path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name"; } } leaf storm_type { diff --git a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang index f842d63cf6..08d5f6f945 100644 --- a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang +++ b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang @@ -50,7 +50,7 @@ module sonic-system-aaa { description "Allow AAA fallback"; default False; } - + leaf debug { type stypes:boolean_type; description "Enable/disable AAA debugging"; diff --git a/src/sonic-yang-models/yang-models/sonic-tc-priority-group-map.yang b/src/sonic-yang-models/yang-models/sonic-tc-priority-group-map.yang index e01fb7e6ac..0fd3c8aaea 100644 --- a/src/sonic-yang-models/yang-models/sonic-tc-priority-group-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-tc-priority-group-map.yang @@ -1,5 +1,5 @@ module sonic-tc-priority-group-map { - + yang-version 1.1; namespace "http://github.com/sonic-net/sonic-tc-priority-group-map"; diff --git a/src/sonic-yang-models/yang-models/sonic-vlan.yang b/src/sonic-yang-models/yang-models/sonic-vlan.yang index f8aa707759..77fd29c0f4 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan.yang @@ -170,7 +170,7 @@ module sonic-vlan { list VLAN_LIST { key "name"; - + leaf name { type string { pattern 'Vlan([0-9]{1,3}|[1-3][0-9]{3}|[4][0][0-8][0-9]|[4][0][9][0-4])'; diff --git a/src/sonic-yang-models/yang-models/sonic-vnet.yang b/src/sonic-yang-models/yang-models/sonic-vnet.yang index f88a945177..9a04105c4e 100644 --- a/src/sonic-yang-models/yang-models/sonic-vnet.yang +++ b/src/sonic-yang-models/yang-models/sonic-vnet.yang @@ -41,7 +41,7 @@ module sonic-vnet { list VNET_LIST { key "name"; - + leaf name { description "An alphanumaric string to represent the name of the unique vnet"; type string; @@ -54,7 +54,7 @@ module sonic-vnet { path "/svxlan:sonic-vxlan/svxlan:VXLAN_TUNNEL/svxlan:VXLAN_TUNNEL_LIST/svxlan:name"; } } - + leaf vni { mandatory true; description "A valid and unique vni which will become part of the encapsulated traffic header."; @@ -80,7 +80,7 @@ module sonic-vnet { pattern "default" { error-message "Invalid VRF name"; } - } + } } leaf advertise_prefix { diff --git a/src/sonic-yang-models/yang-models/sonic-voq-inband-interface.yang b/src/sonic-yang-models/yang-models/sonic-voq-inband-interface.yang index d197a91f80..7861b13752 100644 --- a/src/sonic-yang-models/yang-models/sonic-voq-inband-interface.yang +++ b/src/sonic-yang-models/yang-models/sonic-voq-inband-interface.yang @@ -1,7 +1,7 @@ module sonic-voq-inband-interface { namespace "http://github.com/sonic-net/sonic-voq-inband-interface"; prefix voq-inband-intf; - yang-version 1.1; + yang-version 1.1; import sonic-types { prefix stypes; @@ -34,9 +34,9 @@ module sonic-voq-inband-interface { leaf inband_type { description "Type of inband interface"; type string { - pattern "port|Port"; + pattern "port|Port"; } - default "port"; + default "port"; } } list VOQ_INBAND_INTERFACE_IPPREFIX_LIST { @@ -52,5 +52,5 @@ module sonic-voq-inband-interface { } } } - } + } } diff --git a/src/sonic-yang-models/yang-models/sonic-vrf.yang b/src/sonic-yang-models/yang-models/sonic-vrf.yang index 5387aad2cc..83836a81c1 100644 --- a/src/sonic-yang-models/yang-models/sonic-vrf.yang +++ b/src/sonic-yang-models/yang-models/sonic-vrf.yang @@ -1,7 +1,7 @@ module sonic-vrf { namespace "http://github.com/sonic-net/sonic-vrf"; prefix vrf; - + import sonic-extension { prefix sonic-ext; } @@ -22,7 +22,7 @@ module sonic-vrf { container sonic-vrf { container VRF { - description "Vrf configuration."; + description "Vrf configuration."; list VRF_LIST { key "name"; @@ -34,7 +34,7 @@ module sonic-vrf { error-app-tag vrf-name-invalid; } } - } + } leaf fallback { type boolean; diff --git a/src/sonic-yang-models/yang-models/sonic-vxlan.yang b/src/sonic-yang-models/yang-models/sonic-vxlan.yang index bad6111b35..f35276f23d 100644 --- a/src/sonic-yang-models/yang-models/sonic-vxlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vxlan.yang @@ -49,9 +49,9 @@ module sonic-vxlan { max-elements 1; leaf name { - /* vni devices are created of the form 'name'-vlanid + /* vni devices are created of the form 'name'-vlanid The kernel has a max limit of 15 chars for netdevices. - keeping aside 5 chars for hyphen and vlanid the + keeping aside 5 chars for hyphen and vlanid the name should have a max of 10 chars */ type string { @@ -105,7 +105,7 @@ module sonic-vxlan { description "config db VXLAN_EVPN_NVO table"; - list VXLAN_EVPN_NVO_LIST { + list VXLAN_EVPN_NVO_LIST { key "name"; max-elements 1; diff --git a/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 index 90bba27425..07b40ea742 100644 --- a/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 @@ -42,11 +42,11 @@ module sonic-policer { type stypes:policer_mode; description "Policer mode"; } - + leaf color { type stypes:policer_color_source; description "Policer color Source"; - } + } leaf cir { type uint64; diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index 9a88a0851b..7d33b8433e 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -58,7 +58,7 @@ class ServiceChecker(HealthChecker): self.load_critical_process_cache() self.events_handle = swsscommon.events_init_publisher(EVENTS_PUBLISHER_SOURCE) - + def get_expected_running_containers(self, feature_table): """Get a set of containers that are expected to running on SONiC diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 1357693c10..bc2fee498c 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -35,7 +35,7 @@ class MonitorStateDbTask(ProcessTaskBase): sel = swsscommon.Select() cst = swsscommon.SubscriberStateTable(state_db, "FEATURE") sel.addSelectable(cst) - + while not self.task_stopping_event.is_set(): (state, c) = sel.select(SELECT_TIMEOUT_MSECS) if state == swsscommon.Select.TIMEOUT: @@ -48,8 +48,8 @@ class MonitorStateDbTask(ProcessTaskBase): timestamp = "{}".format(datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")) msg={"unit": key_ext, "evt_src":"feature", "time":timestamp} self.task_notify(msg) - - + + def task_worker(self): if self.task_stopping_event.is_set(): return @@ -57,7 +57,7 @@ class MonitorStateDbTask(ProcessTaskBase): self.subscribe_statedb() except Exception as e: logger.log_error("subscribe_statedb exited- {}".format(str(e))) - + def task_notify(self, msg): if self.task_stopping_event.is_set(): return @@ -124,16 +124,16 @@ class Sysmonitor(ProcessTaskBase): if not self.state_db: self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') self.state_db.connect(self.state_db.STATE_DB) - + self.state_db.set(self.state_db.STATE_DB, "SYSTEM_READY|SYSTEM_STATE", "Status", state) logger.log_info("Posting system ready status {} to statedb".format(state)) - + except Exception as e: logger.log_error("Unable to post system ready status: {}".format(str(e))) #Forms the service list to be monitored def get_all_service_list(self): - + if not self.config_db: self.config_db = swsscommon.ConfigDBConnector() self.config_db.connect() @@ -142,11 +142,11 @@ class Sysmonitor(ProcessTaskBase): #add the services from the below targets targets= ["/etc/systemd/system/multi-user.target.wants", "/etc/systemd/system/sonic.target.wants"] for path in targets: - dir_list += [os.path.basename(i) for i in glob.glob('{}/*.service'.format(path))] + dir_list += [os.path.basename(i) for i in glob.glob('{}/*.service'.format(path))] #add the enabled docker services from config db feature table self.get_service_from_feature_table(dir_list) - + self.config.load_config() if self.config and self.config.ignore_services: for srv in self.config.ignore_services: @@ -161,7 +161,7 @@ class Sysmonitor(ProcessTaskBase): is not an atomic operation, sonic-cfggen do it with two steps: 1. Add an empty table entry to CONFIG DB 2. Add all fields to the table - + So, if system health read db on middle of step 1 and step 2, it might read invalid data. A retry mechanism is here to avoid such issue. @@ -222,7 +222,7 @@ class Sysmonitor(ProcessTaskBase): if fail_reason is None: fail_reason = "NA" pstate = "Down" - + update_time = self.state_db.get(self.state_db.STATE_DB, 'FEATURE|{}'.format(service), 'update_time') if update_time is None: update_time = "-" @@ -270,7 +270,7 @@ class Sysmonitor(ProcessTaskBase): service_status = "Down" service_up_status = "Down" service_name,last_name = event.split('.') - + sysctl_show = self.run_systemctl_show(event) load_state = sysctl_show.get('LoadState') @@ -280,7 +280,7 @@ class Sysmonitor(ProcessTaskBase): active_state = sysctl_show['ActiveState'] sub_state = sysctl_show['SubState'] srv_type = sysctl_show['Type'] - + #Raise syslog for service state change logger.log_info("{} service state changed to [{}/{}]".format(event, active_state, sub_state)) @@ -320,14 +320,14 @@ class Sysmonitor(ProcessTaskBase): fail_reason = "Inactive" else: unit_status = "NOT OK" - + self.post_unit_status(service_name, service_status, service_up_status, fail_reason, update_time) return unit_status except Exception as e: logger.log_error("Get unit status {}-{}".format(service_name, str(e))) - + #Gets status of all the services from service list def get_all_system_status(self): @@ -398,14 +398,14 @@ class Sysmonitor(ProcessTaskBase): if event not in self.dnsrvs_name: self.dnsrvs_name.add(event) astate = "DOWN" - + self.publish_system_status(astate) else: #if received event is not in current full service list but exists in STATE_DB & set, #then it should be removed from STATE_DB & set if event in self.dnsrvs_name: self.dnsrvs_name.remove(event) - + srv_name,last = event.split('.') # stop on service maybe propagated to timers and in that case, # the state_db entry for the service should not be deleted @@ -414,30 +414,30 @@ class Sysmonitor(ProcessTaskBase): key_exists = self.state_db.exists(self.state_db.STATE_DB, key) if key_exists == 1: self.state_db.delete(self.state_db.STATE_DB, key) - + return 0 def system_service(self): if not self.state_db: self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') self.state_db.connect(self.state_db.STATE_DB) - + mpmgr = multiprocessing.Manager() myQ = mpmgr.Queue() try: monitor_system_bus = MonitorSystemBusTask(myQ) monitor_system_bus.task_run() - + monitor_statedb_table = MonitorStateDbTask(myQ) monitor_statedb_table.task_run() - + except Exception as e: logger.log_error("SubProcess-{}".format(str(e))) sys.exit(1) self.update_system_status() - + from queue import Empty # Queue to receive the STATEDB and Systemd state change event while not self.task_stopping_event.is_set(): @@ -460,7 +460,7 @@ class Sysmonitor(ProcessTaskBase): monitor_system_bus.task_stop() monitor_statedb_table.task_stop() - + def task_worker(self): if self.task_stopping_event.is_set(): return diff --git a/src/system-health/tests/mock_connector.py b/src/system-health/tests/mock_connector.py index d602c8eaf1..4eb36f9860 100644 --- a/src/system-health/tests/mock_connector.py +++ b/src/system-health/tests/mock_connector.py @@ -22,11 +22,11 @@ class MockConnector(object): def get_all(self, db_id, key): return MockConnector.data[key] - + def set(self, db_id, key, field, value): self.data[key] = {} self.data[key][field] = value - + def hmset(self, db_id, key, fieldsvalues): self.data[key] = {} for field,value in fieldsvalues.items(): diff --git a/src/systemd-sonic-generator/ssg-test.cc b/src/systemd-sonic-generator/ssg-test.cc index 1d0f33d54b..52706358d1 100644 --- a/src/systemd-sonic-generator/ssg-test.cc +++ b/src/systemd-sonic-generator/ssg-test.cc @@ -95,7 +95,7 @@ class SystemdSonicGeneratorFixture : public testing::Test { const char* asic_conf_format_; }; -/* +/* * class SsgFunctionTest * Implements functions to execute functional level tests. */ @@ -135,7 +135,7 @@ class SsgFunctionTest : public SystemdSonicGeneratorFixture { FILE* fp; SystemdSonicGeneratorFixture::SetUp(); - /* Setup Input and Output directories and files */ + /* Setup Input and Output directories and files */ fs::path path{TEST_UNIT_FILE_PREFIX.c_str()}; fs::create_directories(path); path = fs::path(TEST_OUTPUT_DIR.c_str()); @@ -163,7 +163,7 @@ class SsgFunctionTest : public SystemdSonicGeneratorFixture { private: }; -/* +/* * class SsgMainTest * Implements functions to test ssg_main routine. */ @@ -254,7 +254,7 @@ class SsgMainTest : public SsgFunctionTest { std::string test_service = "test.service"; /* Validate Unit file dependency creation for multi instance - * services. These entries should be present for multi asic + * services. These entries should be present for multi asic * system but not present for single asic system. */ validate_output_dependency_list(multi_asic_dependency_list, @@ -351,7 +351,7 @@ class SsgMainTest : public SsgFunctionTest { /* * The following list defines the Service unit files symlinks generated by * Systemd sonic generator for single and multi asic systems. The test case - * use these lists to check for presence/absence of unit files based on + * use these lists to check for presence/absence of unit files based on * num_asics value. */ @@ -386,7 +386,7 @@ SsgMainTest::common_service_list = { * the original unit file, if required, for multi asic system. * For example: if test.service file defines a dependency "After=multi_inst_a.service", * as multi_inst_a.service is a multi instance service, - * for a system with 2 asics, systemd sonic generator shall modify + * for a system with 2 asics, systemd sonic generator shall modify * test.service to include following dependency strings: * "After=multi_inst_a@0.service" * After=multi_inst_a@1.service" diff --git a/src/tacacs/audisp/Makefile b/src/tacacs/audisp/Makefile index ecfd692779..6fccb9ae7f 100644 --- a/src/tacacs/audisp/Makefile +++ b/src/tacacs/audisp/Makefile @@ -26,7 +26,7 @@ ifeq ($(CROSS_BUILD_ENVIRON), y) else # build package dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) -endif +endif popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/tacacs/bash_tacplus/bash_tacplus.c b/src/tacacs/bash_tacplus/bash_tacplus.c index b184b8f14b..82f57c724c 100644 --- a/src/tacacs/bash_tacplus/bash_tacplus.c +++ b/src/tacacs/bash_tacplus/bash_tacplus.c @@ -42,7 +42,7 @@ /* Tacacs+ config file timestamp string length */ #define CONFIG_FILE_TIME_STAMP_LEN 100 -/* +/* Convert log to a string because va args resoursive issue: http://www.c-faq.com/varargs/handoff.html */ @@ -199,7 +199,7 @@ int tacacs_authorization( continue; } - // increase connected servers + // increase connected servers connected_servers++; result = send_authorization_message(server_fd, user, tty, host, task_id, cmd, args, argc); close(server_fd); @@ -279,7 +279,7 @@ void load_tacacs_config() } output_debug("TACACS+ control flag: 0x%x\n", tacacs_ctrl); - + if (tacacs_ctrl & AUTHORIZATION_FLAG_TACACS) { output_debug("TACACS+ per-command authorization enabled.\n"); } @@ -287,7 +287,7 @@ void load_tacacs_config() if (tacacs_ctrl & AUTHORIZATION_FLAG_LOCAL) { output_debug("Local per-command authorization enabled.\n"); } - + if (tacacs_ctrl & PAM_TAC_DEBUG) { output_debug("TACACS+ debug enabled.\n"); } @@ -371,7 +371,7 @@ int is_local_user(char *user) else { output_error("get user information failed, user: %s, errorno: %d\n", user, s); } - + result = ERROR_CHECK_LOCAL_USER; } else if (strncmp(pwd.pw_gecos, REMOTE_USER_GECOS_PREFIX, strlen(REMOTE_USER_GECOS_PREFIX)) == 0) { @@ -482,7 +482,7 @@ int on_shell_execve (char *user, int shell_level, char *cmd, char **argv) } } - // return 0, so bash will continue run user command and will check user permission with linux permission check. + // return 0, so bash will continue run user command and will check user permission with linux permission check. output_debug("start local authorization for command %s with given arguments\n", cmd); return 0; } \ No newline at end of file diff --git a/src/tacacs/bash_tacplus/unittest/Makefile.am b/src/tacacs/bash_tacplus/unittest/Makefile.am index 5f3cf9af19..1ee7717b6d 100644 --- a/src/tacacs/bash_tacplus/unittest/Makefile.am +++ b/src/tacacs/bash_tacplus/unittest/Makefile.am @@ -11,4 +11,4 @@ DBGFLAGS = -DDEBUG -DBASH_PLUGIN_UT plugin_test_SOURCES = plugin_test.c mock_helper.c ../bash_tacplus.c plugin_test_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_TEST) $(IFLAGS_TEST) -plugin_test_LDADD = -lc -lcunit +plugin_test_LDADD = -lc -lcunit diff --git a/src/tacacs/bash_tacplus/unittest/mock_helper.c b/src/tacacs/bash_tacplus/unittest/mock_helper.c index 6edbdbe1ac..97c99f2cb1 100644 --- a/src/tacacs/bash_tacplus/unittest/mock_helper.c +++ b/src/tacacs/bash_tacplus/unittest/mock_helper.c @@ -65,13 +65,13 @@ void initialize_tacacs_servers() getaddrinfo(buffer, "49", &hints, &servers); tac_srv[idx].addr = &(tac_srv_addr[idx]); memcpy(tac_srv[idx].addr, servers, sizeof(struct addrinfo)); - + tac_srv[idx].addr->ai_addr = &(tac_sock_addr[idx]); memcpy(tac_srv[idx].addr->ai_addr, servers->ai_addr, sizeof(struct sockaddr)); - + snprintf(tac_srv[idx].key, sizeof(tac_srv[idx].key), "key%d", idx); freeaddrinfo(servers); - + debug_printf("MOCK: initialize_tacacs_servers with index: %d, address: %p\n", idx, tac_srv[idx].addr); } } @@ -119,7 +119,7 @@ void tac_free_attrib(struct tac_attrib **attr) { memory_allocate_count--; debug_printf("MOCK: tac_free_attrib memory count: %d\n", memory_allocate_count); - + // the mock code here only free first allocated memory, because the mock tac_add_attrib implementation not allocate new memory. free(*attr); } @@ -133,7 +133,7 @@ int tac_author_send(int tac_fd, const char *user, char *tty, char *host,struct t // send auth message failed return -1; } - + return 0; } @@ -146,7 +146,7 @@ int tac_author_read(int tac_fd, struct areply *reply) { return -1; } - + if (TEST_SCEANRIO_CONNECTION_SEND_DENINED_RESULT == test_scenario) { reply->status = AUTHOR_STATUS_FAIL; @@ -155,7 +155,7 @@ int tac_author_read(int tac_fd, struct areply *reply) { reply->status = AUTHOR_STATUS_PASS_REPL; } - + return 0; } @@ -163,7 +163,7 @@ int tac_author_read(int tac_fd, struct areply *reply) int tac_connect_single(const struct addrinfo *address, const char *key, struct addrinfo *source_address, int timeout, char *vrfname) { debug_printf("MOCK: tac_connect_single with address: %p\n", address); - + switch (test_scenario) { case TEST_SCEANRIO_CONNECTION_ALL_FAILED: @@ -183,7 +183,7 @@ char *tac_ntop(const struct sockaddr *address) return tac_natop_result_buffer; } } - + return "UnknownTestAddress"; } @@ -198,12 +198,12 @@ void mock_syslog(int priority, const char *format, ...) { // set mock message data to buffer for UT. memset(mock_syslog_message_buffer, 0, sizeof(mock_syslog_message_buffer)); - + va_list args; va_start (args, format); // save message to buffer to UT check later vsnprintf(mock_syslog_message_buffer, sizeof(mock_syslog_message_buffer), format, args); va_end (args); - + debug_printf("MOCK: syslog: %s\n", mock_syslog_message_buffer); } \ No newline at end of file diff --git a/src/tacacs/bash_tacplus/unittest/plugin_test.c b/src/tacacs/bash_tacplus/unittest/plugin_test.c index 2617fd8249..87df69b7da 100644 --- a/src/tacacs/bash_tacplus/unittest/plugin_test.c +++ b/src/tacacs/bash_tacplus/unittest/plugin_test.c @@ -23,14 +23,14 @@ void testcase_tacacs_authorization_all_failed() { char *testargv[2]; testargv[0] = "arg1"; testargv[1] = "arg2"; - - + + // test connection failed case set_test_scenario(TEST_SCEANRIO_CONNECTION_ALL_FAILED); int result = tacacs_authorization("test_user","tty0","test_host","test_command",testargv,2); CU_ASSERT_STRING_EQUAL(mock_syslog_message_buffer, "Failed to connect to TACACS server(s)\n"); - + // check return value, -2 for all server not reachable CU_ASSERT_EQUAL(result, -2); } @@ -40,7 +40,7 @@ void testcase_tacacs_authorization_faled() { char *testargv[2]; testargv[0] = "arg1"; testargv[1] = "arg2"; - + // test connection failed case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_FAILED_RESULT); int result = tacacs_authorization("test_user","tty0","test_host","test_command",testargv,2); @@ -54,7 +54,7 @@ void testcase_tacacs_authorization_read_failed() { char *testargv[2]; testargv[0] = "arg1"; testargv[1] = "arg2"; - + // test connection failed case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_SUCCESS_READ_FAILED); int result = tacacs_authorization("test_user","tty0","test_host","test_command",testargv,2); @@ -70,7 +70,7 @@ void testcase_tacacs_authorization_denined() { char *testargv[2]; testargv[0] = "arg1"; testargv[1] = "arg2"; - + // test connection denined case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_DENINED_RESULT); int result = tacacs_authorization("test_user","tty0","test_host","test_command",testargv,2); @@ -86,7 +86,7 @@ void testcase_tacacs_authorization_success() { char *testargv[2]; testargv[0] = "arg1"; testargv[1] = "arg2"; - + // test connection success case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_SUCCESS_RESULT); int result = tacacs_authorization("test_user","tty0","test_host","test_command",testargv,2); @@ -100,7 +100,7 @@ void testcase_authorization_with_host_and_tty_success() { char *testargv[2]; testargv[0] = "arg1"; testargv[1] = "arg2"; - + // test connection success case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_SUCCESS_RESULT); int result = authorization_with_host_and_tty("test_user","test_command",testargv,2); @@ -111,13 +111,13 @@ void testcase_authorization_with_host_and_tty_success() { /* Test check_and_load_changed_tacacs_config */ void testcase_check_and_load_changed_tacacs_config() { - + // test connection failed case check_and_load_changed_tacacs_config(); // check server config updated. CU_ASSERT_STRING_EQUAL(mock_syslog_message_buffer, "Server 2, address:TestAddress2, key:key2\n"); - + // check and load file again. check_and_load_changed_tacacs_config(); @@ -132,7 +132,7 @@ void testcase_on_shell_execve_success() { testargv[0] = "arg1"; testargv[1] = "arg2"; testargv[2] = 0; - + // test connection failed case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_SUCCESS_RESULT); on_shell_execve("test_user", 1, "test_command", testargv); @@ -147,7 +147,7 @@ void testcase_on_shell_execve_denined() { testargv[0] = "arg1"; testargv[1] = "arg2"; testargv[2] = 0; - + // test connection failed case set_test_scenario(TEST_SCEANRIO_CONNECTION_SEND_DENINED_RESULT); on_shell_execve("test_user", 1, "test_command", testargv); @@ -162,7 +162,7 @@ void testcase_on_shell_execve_failed() { testargv[0] = "arg1"; testargv[1] = "arg2"; testargv[2] = 0; - + // test connection failed case set_test_scenario(TEST_SCEANRIO_CONNECTION_ALL_FAILED); on_shell_execve("test_user", 1, "test_command", testargv);