Commit Graph

39 Commits

Author SHA1 Message Date
Rob Bradford
999bc2baca tests: Update integration test to use new payload API
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-10 22:20:07 +01:00
Sebastien Boeuf
5810e3bee8 test_infra: Enhance error reporting related to pipe resizing
Whenever starting a test with the capture_output option, both stdout and
stderr pipes are resized to a greater capacity. But the problem is that
when the system call fcntl() fails, we need to know about the error
returned by the system so that we can apply the necessary changes.

This patch simply enhances the error checking and reporting related to
the invocation of fcntl() when trying to resize a pipe.

Refers to #4475

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-10 14:39:42 +01:00
dependabot[bot]
3d9c9d720f build: bump libc from 0.2.127 to 0.2.129
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.127 to 0.2.129.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.127...0.2.129)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-10 09:11:29 +00:00
Bo Chen
4e31206403 test_infra: Avoid file descriptor leak with epoll
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-08-09 14:21:05 -07:00
Rob Bradford
3df8c6fd3b deps: Bulk upgrade dependencies
Some dependencies are not tracking the latest version in the .toml file
so update all dependencies to the latest version.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-04 18:53:33 +01:00
dependabot[bot]
bb444f3e7c build: bump libc from 0.2.126 to 0.2.127
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.126 to 0.2.127.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.126...0.2.127)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 10:39:47 +00:00
dependabot[bot]
b440cb7d23 build: bump vmm-sys-util from 0.9.0 to 0.10.0
This patch requires the vhost-user-backend crate to be bumped from 0.5.0
to 0.5.1.

Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: vmm-sys-util
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-07-20 09:40:28 +00:00
dependabot[bot]
0b311f6c4c build: bump once_cell from 1.12.1 to 1.13.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.12.1...v1.13.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 02:35:11 +00:00
dependabot[bot]
9c0872def7 build: bump once_cell from 1.12.0 to 1.12.1
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.12.0...v1.12.1)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 11:39:42 +00:00
Rob Bradford
0c82e7593d tests: Remove test on available entropy bits
As far as I can tell this always reports 256 for us now:
https://lore.kernel.org/lkml/YmlMGx6+uigkGiZ0@zx2c4.com/

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-01 18:45:05 +01:00
Wei Liu
32b855df3a tests: switch from lazy_static to once_cell
Once_cell does not require using macro and is slated to become part of
Rust std at some point.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-06-20 16:03:07 +01:00
Rob Bradford
7c8719b4ea tests: Unify API based boot across architectures
Use direct kernel boot for all the tests that create the VM via API.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-17 16:52:56 +01:00
Rob Bradford
094625242d tests: Add tests for vm.delete and vm.shutdown
Fixes: #1295

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-16 11:29:33 +01:00
Rob Bradford
62120f9afe tests: Remove testing of virtio-fs DAX cache
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-27 09:47:13 +02:00
Rob Bradford
38b8e387ea test_infra: Add control of verbosity level
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-23 11:14:53 +01:00
dependabot[bot]
0e16ffbcff build: bump libc from 0.2.125 to 0.2.126
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.125 to 0.2.126.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.125...0.2.126)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-18 07:14:37 +00:00
dependabot[bot]
960a9e0ff7 build: bump libc from 0.2.124 to 0.2.125
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.124 to 0.2.125.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.124...0.2.125)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 18:15:25 +00:00
Bo Chen
e97fe7a43e tests: Cover 'virtio-pmem' for live migration and live upgrade
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-27 12:27:49 -07:00
Bo Chen
f81220ae2d test_infra: Allow to create a GuestCommand with input binary path
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-20 11:51:50 -07:00
dependabot[bot]
de1af55e22 build: bump libc from 0.2.123 to 0.2.124
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.123 to 0.2.124.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.123...0.2.124)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 10:43:52 +00:00
dependabot[bot]
f8201bc151 build: bump libc from 0.2.122 to 0.2.123
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.122 to 0.2.123.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.122...0.2.123)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-13 10:13:32 +01:00
Wei Liu
7d7bfb2034 build: migrate to Rust 2021 edition
Rust 2021 edition has a few improvements over the 2018 edition. Migrate
the project to 2021 edition by following recommended migration steps.
Luckily, the code itself doesn't require fixing.

Bump MSRV to 1.56 as it is required by the 2021 edition. Also fix the
clap build dependency to make Cloud Hypervisor build again.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-04-11 09:51:12 +01:00
dependabot[bot]
fe87812b34 build: bump libc from 0.2.121 to 0.2.122
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.121 to 0.2.122.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.121...0.2.122)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-07 01:12:12 +00:00
dependabot[bot]
f05a408a8d build: bump libc from 0.2.120 to 0.2.121
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.120 to 0.2.121.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.120...0.2.121)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-20 12:25:30 +00:00
dependabot[bot]
9c3f8cf2f5 build: bump libc from 0.2.119 to 0.2.120
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.119 to 0.2.120.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.119...0.2.120)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 00:21:58 +00:00
Rob Bradford
d6895188b1 build: Use consistent version of dirs crate
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-03 16:59:58 +00:00
Bo Chen
c9c031a425 test_infra: Fix clippy issue on aarch64
error: unused variable: `fw_path`
   --> test_infra/src/lib.rs:837:9
    |
837 |         fw_path: &str,
    |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_fw_path`
    |
    = note: `-D unused-variables` implied by `-D warnings`

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Bo Chen
0ab4097606 test_infra: Enable cross-build for "musl" and "aarch64" targets
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] https://github.com/actions-rs/toolchain/issues/102

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Bo Chen
f1151cb55e test_infra: Allow to not print commandline when spawning guest
keep it as default to print out commandline when spawning guest in favor
of integration tests for debugging purpose, while allowing to disable
it when needed (e.g. for performance tests).

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Bo Chen
9b0bd71154 test_infra: Add helper function for performing scp
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Bo Chen
7f987552ef test_infra: Move struct Guest and struct GuestCommand from tests
In this way, these structs can be reused for performance tests.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-07 10:34:00 +01:00
Sebastien Boeuf
cab0b3446f tests: Test OVMF with Linux guest
Extending the test_simple_launch() integration test to validate Cloud
Hypervisor boots correctly with both rust-hypervisor-fw and OVMF on
x86_64 platforms.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-12-04 23:04:32 +01:00
dependabot[bot]
f67b3f79ea build: bump vmm-sys-util from 0.8.0 to 0.9.0
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: vmm-sys-util
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

This needed a bunch of manual updates as well, including vfio-ioctls and
vhost crates. The vhost crate is being patched with the latest version
from rust-vmm because the version 0.1.0 on crates.io doesn't include the
patches we need yet.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-09-16 14:01:19 +01:00
Rob Bradford
3dff598fa2 test_infra: Fix needless borrow warnings
These are are already references so there is no need to take another
reference.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-08-04 16:19:14 +02:00
Rob Bradford
d494d6b837 test_infra: Fix clippy warning (expect_fun_call)
warning: use of `expect` followed by a function call
   --> test_infra/src/lib.rs:598:10
    |
598 |         .expect(&format!("Expected '{}' to run", command))
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Expected '{}' to run", command))`
    |
    = note: `#[warn(clippy::expect_fun_call)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call

warning: use of `expect` followed by a function call
   --> test_infra/src/lib.rs:605:10
    |
605 |         .expect(&format!("Expected '{}' to run", command))
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Expected '{}' to run", command))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-25 08:54:17 -07:00
Sebastien Boeuf
1e2aa769e5 test_infra, tests: Introduce exec_host_command_output() function
This new function allows for better readability of the code by
factorizing a few of lines of code into a single one.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 16:25:41 +02:00
Sebastien Boeuf
eca1df4e2d test_infra, tests: Introduce exec_host_command_status() function
This new function allows for better readability of the code by
factorizing a bunch of lines of code into a single one.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 16:25:41 +02:00
Rob Bradford
e7cf513064 test_infra: Return an error if SSH executed command exits with non-zero
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-03 13:28:25 -07:00
Rob Bradford
88c30764e0 tests: Move test_infra from a module to crate
It must be specified as excluded from the workspace as it must not be
built on non-test targets due to issues with the ssh2 dependency and the
musl toolchain.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-03-23 18:04:50 +01:00