tests/inst: Make nondestructive tests runnable as unit tests
Ideally in the future we change more of our unit tests to support running installed; we've tried this in the past with https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests I'd like to pick that back up again. This takes a step towards that by having our Rust tests. To make this even easier, add a `tests/run-installed` which runs the installed tests (uninstalled, confusingly but conveniently for now).
This commit is contained in:
1 parent
46a0911c6d
commit
7310203ce9
3 files changed
+17
-1
No files matched your search
@@ -6,10 +6,14 @@ use ostree::prelude::*;
|
||||
|
||||
use crate::test::*;
|
||||
|
||||
fn skip_non_ostree_host() -> bool {
|
||||
!std::path::Path::new("/run/ostree-booted").exists()
|
||||
}
|
||||
|
||||
#[itest]
|
||||
fn test_sysroot_ro() -> Result<()> {
|
||||
// TODO add a skipped identifier
|
||||
if !std::path::Path::new("/run/ostree-booted").exists() {
|
||||
if skip_non_ostree_host() {
|
||||
return Ok(());
|
||||
}
|
||||
let cancellable = Some(gio::Cancellable::new());
|
||||
@@ -34,6 +38,9 @@ fn test_sysroot_ro() -> Result<()> {
|
||||
|
||||
#[itest]
|
||||
fn test_immutable_bit() -> Result<()> {
|
||||
if skip_non_ostree_host() {
|
||||
return Ok(());
|
||||
}
|
||||
// https://bugzilla.redhat.com/show_bug.cgi?id=1867601
|
||||
cmd_has_output(sh_inline::bash_command!("lsattr -d /").unwrap(), "-i-")?;
|
||||
Ok(())
|
||||
|
||||
Reference in new issue
Block a user