-
Notifications
You must be signed in to change notification settings - Fork 1.6k
tests: add Wsladiag CLI tests #13975
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
Changes from all commits
5f1830a
b466c8f
a46a738
4e9676a
e1771da
bfff646
365b15d
f3b8b06
dc5b0b3
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 |
|---|---|---|
|
|
@@ -66,6 +66,7 @@ static int ReportError(const std::wstring& context, HRESULT hr) | |
| } | ||
|
|
||
| // Handler for `wsladiag shell <SessionName>` command. | ||
|
|
||
|
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. Same here. Seems like something is inserting extra newlines?
Author
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. Not intentional. I started editing this section but ended up not needing the change, and I missed removing the extra newline. I’ll clean it up. |
||
| static int RunShellCommand(std::wstring_view commandLine) | ||
| { | ||
| std::wstring sessionName; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,184 @@ | ||||||||
| /*++ | ||||||||
|
|
||||||||
| Copyright (c) Microsoft. All rights reserved. | ||||||||
|
|
||||||||
| Module Name: | ||||||||
|
|
||||||||
| WsladiagTests.cpp | ||||||||
|
|
||||||||
| Abstract: | ||||||||
|
|
||||||||
| This file contains smoke tests for wsladiag. | ||||||||
|
|
||||||||
| --*/ | ||||||||
|
|
||||||||
| #include "precomp.h" | ||||||||
| #include "Common.h" | ||||||||
| #include "Localization.h" | ||||||||
|
|
||||||||
| #include <format> | ||||||||
| #include <filesystem> | ||||||||
|
|
||||||||
| namespace WsladiagTests { | ||||||||
| class WsladiagTests | ||||||||
| { | ||||||||
| WSL_TEST_CLASS(WsladiagTests) | ||||||||
|
||||||||
| WSL_TEST_CLASS(WsladiagTests) | |
| WSL_TEST_CLASS(WsladiagTests) | |
| TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wsladiag.exe"); |
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.
@OneBlue does BinaryUnderTest actually do something useful in WSL? Most docs I see on it seem related to internal infra.
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.
I've always assumed that TE would watch said binaries in case they crash and fail the test case if that happens, but I'm not actually not sure that it is the case
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.
@beena352 for completeness, we should specify TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wsladiag.exe") here.
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.
Should we use ValidateWsladiagOutput here as well?
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.
Are these new lines intentional?
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.
Not intentional. I started editing this section but ended up not needing the change, and I missed removing the extra newline. I’ll clean it up.