Commit c72b189f authored by Jean-Claude BAU's avatar Jean-Claude BAU

Manage the slaveOnly key

parent 13b0dde0
...@@ -736,8 +736,12 @@ set action_restart_ppsi "/wr/bin/assembly_ppsi_conf.sh; /etc/init.d/ppsi.sh res ...@@ -736,8 +736,12 @@ set action_restart_ppsi "/wr/bin/assembly_ppsi_conf.sh; /etc/init.d/ppsi.sh res
set idx 0 set idx 0
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_SET,[incr idx]) $action_restart_ppsi set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_SET,[incr idx]) $action_restart_ppsi
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_TIME,idx) "30" set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_TIME,idx) "30"
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_SET,[incr idx]) "NONE" set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_SET,[incr idx]) "sleep 10"
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_TIME,idx) "30"
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_SET,[incr idx]) "wrs_dump_shmem | grep -e \"^ppsi.defaulDS.slaveOnly\""
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_TIME,idx) "30"
set cli_set_record(DUT_PTP_ENABLE_SLAVE_ONLY,ATTEST_SET,[incr idx]) "NONE"
#19. #19.
...@@ -1024,8 +1028,6 @@ set action_restart_ppsi "/wr/bin/assembly_ppsi_conf.sh; /etc/init.d/ppsi.sh res ...@@ -1024,8 +1028,6 @@ set action_restart_ppsi "/wr/bin/assembly_ppsi_conf.sh; /etc/init.d/ppsi.sh res
} }
################################################################################ ################################################################################
# DUT CHECK FUNCTIONS # # DUT CHECK FUNCTIONS #
################################################################################ ################################################################################
...@@ -1066,7 +1068,6 @@ global env ptp_env ...@@ -1066,7 +1068,6 @@ global env ptp_env
set cli_get_record(DUT_PTP_CHECK_PORT_STATE,ATTEST_OUTPUT,[incr idx]) "wrs_dump_shmem | egrep 'cfg.iface_name:|info.state:'" set cli_get_record(DUT_PTP_CHECK_PORT_STATE,ATTEST_OUTPUT,[incr idx]) "wrs_dump_shmem | egrep 'cfg.iface_name:|info.state:'"
set cli_get_record(DUT_PTP_CHECK_PORT_STATE,ATTEST_GET,[incr idx]) "NONE" set cli_get_record(DUT_PTP_CHECK_PORT_STATE,ATTEST_GET,[incr idx]) "NONE"
#2. #2.
################################################################################ ################################################################################
# # # #
...@@ -1162,7 +1163,6 @@ global env ptp_env ...@@ -1162,7 +1163,6 @@ global env ptp_env
} }
################################################################################ ################################################################################
# CALL BACK FOR CLI ENABLE FUNCTIONS # # CALL BACK FOR CLI ENABLE FUNCTIONS #
################################################################################ ################################################################################
...@@ -2842,8 +2842,8 @@ proc ptp::callback_cli_ptp_enable_slave_only {args} { ...@@ -2842,8 +2842,8 @@ proc ptp::callback_cli_ptp_enable_slave_only {args} {
if {[string length $port] == 1 } { if {[string length $port] == 1 } {
set port "0$port" set port "0$port"
} }
set config_slave_only "CONFIG_PTP_SLAVE_ONLY"
set config_ext_port_conf "CONFIG_PTP_OPT_EXT_PORT_CONFIG_ENABLED" set config_ext_port_conf "CONFIG_PTP_OPT_EXT_PORT_CONFIG_ENABLED"
set config_desirade_state "CONFIG_PORT${port}_INST01_DESIRADE_STATE"
# printLog "Performing configuration updation in dot-config." # printLog "Performing configuration updation in dot-config."
...@@ -2853,16 +2853,16 @@ proc ptp::callback_cli_ptp_enable_slave_only {args} { ...@@ -2853,16 +2853,16 @@ proc ptp::callback_cli_ptp_enable_slave_only {args} {
## external port configuration enabled ## external port configuration enabled
set key $config_ext_port_conf set key $config_ext_port_conf
if {[regexp "^$key" $line ]} { if {[regexp "^$key" $line ]} {
# Enable external port configuration # Disable external port configuration
set line "${key}=yes" set line "${key}=no"
printLog $line printLog $line
} }
## Set desired state ## Set slave only
set key $config_desirade_state set key $config_slave_only
if {[regexp "^$key" $line ]} { if {[regexp "^$key" $line ]} {
# Enable external port configuration # Enable slave_only
set line "${key}_SLAVE=yes" set line "${key}=yes"
printLog $line printLog $line
} }
...@@ -2877,7 +2877,7 @@ proc ptp::callback_cli_ptp_enable_slave_only {args} { ...@@ -2877,7 +2877,7 @@ proc ptp::callback_cli_ptp_enable_slave_only {args} {
sleep $::dut_config_delay sleep $::dut_config_delay
return $result return $result
} }
...@@ -3318,6 +3318,7 @@ proc ptp::callback_cli_ptp_disable_slave_only {args} { ...@@ -3318,6 +3318,7 @@ proc ptp::callback_cli_ptp_disable_slave_only {args} {
if {[string length $port] == 1 } { if {[string length $port] == 1 } {
set port "0$port" set port "0$port"
} }
set config_slave_only "CONFIG_PTP_SLAVE_ONLY"
set config_ext_port_conf "CONFIG_PTP_OPT_EXT_PORT_CONFIG_ENABLED" set config_ext_port_conf "CONFIG_PTP_OPT_EXT_PORT_CONFIG_ENABLED"
set config_desirade_state "CONFIG_PORT${port}_INST01_DESIRADE_STATE" set config_desirade_state "CONFIG_PORT${port}_INST01_DESIRADE_STATE"
set config_bmca_mode "CONFIG_PORT${port}_BMODE_AUTO" set config_bmca_mode "CONFIG_PORT${port}_BMODE_AUTO"
...@@ -3327,6 +3328,13 @@ proc ptp::callback_cli_ptp_disable_slave_only {args} { ...@@ -3327,6 +3328,13 @@ proc ptp::callback_cli_ptp_disable_slave_only {args} {
foreach line [split $config "\n"] { foreach line [split $config "\n"] {
## slave only
set key $config_slave_only
if {[regexp "^$key" $line ]} {
# Disable slave only
set line "${key}=no"
printLog $line
}
## external port configuration enabled ## external port configuration enabled
set key $config_ext_port_conf set key $config_ext_port_conf
if {[regexp "^$key" $line ]} { if {[regexp "^$key" $line ]} {
...@@ -3810,3 +3818,4 @@ proc ptp::callback_ipv4_remove_ip_interface {args} { ...@@ -3810,3 +3818,4 @@ proc ptp::callback_ipv4_remove_ip_interface {args} {
return 2 return 2
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment