Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'basvandijk/run-systest-in-uvm' into 'master'
rs/tests: have a UVM config image bazel target per systest This adds a bazel target per system-test that builds a UVM config image that contains a docker image that when run runs the system-test. This enables system-tests that spawn UVMs that run other system-tests. This is both useful for load-testing (like needed for the SNS load tests) and co-locating the system-test driver with the IC under test. This MR also adds an example system-test `remote_replicable_mock_test` that spawns a UVM that runs the `replicable_mock_test`. See merge request dfinity-lab/public/ic!10177
- Loading branch information
Showing
6 changed files
with
103 additions
and
8 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
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,2 @@ | ||
#!/usr/bin/env bash | ||
find /config -name *.tar -exec docker load -i {} \; |
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,56 @@ | ||
#[rustfmt::skip] | ||
|
||
use anyhow::Result; | ||
|
||
use ic_tests::driver::farm::HostFeature; | ||
use ic_tests::driver::new::group::SystemTestGroup; | ||
use ic_tests::driver::test_env::TestEnv; | ||
use ic_tests::driver::test_env_api::{HasDependencies, HasGroupSetup, SshSession, ADMIN}; | ||
use ic_tests::driver::universal_vm::{UniversalVm, UniversalVms}; | ||
use ic_tests::systest; | ||
use slog::info; | ||
|
||
const UNIVERSAL_VM_NAME: &str = "systest-runner"; | ||
|
||
fn main() -> Result<()> { | ||
SystemTestGroup::new() | ||
.with_setup(setup) | ||
.add_test(systest!(test)) | ||
.execute_from_args()?; | ||
Ok(()) | ||
} | ||
|
||
pub fn setup(env: TestEnv) { | ||
env.ensure_group_setup_created(); | ||
UniversalVm::new(String::from(UNIVERSAL_VM_NAME)) | ||
.with_config_img( | ||
env.get_dependency_path("rs/tests/replicable_mock_test_uvm_config_image.zst"), | ||
) | ||
.disable_ipv4() | ||
.with_required_host_features(vec![HostFeature::Host( | ||
"fr1-dll07.fr1.dfinity.network".to_string(), | ||
)]) | ||
.start(&env) | ||
.expect("failed to setup universal VM"); | ||
} | ||
|
||
pub fn test(env: TestEnv) { | ||
let logger = env.logger(); | ||
let universal_vm = env.get_deployed_universal_vm(UNIVERSAL_VM_NAME).unwrap(); | ||
let session = universal_vm.block_on_ssh_session(ADMIN).unwrap(); | ||
|
||
info!( | ||
logger, | ||
"Starting: docker run bazel/rs/tests:replicable_mock_test_image" | ||
); | ||
universal_vm | ||
.block_on_bash_script_from_session( | ||
&session, | ||
"docker run bazel/rs/tests:replicable_mock_test_image", | ||
) | ||
.unwrap(); | ||
info!( | ||
logger, | ||
"Finished: docker run bazel/rs/tests:replicable_mock_test_image" | ||
); | ||
} |
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