-
Notifications
You must be signed in to change notification settings - Fork 18
ltp: support network tests configurations #95
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,34 @@ async def test_find_suite(self, framework, sut, tmpdir): | |
| assert "TMPDIR" in test.env | ||
| assert "LTP_COLORIZE_OUTPUT" in test.env | ||
|
|
||
| async def test_find_suite_network_vars(self, sut, monkeypatch): | ||
| """ | ||
| Test that all SUPPORTED_ENV variables and TST_/LTP_ prefixed variables | ||
| are forwarded to tests. | ||
| """ | ||
| # Build a mapping of every variable that should be forwarded: | ||
| # all entries in SUPPORTED_ENV (skipping PATH which is always present) | ||
| # plus representative TST_ and LTP_ prefixed variables. | ||
| net_vars = { | ||
| key: f"test_value_{key}" | ||
| for key in LTPFramework.SUPPORTED_ENV | ||
| if key != "PATH" | ||
| } | ||
| # One representative per prefix is enough to verify prefix-based forwarding. | ||
| net_vars["TST_USE_NETNS"] = "yes" | ||
| net_vars["LTP_RSH"] = "ssh -nq" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also the default. Having the definition on 2 places only ask for problems if tst_net.sh changes it, it will be overwritten in kirk. |
||
|
|
||
| for key, val in net_vars.items(): | ||
| monkeypatch.setenv(key, val) | ||
|
|
||
| framework = LTPFramework() | ||
| suite = await framework.find_suite(sut, "suite0") | ||
|
|
||
| for test in suite.tests: | ||
| for key, val in net_vars.items(): | ||
| assert key in test.env, f"{key} not found in test env" | ||
| assert test.env[key] == val | ||
|
|
||
| async def test_find_suite_max_runtime(self, sut): | ||
| """ | ||
| Test find_suite method when max_runtime is defined. | ||
|
|
||
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.
FYI This is not needed, it's a default.