forked from microsoft/hcsshim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the full path to the `functional.test.exe` binary when sharing into the uVM or container for the `TestHVSock_*` test cases in `test\functional\hvsock_test.go` to prevent vSMB share issues. Otherwise, `os.Args[0]` will return the path that the tests were run with (e.g., `.\functional.test.exe`), which can cause vSMB to fail with `The parameter is incorrect.` (likely because it cannot find the current file). Signed-off-by: Hamza El-Saawy <[email protected]>
- Loading branch information
Showing
3 changed files
with
97 additions
and
20 deletions.
There are no files selected for viewing
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
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,29 @@ | ||
//go:build windows | ||
|
||
package util | ||
|
||
import ( | ||
"context" | ||
"path/filepath" | ||
"testing" | ||
) | ||
|
||
// windows only because TestingBinaryPath is Windows only as well, and the default path is `C:\` | ||
|
||
// Default path to share the current testing binary under. | ||
const ReExecDefaultGuestPathBase = `C:\` | ||
|
||
// ReExecSelfGuestPath returns the path to the current testing binary, as well as the | ||
// path should be shared (under the path specified by base). | ||
// | ||
// If base is empty, [ReExecDefaultGuestPathBase] will be used. | ||
func ReExecSelfGuestPath(ctx context.Context, tb testing.TB, base string) (string, string) { | ||
tb.Helper() | ||
|
||
if base == "" { | ||
base = `C:\` | ||
} | ||
|
||
self := TestingBinaryPath(ctx, tb) | ||
return self, filepath.Join(base, filepath.Base(self)) | ||
} |
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