-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This runs from tmt. Signed-off-by: Colin Walters <[email protected]>
- Loading branch information
Showing
4 changed files
with
47 additions
and
5 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,25 @@ | ||
use anyhow::Result; | ||
use fn_error_context::context; | ||
use xshell::cmd; | ||
|
||
use super::new_test; | ||
|
||
fn test_status() -> Result<()> { | ||
let sh = &xshell::Shell::new()?; | ||
let host: serde_json::Value = serde_json::from_str(&cmd!(sh, "bootc status --json").read()?)?; | ||
let status = host.get("status").unwrap(); | ||
let booted = status.get("booted").unwrap(); | ||
assert!(booted.get("image").is_some()); | ||
Ok(()) | ||
} | ||
|
||
/// Tests that assume we're in a bootc host system. | ||
#[context("Host booted tests")] | ||
pub(crate) fn run_booted_host(mut testargs: libtest_mimic::Arguments) -> Result<()> { | ||
// Force all of these tests to be serial because they mutate global state | ||
testargs.test_threads = Some(1); | ||
|
||
let tests = [new_test("status", test_status)]; | ||
|
||
libtest_mimic::run(&testargs, tests.into()).exit() | ||
} |
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