Skip to content
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

test pr #2

Closed
wants to merge 5 commits into from
Closed

test pr #2

wants to merge 5 commits into from

Conversation

helsaawy
Copy link
Owner

@helsaawy helsaawy commented Dec 8, 2023

PR for testing PR/merge CI

Have `internal\cmd.Cmd` ignore relay and close errors from the
underlying IO channel being closed, since not all
`io.Reader`/`io.Writer`s return an `io.EOF` if the are closed during an
IO operation.

This standardizes behavior between an `hcs`/`gcs` `Process` (which use a
`go-winio.win32File` for their IO channels, and return `io.EOF` for
read and write operations on a closed handle) and `JobProcess` (which
uses an `os.Pipe` that instead return an `os.ErrClosed`).

Additionally, ignore errors from closing an already-closed std IO
channel.

Update `Cmd.Wait` to return a known error value if it times out waiting
on IO copy after the command exits (and update `TestCmdStuckIo` to check
for that error).
Prior, the test checked for an `io.ErrClosedPipe`, which:
1. is not the best indicator that IO is stuck; and
2. is now ignored as an error value raised during IO relay.

Signed-off-by: Hamza El-Saawy <[email protected]>
Remove unused/legacy functional test flags/environment variables.

Unify [TestMain] control flow, so there is only one exit call, and
`defer` is used to run cleanup after the tests are run.

Standardize UVM `default[L|W]COWOptions` to accept a context, and add
context parameter to `namespacedContext`

Remove all build tags aside from `functional`, since features are used
to select the tests to run. This standardizes the functional tests with
the cri-containerd tests, even though the feature names themselves are
different.

Add `test/pkg/uvm.CreateWCOW` function to mirror `CreateLCOW`, and add
`Create` and `CreateAndStart` functions that pick LCOW or WCOW based on
the options provided.

Have uVM scratch and image layers be created under a dedicated and
persisted folder within `%TEMP%` that is excluded from Windows defender.
(The folder will be removed during OS restart, regardless of contents.)

Remove copied OCI spec options from `test/internal/oci`, add new
options for creating HostProcess containers.

Add a `internal\sync.OnceValue`(`Ctx`) function that mirrors
`sync.OnceValues` (introduced in go1.21) to have a type-safe `Once`
function.

Check that required privileges are held (only once) when unpacking
Windows layers.

Fix LCOW tests in `lcow_test.go` that were setting `KernelDirect`
without also updating `KernelFile`.

Add `util.Context` function to create context that times out before test
timeout, to help with timing issues and allow time for cleanup and
logging.

Rename `cri_util` to `criutil`, since underscores are frowned upon in
package names.
Add a `test` prefix to `github.com/Microsoft/hcsshim/test/pkg/*` and
`github.com/Microsoft/hcsshim/test/internal/*` imports to be consistent
across all `test/functional/*` files.

Signed-off-by: Hamza El-Saawy <[email protected]>
Update and un-skip WCOW uVM and container tests (and add WCOW uVM
benchmarks), as well as WCOW vSMB and LCOW boto files tests.

Add WCOW host process tests, including dedicated tests for setting
username, and verifying hostname and volume mounts.

Moved:
 - `lcow_bench_test.go` to `uvm_bench_test.go`
 - `lcow_container_test.go` to `container_test.go`
 - `lcow_test.go` to `lcow_uvm_test.go` and `uvm_test.go`

Fix bug where removing a direct-mapped vSMB share fails.

Run (non-virtualization/uVM) functional tests within CI.

Make sure container specs are created with the default working
directory (`C:\`), similar to how `internal\cmd` works).

Relies on PR: microsoft#1974

Signed-off-by: Hamza El-Saawy <[email protected]>
Add tests for binding to and listening on hyper-v sockets from within a
uVM (as well as a hyper-v isolated containerd).
Tests verify default SDDL and wildcard bind settings, as well updating
the settings for a particular service ID.

Signed-off-by: Hamza El-Saawy <[email protected]>
@helsaawy helsaawy force-pushed the bench branch 3 times, most recently from 4668a33 to 04607e4 Compare December 13, 2023 18:35
Signed-off-by: Hamza El-Saawy <[email protected]>
@helsaawy helsaawy force-pushed the func-tests branch 3 times, most recently from f592f71 to fcb7cc9 Compare April 2, 2024 15:16
@helsaawy helsaawy force-pushed the func-tests branch 3 times, most recently from bc56d8e to 7e449aa Compare April 10, 2024 18:30
@helsaawy helsaawy deleted the branch func-tests May 28, 2024 19:16
@helsaawy helsaawy closed this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant