From e7c0dba4a5dde281f64d089b192c0cd3ae18ee08 Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Thu, 14 Aug 2025 16:37:35 +0000 Subject: [PATCH 01/12] Add OIR testplan Add OIR API. Address PR comments. Update docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md Co-authored-by: mihirpat1 <112018033+mihirpat1@users.noreply.github.com> Add tables to monitor Update OIR API. Update testplan to check for presence data. Add checks for peer port as well. Added the sample PhysicalOIR class. Signed-off-by: Ariz Zubair(Microsoft) --- .../optics_insertion_removal_testplan.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md diff --git a/docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md b/docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md new file mode 100644 index 00000000000..5131de9035b --- /dev/null +++ b/docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md @@ -0,0 +1,159 @@ +# Optics Insertion and Removal Test Plan + +## Scope + +This test plan outlines a comprehensive framework for testing the online insertion and removal (OIR) of CMIS compliant transceivers being onboarded to SONiC. It includes both physical OIR (where transceivers are physically inserted and removed) and remote reseat (where OIR is simulated using on-device command or script). The goal is to automate all tests listed in this document. + +**Optics Scope**: +All the optics types mentioned in the [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#scope) are in scope for this test plan. + +## Testbed Topology + +Please refer to the [Testbed Topology](./transceiver_onboarding_test_plan.md#testbed-topology) section. + +## Test Cases + +**Pre-requisites for the Below Tests:** + +1. All the pre-requisites mentioned in [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#test-cases) must be met. + +2. `physical_oir.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the physical OIR tests. The schema is defined in [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#test-cases). Following attributes are applicable here: + +| Attribute | Type | Default | Mandatory | Override Levels | Description | +|-----------|------|---------|------------|-------------|-------------| +| port_under_test | List | All | No | None| A list under `dut.dut_name` containing the ports to be tested for physical OIR test.
This attribute must exist only under `dut` field. | +| oir_method | String | manual | No | dut | The method used for OIR ("manual" or "automated"). | +| physical_oir_timeout_min | Int | 30 | No | dut | The timeout value in minutes to wait for the optics to be inserted/removed. | +| simultaneous_oir | Bool | False | No | dut | A flag indicating whether to allow simultaneous OIR operations on multiple ports. | +| physical_oir_stress_iteration | Int | 5 | No | dut | The number of iterations to stress test the physical OIR process. | +| monitor_kernel_errors | Bool | False | No | transceivers | A flag indicating whether to monitor kernel errors during the test. | +| link_flap_monitor_timeout_sec | Int | 10 | No | transceivers | The duration in seconds to monitor for link flaps after OIR operations. | + + +3. `remote_reseat.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the remote reseat tests. The schema is defined in [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#test-cases). + +| Attribute | Type | Default | Mandatory | Override Levels | Description | +|-----------|------|---------|------------|-------------|-------------| +| port_under_test | List | All | No | None | A list under `dut.dut_name` containing the ports to be tested for remote reseat test.
This attribute must exist only under `dut` field. | +| remote_reseat_timeout_min | Int | 10 | No | transceivers | The timeout value in seconds to wait for the remote reseat process to complete. | +| remote_reseat_stress_iteration | Int | 5 | No | dut | The number of iterations to stress test the remote reseat process. | +| monitor_kernel_errors | Bool | False | No | transceivers | A flag indicating whether to monitor kernel errors during the test. | +| link_flap_monitor_timeout_sec | Int | 10 | No | transceivers | The duration in seconds to monitor for link flaps after remote reseat. | + +#### 1.1 Optics Insertion and Removal Testing + +This section outlines the test cases for validating the insertion and removal of optics in SONiC. The state transitions and services' health are to be tested as a result of optics insertion and removal. The tests cover both physical OIR and remote reseat scenarios, ensuring that the system behaves correctly when optics are inserted or removed. + +##### 1.1.1 Physical OIR Tests + +| TC No. | Test | Steps | Expected Results | +|------|------|------|------------------| +| 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 3 | Simultaneous Physical OIR | 1. Physically remove all optical modules under test simultaneously.
2. Physically insert all optical modules under test simultaneously.| 1. All the expected results from TC#1 for all ports under test.
2. All the expected results from TC#2 for all ports under test.| +| 4 | Physical OIR stress test| 1. Perform the physical OIR process `physical_oir_stress_iteration` times in quick succession.| 1. All the expected results from TC#2 after last insertion.| + +> Note: List of transceiver related DB tables can be found at [transceiver related DB tables](https://github.com/sonic-net/sonic-platform-daemons/blob/master/sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py#L11C1-L46C40). + +##### 1.1.2 Remote reseat Tests +Remote reseat involves simulating the insertion and removal of optical modules by resetting the optics and restarting the interface. This method is useful for testing the system's response to optics insertion and removal without physically handling the hardware. + +| TC No. | Test | Steps | Expected Results | +|------|------|------|------------------| +| 1 | Remote reseat test| 1. Perform the remote reseat on the module under test.| 1. Transceiver eeprom show command should show the values as per the configuration file with the exit code as 0.
2. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
3. Interface should go oper up.
4. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds
5. Check that optics SI settings and media settings are as expected.
6. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
7. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
8. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
9. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 2 | Remote reseat stress test| 1. Perform the remote reseat process `remote_reseat_stress_iteration` times.| 1. All the expected results from TC#1 after the last remote reseat.| + +##### Transceiver info tables +This table lists the transceiver related DB tables with the attributes that should be monitored during the physical OIR and remote reseat tests to ensure they are not deleted or corrupted. + +| Table name | Attributes to Monitor | +|------------|----------------------| +| TRANSCEIVER INFO TABLE | cmis_rev, model, type, connector, manufacturer | +| TRANSCEIVER FIRMWARE INFO TABLE | active firmware | +| TRANSCEIVER DOM SENSOR TABLE | everything | +| TRANSCEIVER DOM FLAG TABLE | everything | +| TRANSCEIVER VDM REAL VALUE table | everything | +| TRANSCEIVER STATUS TABLE | everything | +| TRANSCEIVER STATUS FLAG TABLE | everything | +| APPL_DB | link related info, admin status, oper status, fec should be rs. | + + +##### Transceiver flag change tables +This table lists the transceiver flag change count DB tables that should be monitored during the physical OIR and remote reseat tests to ensure they are updated correctly. + +| Table name | +|------------| +| TRANSCEIVER STATUS FLAG CHANGE COUNT | +| TRANSCEIVER DOM FLAG CHANGE COUNT | +| TRANSCEIVER VDM HALARM FLAG CHANGE COUNT | +| TRANSCEIVER VDM LALARM FLAG CHANGE COUNT | +| TRANSCEIVER VDM HWARN FLAG CHANGE COUNT | +| TRANSCEIVER VDM LWARN FLAG CHANGE COUNT | + + +## Physical OIR API + +The Physical OIR API provides a set of functions for performing physical optical insertion and removal tests on the device under test (DUT). This API allows users to check OIR support status, perform optics insertion/removal operations, and clean up OIR resources. + +A class named `PhysicalOIR` is defined under `tests.common.physical_oir` module. If the class can not be imported, the physical OIR tests are skipped. The class has following methods: + +1. **Constructor Method** + - Description: Initializes the PhysicalOIR class. + - Parameters: + - `duthost` : AnsibleHost object of the dut. Following attributes are fetched from the `duthost` object for further processing: + - `port_under_test`: List of ports to be tested. + - `tbinfo`: Testbed information + - `physical_oir_timeout_min`: Timeout value in minutes for the OIR process. + - `oir_method`: The method used for OIR ("manual" or "automated"). + - `simultaneous_oir`: A flag indicating whether to allow simultaneous OIR operations on multiple ports. + + - `ansible-adhoc` : Ansible adhoc fixture to send commands to perform OIR operations. +2. **is_available** + - Description: Checks if the testbed supports physical OIR. + - Parameters: None + - Returns: Boolean indicating availability. + +3. **insert_sfps** + - Description: Inserts SFPs on the ports specified by the port_under_test attribute. + - Parameters: None + - Returns: True if insertion is successful, False otherwise. + +4. **remove_sfps** + - Description: Removes SFPs from the ports specified by the port_under_test attribute. + - Parameters: None + - Returns: True if removal is successful, False otherwise. + +5. **cleanup** + - Description: Cleans up resources used by the PhysicalOIR class. + - Parameters: None + - Returns: None + +The `PhysicalOIR` class should look like below: + +```python +# File tests/common/physical_oir.py +class PhysicalOir: + def __init__(self, duthost, ansible_adhoc): + # Initiate the class with required attributes + pass + + def is_available(self) -> bool: + # Check if physical OIR is supported in the testbed + pass + + def insert_sfps(self) -> bool: + # Insert SFPs on the ports specified by port_under_test attribute + pass + + def remove_sfps(self) -> bool: + # Remove SFPs from the ports specified by port_under_test attribute + pass + + def cleanup(self): + # Cleanup resources used by the PhysicalOIR class + pass +``` + +#### CLI commands + +Refer to [CLI commands](./transceiver_onboarding_test_plan.md#cli-commands) section for the CLI commands used in the above test cases. \ No newline at end of file From 3e78f43c852485b0b7ea651dd815625752ac8dfe Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Wed, 18 Feb 2026 20:28:50 +0000 Subject: [PATCH 02/12] Move the testplan to transceiver directory. Signed-off-by: Ariz Zubair(Microsoft) --- .../optics_insertion_removal_testplan.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/testplan/{transceiver_onboarding => transceiver}/optics_insertion_removal_testplan.md (100%) diff --git a/docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md similarity index 100% rename from docs/testplan/transceiver_onboarding/optics_insertion_removal_testplan.md rename to docs/testplan/transceiver/optics_insertion_removal_testplan.md From f43b1c590be25b70fa1c09e058663a93a7afda4a Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Wed, 18 Feb 2026 20:30:44 +0000 Subject: [PATCH 03/12] Fix link. Signed-off-by: Ariz Zubair(Microsoft) --- .../transceiver/optics_insertion_removal_testplan.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 5131de9035b..2ec86bb023f 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -5,19 +5,19 @@ This test plan outlines a comprehensive framework for testing the online insertion and removal (OIR) of CMIS compliant transceivers being onboarded to SONiC. It includes both physical OIR (where transceivers are physically inserted and removed) and remote reseat (where OIR is simulated using on-device command or script). The goal is to automate all tests listed in this document. **Optics Scope**: -All the optics types mentioned in the [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#scope) are in scope for this test plan. +All the optics types mentioned in the [Transceiver Onboarding Test Plan](./test_plan.md#scope) are in scope for this test plan. ## Testbed Topology -Please refer to the [Testbed Topology](./transceiver_onboarding_test_plan.md#testbed-topology) section. +Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. ## Test Cases **Pre-requisites for the Below Tests:** -1. All the pre-requisites mentioned in [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#test-cases) must be met. +1. All the pre-requisites mentioned in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases) must be met. -2. `physical_oir.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the physical OIR tests. The schema is defined in [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#test-cases). Following attributes are applicable here: +2. `physical_oir.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the physical OIR tests. The schema is defined in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases). Following attributes are applicable here: | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| @@ -30,7 +30,7 @@ Please refer to the [Testbed Topology](./transceiver_onboarding_test_plan.md#tes | link_flap_monitor_timeout_sec | Int | 10 | No | transceivers | The duration in seconds to monitor for link flaps after OIR operations. | -3. `remote_reseat.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the remote reseat tests. The schema is defined in [Transceiver Onboarding Test Plan](./transceiver_onboarding_test_plan.md#test-cases). +3. `remote_reseat.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the remote reseat tests. The schema is defined in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases). | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| @@ -156,4 +156,4 @@ class PhysicalOir: #### CLI commands -Refer to [CLI commands](./transceiver_onboarding_test_plan.md#cli-commands) section for the CLI commands used in the above test cases. \ No newline at end of file +Refer to [CLI commands](./test_plan.md#cli-commands) section for the CLI commands used in the above test cases. \ No newline at end of file From f32ae52105fc3d9129c951db5fae0a0beb6a44cf Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Fri, 20 Feb 2026 14:21:14 +0000 Subject: [PATCH 04/12] Add port_startup_wait_sec attribute details. Signed-off-by: Ariz Zubair(Microsoft) --- .../transceiver/optics_insertion_removal_testplan.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 2ec86bb023f..33a6f4fb07e 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -40,6 +40,8 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. | monitor_kernel_errors | Bool | False | No | transceivers | A flag indicating whether to monitor kernel errors during the test. | | link_flap_monitor_timeout_sec | Int | 10 | No | transceivers | The duration in seconds to monitor for link flaps after remote reseat. | +4. `port_startup_wait_sec` attribute of the [transceiver system testplan](./system_test_plan.md#attributes) is to be used to get the wait time before checking the interface operational status after the optics insertion or remote reseat. + #### 1.1 Optics Insertion and Removal Testing This section outlines the test cases for validating the insertion and removal of optics in SONiC. The state transitions and services' health are to be tested as a result of optics insertion and removal. The tests cover both physical OIR and remote reseat scenarios, ensuring that the system behaves correctly when optics are inserted or removed. @@ -49,7 +51,7 @@ This section outlines the test cases for validating the insertion and removal of | TC No. | Test | Steps | Expected Results | |------|------|------|------------------| | 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | -| 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up after `port_startup_wait_sec` seconds.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | | 3 | Simultaneous Physical OIR | 1. Physically remove all optical modules under test simultaneously.
2. Physically insert all optical modules under test simultaneously.| 1. All the expected results from TC#1 for all ports under test.
2. All the expected results from TC#2 for all ports under test.| | 4 | Physical OIR stress test| 1. Perform the physical OIR process `physical_oir_stress_iteration` times in quick succession.| 1. All the expected results from TC#2 after last insertion.| @@ -60,7 +62,7 @@ Remote reseat involves simulating the insertion and removal of optical modules b | TC No. | Test | Steps | Expected Results | |------|------|------|------------------| -| 1 | Remote reseat test| 1. Perform the remote reseat on the module under test.| 1. Transceiver eeprom show command should show the values as per the configuration file with the exit code as 0.
2. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
3. Interface should go oper up.
4. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds
5. Check that optics SI settings and media settings are as expected.
6. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
7. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
8. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
9. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 1 | Remote reseat test| 1. Perform the remote reseat on the module under test.| 1. Transceiver eeprom show command should show the values as per the configuration file with the exit code as 0.
2. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
3. Interface should go oper up after `port_startup_wait_sec` seconds.
4. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds
5. Check that optics SI settings and media settings are as expected.
6. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
7. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
8. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
9. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | | 2 | Remote reseat stress test| 1. Perform the remote reseat process `remote_reseat_stress_iteration` times.| 1. All the expected results from TC#1 after the last remote reseat.| ##### Transceiver info tables From 37e130e9e5dd660a9e907e1bd2e378590d143549 Mon Sep 17 00:00:00 2001 From: Ariz Zubair <5427064+az-pz@users.noreply.github.com> Date: Fri, 6 Mar 2026 00:03:42 +0530 Subject: [PATCH 05/12] Refine optics removal validation test case Updated the expected results for optics removal validation to include link flap count for the local port. Signed-off-by: Ariz Zubair(Microsoft) --- .../testplan/transceiver/optics_insertion_removal_testplan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 33a6f4fb07e..bed5e8fd2d2 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -50,7 +50,7 @@ This section outlines the test cases for validating the insertion and removal of | TC No. | Test | Steps | Expected Results | |------|------|------|------------------| -| 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the local port and the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | | 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up after `port_startup_wait_sec` seconds.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | | 3 | Simultaneous Physical OIR | 1. Physically remove all optical modules under test simultaneously.
2. Physically insert all optical modules under test simultaneously.| 1. All the expected results from TC#1 for all ports under test.
2. All the expected results from TC#2 for all ports under test.| | 4 | Physical OIR stress test| 1. Perform the physical OIR process `physical_oir_stress_iteration` times in quick succession.| 1. All the expected results from TC#2 after last insertion.| @@ -158,4 +158,4 @@ class PhysicalOir: #### CLI commands -Refer to [CLI commands](./test_plan.md#cli-commands) section for the CLI commands used in the above test cases. \ No newline at end of file +Refer to [CLI commands](./test_plan.md#cli-commands) section for the CLI commands used in the above test cases. From 0f624d93731e37af9e4ef606b7277bb2cf5ceb4e Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Tue, 10 Mar 2026 16:01:51 +0000 Subject: [PATCH 06/12] Update paths for physical OIR and remote reseat JSON files in test plan Signed-off-by: Ariz Zubair(Microsoft) --- .../testplan/transceiver/optics_insertion_removal_testplan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index bed5e8fd2d2..01873f29484 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -17,7 +17,7 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. 1. All the pre-requisites mentioned in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases) must be met. -2. `physical_oir.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the physical OIR tests. The schema is defined in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases). Following attributes are applicable here: +2. `physical_oir.json` located in `ansible/files/transceiver/inventory/attributes` directory should be present to define the attributes for the physical OIR tests. The schema is defined in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases). Following attributes are applicable here: | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| @@ -30,7 +30,7 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. | link_flap_monitor_timeout_sec | Int | 10 | No | transceivers | The duration in seconds to monitor for link flaps after OIR operations. | -3. `remote_reseat.json` located in `ansible/files/transceiver/inventory` directory should be present to define the attributes for the remote reseat tests. The schema is defined in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases). +3. `remote_reseat.json` located in `ansible/files/transceiver/inventory/attributes` directory should be present to define the attributes for the remote reseat tests. The schema is defined in [Transceiver Onboarding Test Plan](./test_plan.md#test-cases). | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| From c6e6b647d8fc34429932230ac4ece679e9d563f1 Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Tue, 10 Mar 2026 19:01:43 +0000 Subject: [PATCH 07/12] Fix attribute name from 'port_under_test' to 'ports_under_test' in OIR test plan Signed-off-by: Ariz Zubair(Microsoft) --- .../optics_insertion_removal_testplan.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 01873f29484..86d2f6907b1 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -21,7 +21,7 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| -| port_under_test | List | All | No | None| A list under `dut.dut_name` containing the ports to be tested for physical OIR test.
This attribute must exist only under `dut` field. | +| ports_under_test | List | [] | No | None| A list under `dut.dut_name` containing the ports to be tested for physical OIR test.
This attribute must exist only under `dut` field. | | oir_method | String | manual | No | dut | The method used for OIR ("manual" or "automated"). | | physical_oir_timeout_min | Int | 30 | No | dut | The timeout value in minutes to wait for the optics to be inserted/removed. | | simultaneous_oir | Bool | False | No | dut | A flag indicating whether to allow simultaneous OIR operations on multiple ports. | @@ -34,7 +34,7 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| -| port_under_test | List | All | No | None | A list under `dut.dut_name` containing the ports to be tested for remote reseat test.
This attribute must exist only under `dut` field. | +| ports_under_test | List | [] | No | None | A list under `dut.dut_name` containing the ports to be tested for remote reseat test.
This attribute must exist only under `dut` field. | | remote_reseat_timeout_min | Int | 10 | No | transceivers | The timeout value in seconds to wait for the remote reseat process to complete. | | remote_reseat_stress_iteration | Int | 5 | No | dut | The number of iterations to stress test the remote reseat process. | | monitor_kernel_errors | Bool | False | No | transceivers | A flag indicating whether to monitor kernel errors during the test. | @@ -103,25 +103,26 @@ A class named `PhysicalOIR` is defined under `tests.common.physical_oir` module. - Description: Initializes the PhysicalOIR class. - Parameters: - `duthost` : AnsibleHost object of the dut. Following attributes are fetched from the `duthost` object for further processing: - - `port_under_test`: List of ports to be tested. + - `ports_under_test`: List of ports to be tested. - `tbinfo`: Testbed information - `physical_oir_timeout_min`: Timeout value in minutes for the OIR process. - `oir_method`: The method used for OIR ("manual" or "automated"). - `simultaneous_oir`: A flag indicating whether to allow simultaneous OIR operations on multiple ports. - `ansible-adhoc` : Ansible adhoc fixture to send commands to perform OIR operations. + - `port_attributes_dict`: A dictionary containing the port test attributes defined in `physical_oir.json` file. 2. **is_available** - Description: Checks if the testbed supports physical OIR. - Parameters: None - Returns: Boolean indicating availability. 3. **insert_sfps** - - Description: Inserts SFPs on the ports specified by the port_under_test attribute. + - Description: Inserts SFPs on the ports specified by the ports_under_test attribute. - Parameters: None - Returns: True if insertion is successful, False otherwise. 4. **remove_sfps** - - Description: Removes SFPs from the ports specified by the port_under_test attribute. + - Description: Removes SFPs from the ports specified by the ports_under_test attribute. - Parameters: None - Returns: True if removal is successful, False otherwise. @@ -144,11 +145,11 @@ class PhysicalOir: pass def insert_sfps(self) -> bool: - # Insert SFPs on the ports specified by port_under_test attribute + # Insert SFPs on the ports specified by ports_under_test attribute pass def remove_sfps(self) -> bool: - # Remove SFPs from the ports specified by port_under_test attribute + # Remove SFPs from the ports specified by ports_under_test attribute pass def cleanup(self): From 60f5838e99698b2f1b964435704adb68b279692a Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Tue, 10 Mar 2026 20:00:55 +0000 Subject: [PATCH 08/12] Update PhysicalOir class constructor to include port_attributes_dict parameter Signed-off-by: Ariz Zubair(Microsoft) --- docs/testplan/transceiver/optics_insertion_removal_testplan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 86d2f6907b1..e94c397b932 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -136,7 +136,7 @@ The `PhysicalOIR` class should look like below: ```python # File tests/common/physical_oir.py class PhysicalOir: - def __init__(self, duthost, ansible_adhoc): + def __init__(self, duthost, ansible_adhoc, port_attributes_dict): # Initiate the class with required attributes pass From 6ad67b4b7c11f3536fba38c5ff1d9c81ba05a483 Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Mon, 27 Apr 2026 19:08:44 +0000 Subject: [PATCH 09/12] Update OIR api return types Signed-off-by: Ariz Zubair(Microsoft) --- .../transceiver/optics_insertion_removal_testplan.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index e94c397b932..6a6f108725f 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -119,12 +119,12 @@ A class named `PhysicalOIR` is defined under `tests.common.physical_oir` module. 3. **insert_sfps** - Description: Inserts SFPs on the ports specified by the ports_under_test attribute. - Parameters: None - - Returns: True if insertion is successful, False otherwise. + - Returns: None when the operation is complete. 4. **remove_sfps** - Description: Removes SFPs from the ports specified by the ports_under_test attribute. - Parameters: None - - Returns: True if removal is successful, False otherwise. + - Returns: None when the operation is complete. 5. **cleanup** - Description: Cleans up resources used by the PhysicalOIR class. @@ -144,15 +144,15 @@ class PhysicalOir: # Check if physical OIR is supported in the testbed pass - def insert_sfps(self) -> bool: + def insert_sfps(self) -> None: # Insert SFPs on the ports specified by ports_under_test attribute pass - def remove_sfps(self) -> bool: + def remove_sfps(self) -> None: # Remove SFPs from the ports specified by ports_under_test attribute pass - def cleanup(self): + def cleanup(self) -> None: # Cleanup resources used by the PhysicalOIR class pass ``` From ec44eb2c8b264d9343a6a0e08ee88e391a0bc06d Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Wed, 29 Apr 2026 13:35:40 +0000 Subject: [PATCH 10/12] Address PR comments. Signed-off-by: Ariz Zubair(Microsoft) --- .../optics_insertion_removal_testplan.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 6a6f108725f..4f31ffeac22 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -35,7 +35,7 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| | ports_under_test | List | [] | No | None | A list under `dut.dut_name` containing the ports to be tested for remote reseat test.
This attribute must exist only under `dut` field. | -| remote_reseat_timeout_min | Int | 10 | No | transceivers | The timeout value in seconds to wait for the remote reseat process to complete. | +| remote_reseat_timeout_min | Int | 10 | No | transceivers | The timeout value in minutes to wait for the remote reseat process to complete. | | remote_reseat_stress_iteration | Int | 5 | No | dut | The number of iterations to stress test the remote reseat process. | | monitor_kernel_errors | Bool | False | No | transceivers | A flag indicating whether to monitor kernel errors during the test. | | link_flap_monitor_timeout_sec | Int | 10 | No | transceivers | The duration in seconds to monitor for link flaps after remote reseat. | @@ -51,8 +51,8 @@ This section outlines the test cases for validating the insertion and removal of | TC No. | Test | Steps | Expected Results | |------|------|------|------------------| | 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the local port and the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | -| 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up after `port_startup_wait_sec` seconds.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | -| 3 | Simultaneous Physical OIR | 1. Physically remove all optical modules under test simultaneously.
2. Physically insert all optical modules under test simultaneously.| 1. All the expected results from TC#1 for all ports under test.
2. All the expected results from TC#2 for all ports under test.| +| 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up after `port_startup_wait_sec` seconds.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd`, `orchagent` does not crash/restart. | +| 3 | Simultaneous Physical OIR | 1. Physically remove all optical modules under test simultaneously if `simultaneous_oir` attribute is `True`.
2. Physically insert all optical modules under test simultaneously.| 1. All the expected results from TC#1 for all ports under test.
2. All the expected results from TC#2 for all ports under test.| | 4 | Physical OIR stress test| 1. Perform the physical OIR process `physical_oir_stress_iteration` times in quick succession.| 1. All the expected results from TC#2 after last insertion.| > Note: List of transceiver related DB tables can be found at [transceiver related DB tables](https://github.com/sonic-net/sonic-platform-daemons/blob/master/sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py#L11C1-L46C40). @@ -97,10 +97,10 @@ This table lists the transceiver flag change count DB tables that should be moni The Physical OIR API provides a set of functions for performing physical optical insertion and removal tests on the device under test (DUT). This API allows users to check OIR support status, perform optics insertion/removal operations, and clean up OIR resources. -A class named `PhysicalOIR` is defined under `tests.common.physical_oir` module. If the class can not be imported, the physical OIR tests are skipped. The class has following methods: +A class named `PhysicalOir` is defined under `tests.common.physical_oir` module. If the class can not be imported, the physical OIR tests are skipped. The class has following methods: 1. **Constructor Method** - - Description: Initializes the PhysicalOIR class. + - Description: Initializes the PhysicalOir class. - Parameters: - `duthost` : AnsibleHost object of the dut. Following attributes are fetched from the `duthost` object for further processing: - `ports_under_test`: List of ports to be tested. @@ -127,11 +127,11 @@ A class named `PhysicalOIR` is defined under `tests.common.physical_oir` module. - Returns: None when the operation is complete. 5. **cleanup** - - Description: Cleans up resources used by the PhysicalOIR class. + - Description: Cleans up resources used by the PhysicalOir class. - Parameters: None - Returns: None -The `PhysicalOIR` class should look like below: +The `PhysicalOir` class should look like below: ```python # File tests/common/physical_oir.py @@ -153,7 +153,7 @@ class PhysicalOir: pass def cleanup(self) -> None: - # Cleanup resources used by the PhysicalOIR class + # Cleanup resources used by the PhysicalOir class pass ``` From 126f64d0c4a38004f89959380d3cd990442beeb6 Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Wed, 29 Apr 2026 13:39:06 +0000 Subject: [PATCH 11/12] Address PR comments. Signed-off-by: Ariz Zubair(Microsoft) --- .../testplan/transceiver/optics_insertion_removal_testplan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 4f31ffeac22..6f721689f09 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -50,7 +50,7 @@ This section outlines the test cases for validating the insertion and removal of | TC No. | Test | Steps | Expected Results | |------|------|------|------------------| -| 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the local port and the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 1 | Optics removal validation| 1. Physically remove the optical module under test.|1. Transceiver presence command should return "Not present" with exit code 0.
2. Transceiver eeprom command should return "SFP EEPROM not detected" with exit code 0.
3. DOM, VDM and PM (if applicable) values are returned as empty from the CLI.
4. Transceiver related db tables are not deleted.
5. Interface should go oper down.
6. Other interfaces on the device should stay up.
7. Peer port should go oper down.
8. Link flap count of the local port and the peer port should increase by 1.
9. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the peer port.
10. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
11. Critical process such as `xcvrd`, `syncd`, `orchagent` does not crash/restart. | | 2 | Optics insertion validation| 1. Insert the optical module under test.|1. Transceiver presence command should return "Present" with exit code 0.
2. Transceiver eeprom show command should show the values as per the configuration file and with the exit code as 0.
3. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
4. Interface should go oper up after `port_startup_wait_sec` seconds.
5. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds.
6. Check that optics SI settings and media settings are as expected.
7. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
8. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
9. Peer port should become oper up.
10. Link flap count of the peer port should increase by 1.
11. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
12. Critical process such as `xcvrd`, `syncd`, `orchagent` does not crash/restart. | | 3 | Simultaneous Physical OIR | 1. Physically remove all optical modules under test simultaneously if `simultaneous_oir` attribute is `True`.
2. Physically insert all optical modules under test simultaneously.| 1. All the expected results from TC#1 for all ports under test.
2. All the expected results from TC#2 for all ports under test.| | 4 | Physical OIR stress test| 1. Perform the physical OIR process `physical_oir_stress_iteration` times in quick succession.| 1. All the expected results from TC#2 after last insertion.| @@ -62,7 +62,7 @@ Remote reseat involves simulating the insertion and removal of optical modules b | TC No. | Test | Steps | Expected Results | |------|------|------|------------------| -| 1 | Remote reseat test| 1. Perform the remote reseat on the module under test.| 1. Transceiver eeprom show command should show the values as per the configuration file with the exit code as 0.
2. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
3. Interface should go oper up after `port_startup_wait_sec` seconds.
4. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds
5. Check that optics SI settings and media settings are as expected.
6. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
7. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
8. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
9. Critical process such as `xcvrd`, `syncd` `orchagent` does not crash/restart. | +| 1 | Remote reseat test| 1. Perform the remote reseat on the module under test.| 1. Transceiver eeprom show command should show the values as per the configuration file with the exit code as 0.
2. Expected DOM, VDM and PM (if applicable) values should be present for the interface.
3. Interface should go oper up after `port_startup_wait_sec` seconds.
4. No link flaps are seen for `link_flap_monitor_timeout_sec` seconds
5. Check that optics SI settings and media settings are as expected.
6. Verify that port appears in LLDP neighbor table and the LLDP neighbor information is correctly populated.
7. Ensure that [transceiver info tables](#transceiver-info-tables) and [transceiver flag change tables](#transceiver-flag-change-tables) are updated correctly for the local and the peer port.
8. Check that kernel has no error messages in syslog if `monitor_kernel_errors` flag is set.
9. Critical process such as `xcvrd`, `syncd`, `orchagent` does not crash/restart. | | 2 | Remote reseat stress test| 1. Perform the remote reseat process `remote_reseat_stress_iteration` times.| 1. All the expected results from TC#1 after the last remote reseat.| ##### Transceiver info tables From 4beaf0a581cfeaa79be42ca0aa2e3a983a98cd87 Mon Sep 17 00:00:00 2001 From: "Ariz Zubair(Microsoft)" Date: Sat, 23 May 2026 09:59:15 +0000 Subject: [PATCH 12/12] Address PR comments. Signed-off-by: Ariz Zubair(Microsoft) --- .../transceiver/optics_insertion_removal_testplan.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/testplan/transceiver/optics_insertion_removal_testplan.md b/docs/testplan/transceiver/optics_insertion_removal_testplan.md index 6f721689f09..3f9d9ac6509 100644 --- a/docs/testplan/transceiver/optics_insertion_removal_testplan.md +++ b/docs/testplan/transceiver/optics_insertion_removal_testplan.md @@ -22,7 +22,7 @@ Please refer to the [Testbed Topology](./test_plan.md#testbed-topology) section. | Attribute | Type | Default | Mandatory | Override Levels | Description | |-----------|------|---------|------------|-------------|-------------| | ports_under_test | List | [] | No | None| A list under `dut.dut_name` containing the ports to be tested for physical OIR test.
This attribute must exist only under `dut` field. | -| oir_method | String | manual | No | dut | The method used for OIR ("manual" or "automated"). | +| oir_method | String | simulated | No | dut | The method used for OIR ("manual", "simulated" or "automated"). | | physical_oir_timeout_min | Int | 30 | No | dut | The timeout value in minutes to wait for the optics to be inserted/removed. | | simultaneous_oir | Bool | False | No | dut | A flag indicating whether to allow simultaneous OIR operations on multiple ports. | | physical_oir_stress_iteration | Int | 5 | No | dut | The number of iterations to stress test the physical OIR process. | @@ -138,23 +138,18 @@ The `PhysicalOir` class should look like below: class PhysicalOir: def __init__(self, duthost, ansible_adhoc, port_attributes_dict): # Initiate the class with required attributes - pass def is_available(self) -> bool: # Check if physical OIR is supported in the testbed - pass def insert_sfps(self) -> None: # Insert SFPs on the ports specified by ports_under_test attribute - pass def remove_sfps(self) -> None: # Remove SFPs from the ports specified by ports_under_test attribute - pass def cleanup(self) -> None: # Cleanup resources used by the PhysicalOir class - pass ``` #### CLI commands