Skip to content

[dualtor] Load minigraph before golden config generation - #26676

Merged
lolyu merged 1 commit into
sonic-net:masterfrom
pdam-arista:fix-dualtor-golden-config-minigraph-preload
Aug 6, 2026
Merged

lolyu merged 1 commit into
sonic-net:masterfrom
pdam-arista:fix-dualtor-golden-config-minigraph-preload

Conversation

@pdam-arista

@pdam-arista pdam-arista commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description of PR

PR #26376 added dual-ToR golden config generation support for prober_type
and neighbor_mode. As part of that change, dualtor topologies started
generating golden_config_db.json with a PORT table copied from minigraph.

The deploy flow already runs config load_minigraph -y before golden config
generation for lt2 and ft2, because those topologies modify/copy PORT
and need the DUT config to reflect testbed-specific interface admin state
first. The new dualtor golden config path missed this preload step.

Without the preload, unused routed ports can be preserved as admin up in
golden_config_db.json. These ports have no link, remain oper down, and
pretest interface sanity fails.

This PR extends the existing preload condition to include dualtor.

Summary:
Fixes #26673

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO):
Failure type: regression

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Test result

202605

Failure Results

  • SONiC image: branch.202605-ars.e7f59890-buildimage.de4f9f0baae9667c05bfe9fdeb1a4fdf4bd19d6c-nightly-2026.07.28.16.40
  • SONiC build commit: 0a4101e99
  • Build date: Tue Jul 28 21:11:40 UTC 2026
    test_pretest.log
    test_pretest.xml

Pass Results (after fix)

  • SONiC image: branch.202605-ars.e7f59890-buildimage.de4f9f0baae9667c05bfe9fdeb1a4fdf4bd19d6c-nightly-2026.07.28.16.40
  • SONiC build commit: 0a4101e99
  • Build date: Tue Jul 28 21:11:40 UTC 2026
    test_pretest.log
    test_pretest.xml

sonic-mgmt change under test:

Note: Both before and after tests used the same SONiC image/build; the validated change is in sonic-mgmt.

Approach

What is the motivation for this PR?

Fix a regression introduced when dualtor was added to the golden config
generation path. dualtor golden config now copies PORT, so it needs the
same minigraph preload step that already exists for lt2 and ft2.

How did you do it?

Updated ansible/config_sonic_basedon_testbed.yml so the existing
config load_minigraph -y step runs for dualtor before
golden_config_db.json is generated.

  -        when: "'lt2' in topo or 'ft2' in topo"
  +        when: "'lt2' in topo or 'ft2' in topo or 'dualtor' in topo"

How did you verify/test it?

Inspected failed pretest logs from tst-esx-31.
All failed during pretest setup sanity with unused routed ports
left as admin up / oper down.
Applied the fix and sanitized the duts , ran deploy-mg and pret-tests

Any platform specific information?

N/A

Supported testbed topology if it's a new test case?

N/A

Documentation

N/A

Signed-off-by: Pratik Dam <pdam@arista.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions
github-actions Bot requested review from r12f, sdszhang and wangxin July 30, 2026 02:41
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pdam-arista

Copy link
Copy Markdown
Contributor Author

arp/test_neighbor_mac.py failed in pipeline . Its not directly related to my fix . We could address this subsequently

pytest_assert(
            ping_succeeded,
            "Failed to ping DUT interface {} from PTF IP {}{}, stdout: {}, stderr: {}".format(
                self.DUT_INTF_IP,
                self.PTF_HOST_IP,
                " within {} seconds".format(self.PING_RETRY_TIMEOUT) if is_vpp else "",
                ping_result.get("stdout", ""),
                ping_result.get("stderr", "")
            )
        )
E       Failed: Failed to ping DUT interface 20.0.0.1 from PTF IP 20.0.0.2 within 120 seconds, stdout: PING 20.0.0.1 (20.0.0.1) from 20.0.0.2 : 56(84) bytes of data.
E       
E       --- 20.0.0.1 ping statistics ---
E       1 packets transmitted, 0 received, 100% packet loss, time 0ms, stderr:

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202605.
Added label(s) for branch(es) 202605.

---Powered by SONiC BuildBot

@mssonicbld mssonicbld added the Tested for 202605 branch Tested for 202605 branch label Jul 30, 2026
@mssonicbld

Copy link
Copy Markdown
Collaborator

The Tested branch section has been ticked and Test result is provided for branch(es): 202605. Added label(s): Tested for 202605 Branch.

---Powered by SONiC BuildBot

@pdam-arista pdam-arista reopened this Jul 30, 2026
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@lolyu
lolyu self-requested a review August 6, 2026 05:08

@lolyu lolyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lolyu
lolyu merged commit 05b2c11 into sonic-net:master Aug 6, 2026
34 checks passed
@StormLiangMS

Copy link
Copy Markdown
Collaborator

@pdam-arista — this 202605 backport request is not approval-ready yet. Please update the PR description with:

  • the exact 202605 image/commit used for the attached before/after test results

This information needs to be in the backport/test sections so the request is traceable and BuildBot can validate it.

@pdam-arista

Copy link
Copy Markdown
Contributor Author

@pdam-arista — this 202605 backport request is not approval-ready yet. Please update the PR description with:

  • the exact 202605 image/commit used for the attached before/after test results

This information needs to be in the backport/test sections so the request is traceable and BuildBot can validate it.

Hi @StormLiangMS , updated the necessary information

@mssonicbld

Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202605: #27337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: dualtor golden config generation preserves unused ports as admin up

4 participants