Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status: Use prepare_for_write instead of require_root #595

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading