-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pfc tests migration from abstract to snappi #3641
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f98634a
Merge pull request #1 from Azure/master
ANISH-GOTTAPU 0edbf44
adding bgp-tencent tests
ANISH-GOTTAPU b4c547e
adding bgp-tencent tests
ANISH-GOTTAPU 143858a
align with new model
ANISH-GOTTAPU 547d663
updating bgp tencent tests
ANISH-GOTTAPU 31b3f5d
merging common part
ANISH-GOTTAPU da0be89
ixia/bgp/test_bgp_routing_policies.py
ANISH-GOTTAPU fc415fd
Delete test_bgp_routing_policies.py
ANISH-GOTTAPU c581d61
Merge pull request #3 from Azure/master
ANISH-GOTTAPU 672a4f6
Merge pull request #4 from Azure/master
ANISH-GOTTAPU b3462e0
Merge pull request #2 from ANISH-GOTTAPU/bgp_tests
tim-rj 2c021f1
Revert "Routing Policy Tests"
tim-rj ccb03f0
Merge pull request #7 from ANISH-GOTTAPU/revert-2-bgp_tests
ANISH-GOTTAPU 756a1f1
Merge branch 'Azure:master' into master
ANISH-GOTTAPU 5983860
pfc tests migrated to snappi
ANISH-GOTTAPU 91bf065
pfc tests migrated to snappi
ANISH-GOTTAPU 903b055
pfc tests migration to snappi
ANISH-GOTTAPU cf37111
Pfc tests migration from abstract to snappi
ANISH-GOTTAPU File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import pytest | ||
import random | ||
from tests.common.ixia.common_helpers import enable_packet_aging, start_pfcwd | ||
from tests.conftest import generate_priority_lists | ||
|
||
@pytest.fixture(autouse=True, scope="module") | ||
def rand_lossless_prio(request): | ||
""" | ||
Fixture that randomly selects a lossless priority | ||
|
||
Args: | ||
request (object): pytest request object | ||
|
||
Yields: | ||
lossless priority (str): string containing 'hostname|lossless priority' | ||
|
||
""" | ||
lossless_prios = generate_priority_lists(request, "lossless") | ||
if lossless_prios: | ||
yield random.sample(lossless_prios, 1)[0] | ||
else: | ||
yield 'unknown|unknown' | ||
|
||
@pytest.fixture(autouse=True, scope="module") | ||
def rand_lossy_prio(request): | ||
""" | ||
Fixture that randomly selects a lossy priority | ||
|
||
Args: | ||
request (object): pytest request object | ||
|
||
Yields: | ||
lossy priority (str): string containing 'hostname|lossy priority' | ||
|
||
""" | ||
lossy_prios = generate_priority_lists(request, "lossy") | ||
if lossy_prios: | ||
yield random.sample(lossy_prios, 1)[0] | ||
else: | ||
yield 'unknown|unknown' | ||
|
||
@pytest.fixture(autouse=True, scope="module") | ||
def start_pfcwd_after_test(duthosts, rand_one_dut_hostname): | ||
""" | ||
Ensure that PFC watchdog is enabled with default setting after tests | ||
|
||
Args: | ||
duthosts (pytest fixture) : list of DUTs | ||
rand_one_dut_hostname (pytest fixture): DUT hostname | ||
|
||
Yields: | ||
N/A | ||
""" | ||
yield | ||
|
||
duthost = duthosts[rand_one_dut_hostname] | ||
start_pfcwd(duthost) | ||
|
||
@pytest.fixture(autouse=True, scope="module") | ||
def enable_packet_aging_after_test(duthosts, rand_one_dut_hostname): | ||
""" | ||
Ensure that packet aging is enabled after tests | ||
|
||
Args: | ||
duthosts (pytest fixture) : list of DUTs | ||
rand_one_dut_hostname (pytest fixture): DUT hostname | ||
|
||
Yields: | ||
N/A | ||
""" | ||
yield | ||
|
||
duthost = duthosts[rand_one_dut_hostname] | ||
enable_packet_aging(duthost) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Local library for PFC tests. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use tests.common.snappi.common_helpers instead.