Skip to content

Commit

Permalink
Changed /sys/kernel/address_bits to /sys/kernel/profiling in …
Browse files Browse the repository at this point in the history
…test_cp (#6294)

* Changed sys/kernel/address_bits to sys/kernel/profiling

* Added comments and fixed formatting

---------

Co-authored-by: Anirban <anirban@pop-os.localdomain>
  • Loading branch information
AnirbanHalder654322 and Anirban authored May 2, 2024
1 parent 549868b commit c5a530f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/by-util/test_cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3952,13 +3952,13 @@ fn test_cp_debug_reflink_never_sparse_always_empty_file_with_hole() {
#[test]
#[cfg(target_os = "linux")]
fn test_cp_default_virtual_file() {
// This file has existed at least since 2008, so we assume that it is present on "all" Linux kernels.
// https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-profiling

use std::os::unix::prelude::MetadataExt;
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
ts.ucmd()
.arg("/sys/kernel/address_bits")
.arg("b")
.succeeds();
ts.ucmd().arg("/sys/kernel/profiling").arg("b").succeeds();

let dest_size = std::fs::metadata(at.plus("b"))
.expect("Metadata of copied file cannot be read")
Expand Down Expand Up @@ -4037,11 +4037,13 @@ fn test_cp_debug_reflink_never_sparse_always_non_sparse_file_with_long_zero_sequ
#[test]
#[cfg(target_os = "linux")]
fn test_cp_debug_sparse_always_sparse_virtual_file() {
// This file has existed at least since 2008, so we assume that it is present on "all" Linux kernels.
// https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-profiling
let ts = TestScenario::new(util_name!());
ts.ucmd()
.arg("--debug")
.arg("--sparse=always")
.arg("/sys/kernel/address_bits")
.arg("/sys/kernel/profiling")
.arg("b")
.succeeds()
.stdout_contains(
Expand Down Expand Up @@ -4209,10 +4211,12 @@ fn test_cp_debug_sparse_never_file_with_hole() {
#[test]
#[cfg(target_os = "linux")]
fn test_cp_debug_default_sparse_virtual_file() {
// This file has existed at least since 2008, so we assume that it is present on "all" Linux kernels.
// https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-profiling
let ts = TestScenario::new(util_name!());
ts.ucmd()
.arg("--debug")
.arg("/sys/kernel/address_bits")
.arg("/sys/kernel/profiling")
.arg("b")
.succeeds()
.stdout_contains(
Expand Down

0 comments on commit c5a530f

Please sign in to comment.