1
0
mirror of https://github.com/uutils/coreutils synced 2024-07-09 04:06:02 +00:00

Changed `/sys/kernel/address_bits to /sys/kernel/profiling` in 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>
This commit is contained in:
Anirban Halder 2024-05-02 21:55:22 +05:30 committed by GitHub
parent 549868b31f
commit c5a530f4a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")
@ -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(
@ -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(