Skip to content

Commit

Permalink
Merge pull request #595 from ckyrouac/boot-rw-fix
Browse files Browse the repository at this point in the history
status: Use prepare_for_write instead of require_root
  • Loading branch information
cgwalters committed Jun 12, 2024
2 parents 08ad812 + dcfc752 commit 559aca6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> {
let host = if !Utf8Path::new("/run/ostree-booted").try_exists()? {
Default::default()
} else {
crate::cli::require_root()?;
crate::cli::prepare_for_write().await?;
let sysroot = super::cli::get_locked_sysroot().await?;
let booted_deployment = sysroot.booted_deployment();
let (_deployments, host) = get_status(&sysroot, booted_deployment.as_ref())?;
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/playbooks/check-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@
shell: findmnt -r -o OPTIONS -n /sysroot | awk -F "," '{print $1}'
register: result_sysroot_mount_status

- name: /sysroot should be mount with rw permission
- name: /sysroot should be mount with ro permission
block:
- assert:
that:
- result_sysroot_mount_status.stdout == "rw"
fail_msg: "/sysroot is not mounted with rw permission"
success_msg: "/sysroot is mounted with rw permission"
- result_sysroot_mount_status.stdout == "ro"
fail_msg: "/sysroot is not mounted with ro permission"
success_msg: "/sysroot is mounted with ro permission"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
Expand Down

0 comments on commit 559aca6

Please sign in to comment.