g_autoptr (OstreeSysroot) sysroot = NULL;
if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
- OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER
- | OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED,
- invocation, &sysroot, cancellable, error))
+ OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER, invocation, &sysroot,
+ cancellable, error))
return FALSE;
if (!ostree_sysroot_ensure_initialized (sysroot, cancellable, error))
test!(sysroot::itest_sysroot_ro),
test!(sysroot::itest_immutable_bit),
test!(sysroot::itest_tmpfiles),
+ test!(sysroot::itest_osinit_unshare),
test!(repobin::itest_basic),
test!(repobin::itest_nofifo),
test!(repobin::itest_mtime),
use anyhow::Result;
use ostree_ext::prelude::*;
use ostree_ext::{gio, ostree};
+use xshell::cmd;
use crate::test::*;
assert_eq!(metadata.permissions().mode() & !libc::S_IFMT, 0o755);
Ok(())
}
+
+pub(crate) fn itest_osinit_unshare() -> Result<()> {
+ if skip_non_ostree_host() {
+ return Ok(());
+ }
+ let sh = xshell::Shell::new()?;
+ cmd!(sh, "ostree admin os-init ostreetestsuite").run()?;
+ let metadata = Path::new("/run/ostree").metadata()?;
+ assert_eq!(metadata.permissions().mode() & !libc::S_IFMT, 0o755);
+ Ok(())
+}